sudo apt update && sudo apt upgrade --yes && \
sudo apt install git build-essential ufw curl jq snapd screen ncdu nano fuse ufw --yes
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
git clone https://github.com/chain4energy/c4e-chain
cd c4e-chain
git checkout v1.4.2
make install
c4ed version
c4ed init <node_name> --chain-id perun-1
wget https://raw.githubusercontent.com/obajay/nodes-Guides/main/C4E/genesis.json -O $HOME/.c4e-chain/config/genesis.json
peers="1b802d4616c1de3fa687ad0d671b1b9d64754a44@88.198.49.217:26156,3d75b4da612395d69ef58a0f6dbb851bd98c1962@185.144.99.246:26656,a9bdcae2527c4a27a6f4882e852329241a945699@46.4.81.204:30656,2f6141859c28c088514b46f7783509aeeb87553f@141.94.193.12:11656,bf78d9bd64cf7e83357966aa3b4ca19d996ef1ef@51.75.55.49:26656,e84d7bff6960e7b50ee8eba09ef6f25b0b0b30cc@95.214.53.105:56656,717c041cf112f778508033e99a16288ec9d034c8@95.217.35.186:60756,cff10605b619e5119a1c9d53397a798de8fbf83b@64.227.136.63:26656,770fc199534d3126ff336b93aaf643a80e12761a@185.169.252.22:26656,c37c30000caf21391e77a457f7721685e41bea42@195.3.223.221:26656"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" ~/.c4e-chain/config/config.toml
sed -i 's|^minimum-gas-prices *=.*|minimum-gas-prices = "0uc4e"|g' $HOME/.c4e-chain/config/app.toml
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
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
systemctl daemon-reload
systemctl enable c4ed
systemctl restart c4ed
journalctl -u c4ed -f -o cat