Compare commits
3 Commits
zerog-tarb
...
zerog-init
| Author | SHA1 | Date | |
|---|---|---|---|
| 92cdb31d17 | |||
| 4a060bee0d | |||
| 4db13b2fc4 |
@@ -3368,6 +3368,16 @@
|
|||||||
"https://mova.drpc.org"
|
"https://mova.drpc.org"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"mova-mainnet-v2": {
|
||||||
|
"protocol": "eth",
|
||||||
|
"id": 61901,
|
||||||
|
"block_time_ms": 2000,
|
||||||
|
"lagging_lag": 10,
|
||||||
|
"syncing_lag": 20,
|
||||||
|
"urls": [
|
||||||
|
"https://mova-mainnet-v2.drpc.org"
|
||||||
|
]
|
||||||
|
},
|
||||||
"mova-testnet": {
|
"mova-testnet": {
|
||||||
"protocol": "eth",
|
"protocol": "eth",
|
||||||
"id": 10323,
|
"id": 10323,
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ services:
|
|||||||
- --chaincfg.node-api.logging
|
- --chaincfg.node-api.logging
|
||||||
- --home=/root/.0g
|
- --home=/root/.0g
|
||||||
- --p2p.external_address=${IP}:16172
|
- --p2p.external_address=${IP}:16172
|
||||||
- --p2p.seeds=${ZERO_GRAVITY_GALILEO_ZEROG_SEEDS:-461b27a9d1530eb47f62fe010a8d3e5d43b6740c@34.82.252.10:26656}
|
- --p2p.seeds=${ZERO_GRAVITY_GALILEO_ZEROG_SEEDS:-e0750abc061d276894a593c7b671913c14aa4ecc@34.82.252.10:26656}
|
||||||
- --pruning=default
|
- --pruning=default
|
||||||
- --rpc.laddr=tcp://0.0.0.0:16172
|
- --rpc.laddr=tcp://0.0.0.0:16172
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|||||||
@@ -61,23 +61,41 @@ env
|
|||||||
|
|
||||||
# seems to be the same for all the 0g chains
|
# seems to be the same for all the 0g chains
|
||||||
|
|
||||||
if [ ! -f "$DATA_DIR/priv_validator_state.json" ]; then
|
# $DATA_DIR and $CONFIG_DIR are SEPARATE docker volumes (<node>_zerog and <node>_config),
|
||||||
echo "priv_validator_state.json not found in $HOME_DIR. Proceeding with initialization steps..."
|
# so the presence of a file in one says nothing about the other. Guard on everything
|
||||||
|
# 0gchaind actually needs to boot, and write the copies so the LAST file written is the
|
||||||
|
# one that would make a re-run skip.
|
||||||
|
#
|
||||||
|
# The previous version guarded solely on $DATA_DIR/priv_validator_state.json and copied it
|
||||||
|
# BEFORE the two key files. An init interrupted between those copies therefore left the
|
||||||
|
# data volume with the guard file and the config volume without the keys, so every later
|
||||||
|
# start took the "Already initialized" branch, copied nothing, and 0gchaind panicked:
|
||||||
|
#
|
||||||
|
# panic: error calling provider ProvideBlsSigner (node-core/components/signer.go:46):
|
||||||
|
# key file does not exist at path: /root/.0g/config/priv_validator_key.json
|
||||||
|
#
|
||||||
|
# That state is unrecoverable by restarting - the node wedges permanently. Hit on
|
||||||
|
# aristotle @ rpc-de-32 on 2026-08-12 after repeated build failures interrupted its init.
|
||||||
|
if [ ! -f "$CONFIG_DIR/priv_validator_key.json" ] || \
|
||||||
|
[ ! -f "$CONFIG_DIR/node_key.json" ] || \
|
||||||
|
[ ! -f "$DATA_DIR/priv_validator_state.json" ]; then
|
||||||
|
echo "0g: node identity incomplete (config keys and/or priv_validator_state.json). Initializing..."
|
||||||
TMP_DIR=$(mktemp -d)
|
TMP_DIR=$(mktemp -d)
|
||||||
# You can add any additional initialization logic here if needed
|
# You can add any additional initialization logic here if needed
|
||||||
if /0g/bin/0gchaind init ${MONIKER} --chaincfg.chain-spec ${CHAIN_SPEC} --home $TMP_DIR; then
|
if /0g/bin/0gchaind init ${MONIKER} --chaincfg.chain-spec ${CHAIN_SPEC} --home $TMP_DIR; then
|
||||||
cp -r /0g/0g-home/0gchaind-home/config/* $CONFIG_DIR
|
cp -r /0g/0g-home/0gchaind-home/config/* $CONFIG_DIR
|
||||||
cp $TMP_DIR/data/priv_validator_state.json $DATA_DIR
|
# Keys first, guard file last: if this is interrupted the next start re-runs
|
||||||
|
# initialization instead of latching into the wedged state described above.
|
||||||
cp $TMP_DIR/config/node_key.json $CONFIG_DIR
|
cp $TMP_DIR/config/node_key.json $CONFIG_DIR
|
||||||
cp $TMP_DIR/config/priv_validator_key.json $CONFIG_DIR
|
cp $TMP_DIR/config/priv_validator_key.json $CONFIG_DIR
|
||||||
|
cp $TMP_DIR/data/priv_validator_state.json $DATA_DIR
|
||||||
else
|
else
|
||||||
echo "Already initialized, continuing!" >&2
|
echo "Already initialized, continuing!" >&2
|
||||||
fi
|
fi
|
||||||
rm -rf $TMP_DIR # delete tmp dir
|
rm -rf $TMP_DIR # delete tmp dir
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "priv_validator_state.json found in $HOME_DIR. Continuing!" >&2
|
echo "0g: node identity complete (config keys + priv_validator_state.json). Continuing!" >&2
|
||||||
echo "Already initialized, continuing!" >&2
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec /0g/bin/0gchaind $@
|
exec /0g/bin/0gchaind $@
|
||||||
|
|||||||
Reference in New Issue
Block a user