This commit is contained in:
goldsquid
2025-09-16 19:38:16 +07:00
parent 1a730d708d
commit 7cca5e6e8a
3 changed files with 4 additions and 1 deletions

View File

@@ -45,13 +45,16 @@ DATA_DIR="$HOME_DIR/data"
mkdir -p $CONFIG_DIR mkdir -p $CONFIG_DIR
mkdir -p $DATA_DIR mkdir -p $DATA_DIR
CHAIN_SPEC=devnet
env env
# seems to be the same for all the 0g chains
if [ ! -f "$DATA_DIR/priv_validator_state.json" ]; then if [ ! -f "$DATA_DIR/priv_validator_state.json" ]; then
echo "priv_validator_state.json not found in $HOME_DIR. Proceeding with initialization steps..." echo "priv_validator_state.json not found in $HOME_DIR. Proceeding with initialization steps..."
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} --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 cp $TMP_DIR/data/priv_validator_state.json $DATA_DIR
cp $TMP_DIR/config/node_key.json $CONFIG_DIR cp $TMP_DIR/config/node_key.json $CONFIG_DIR