Skip to content

Commit 56566ca

Browse files
authored
Refactor URL fields in components to work with kubernetes (#1755)
* Refactor URL fields in components to work with kubernetes * add changeset
1 parent c5c0b6f commit 56566ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+146
-143
lines changed

book/src/developing/developing_components.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ Do not use `testcontainers.NewDockerProvider()` methods, see issues: [#1](https:
9090

9191
return &NodeOut{
9292
UseCache: true,
93-
DockerURL: fmt.Sprintf("http://%s:%s", containerName, in.Node.Port),
94-
HostURL: fmt.Sprintf("http://%s:%s", host, mp.Port()),
93+
InternalURL: fmt.Sprintf("http://%s:%s", containerName, in.Node.Port),
94+
ExternalURL: fmt.Sprintf("http://%s:%s", host, mp.Port()),
9595
}, nil
9696
```
9797

book/src/framework/components/blockchains/aptos.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ func TestAptosSmoke(t *testing.T) {
5353

5454
t.Run("test something", func(t *testing.T) {
5555
// use internal URL to connect Chainlink nodes
56-
_ = bc.Nodes[0].DockerInternalHTTPUrl
56+
_ = bc.Nodes[0].InternalHTTPUrl
5757
// use host URL to interact
58-
_ = bc.Nodes[0].HostHTTPUrl
59-
r := resty.New().SetBaseURL(bc.Nodes[0].HostHTTPUrl).EnableTrace()
58+
_ = bc.Nodes[0].ExternalHTTPUrl
59+
r := resty.New().SetBaseURL(bc.Nodes[0].ExternalHTTPUrl).EnableTrace()
6060
_, err := r.R().Get("/v1/transactions")
6161
require.NoError(t, err)
6262
})

book/src/framework/components/blockchains/evm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ We support 3 EVM clients at the moment: [Geth](https://geth.ethereum.org/docs/fu
3131

3232
[[blockchain_a.out.nodes]]
3333
# URLs to access the node(s) inside docker network, used by other components
34-
docker_internal_http_url = "http://anvil-14411:8545"
35-
docker_internal_ws_url = "ws://anvil-14411:8545"
34+
internal_http_url = "http://anvil-14411:8545"
35+
internal_ws_url = "ws://anvil-14411:8545"
3636
# URLs to access the node(s) on your host machine or in CI
3737
http_url = "http://127.0.0.1:33955"
3838
ws_url = "ws://127.0.0.1:33955"

book/src/framework/components/blockchains/solana.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ func TestSolanaSmoke(t *testing.T) {
6060

6161
t.Run("test something", func(t *testing.T) {
6262
// use internal URL to connect chainlink nodes
63-
_ = bc.Nodes[0].DockerInternalHTTPUrl
63+
_ = bc.Nodes[0].InternalHTTPUrl
6464
// use host URL to deploy contracts
65-
c := client.NewClient(bc.Nodes[0].HostHTTPUrl)
65+
c := client.NewClient(bc.Nodes[0].ExternalHTTPUrl)
6666
latestSlot, err := c.GetSlotWithConfig(context.Background(), client.GetSlotConfig{Commitment: "processed"})
6767
require.NoError(t, err)
6868
fmt.Printf("Latest slot: %v\n", latestSlot)

book/src/framework/components/blockchains/sui.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ func TestSuiSmoke(t *testing.T) {
5050

5151
t.Run("test something", func(t *testing.T) {
5252
// use internal URL to connect Chainlink nodes
53-
_ = bc.Nodes[0].DockerInternalHTTPUrl
53+
_ = bc.Nodes[0].InternalHTTPUrl
5454
// use host URL to interact
55-
_ = bc.Nodes[0].HostHTTPUrl
55+
_ = bc.Nodes[0].ExternalHTTPUrl
5656

57-
cli := sui.NewSuiClient(bc.Nodes[0].HostHTTPUrl)
57+
cli := sui.NewSuiClient(bc.Nodes[0].ExternalHTTPUrl)
5858

5959
signerAccount, err := signer.NewSignertWithMnemonic(bc.NetworkSpecificData.SuiAccount.Mnemonic)
6060
require.NoError(t, err)

book/src/framework/components/blockchains/tron.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ func TestTRONSmoke(t *testing.T) {
3535

3636
t.Run("test something", func(t *testing.T) {
3737
// use internal URL to connect Chainlink nodes
38-
_ = bc.Nodes[0].DockerInternalHTTPUrl
38+
_ = bc.Nodes[0].InternalHTTPUrl
3939
// use host URL to interact
40-
_ = bc.Nodes[0].HostHTTPUrl
40+
_ = bc.Nodes[0].ExternalHTTPUrl
4141

42-
// use bc.Nodes[0].HostHTTPUrl + "/wallet" to access full node
43-
// use bc.Nodes[0].HostHTTPUrl + "/walletsolidity" to access Solidity node
42+
// use bc.Nodes[0].ExternalHTTPUrl + "/wallet" to access full node
43+
// use bc.Nodes[0].ExternalHTTPUrl + "/walletsolidity" to access Solidity node
4444
})
4545
}
4646
```

book/src/framework/components/chainlink/node.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ func TestMe(t *testing.T) {
102102
require.NoError(t, err)
103103

104104
t.Run("test something", func(t *testing.T) {
105-
fmt.Printf("node url: %s\n", output.Node.HostURL)
106-
require.NotEmpty(t, output.Node.HostURL)
105+
fmt.Printf("node url: %s\n", output.Node.ExternalURL)
106+
require.NotEmpty(t, output.Node.ExternalURL)
107107
})
108108
}
109109
```

book/src/framework/components/chainlink/nodeset.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ This component requires some Blockchain to be deployed, add this to config
3232

3333
[[blockchain_a.out.nodes]]
3434
# URLs to access the node(s) inside docker network, used by other components
35-
docker_internal_http_url = "http://anvil-14411:8545"
36-
docker_internal_ws_url = "ws://anvil-14411:8545"
35+
internal_http_url = "http://anvil-14411:8545"
36+
internal_ws_url = "ws://anvil-14411:8545"
3737
# URLs to access the node(s) on your host machine or in CI
3838
http_url = "http://127.0.0.1:33955"
3939
ws_url = "ws://127.0.0.1:33955"
@@ -155,7 +155,7 @@ func TestMe(t *testing.T) {
155155

156156
t.Run("test something", func(t *testing.T) {
157157
for _, n := range out.CLNodes {
158-
require.NotEmpty(t, n.Node.HostURL)
158+
require.NotEmpty(t, n.Node.ExternalURL)
159159
require.NotEmpty(t, n.Node.HostP2PURL)
160160
}
161161
})

book/src/framework/components/developing_components.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ An example of [composite component](../../../../framework/components/simple_node
8888
8989
return &NodeOut{
9090
UseCache: true,
91-
DockerURL: fmt.Sprintf("http://%s:%s", containerName, in.Node.Port),
92-
HostURL: fmt.Sprintf("http://%s:%s", host, mp.Port()),
91+
InternalURL: fmt.Sprintf("http://%s:%s", containerName, in.Node.Port),
92+
ExternalURL: fmt.Sprintf("http://%s:%s", host, mp.Port()),
9393
}, nil
9494
```

book/src/framework/connecting_chainlink_node.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ func TestNode(t *testing.T) {
5151
require.NoError(t, err)
5252

5353
t.Run("test something", func(t *testing.T) {
54-
fmt.Printf("node url: %s\n", output.Node.HostURL)
55-
require.NotEmpty(t, output.Node.HostURL)
54+
fmt.Printf("node url: %s\n", output.Node.ExternalURL)
55+
require.NotEmpty(t, output.Node.ExternalURL)
5656
})
5757
}
5858

0 commit comments

Comments
 (0)