Starting the node

Once you received your post-registration node ID, the following will guide you through the steps to start and run the Redbelly node.

Config file

Step 1: Download template

Important!

You will need to access the Redbelly Developer Support Portal which you would have received an invite to if you were accepted into the Node Operator program.

Step 2: Create config.yaml

Important!

Before proceeding further please ensure that you have received the post-registration node ID (Node ID will be provided by Redbelly post successful submission of the node registration form as mentioned in the previous step.)

Create a config.yaml file using the sample template. Set the ip and id fields with your node-specific values. Rest all the values should remain the same. Note that FQDN should not end with a period(.)

ip: <ENTER FULLY QUALIFIED DOMAIN NAME (FQDN) HERE>
id: <ENTER THE ID PROVIDED POST REGISTRATION HERE - See section 'Node Registration'>
genesisContracts:
bootstrapContractsRegistryAddress: 0xDAFEA492D9c6733ae3d56b7Ed1ADB60692c98Bc5
consensusPort: 1888
grpcPort: 1111
privateKeyHex:<Private_key_for_signing_address>
poolConfig:
initCap: 5
maxCap: 30
idleTimeout: 180
clientKeepAliveConfig:
keepAliveTime: 1
keepAliveTimeOut: 20
serverKeepAliveConfig:
serverKeepAliveTime: 70
serverKeepAliveTimeOut: 10
minTime: 60
rpcPoolConfig:
maxOpenCount: 1
maxIdleCount: 1
maxIdleTime: 30

Start the node

Start the node with the following steps to run the Redbelly binary.

Step 1: Create observe.sh

Create File observe.sh and update the Redbelly flags used as per your configuration. Also, replace and with the path of the SSL certificate and private key generated in pre-requisites.
#!/bin/sh
# filename: observe.sh
if [ ! -d rbn ]; then
echo "rbn doesnt exist. Initialising redbelly"
mkdir -p rbn
mkdir -p consensus
cp config.yaml ./consensus

./binaries/rbbc init --datadir=rbn --standalone
rm -rf ./rbn/database/chaindata
rm -rf ./rbn/database/nodes
 mkdir -p ./rbn/genesis
cp genesis.json ./rbn/genesis
else
echo "rbn already exists. continuing with existing setup"
cp config.yaml ./consensus
fi


# Run EVM
rm -f log
./binaries/rbbc run --datadir=rbn --consensus.dir=consensus --tls --consensus.tls --tls.cert=<PATH TO SSL CERTIFICATE> --tls.key=<PATH TO SSL CERTIFICATE KEY> --http --http.addr=0.0.0.0 --http.corsdomain=* --http.vhosts=* --http.port=8545 --http.api eth,net,web3,rbn --ws --ws.addr=0.0.0.0 --ws.port=8546 --ws.origins="*" --ws.api eth,net,web3,rbn --threshold=200 --timeout=500 --logging.level info --mode production --consensus.type dbft --config.file config.yaml --bootstrap.tries=10 --bootstrap.wait=10 --recovery.tries=10 --recovery.wait=10

Step 2: Create start-rbn.sh

Create file start-rbn.sh by using the following command:
#!/bin/sh
# filename: start-rbn.sh
mkdir -p binaries
mkdir -p consensus
chmod +x rbbc
cp rbbc binaries/rbbc
mkdir -p logs
nohup ./observe.sh > ./logs/rbbcLogs 2>&1 &

Step 3: Make files executable

Make observe.sh and start-rbn.sh executable by using the following command:
chmod +x observe.sh
chmod +x start-rbn.sh

Step 4: Run start file

Run start-rbn.sh by using the following command:
./start-rbn.sh