From 0da2b42908aa9927b4fa79a2173d09dfdf74c592 Mon Sep 17 00:00:00 2001 From: Flavien Binet Date: Mon, 22 Mar 2021 15:47:03 +0100 Subject: [PATCH] feat: add run_node.sh option to overwrite genesis --- entrypoints/run-node.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/entrypoints/run-node.sh b/entrypoints/run-node.sh index 38ea56eb0..921848131 100755 --- a/entrypoints/run-node.sh +++ b/entrypoints/run-node.sh @@ -37,6 +37,15 @@ else sed -i "s/tempmoniker/$MONIKER/g" ~/.fetchd/config/config.toml sed -i "s/tempexternal/$P2PADDRESS/g" ~/.fetchd/config/config.toml + # Genesis usually comes from /root/wasm-temp-config/genesis.json, which is populated from a configmap + # Some genesis might not fit there (when over 1MB), so as an alternative, OVERWRITE_GENESIS_URL environment + # can be specified to pull the genesis from the URL it contains. + if [ ! -z "${OVERWRITE_GENESIS_URL}" ]; + then + echo "Overwritting genesis.json from ${OVERWRITE_GENESIS_URL}" + curl -o ~/.fetchd/config/genesis.json "${OVERWRITE_GENESIS_URL}" + fi + ## ## Create priv_validator_state.json if it does not exist ##