diff --git a/.github/workflows/docker-network-health.yml b/.github/workflows/docker-network-health.yml index c473f7711..1bf65f1a5 100644 --- a/.github/workflows/docker-network-health.yml +++ b/.github/workflows/docker-network-health.yml @@ -31,7 +31,7 @@ jobs: # Run network cd ./tools/docker-network - timeout 10m ./run.sh 0 0 & + timeout 10m ./run.sh & RUN_PID=$! # Wait for node-4 to be created before querying it diff --git a/components/dashboard_metrics/info.go b/components/dashboard_metrics/info.go index 0172f2051..ae61c20aa 100644 --- a/components/dashboard_metrics/info.go +++ b/components/dashboard_metrics/info.go @@ -13,12 +13,32 @@ func nodeInfoExtended() *NodeInfoExtended { var m runtime.MemStats runtime.ReadMemStats(&m) + getExternalMultiAddr := func() string { + var fallback string + + for i, addr := range deps.Host.Addrs() { + if i == 0 { + fallback = addr.String() + } + + for _, protocol := range addr.Protocols() { + // search the first dns address + if protocol.Name == "dns" { + return addr.String() + } + } + } + + return fallback + } + status := &NodeInfoExtended{ Version: deps.AppInfo.Version, LatestVersion: deps.AppInfo.LatestGitHubVersion, Uptime: time.Since(nodeStartupTimestamp).Milliseconds(), NodeID: deps.Host.ID().String(), - NodeAlias: ParamsNode.Alias, + MultiAddress: getExternalMultiAddr(), + Alias: ParamsNode.Alias, MemoryUsage: int64(m.HeapAlloc + m.StackSys + m.MSpanSys + m.MCacheSys + m.BuckHashSys + m.GCSys + m.OtherSys), } diff --git a/components/dashboard_metrics/types.go b/components/dashboard_metrics/types.go index aacd49adf..800318804 100644 --- a/components/dashboard_metrics/types.go +++ b/components/dashboard_metrics/types.go @@ -6,7 +6,8 @@ type NodeInfoExtended struct { LatestVersion string `serix:",lenPrefix=uint8"` Uptime int64 `serix:""` NodeID string `serix:",lenPrefix=uint8"` - NodeAlias string `serix:",lenPrefix=uint8"` + MultiAddress string `serix:",lenPrefix=uint8"` + Alias string `serix:",lenPrefix=uint8"` MemoryUsage int64 `serix:""` } diff --git a/tools/docker-network/restart.sh b/tools/docker-network/restart.sh index 93f678ad5..a0897d521 100755 --- a/tools/docker-network/restart.sh +++ b/tools/docker-network/restart.sh @@ -2,4 +2,4 @@ docker compose kill docker compose down -./run.sh 0 +./run.sh \ No newline at end of file diff --git a/tools/docker-network/run.sh b/tools/docker-network/run.sh index fda5a9d75..cc3051aaf 100755 --- a/tools/docker-network/run.sh +++ b/tools/docker-network/run.sh @@ -46,6 +46,7 @@ mkdir -p docker-network-snapshots/ chmod o+w docker-network-snapshots/ # Allow docker compose to build and cache an image +echo "Building docker image" echo $DOCKER_BUILD_CONTEXT $DOCKERFILE_PATH docker compose build --build-arg WITH_GO_WORK=${WITH_GO_WORK:-0} --build-arg DOCKER_BUILD_CONTEXT=${DOCKER_BUILD_CONTEXT} --build-arg DOCKERFILE_PATH=${DOCKERFILE_PATH}