⚒️Installation

  1. Update packages and install useful tools.

sudo apt update && sudo apt upgrade --yes && \
sudo apt install git build-essential ufw curl jq snapd screen ncdu nano fuse ufw --yes
  1. Install go using snap.

sudo snap install go --classic && \
echo 'export GOPATH="$HOME/go"' >> ~/.profile && \
echo 'export GOBIN="$GOPATH/bin"' >> ~/.profile && \
echo 'export PATH="$GOBIN:$PATH"' >> ~/.profile && \
source ~/.profile && \
go version
  1. Build the binary from source.

git clone https://github.com/chain4energy/c4e-chain
cd c4e-chain
git checkout v1.4.3
make install
c4ed version
  1. Initialize your node.

c4ed init <node_name> --chain-id perun-1
  1. Download genesis.

wget https://raw.githubusercontent.com/obajay/nodes-Guides/main/C4E/genesis.json -O $HOME/.c4e-chain/config/genesis.json
  1. Add persistent peers to config.toml.

peers="[email protected]:26156,[email protected]:26656,[email protected]:30656,[email protected]:11656,[email protected]:26656,[email protected]:56656,[email protected]:60756,[email protected]:26656,[email protected]:26656,[email protected]:26656"
sed -i.bak -e  "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" ~/.c4e-chain/config/config.toml
  1. Set up minimum gas price.

sed -i 's|^minimum-gas-prices *=.*|minimum-gas-prices = "0uc4e"|g' $HOME/.c4e-chain/config/app.toml
  1. Set up pruning (optional).

pruning="custom"
pruning_keep_recent="100"
pruning_keep_every="0"
pruning_interval="10"
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.c4e-chain/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.c4e-chain/config/app.toml
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.c4e-chain/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.c4e-chain/config/app.toml
  1. Create service file.

sudo tee /etc/systemd/system/c4ed.service > /dev/null <<EOF
[Unit]
Description=Chain4Energy Daemon
After=network-online.target

[Service]
User=$USER
ExecStart=$(which c4ed) start
Restart=on-failure
RestartSec=3
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF
  1. Enable and start service.

systemctl daemon-reload
systemctl enable c4ed
systemctl restart c4ed
journalctl -u c4ed -f -o cat

If you would like to speed up the sync process, you may try using State Sync.

Last updated