@@ -659,7 +659,7 @@ func (ln *localNetwork) addNode(nodeConfig node.Config) (node.Node, error) {
659
659
name : nodeConfig .Name ,
660
660
nodeID : nodeID ,
661
661
networkID : ln .networkID ,
662
- client : ln .newAPIClientF ("localhost" , nodeData .apiPort ),
662
+ client : ln .newAPIClientF (nodeData . publicIP , nodeData .apiPort ),
663
663
process : nodeProcess ,
664
664
apiPort : nodeData .apiPort ,
665
665
p2pPort : nodeData .p2pPort ,
@@ -678,7 +678,7 @@ func (ln *localNetwork) addNode(nodeConfig node.Config) (node.Node, error) {
678
678
// so this node won't try to use itself as a beacon.
679
679
if ! isPausedNode && nodeConfig .IsBeacon {
680
680
err = ln .bootstraps .Add (beacon .New (nodeID , ips.IPPort {
681
- IP : net .IPv6loopback ,
681
+ IP : net .ParseIP ( nodeData . publicIP ) ,
682
682
Port : nodeData .p2pPort ,
683
683
}))
684
684
}
@@ -1054,6 +1054,7 @@ func (ln *localNetwork) setNodeName(nodeConfig *node.Config) error {
1054
1054
1055
1055
type buildArgsReturn struct {
1056
1056
args []string
1057
+ publicIP string
1057
1058
apiPort uint16
1058
1059
p2pPort uint16
1059
1060
dataDir string
@@ -1119,12 +1120,19 @@ func (ln *localNetwork) buildArgs(
1119
1120
return buildArgsReturn {}, err
1120
1121
}
1121
1122
1123
+ // publicIP from all configs for node
1124
+ publicIP , err := getConfigEntry (nodeConfig .Flags , configFile , config .PublicIPKey , constants .IPv4Lookback )
1125
+ if err != nil {
1126
+ return buildArgsReturn {}, err
1127
+ }
1128
+
1122
1129
// Flags for AvalancheGo
1123
1130
flags := map [string ]string {
1124
1131
config .NetworkNameKey : fmt .Sprintf ("%d" , ln .networkID ),
1125
1132
config .DataDirKey : dataDir ,
1126
1133
config .DBPathKey : dbDir ,
1127
1134
config .LogsDirKey : logsDir ,
1135
+ config .PublicIPKey : publicIP ,
1128
1136
config .HTTPPortKey : fmt .Sprintf ("%d" , apiPort ),
1129
1137
config .StakingPortKey : fmt .Sprintf ("%d" , p2pPort ),
1130
1138
config .BootstrapIPsKey : ln .bootstraps .IPsArg (),
@@ -1171,6 +1179,7 @@ func (ln *localNetwork) buildArgs(
1171
1179
1172
1180
return buildArgsReturn {
1173
1181
args : args ,
1182
+ publicIP : publicIP ,
1174
1183
apiPort : apiPort ,
1175
1184
p2pPort : p2pPort ,
1176
1185
dataDir : dataDir ,
0 commit comments