Skip to content

Commit 3078777

Browse files
committed
wip
1 parent 6002ace commit 3078777

File tree

8 files changed

+41
-146
lines changed

8 files changed

+41
-146
lines changed

framework/components/clnode/clnode.go

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ type NodeOut struct {
6666
APIAuthPassword string `toml:"api_auth_password"`
6767
ContainerName string `toml:"container_name"`
6868
HostURL string `toml:"url"`
69-
HostP2PURL string `toml:"p2p_url"`
7069
DockerURL string `toml:"docker_internal_url"`
7170
DockerP2PUrl string `toml:"p2p_docker_internal_url"`
7271
}
@@ -122,7 +121,7 @@ func newNode(in *Input, pgOut *postgres.Output) (*NodeOut, error) {
122121
if err != nil {
123122
return nil, err
124123
}
125-
cfgPath, err := writeDefaultConfig(in)
124+
cfgPath, err := writeDefaultConfig()
126125
if err != nil {
127126
return nil, err
128127
}
@@ -148,7 +147,6 @@ func newNode(in *Input, pgOut *postgres.Output) (*NodeOut, error) {
148147
}
149148

150149
httpPort := fmt.Sprintf("%s/tcp", DefaultHTTPPort)
151-
p2pPort := fmt.Sprintf("%s/udp", DefaultP2PPort)
152150
var containerName string
153151
if in.Node.Name != "" {
154152
containerName = in.Node.Name
@@ -159,7 +157,7 @@ func newNode(in *Input, pgOut *postgres.Output) (*NodeOut, error) {
159157
for _, p := range in.Node.CustomPorts {
160158
customPorts = append(customPorts, fmt.Sprintf("%d/tcp", p))
161159
}
162-
exposedPorts := []string{httpPort, p2pPort}
160+
exposedPorts := []string{httpPort}
163161
exposedPorts = append(exposedPorts, customPorts...)
164162

165163
portBindings := nat.PortMap{
@@ -169,12 +167,6 @@ func newNode(in *Input, pgOut *postgres.Output) (*NodeOut, error) {
169167
HostPort: fmt.Sprintf("%d/tcp", in.Node.HTTPPort),
170168
},
171169
},
172-
nat.Port(p2pPort): []nat.PortBinding{
173-
{
174-
HostIP: "0.0.0.0",
175-
HostPort: fmt.Sprintf("%d/udp", in.Node.P2PPort),
176-
},
177-
},
178170
}
179171
for _, p := range customPorts {
180172
portBindings[nat.Port(p)] = []nat.PortBinding{
@@ -284,14 +276,12 @@ func newNode(in *Input, pgOut *postgres.Output) (*NodeOut, error) {
284276
}
285277

286278
mp := nat.Port(fmt.Sprintf("%d/tcp", in.Node.HTTPPort))
287-
mpP2P := nat.Port(fmt.Sprintf("%d/udp", in.Node.P2PPort))
288279

289280
return &NodeOut{
290281
APIAuthUser: DefaultAPIUser,
291282
APIAuthPassword: DefaultAPIPassword,
292283
ContainerName: containerName,
293284
HostURL: fmt.Sprintf("http://%s:%s", host, mp.Port()),
294-
HostP2PURL: fmt.Sprintf("http://%s:%s", host, mpP2P.Port()),
295285
DockerURL: fmt.Sprintf("http://%s:%s", containerName, DefaultHTTPPort),
296286
DockerP2PUrl: fmt.Sprintf("http://%s:%s", containerName, DefaultP2PPort),
297287
}, nil
@@ -302,7 +292,7 @@ type DefaultCLNodeConfig struct {
302292
SecureCookies bool
303293
}
304294

305-
func generateDefaultConfig(in *Input) (string, error) {
295+
func generateDefaultConfig() (string, error) {
306296
config := DefaultCLNodeConfig{
307297
HTTPPort: DefaultHTTPPort,
308298
SecureCookies: false,
@@ -350,8 +340,8 @@ func writeDefaultSecrets(pgOut *postgres.Output) (*os.File, error) {
350340
return WriteTmpFile(secretsOverrides, "secrets.toml")
351341
}
352342

353-
func writeDefaultConfig(in *Input) (*os.File, error) {
354-
cfg, err := generateDefaultConfig(in)
343+
func writeDefaultConfig() (*os.File, error) {
344+
cfg, err := generateDefaultConfig()
355345
if err != nil {
356346
return nil, err
357347
}

framework/components/clnode/clnode_test.go

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func checkBasicOutputs(t *testing.T, output *clnode.Output) {
2323
require.Contains(t, output.Node.DockerP2PUrl, "cl-node")
2424
require.NotNil(t, output.PostgreSQL)
2525
require.Contains(t, output.PostgreSQL.Url, "postgresql://chainlink:[email protected]")
26-
require.Contains(t, output.PostgreSQL.DockerInternalURL, "postgresql://chainlink:thispasswordislongenough@postgresql-")
26+
require.Contains(t, output.PostgreSQL.DockerInternalURL, "postgresql://chainlink:thispasswordislongenough@ns-postgresql")
2727
}
2828

2929
func TestComponentDockerNodeWithSharedDB(t *testing.T) {
@@ -61,35 +61,35 @@ func TestComponentDockerNodeWithSharedDB(t *testing.T) {
6161
}
6262
}
6363

64-
func TestComponentDockerNodeWithDB(t *testing.T) {
65-
testCases := []testCase{
66-
{
67-
name: "basic use case",
68-
input: &clnode.Input{
69-
DbInput: &postgres.Input{
70-
Image: "postgres:15.6",
71-
Port: 15000,
72-
VolumeName: "b",
73-
},
74-
Node: &clnode.NodeInput{
75-
Image: "public.ecr.aws/chainlink/chainlink:v2.17.0",
76-
Name: "cl-node-2",
77-
},
78-
},
79-
assertion: func(t *testing.T, output *clnode.Output) {
80-
checkBasicOutputs(t, output)
81-
},
82-
},
83-
}
84-
85-
for _, tc := range testCases {
86-
err := framework.DefaultNetwork(&sync.Once{})
87-
require.NoError(t, err)
88-
89-
t.Run(tc.name, func(t *testing.T) {
90-
output, err := clnode.NewNodeWithDB(tc.input)
91-
require.NoError(t, err)
92-
tc.assertion(t, output)
93-
})
94-
}
95-
}
64+
//func TestComponentDockerNodeWithDB(t *testing.T) {
65+
// testCases := []testCase{
66+
// {
67+
// name: "basic use case",
68+
// input: &clnode.Input{
69+
// DbInput: &postgres.Input{
70+
// Image: "postgres:15.6",
71+
// Port: 15000,
72+
// VolumeName: "b",
73+
// },
74+
// Node: &clnode.NodeInput{
75+
// Image: "public.ecr.aws/chainlink/chainlink:v2.17.0",
76+
// Name: "cl-node-2",
77+
// },
78+
// },
79+
// assertion: func(t *testing.T, output *clnode.Output) {
80+
// checkBasicOutputs(t, output)
81+
// },
82+
// },
83+
// }
84+
//
85+
// for _, tc := range testCases {
86+
// err := framework.DefaultNetwork(&sync.Once{})
87+
// require.NoError(t, err)
88+
//
89+
// t.Run(tc.name, func(t *testing.T) {
90+
// output, err := clnode.NewNodeWithDB(tc.input)
91+
// require.NoError(t, err)
92+
// tc.assertion(t, output)
93+
// })
94+
// }
95+
//}

framework/components/simple_node_set/node_set.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ func printURLs(out *Output) {
6565
httpURLs, p2pURLs, pgURLs := make([]string, 0), make([]string, 0), make([]string, 0)
6666
for _, n := range out.CLNodes {
6767
httpURLs = append(httpURLs, n.Node.HostURL)
68-
p2pURLs = append(p2pURLs, n.Node.HostP2PURL)
6968
pgURLs = append(pgURLs, n.PostgreSQL.Url)
7069
}
7170
framework.L.Info().Any("UI", httpURLs).Send()

framework/components/simple_node_set/nodeset_test.go

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313

1414
type testCase struct {
1515
name string
16-
fakeURL string
1716
funding float64
1817
bcInput *blockchain.Input
1918
nodeSetInput *ns.Input
@@ -40,8 +39,7 @@ func checkBasicOutputs(t *testing.T, output *ns.Output) {
4039
func TestComponentDockerNodeSetSharedDB(t *testing.T) {
4140
testCases := []testCase{
4241
{
43-
name: "2 nodes cluster, override mode 'all'",
44-
fakeURL: "http://example.com",
42+
name: "2 nodes cluster, override mode 'all'",
4543
bcInput: &blockchain.Input{
4644
Type: "anvil",
4745
Image: "f4hrenh9it/foundry",
@@ -56,9 +54,6 @@ func TestComponentDockerNodeSetSharedDB(t *testing.T) {
5654
},
5755
NodeSpecs: []*clnode.Input{
5856
{
59-
DbInput: &postgres.Input{
60-
Image: "postgres:15.6",
61-
},
6257
Node: &clnode.NodeInput{
6358
Image: "public.ecr.aws/chainlink/chainlink:v2.17.0",
6459
Name: "cl-node",
@@ -71,8 +66,7 @@ func TestComponentDockerNodeSetSharedDB(t *testing.T) {
7166
},
7267
},
7368
{
74-
name: "2 nodes cluster, override mode 'each'",
75-
fakeURL: "http://example.com",
69+
name: "2 nodes cluster, override mode 'each'",
7670
bcInput: &blockchain.Input{
7771
Type: "anvil",
7872
Image: "f4hrenh9it/foundry",
@@ -90,10 +84,6 @@ func TestComponentDockerNodeSetSharedDB(t *testing.T) {
9084
},
9185
NodeSpecs: []*clnode.Input{
9286
{
93-
DbInput: &postgres.Input{
94-
Image: "postgres:15.6",
95-
Port: 14000,
96-
},
9787
Node: &clnode.NodeInput{
9888
Image: "public.ecr.aws/chainlink/chainlink:v2.17.0",
9989
Name: "cl-node-1",
@@ -104,9 +94,6 @@ level = 'info'
10494
},
10595
},
10696
{
107-
DbInput: &postgres.Input{
108-
Image: "postgres:15.6",
109-
},
11097
Node: &clnode.NodeInput{
11198
Image: "public.ecr.aws/chainlink/chainlink:v2.17.0",
11299
Name: "cl-node-2",

framework/examples/myproject/go.mod

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ replace (
88
)
99

1010
require (
11+
github.com/go-resty/resty/v2 v2.15.3
1112
github.com/smartcontractkit/chainlink-testing-framework/framework v0.2.5
1213
github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2
1314
github.com/stretchr/testify v1.9.0
@@ -27,7 +28,6 @@ require (
2728
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
2829
github.com/armon/go-metrics v0.4.1 // indirect
2930
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
30-
github.com/atotto/clipboard v0.1.4 // indirect
3131
github.com/aws/aws-sdk-go v1.45.25 // indirect
3232
github.com/aws/aws-sdk-go-v2 v1.31.0 // indirect
3333
github.com/aws/aws-sdk-go-v2/config v1.27.39 // indirect
@@ -43,26 +43,16 @@ require (
4343
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.3 // indirect
4444
github.com/aws/aws-sdk-go-v2/service/sts v1.31.3 // indirect
4545
github.com/aws/smithy-go v1.21.0 // indirect
46-
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
4746
github.com/benbjohnson/clock v1.3.5 // indirect
4847
github.com/beorn7/perks v1.0.1 // indirect
4948
github.com/buger/jsonparser v1.1.1 // indirect
5049
github.com/bytedance/sonic v1.12.3 // indirect
5150
github.com/bytedance/sonic/loader v0.2.0 // indirect
5251
github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b // indirect
5352
github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8 // indirect
54-
github.com/catppuccin/go v0.2.0 // indirect
5553
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
5654
github.com/cespare/xxhash v1.1.0 // indirect
5755
github.com/cespare/xxhash/v2 v2.3.0 // indirect
58-
github.com/charmbracelet/bubbles v0.20.0 // indirect
59-
github.com/charmbracelet/bubbletea v1.1.1 // indirect
60-
github.com/charmbracelet/huh v0.6.0 // indirect
61-
github.com/charmbracelet/huh/spinner v0.0.0-20241028115900-20a4d21717a8 // indirect
62-
github.com/charmbracelet/lipgloss v0.13.0 // indirect
63-
github.com/charmbracelet/x/ansi v0.2.3 // indirect
64-
github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 // indirect
65-
github.com/charmbracelet/x/term v0.2.0 // indirect
6656
github.com/cloudwego/base64x v0.1.4 // indirect
6757
github.com/cloudwego/iasm v0.2.0 // indirect
6858
github.com/coder/websocket v1.8.12 // indirect
@@ -72,7 +62,6 @@ require (
7262
github.com/coreos/go-semver v0.3.0 // indirect
7363
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
7464
github.com/cpuguy83/dockercfg v0.3.2 // indirect
75-
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
7665
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
7766
github.com/dennwc/varint v1.0.0 // indirect
7867
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
@@ -83,7 +72,6 @@ require (
8372
github.com/dustin/go-humanize v1.0.1 // indirect
8473
github.com/edsrzf/mmap-go v1.1.0 // indirect
8574
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
86-
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
8775
github.com/ethereum/go-ethereum v1.14.11 // indirect
8876
github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb // indirect
8977
github.com/fatih/color v1.16.0 // indirect
@@ -111,7 +99,6 @@ require (
11199
github.com/go-playground/universal-translator v0.18.1 // indirect
112100
github.com/go-playground/validator/v10 v10.22.1 // indirect
113101
github.com/go-redis/redis/v8 v8.11.5 // indirect
114-
github.com/go-resty/resty/v2 v2.15.3 // indirect
115102
github.com/goccy/go-json v0.10.3 // indirect
116103
github.com/gogo/googleapis v1.4.1 // indirect
117104
github.com/gogo/protobuf v1.3.2 // indirect
@@ -155,18 +142,14 @@ require (
155142
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
156143
github.com/kylelemons/godebug v1.1.0 // indirect
157144
github.com/leodido/go-urn v1.4.0 // indirect
158-
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
159145
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
160146
github.com/magiconair/properties v1.8.7 // indirect
161147
github.com/mailru/easyjson v0.7.7 // indirect
162148
github.com/mattn/go-colorable v0.1.13 // indirect
163149
github.com/mattn/go-isatty v0.0.20 // indirect
164-
github.com/mattn/go-localereader v0.0.1 // indirect
165-
github.com/mattn/go-runewidth v0.0.16 // indirect
166150
github.com/miekg/dns v1.1.56 // indirect
167151
github.com/mitchellh/copystructure v1.0.0 // indirect
168152
github.com/mitchellh/go-homedir v1.1.0 // indirect
169-
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
170153
github.com/mitchellh/mapstructure v1.5.0 // indirect
171154
github.com/mitchellh/reflectwalk v1.0.1 // indirect
172155
github.com/moby/docker-image-spec v1.3.1 // indirect
@@ -177,9 +160,6 @@ require (
177160
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
178161
github.com/modern-go/reflect2 v1.0.2 // indirect
179162
github.com/morikuni/aec v1.0.0 // indirect
180-
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
181-
github.com/muesli/cancelreader v0.2.2 // indirect
182-
github.com/muesli/termenv v0.15.3-0.20240618155329-98d742f6907a // indirect
183163
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
184164
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
185165
github.com/oklog/ulid v1.3.1 // indirect
@@ -189,7 +169,6 @@ require (
189169
github.com/opentracing-contrib/go-stdlib v1.0.0 // indirect
190170
github.com/opentracing/opentracing-go v1.2.0 // indirect
191171
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
192-
github.com/pelletier/go-toml v1.9.5 // indirect
193172
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
194173
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
195174
github.com/pkg/errors v0.9.1 // indirect
@@ -203,9 +182,7 @@ require (
203182
github.com/prometheus/exporter-toolkit v0.10.1-0.20230714054209-2f4150c63f97 // indirect
204183
github.com/prometheus/procfs v0.15.1 // indirect
205184
github.com/prometheus/prometheus v0.47.2-0.20231010075449-4b9c19fe5510 // indirect
206-
github.com/rivo/uniseg v0.4.7 // indirect
207185
github.com/rs/zerolog v1.33.0 // indirect
208-
github.com/russross/blackfriday/v2 v2.1.0 // indirect
209186
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect
210187
github.com/sercand/kuberesolver/v5 v5.1.1 // indirect
211188
github.com/shirou/gopsutil/v3 v3.23.12 // indirect
@@ -225,9 +202,7 @@ require (
225202
github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect
226203
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
227204
github.com/ugorji/go/codec v1.2.12 // indirect
228-
github.com/urfave/cli/v2 v2.27.5 // indirect
229205
github.com/x448/float16 v0.8.4 // indirect
230-
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
231206
github.com/yusufpapurcu/wmi v1.2.3 // indirect
232207
go.etcd.io/etcd/api/v3 v3.5.7 // indirect
233208
go.etcd.io/etcd/client/pkg/v3 v3.5.7 // indirect

0 commit comments

Comments
 (0)