Manual

Build the Node from scratch step by step

1. Install Dependencies

sudo apt update && sudo apt upgrade -y && sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential bsdmainutils git make ncdu gcc git jq chrony liblz4-tool -y

  1. Install GO

If you already Installed GO version 1.19.5 you can skip this step

check your GO version:

ver="1.19.5"
cd $HOME
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" >> ~/.bash_profile
source ~/.bash_profile
go version

  1. Download and Install Binary

cd $HOME
rm -rf planq/
git clone https://github.com/planq-network/planq.git
cd planq/
git fetch
git checkout v1.0.5
make build

  1. Install Cosmovisor

go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.4.0

  1. Create Symbolic Links for Cosmovisor

mkdir -p $HOME/.planqd/cosmovisor/genesis/bin
mv build/planqd $HOME/.planqd/cosmovisor/genesis/bin/
rm -rf build

sudo ln -s $HOME/.planqd/cosmovisor/genesis $HOME/.planqd/cosmovisor/current
sudo ln -s $HOME/.planqd/cosmovisor/current/bin/planqd /usr/local/bin/planqd

  1. Set Config App

First, create variable for:

NODENAME=<fill with your node name>
PORT=<fill with your available port>

(you can use port 4-65353, except: 18, 22, 23, 53, 80 and 323)
planqd config chain-id planq_7070-2
planqd config keyring-backend file
planqd config node tcp://localhost:${PORT}657
planqd init $NODENAME --chain-id planq_7070-2

  1. Download Addrbook & Genesis

wget -O ${HOME}/.planqd/config/addrbook.json https://raw.githubusercontent.com/planq-network/networks/main/mainnet/addrbook.json
wget -O ${HOME}/.planqd/config/genesis.json https://raw.githubusercontent.com/planq-network/networks/main/mainnet/genesis.json

  1. Configure Seeds and Peers

SEEDS=`curl -sL https://raw.githubusercontent.com/planq-network/networks/main/mainnet/seeds.txt | awk '{print $1}' | paste -s -d, -`
PEERS=`curl -sL https://raw.githubusercontent.com/planq-network/networks/main/mainnet/peers.txt | sort -R | head -n 10 | awk '{print $1}' | paste -s -d, -`
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.planqd/config/config.toml

  1. Configure Pruninge

PRUNING="custom"
PRUNING_KEEP_RECENT="100"
PRUNING_INTERVAL="19"

sed -i -e "s/^pruning *=.*/pruning = \"$PRUNING\"/" $HOME/.planqd/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \
\"$PRUNING_KEEP_RECENT\"/" $HOME/.planqd/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \
\"$PRUNING_INTERVAL\"/" $HOME/.planqd/config/app.toml

  1. Create Service

sudo tee /etc/systemd/system/planqd.service > /dev/null << EOF
[Unit]
Description=planqd 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/.planqd"
Environment="DAEMON_NAME=planqd"
Environment="UNSAFE_SKIP_BACKUP=true"

[Install]
WantedBy=multi-user.target
EOF

  1. Start Node

sudo systemctl daemon-reload
sudo systemctl enable planqd
sudo systemctl start planqd

  1. (Optional) Check Node Status

if you want check your Node logs, run the command below:

sudo journalctl -fu planqd -o cat

if you want check your Node synchronize status, run the command below:

curl -s localhost:${PORT}657/status

Last updated