2024-07-17 09:29:46 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
|
|
|
|
2024-07-23 06:40:19 +00:00
|
|
|
node_config_file="/app/config.toml"
|
2024-07-18 11:48:24 +00:00
|
|
|
|
2024-07-23 06:40:19 +00:00
|
|
|
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}"
|
2024-07-23 11:46:46 +00:00
|
|
|
echo "NITRO_EXT_MULTIADDR: ${NITRO_EXT_MULTIADDR}"
|
2024-07-23 06:40:19 +00:00
|
|
|
echo "NITRO_L2: ${NITRO_L2}"
|
2024-07-18 11:48:24 +00:00
|
|
|
|
2024-07-23 06:40:19 +00:00
|
|
|
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}"
|
2024-07-23 11:46:46 +00:00
|
|
|
publicip = "${NITRO_PUBLIC_P2P_HOST}"
|
|
|
|
extMultiAddr = "${NITRO_EXT_MULTIADDR}"
|
2024-07-23 06:40:19 +00:00
|
|
|
l2 = ${NITRO_L2}
|
2024-07-18 11:48:24 +00:00
|
|
|
|
2024-07-23 06:40:19 +00:00
|
|
|
naaddress = "${NA_ADDRESS}"
|
2024-07-24 11:37:58 +00:00
|
|
|
vpaaddress = "${VPA_ADDRESS}"
|
|
|
|
caaddress = "${CA_ADDRESS}"
|
2024-07-23 06:40:19 +00:00
|
|
|
EOF
|
2024-07-18 11:48:24 +00:00
|
|
|
|
2024-07-23 06:40:19 +00:00
|
|
|
# Start the node
|
|
|
|
./nitro -config $node_config_file
|