refactor: parametrize node key for signer and member nodes

This commit is contained in:
mrekucci 2024-09-23 17:42:44 +02:00
parent 6811ee9034
commit 59430eabca

View file

@ -87,8 +87,6 @@ fi
if [ "$GETH_NODE_TYPE" = "bootnode" ]; then if [ "$GETH_NODE_TYPE" = "bootnode" ]; then
echo "Starting bootnode" echo "Starting bootnode"
# Generate boot.key
echo "$BOOT_KEY" > $GETH_DATA_DIR/boot.key echo "$BOOT_KEY" > $GETH_DATA_DIR/boot.key
exec "$GETH_BIN_PATH" \ exec "$GETH_BIN_PATH" \
@ -130,8 +128,10 @@ if [ "$GETH_NODE_TYPE" = "bootnode" ]; then
elif [ "$GETH_NODE_TYPE" = "signer" ]; then elif [ "$GETH_NODE_TYPE" = "signer" ]; then
echo "Starting signer node" echo "Starting signer node"
echo "BOOTNODE_ENDPOINT is set to: $BOOTNODE_ENDPOINT" echo "$BOOT_KEY" > $GETH_DATA_DIR/boot.key
GETH_PORT="${GETH_PORT:-30311}"
echo "BOOTNODE_ENDPOINT is set to: $BOOTNODE_ENDPOINT"
GETH_PORT="${GETH_PORT:-30311}"
exec "$GETH_BIN_PATH" \ exec "$GETH_BIN_PATH" \
--verbosity="$GETH_VERBOSITY" \ --verbosity="$GETH_VERBOSITY" \
@ -157,6 +157,7 @@ elif [ "$GETH_NODE_TYPE" = "signer" ]; then
--miner.etherbase=$BLOCK_SIGNER_ADDRESS \ --miner.etherbase=$BLOCK_SIGNER_ADDRESS \
--allow-insecure-unlock \ --allow-insecure-unlock \
--nousb \ --nousb \
--nodekey $GETH_DATA_DIR/boot.key \
--netrestrict $NET_RESTRICT \ --netrestrict $NET_RESTRICT \
--metrics \ --metrics \
--metrics.addr="$NODE_IP" \ --metrics.addr="$NODE_IP" \
@ -180,6 +181,7 @@ elif [ "$GETH_NODE_TYPE" = "signer" ]; then
elif [ "$GETH_NODE_TYPE" = "member" ]; then elif [ "$GETH_NODE_TYPE" = "member" ]; then
echo "Starting member node" echo "Starting member node"
echo "$BOOT_KEY" > $GETH_DATA_DIR/boot.key
echo "BOOTNODE_ENDPOINT is set to: $BOOTNODE_ENDPOINT" echo "BOOTNODE_ENDPOINT is set to: $BOOTNODE_ENDPOINT"
GETH_PORT="${GETH_PORT:-30311}" GETH_PORT="${GETH_PORT:-30311}"
@ -202,6 +204,7 @@ elif [ "$GETH_NODE_TYPE" = "member" ]; then
--bootnodes $BOOTNODE_ENDPOINT \ --bootnodes $BOOTNODE_ENDPOINT \
--networkid=$CHAIN_ID \ --networkid=$CHAIN_ID \
--password="$GETH_DATA_DIR"/password \ --password="$GETH_DATA_DIR"/password \
--nodekey $GETH_DATA_DIR/boot.key \
--metrics \ --metrics \
--metrics.addr="$NODE_IP" \ --metrics.addr="$NODE_IP" \
--metrics.port=6060 \ --metrics.port=6060 \