fix: entrypoint script for existing setup (#58)

This commit is contained in:
aloknerurkar 2025-03-11 22:01:21 +05:30 committed by GitHub
parent d6f0d34bba
commit 6ebd351534
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -35,6 +35,7 @@ if [ "$GETH_NODE_TYPE" = "signer" ]; then
if [ ! -f "$GETH_DATA_DIR/password" ]; then
echo -n "$GETH_KEYSTORE_PASSWORD" > "$GETH_DATA_DIR"/password
fi
if [ ! -d "$GETH_KEYSTORE_DIR" ]; then
if [ -n "$BLOCK_SIGNER_PRIVATE_KEY" ]; then
echo "$GETH_KEYSTORE_DIR missing, running account import"
@ -51,6 +52,9 @@ if [ "$GETH_NODE_TYPE" = "signer" ]; then
fi
else
echo "$GETH_KEYSTORE_DIR exists."
if [ -n "$BLOCK_SIGNER_ADDRESS" ]; then
echo "Block signer address with 0x prefix: $BLOCK_SIGNER_ADDRESS"
else
if [ -z "$BLOCK_SIGNER_PRIVATE_KEY" ]; then
GETH_ACCOUNT_LIST=$("$GETH_BIN_PATH" --verbosity="$GETH_VERBOSITY" account list --datadir "$GETH_DATA_DIR")
BLOCK_SIGNER_ADDRESS_WITHOUT_PREFIX=$(echo "$GETH_ACCOUNT_LIST" | grep -oE '[0-9a-fA-F]{40}$')
@ -59,6 +63,7 @@ if [ "$GETH_NODE_TYPE" = "signer" ]; then
fi
fi
fi
fi
# Init geth if needed
if [ ! -d "$GETH_CHAINDATA_DIR" ]; then
@ -92,7 +97,6 @@ else
fi
# (Optional) Echo the values for verification
if [ "$GETH_NODE_TYPE" = "bootnode" ]; then
echo "Starting bootnode"
echo "$NODE_KEY" > $GETH_DATA_DIR/nodekey
@ -134,7 +138,7 @@ if [ "$GETH_NODE_TYPE" = "bootnode" ]; then
--rpc.allow-unprotected-txs \
--miner.gasprice=50000000 \
--txpool.pricelimit=50000000 \
--gpo.maxprice=500000000000 \
--gpo.maxprice=500000000000
elif [ "$GETH_NODE_TYPE" = "signer" ]; then
echo "Starting signer node"
@ -238,6 +242,7 @@ elif [ "$GETH_NODE_TYPE" = "member" ]; then
--txpool.pricelimit=50000000 \
--gpo.maxprice=500000000000 \
"$NAT_FLAG"
elif [ "$GETH_NODE_TYPE" = "archive" ]; then
echo "Starting archive node"
echo "BOOTNODE_ENDPOINT is set to: $BOOTNODE_ENDPOINT"