Matches the run profile flags to prevent 'incompatible state scheme' crash on fresh datadir initialization (stored: hash, provided: path). Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
23 lines
708 B
Bash
23 lines
708 B
Bash
#!/bin/sh
|
|
|
|
set -e # Exit on failure
|
|
|
|
GETH_DATA_DIR="/root/.ethereum"
|
|
CONFIG_FILE="/config/config.toml"
|
|
GENESIS_FILE="/config/genesis.json"
|
|
|
|
# Initialize geth from genesis if data directory is empty
|
|
if [ -z "$(ls -A "$GETH_DATA_DIR")" ]; then
|
|
echo "abcore: data directory is empty, initializing from genesis..."
|
|
if [ -f "$GENESIS_FILE" ]; then
|
|
/abcore/bin/geth init --datadir "$GETH_DATA_DIR" --db.engine=pebble --state.scheme=path "$GENESIS_FILE"
|
|
else
|
|
echo "abcore: genesis file not found at $GENESIS_FILE" >&2
|
|
exit 1
|
|
fi
|
|
else
|
|
echo "abcore: data directory not empty, continuing..."
|
|
fi
|
|
|
|
exec /abcore/bin/geth --config "$CONFIG_FILE" --datadir "$GETH_DATA_DIR" "$@"
|