Configure a node
8/1/25Less than 1 minute
Configure a node
Setup a node
Select a chain:
export CHAINID=perun-1
Init chain and delete generated genesis:
c4ed init <MONIKER> --chain-id $CHAINID
rm -rf ~/.c4e-chain/config/genesis.json
Clone repository with chains:
git clone https://github.com/chain4energy/c4e-chains.git
cd c4e-chains/$CHAINID
Copy genesis file from repo:
cp genesis.json ~/.c4e-chain/config/
Run node
Change the persistent peers inside config.toml
file:
sed -e "s|persistent_peers = \".*\"|persistent_peers = \"$(cat .data | grep -oP 'Persistent peers\s+\K\S+')\"|g" ~/.c4e-chain/config/config.toml > ~/.c4e-chain/config/config.toml.tmp
mv ~/.c4e-chain/config/config.toml.tmp ~/.c4e-chain/config/config.toml
Change external_address
value to contact your node using public IP of your node:
PUB_IP=`curl -s -4 icanhazip.com`
sed -e "s|external_address = \".*\"|external_address = \"$PUB_IP:26656\"|g" ~/.c4e-chain/config/config.toml > ~/.c4e-chain/config/config.toml.tmp
mv ~/.c4e-chain/config/config.toml.tmp ~/.c4e-chain/config/config.toml