Add a config option for testnet
This commit is contained in:
parent
1bdff2b22e
commit
372cace05f
@ -2,7 +2,8 @@ services:
|
|||||||
bsc:
|
bsc:
|
||||||
image: ghcr.io/bnb-chain/bsc:1.4.8
|
image: ghcr.io/bnb-chain/bsc:1.4.8
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
# environment:
|
environment:
|
||||||
|
CERC_BSC_NETWORK: ${CERC_BSC_NETWORK:-mainnet}
|
||||||
volumes:
|
volumes:
|
||||||
- ../config/docker-entrypoint.sh:/bsc/docker-entrypoint.sh
|
- ../config/docker-entrypoint.sh:/bsc/docker-entrypoint.sh
|
||||||
- data:/data
|
- data:/data
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
echo "Setting up BSC $CERC_BSC_NETWORK"
|
||||||
|
|
||||||
BSC_CONFIG=${BSC_HOME}/config/config.toml
|
BSC_CONFIG=${BSC_HOME}/config/config.toml
|
||||||
BSC_GENESIS=${BSC_HOME}/config/genesis.json
|
BSC_GENESIS=${BSC_HOME}/config/genesis.json
|
||||||
|
|
||||||
# TODO: Check for testnet flag
|
|
||||||
|
|
||||||
if [ -f "$BSC_CONFIG" ]; then
|
if [ -f "$BSC_CONFIG" ]; then
|
||||||
echo "Config file found at $BSC_CONFIG"
|
echo "Config file found at $BSC_CONFIG"
|
||||||
else
|
else
|
||||||
echo "Config file not found at $BSC_CONFIG, downloading..."
|
echo "Config file not found at $BSC_CONFIG, downloading config for $CERC_BSC_NETWORK..."
|
||||||
|
|
||||||
# Download and unzip the config files
|
# Download and unzip the config files
|
||||||
wget -O config.zip $(curl -s https://api.github.com/repos/bnb-chain/bsc/releases/latest |grep browser_ |grep mainnet |cut -d\" -f4)
|
wget -O config.zip $(curl -s https://api.github.com/repos/bnb-chain/bsc/releases/latest |grep browser_ |grep $CERC_BSC_NETWORK |cut -d\" -f4)
|
||||||
unzip config.zip -d config
|
unzip config.zip -d config
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -25,4 +25,16 @@ if [ ! -d "$GETH_DIR" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# TODO: Check for archive mode flag
|
# TODO: Check for archive mode flag
|
||||||
exec "geth" "--config" ${BSC_CONFIG} "--datadir" ${DATA_DIR} "$@"
|
exec "geth" \
|
||||||
|
--config="${BSC_CONFIG}" \
|
||||||
|
--datadir="${DATA_DIR}" \
|
||||||
|
--http \
|
||||||
|
--http.addr="0.0.0.0" \
|
||||||
|
--http.port 8545 \
|
||||||
|
--http.vhosts="*" \
|
||||||
|
--http.corsdomain="*" \
|
||||||
|
--ws \
|
||||||
|
--ws.addr="0.0.0.0" \
|
||||||
|
--ws.port 8546 \
|
||||||
|
--ws.origins="*" \
|
||||||
|
"$@"
|
||||||
|
Loading…
Reference in New Issue
Block a user