Skip to content

Commit 5616c9e

Browse files
authored
Merge pull request #684 from ava-labs/proxy-fix
use localhost instead of 0.0.0.0 for proxy fix
2 parents adfc7b5 + 00d6306 commit 5616c9e

File tree

8 files changed

+24
-24
lines changed

8 files changed

+24
-24
lines changed

cmd/control/control.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func NewCommand() *cobra.Command {
5151

5252
cmd.PersistentFlags().StringVar(&logLevel, "log-level", logging.Info.String(), "log level")
5353
cmd.PersistentFlags().StringVar(&logDir, "log-dir", "", "log directory")
54-
cmd.PersistentFlags().StringVar(&endpoint, "endpoint", "0.0.0.0:8080", "server endpoint")
54+
cmd.PersistentFlags().StringVar(&endpoint, "endpoint", "localhost:8080", "server endpoint")
5555
cmd.PersistentFlags().DurationVar(&dialTimeout, "dial-timeout", 10*time.Second, "server dial timeout")
5656
cmd.PersistentFlags().DurationVar(&requestTimeout, "request-timeout", 3*time.Minute, "client request timeout")
5757

cmd/ping/ping.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func NewCommand() *cobra.Command {
2929
}
3030

3131
cmd.PersistentFlags().StringVar(&logLevel, "log-level", logging.Info.String(), "log level")
32-
cmd.PersistentFlags().StringVar(&endpoint, "endpoint", "0.0.0.0:8080", "server endpoint")
32+
cmd.PersistentFlags().StringVar(&endpoint, "endpoint", "localhost:8080", "server endpoint")
3333
cmd.PersistentFlags().DurationVar(&dialTimeout, "dial-timeout", 10*time.Second, "server dial timeout")
3434
cmd.PersistentFlags().DurationVar(&requestTimeout, "request-timeout", 10*time.Second, "client request timeout")
3535

docs/blockchain-examples.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ curl -X POST -k http://localhost:8081/v1/control/start -d '{"numNodes":5,"logLev
102102
# or
103103
avalanche-network-runner control start \
104104
--log-level debug \
105-
--endpoint="0.0.0.0:8080" \
105+
--endpoint="localhost:8080" \
106106
--blockchain-specs '[{"vm_name": "subnetevm", "genesis": "/tmp/subnet-evm.genesis.json"}]'
107107
```
108108

@@ -119,7 +119,7 @@ curl -X POST -k http://localhost:8081/v1/control/start -d '{"numNodes":5,"logLev
119119
# or
120120
avalanche-network-runner control start \
121121
--log-level debug \
122-
--endpoint="0.0.0.0:8080" \
122+
--endpoint="localhost:8080" \
123123
--blockchain-specs '[{"vm_name": "subnetevm", "genesis": "/tmp/subnet-evm.genesis.json", "chain_config": "'$CHAIN_CONFIG_PATH'", "network_upgrade": "'$NETWORK_UPGRADE_PATH'", "subnet_config": "'$SUBNET_CONFIG_PATH'"}]'
124124
```
125125

@@ -183,7 +183,7 @@ curl -X POST -k http://localhost:8081/v1/control/start -d '{"numNodes":5,"logLev
183183
# or
184184
avalanche-network-runner control start \
185185
--log-level debug \
186-
--endpoint="0.0.0.0:8080" \
186+
--endpoint="localhost:8080" \
187187
--blockchain-specs '[{"vm_name": "blobvm", "genesis": "/tmp/blobvm.genesis.json"}]'
188188
```
189189

@@ -200,7 +200,7 @@ curl -X POST -k http://localhost:8081/v1/control/start -d '{"numNodes":5,"logLev
200200
# or
201201
avalanche-network-runner control start \
202202
--log-level debug \
203-
--endpoint="0.0.0.0:8080" \
203+
--endpoint="localhost:8080" \
204204
--blockchain-specs '[{"vm_name": "blobvm", "genesis": "/tmp/blobvm.genesis.json", "chain_config": "'$CHAIN_CONFIG_PATH'", "network_upgrade": "'$NETWORK_UPGRADE_PATH'", "subnet_config": "'$SUBNET_CONFIG_PATH'"}]'
205205
```
206206

@@ -264,7 +264,7 @@ curl -X POST -k http://localhost:8081/v1/control/start -d '{"numNodes":5,"logLev
264264
# or
265265
avalanche-network-runner control start \
266266
--log-level debug \
267-
--endpoint="0.0.0.0:8080" \
267+
--endpoint="localhost:8080" \
268268
--blockchain-specs '[{"vm_name":"timestampvm","genesis":"/tmp/timestampvm.genesis.json","blockchain_alias":"timestamp"}]'
269269
```
270270

docs/examples.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ curl -X POST -k http://localhost:8081/v1/control/removenode -d '{"name":"node5"}
323323
avalanche-network-runner control remove-node \
324324
--request-timeout=3m \
325325
--log-level debug \
326-
--endpoint="0.0.0.0:8080" \
326+
--endpoint="localhost:8080" \
327327
node5
328328
```
329329

@@ -338,7 +338,7 @@ curl -X POST -k http://localhost:8081/v1/control/restartnode -d '{"name":"node1"
338338
avalanche-network-runner control restart-node \
339339
--request-timeout=3m \
340340
--log-level debug \
341-
--endpoint="0.0.0.0:8080" \
341+
--endpoint="localhost:8080" \
342342
node1
343343
```
344344

@@ -353,7 +353,7 @@ curl -X POST -k http://localhost:8081/v1/control/addnode -d '{"name":"node99","l
353353
avalanche-network-runner control add-node \
354354
--request-timeout=3m \
355355
--log-level debug \
356-
--endpoint="0.0.0.0:8080" \
356+
--endpoint="localhost:8080" \
357357
node99
358358
```
359359

@@ -368,7 +368,7 @@ curl -X POST -k http://localhost:8081/v1/control/pausenode -d '{"name":"node99",
368368
avalanche-network-runner control pause-node \
369369
--request-timeout=3m \
370370
--log-level debug \
371-
--endpoint="0.0.0.0:8080" \
371+
--endpoint="localhost:8080" \
372372
node99
373373
```
374374

@@ -381,7 +381,7 @@ curl -X POST -k http://localhost:8081/v1/control/resumenode -d '{"name":"node99"
381381
avalanche-network-runner control resume-node \
382382
--request-timeout=3m \
383383
--log-level debug \
384-
--endpoint="0.0.0.0:8080" \
384+
--endpoint="localhost:8080" \
385385
node99
386386
```
387387

@@ -412,7 +412,7 @@ curl -X POST -k http://localhost:8081/v1/control/attachpeer -d '{"nodeName":"nod
412412
avalanche-network-runner control attach-peer \
413413
--request-timeout=3m \
414414
--log-level debug \
415-
--endpoint="0.0.0.0:8080" \
415+
--endpoint="localhost:8080" \
416416
--node-name node1
417417
```
418418

@@ -425,7 +425,7 @@ curl -X POST -k http://localhost:8081/v1/control/sendoutboundmessage -d '{"nodeN
425425
avalanche-network-runner control send-outbound-message \
426426
--request-timeout=3m \
427427
--log-level debug \
428-
--endpoint="0.0.0.0:8080" \
428+
--endpoint="localhost:8080" \
429429
--node-name node1 \
430430
--peer-id "7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg" \
431431
--message-op=16 \
@@ -442,7 +442,7 @@ curl -X POST -k http://localhost:8081/v1/control/stop
442442
# or
443443
avalanche-network-runner control stop \
444444
--log-level debug \
445-
--endpoint="0.0.0.0:8080"
445+
--endpoint="localhost:8080"
446446
```
447447

448448
Note: this does not stops the server.

docs/reference.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Global Flags
44

55
- `--dial-timeout duration` server dial timeout (default 10s)
6-
- `--endpoint string` server endpoint (default "0.0.0.0:8080")
6+
- `--endpoint string` server endpoint (default "localhost:8080")
77
- `--log-dir string` log directory
88
- `--log-level string` log level (default "INFO")
99
- `--request-timeout duration` client request timeout (default 3m0s)
@@ -622,7 +622,7 @@ cli
622622
avalanche-network-runner control restart-node \
623623
--request-timeout=3m \
624624
--log-level debug \
625-
--endpoint="0.0.0.0:8080" \
625+
--endpoint="localhost:8080" \
626626
node1
627627
```
628628
@@ -741,7 +741,7 @@ cli
741741
avalanche-network-runner control send-outbound-message \
742742
--request-timeout=3m \
743743
--log-level debug \
744-
--endpoint="0.0.0.0:8080" \
744+
--endpoint="localhost:8080" \
745745
--node-name node1 \
746746
--peer-id "7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg" \
747747
--message-op=16 \
@@ -787,7 +787,7 @@ cli
787787
```sh
788788
avalanche-network-runner control start \
789789
--log-level debug \
790-
--endpoint="0.0.0.0:8080" \
790+
--endpoint="localhost:8080" \
791791
--number-of-nodes=5 \
792792
--blockchain-specs '[{"vm_name": "subnetevm", "genesis": "./path/to/config.json"}]'
793793
```

scripts/tests.e2e.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ echo "running e2e tests"
146146
--ginkgo.v \
147147
--ginkgo.fail-fast \
148148
--log-level debug \
149-
--grpc-endpoint="0.0.0.0:8080" \
150-
--grpc-gateway-endpoint="0.0.0.0:8081" \
149+
--grpc-endpoint="localhost:8080" \
150+
--grpc-gateway-endpoint="localhost:8081" \
151151
--avalanchego-path-1=${VERSION_1_DIR}/avalanchego \
152152
--avalanchego-path-2=${VERSION_2_DIR}/avalanchego

server/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func (s *server) Run(rootCtx context.Context) (err error) {
176176
ctx, cancel := context.WithTimeout(rootCtx, s.cfg.DialTimeout)
177177
gwConn, err := grpc.DialContext(
178178
ctx,
179-
"0.0.0.0"+s.cfg.Port,
179+
"localhost"+s.cfg.Port,
180180
grpc.WithBlock(),
181181
grpc.WithTransportCredentials(insecure.NewCredentials()),
182182
)

tests/e2e/e2e_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@ func init() {
121121
flag.StringVar(
122122
&gRPCEp,
123123
"grpc-endpoint",
124-
"0.0.0.0:8080",
124+
"localhost:8080",
125125
"gRPC server endpoint",
126126
)
127127
flag.StringVar(
128128
&gRPCGatewayEp,
129129
"grpc-gateway-endpoint",
130-
"0.0.0.0:8081",
130+
"localhost:8081",
131131
"gRPC gateway endpoint",
132132
)
133133
flag.StringVar(

0 commit comments

Comments
 (0)