πŸ”Œ Installation

Install Go (if not already installed):

cd $HOME
VERSION="1.23.1"
wget "https://golang.org/dl/go$VERSION.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$VERSION.linux-amd64.tar.gz"
rm "go$VERSION.linux-amd64.tar.gz"
[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bash_profile
source ~/.bash_profile
[ ! -d ~/go/bin ] && mkdir -p ~/go/bin

Define Environment Variables:

echo "export WALLET='wallet'" >> $HOME/.bash_profile
echo "export MONIKER='noderuner'" >> $HOME/.bash_profile
echo "export ZENROCK_CHAIN_ID='gardia-2'" >> $HOME/.bash_profile
echo "export ZENROCK_PORT=46657" >> $HOME/.bash_profile  # Set custom base port here
source ~/.bash_profile

Download the Zenrockd Binary:

cd $HOME
curl -o zenrockd https://releases.gardia.zenrocklabs.io/zenrockd-latest
chmod +x zenrockd
mv zenrockd ~/go/bin/

Configure and Initialize Node:

zenrockd init $MONIKER --chain-id $ZENROCK_CHAIN_ID
zenrockd config set client chain-id $ZENROCK_CHAIN_ID
zenrockd config set client node tcp://localhost:${ZENROCK_PORT}

Download Genesis and Addrbook Files:

wget -O $HOME/.zrchain/config/genesis.json https://raw.githubusercontent.com/mytolga/zenrock/refs/heads/main/genesis.json
wget -O $HOME/.zrchain/config/addrbook.json https://raw.githubusercontent.com/mytolga/zenrock/refs/heads/main/addrbook.json

Set Seed and Peer Nodes:

SEEDS="0ce55654cba1669707ebba8954413892ce8c0b31@zenrock-testnet-rpc.noderuner.xyz:46656"
PEERS=$(curl -sS https://zenrock-testnet-rpc.noderuner.xyz/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}' | paste -sd, -)
echo $PEERS
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.zrchain/config/config.toml

Update App Ports in app.toml:

sed -i.bak -e "s%:1317%:${ZENROCK_PORT}17%g;
s%:8080%:${ZENROCK_PORT}80%g;
s%:9090%:${ZENROCK_PORT}90%g;
s%:9091%:${ZENROCK_PORT}91%g;
s%:8545%:${ZENROCK_PORT}45%g;
s%:8546%:${ZENROCK_PORT}46%g;
s%:6065%:${ZENROCK_PORT}65%g" $HOME/.zrchain/config/app.toml

Update Ports in config.toml:

sed -i.bak -e "s%:26658%:${ZENROCK_PORT}58%g;
s%:26657%:${ZENROCK_PORT}57%g;
s%:6060%:${ZENROCK_PORT}60%g;
s%:26656%:${ZENROCK_PORT}56%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${ZENROCK_PORT}56\"%;
s%:26660%:${ZENROCK_PORT}60%g" $HOME/.zrchain/config/config.toml

Set Pruning and Gas Prices:

sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.zrchain/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.zrchain/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"50\"/" $HOME/.zrchain/config/app.toml
sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0urock"|g' $HOME/.zrchain/config/app.toml
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.zrchain/config/config.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.zrchain/config/config.toml

Create Systemd Service File:

sudo tee /etc/systemd/system/zenrockd.service > /dev/null <<EOF
[Unit]
Description=Zenrock Node Service
After=network-online.target
[Service]
User=$USER
WorkingDirectory=$HOME/.zrchain
ExecStart=$(which zenrockd) start --home $HOME/.zrchain
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

Snapshot

Soon

Enable and Start the Node:

sudo systemctl daemon-reload
sudo systemctl enable zenrockd
sudo systemctl restart zenrockd && sudo journalctl -fu zenrockd -o cat

Last updated