diff --git a/docker-compose.yml b/docker-compose.yml index 5de9433f..146d2c83 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -36,7 +36,12 @@ services: volumes: - "setup-data:/setup" - "node0-data:/root/.fetchd" - + ports: + - "26657:26657" + - "26656:26656" + - "1317:1317" + - "9090:9090" + # networks: # localnet: # ipv4_address: 192.168.10.2 @@ -57,7 +62,6 @@ services: volumes: - "setup-data:/setup" - "node1-data:/root/.fetchd" - # networks: # localnet: # ipv4_address: 192.168.10.3 diff --git a/entrypoints/run-localnet-setup.py b/entrypoints/run-localnet-setup.py index d0c389a7..44ca7535 100755 --- a/entrypoints/run-localnet-setup.py +++ b/entrypoints/run-localnet-setup.py @@ -11,13 +11,15 @@ FETCHD_CONFIG_ROOT = '/root/.fetchd/config' GENESIS_PATH = os.path.join(FETCHD_CONFIG_ROOT, 'genesis.json') GENTX_PATH = os.path.join(FETCHD_CONFIG_ROOT, 'gentx') - +APP_TOML_PATH = os.path.join(FETCHD_CONFIG_ROOT, 'app.toml') def create_genesis(chain_id: str): cmd = ['fetchd', 'init', 'setup-node', '--chain-id', chain_id] subprocess.check_call(cmd) replace_denom_cmd = ['sed', '-i', 's/stake/'+DENOM+'/g', GENESIS_PATH] subprocess.check_call(replace_denom_cmd) + grpc_fix_cmd = ['sed','-i','s/localhost/0.0.0.0/', APP_TOML_PATH] + subprocess.check_call(grpc_fix_cmd) def get_validators(): validators = set() diff --git a/entrypoints/run-localnet.sh b/entrypoints/run-localnet.sh index 6c145f19..981aeec4 100755 --- a/entrypoints/run-localnet.sh +++ b/entrypoints/run-localnet.sh @@ -67,6 +67,11 @@ if [ ! -f /setup/genesis.json ]; then done fi +# ensure gRPC listens on 0.0.0.0, not localhost +if [ -f "/root/.fetchd/config/app.toml" ]; then + sed -i 's/localhost/0.0.0.0/g' /root/.fetchd/config/app.toml +fi + # copy the generated genesis file cp /setup/genesis.json /root/.fetchd/config/genesis.json