@@ -29,6 +29,7 @@ type NodeInput struct {
2929 Tag string `toml:"tag" validate:"required"`
3030 PullImage bool `toml:"pull_image" default:"true"`
3131 Port string `toml:"port" validate:"required" default:"6688"`
32+ P2PPort string `toml:"p2p_port" validate:"required" default:"6690"`
3233 CapabilitiesBinaryPaths []string `toml:"capabilities"`
3334 CapabilityContainerDir string `toml:"capabilities_container_dir" default:"/capabilities"`
3435 TestConfigOverrides string `toml:"test_config_overrides"`
@@ -46,8 +47,10 @@ type Output struct {
4647
4748// NodeOut is CL node container output, URLs to connect
4849type NodeOut struct {
49- HostURL string `toml:"url"`
50- DockerURL string `toml:"docker_internal_url"`
50+ HostURL string `toml:"url"`
51+ HostP2PURL string `toml:"p2p_url"`
52+ DockerURL string `toml:"docker_internal_url"`
53+ DockerP2PUrl string `toml:"p2p_docker_internal_url"`
5154}
5255
5356// NewNode create a new Chainlink node with some image:tag and one or several configs
@@ -109,7 +112,8 @@ func newNode(in *Input, pgOut *postgres.Output) (*NodeOut, error) {
109112 return nil , err
110113 }
111114
112- bindPort := fmt .Sprintf ("%s/tcp" , in .Node .Port )
115+ httpPort := fmt .Sprintf ("%s/tcp" , in .Node .Port )
116+ p2pPort := fmt .Sprintf ("%s/udp" , in .Node .P2PPort )
113117 containerName := framework .DefaultTCName ("clnode" )
114118
115119 req := tc.ContainerRequest {
@@ -121,7 +125,7 @@ func newNode(in *Input, pgOut *postgres.Output) (*NodeOut, error) {
121125 NetworkAliases : map [string ][]string {
122126 framework .DefaultNetworkName : {containerName },
123127 },
124- ExposedPorts : []string {bindPort },
128+ ExposedPorts : []string {httpPort , p2pPort },
125129 Entrypoint : []string {
126130 "/bin/sh" , "-c" ,
127131 "chainlink -c /config/config -c /config/overrides -c /config/user-overrides -s /config/secrets -s /config/secrets-overrides -s /config/user-secrets-overrides node start -d -p /config/node_password -a /config/apicredentials" ,
@@ -191,14 +195,20 @@ func newNode(in *Input, pgOut *postgres.Output) (*NodeOut, error) {
191195 if err != nil {
192196 return nil , err
193197 }
194- mp , err := c .MappedPort (ctx , nat .Port (bindPort ))
198+ mp , err := c .MappedPort (ctx , nat .Port (httpPort ))
199+ if err != nil {
200+ return nil , err
201+ }
202+ mpP2P , err := c .MappedPort (ctx , nat .Port (p2pPort ))
195203 if err != nil {
196204 return nil , err
197205 }
198206
199207 return & NodeOut {
200- DockerURL : fmt .Sprintf ("http://%s:%s" , containerName , in .Node .Port ),
201- HostURL : fmt .Sprintf ("http://%s:%s" , host , mp .Port ()),
208+ HostURL : fmt .Sprintf ("http://%s:%s" , host , mp .Port ()),
209+ HostP2PURL : fmt .Sprintf ("http://%s:%s" , host , mpP2P .Port ()),
210+ DockerURL : fmt .Sprintf ("http://%s:%s" , containerName , in .Node .Port ),
211+ DockerP2PUrl : fmt .Sprintf ("http://%s:%s" , containerName , in .Node .P2PPort ),
202212 }, nil
203213}
204214
0 commit comments