nitro-stack/stack-orchestrator/config/go-nitro/run-nitro-node.sh

49 lines
1.4 KiB
Bash
Raw Normal View History

#!/bin/bash
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
fi
node_config_file="/app/config.toml"
echo "Using the following environment variables:"
echo "NITRO_USE_DURABLE_STORE: ${NITRO_USE_DURABLE_STORE}"
echo "NITRO_MSG_PORT: ${NITRO_MSG_PORT}"
echo "NITRO_RPC_PORT: ${NITRO_RPC_PORT}"
echo "NITRO_SC_PK: ${NITRO_SC_PK}"
echo "NITRO_CHAIN_PK: ${NITRO_CHAIN_PK}"
echo "NITRO_CHAIN_URL: ${NITRO_CHAIN_URL}"
echo "NITRO_BOOTPEERS: ${NITRO_BOOTPEERS}"
echo "NITRO_PUBLIC_P2P_HOST: ${NITRO_PUBLIC_P2P_HOST}"
echo "NITRO_EXT_MULTIADDR: ${NITRO_EXT_MULTIADDR}"
echo "NITRO_L2: ${NITRO_L2}"
echo "Using Nitro contract addresses:"
echo "NA_ADDRESS: ${NA_ADDRESS}"
echo "CA_ADDRESS: ${CA_ADDRESS}"
echo "VPA_ADDRESS: ${VPA_ADDRESS}"
# Create required certs
./create-certs.sh
# Create the required config file
cat <<EOF > "$node_config_file"
usedurablestore = ${NITRO_USE_DURABLE_STORE}
msgport = ${NITRO_MSG_PORT}
rpcport = ${NITRO_RPC_PORT}
pk = "${NITRO_SC_PK}"
chainpk = "${NITRO_CHAIN_PK}"
chainurl = "${NITRO_CHAIN_URL}"
bootpeers = "${NITRO_BOOTPEERS}"
publicip = "${NITRO_PUBLIC_P2P_HOST}"
extMultiAddr = "${NITRO_EXT_MULTIADDR}"
l2 = ${NITRO_L2}
naaddress = "${NA_ADDRESS}"
vpaaddress = "${VPA_ADDRESS}"
caaddress = "${CA_ADDRESS}"
EOF
# Start the node
./nitro -config $node_config_file