Skip to content

Commit 46dc418

Browse files
committed
expose nodes internal IP
1 parent 5030b3e commit 46dc418

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

framework/components/clnode/clnode.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ type NodeOut struct {
6565
APIAuthUser string `toml:"api_auth_user"`
6666
APIAuthPassword string `toml:"api_auth_password"`
6767
ContainerName string `toml:"container_name"`
68+
InternalIP string `toml:"internal_ip"`
6869
HostURL string `toml:"url"`
6970
DockerURL string `toml:"docker_internal_url"`
7071
DockerP2PUrl string `toml:"p2p_docker_internal_url"`
@@ -277,13 +278,19 @@ func newNode(in *Input, pgOut *postgres.Output) (*NodeOut, error) {
277278

278279
mp := nat.Port(fmt.Sprintf("%d/tcp", in.Node.HTTPPort))
279280

281+
ip, err := c.ContainerIP(ctx)
282+
if err != nil {
283+
return nil, err
284+
}
285+
280286
return &NodeOut{
281287
APIAuthUser: DefaultAPIUser,
282288
APIAuthPassword: DefaultAPIPassword,
283289
ContainerName: containerName,
290+
InternalIP: ip,
284291
HostURL: fmt.Sprintf("http://%s:%s", host, mp.Port()),
285292
DockerURL: fmt.Sprintf("http://%s:%s", containerName, DefaultHTTPPort),
286-
DockerP2PUrl: fmt.Sprintf("http://%s:%s", containerName, DefaultP2PPort),
293+
DockerP2PUrl: fmt.Sprintf("http://%s:%s", ip, DefaultP2PPort),
287294
}, nil
288295
}
289296

0 commit comments

Comments
 (0)