![](https://docs.indonode.net/~gitbook/image?url=https%3A%2F%2Fexplorer.indonode.net%2Flogos%2Fc4e.png&width=768&dpr=4&quality=100&sign=b703416d&sv=1)
Version | Chain-id | Wasm |
---|---|---|
1.3.0 | babajaga-1 | DISABLED |
Setup Server
# Update Packages
sudo apt update && apt upgrade -y
sudo apt install curl git jq lz4 build-essential unzip fail2ban ufw -y
# Set Firewall
sudo apt install -y ufw
sudo ufw default allow outgoing
sudo ufw default deny incoming
sudo ufw allow ssh
sudo ufw allow 9100
# Enable Firewall
sudo ufw enable
# Install Go
ver="1.20"
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz"
rm "go$ver.linux-amd64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile
go version
# Install Cosmovisor (OPTIONAL If you are using Cosmovisor)
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0
Node Installation
There is 2 ways to install node , using Cosmovisor or Run the binary directly, you can choose whats you prefer
# Download and install binary
cd $HOME
rm -rf c4e-chain/
git clone https://github.com/chain4energy/c4e-chain.git
cd c4e-chain/
git checkout v1.3.0
make build
# Setup Cosmovisor Symlinks
mkdir -p $HOME/.c4e-chain/cosmovisor/genesis/bin
mv build/c4ed $HOME/.c4e-chain/cosmovisor/genesis/bin/
rm -rf build
sudo ln -s $HOME/.c4e-chain/cosmovisor/genesis $HOME/.c4e-chain/cosmovisor/current
sudo ln -s $HOME/.c4e-chain/cosmovisor/current/bin/c4ed /usr/local/bin/c4ed
# Set Configuration for your node
c4ed config chain-id babajaga-1
c4ed config keyring-backend file
# Init your node
# You can change "MyNode" to anything you like
c4ed init MyNode --chain-id babajaga-1
# Add Genesis File and Addrbook
curl -Ls https://snapshots.indonode.net/c4e/testnet/genesis.json > $HOME/.c4e-chain/config/genesis.json
#Configure Seeds and Peers
peers=$(curl -s https://ss-t.c4e.nodestake.top/peers.txt)
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" ~/.c4e-chain/config/config.toml
# Set Pruning, Enable Prometheus, Gas Price, and Indexer
PRUNING="custom"
PRUNING_KEEP_RECENT="100"
PRUNING_INTERVAL="19"
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-interval *=.*/pruning-interval = \
\"$PRUNING_INTERVAL\"/" $HOME/.c4e-chain/config/app.toml
sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME/.c4e-chain/config/config.toml
sed -i 's|^prometheus *=.*|prometheus = true|' $HOME/.c4e-chain/config/config.toml
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0025uc4e\"/" $HOME/.c4e-chain/config/app.toml
# Set Service file
sudo tee /etc/systemd/system/c4ed.service > /dev/null << EOF
[Unit]
Description=c4ed testnet node service
After=network-online.target
[Service]
User=$USER
ExecStart=$(which cosmovisor) run start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
Environment="DAEMON_HOME=$HOME/.c4e-chain"
Environment="DAEMON_NAME=c4ed"
Environment="UNSAFE_SKIP_BACKUP=true"
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable c4ed
# Start the Node
sudo systemctl restart c4ed
sudo journalctl -fu c4ed -o cat
# Download and install binary
cd $HOME
rm -rf c4e-chain/
git clone https://github.com/chain4energy/c4e-chain.git
cd c4e-chain/
git checkout v1.3.0
make install
# Set Configuration for your node
c4ed config chain-id babajaga-1
c4ed config keyring-backend file
# Init your node
# You can change "MyNode" to anything you like
c4ed init MyNode --chain-in babajaga-1
# Add Genesis File and Addrbook
wget https://raw.githubusercontent.com/planq-network/networks/main/mainnet/genesis.json
mv genesis.json $HOME/.c4e-chain/config/
#Configure Seeds and Peers
peers=$(curl -s https://ss-t.c4e.nodestake.top/peers.txt)
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" ~/.c4e-chain/config/config.toml
# Set Pruning, Enable Prometheus, Gas Prices, and Indexer
PRUNING="custom"
PRUNING_KEEP_RECENT="100"
PRUNING_INTERVAL="19"
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-interval *=.*/pruning-interval = \
\"$PRUNING_INTERVAL\"/" $HOME/.c4e-chain/config/app.toml
sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME/.c4e-chain/config/config.toml
sed -i 's|^prometheus *=.*|prometheus = true|' $HOME/.c4e-chain/config/config.toml
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0025uc4e\"/" $HOME/.c4e-chain/config/app.toml
# Set Service file
sudo tee /etc/systemd/system/c4ed.service > /dev/null <<EOF
[Unit]
Description=c4ed testnet node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which c4ed) start
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable c4ed
# Start the Node
sudo systemctl restart c4ed
sudo journalctl -fu c4ed -o cat
Last updated