A comprehensive guide to installing and configuring a Planq blockchain node on your server. Follow these steps to set up your node quickly and efficiently.
First, make sure your system is up to date with the latest packages.
sudo apt update && sudo apt upgrade -y
Copied!
Install the necessary dependencies for the Planq node software.
sudo apt install curl build-essential git wget jq make gcc tmux htop nvme-cli pkg-config libssl-dev libleveldb-dev tar clang bsdmainutils ncdu unzip lz4 -y
Copied!
Install Go programming language which is required for building the Planq node.
wget https://go.dev/dl/go1.20.5.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go1.20.5.linux-amd64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc
Copied!
Clone the official Planq repository to your local machine.
git clone https://github.com/planq-network/planq.git
cd planq
Copied!
Build the Planq node software from source.
make install
Copied!
Initialize your Planq node with a custom moniker.
planqd init mynode --chain-id planq_7000-1
Copied!
Download the genesis file for the Planq network.
wget https://raw.githubusercontent.com/planq-network/networks/main/mainnet/genesis.json -O ~/.planqd/config/genesis.json
Copied!
Add persistent peers to your configuration.
PEERS="$(curl -s https://raw.githubusercontent.com/planq-network/networks/main/mainnet/peers.txt | head -n 10 | awk '{print $1}' | paste -s -d ',' -)"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" ~/.planqd/config/config.toml
Copied!
Enable state sync for faster synchronization.
sed -i.bak -E 's#^(enable[[:space:]]+=[[:space:]]+).*$#\1true#' ~/.planqd/config/config.toml
sed -i.bak -E 's#^(rpc_servers[[:space:]]+=[[:space:]]+).*$#\1"https://rpc.planq.network,https://rpc.planq.network"#' ~/.planqd/config/config.toml
sed -i.bak -E 's#^(trust_height[[:space:]]+=[[:space:]]+).*$#\1"1"#' ~/.planqd/config/config.toml
sed -i.bak -E 's#^(trust_hash[[:space:]]+=[[:space:]]+).*$#\1"0000000000000000000000000000000000000000000000000000000000000000"#' ~/.planqd/config/config.toml
Copied!
Create a systemd service file for automatic startup.
sudo tee /etc/systemd/system/planqd.service > /dev/null
[Unit]
Description=Planq Node
After=network.target
[Service]
Type=simple
User=$USER
WorkingDirectory=$HOME
ExecStart=$(which planqd) start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
Copied!
Enable and start the Planq node service.
sudo systemctl daemon-reload
sudo systemctl enable planqd
sudo systemctl start planqd
Copied!
Monitor your node's status and logs.
# Check service status
sudo systemctl status planqd
# View logs
sudo journalctl -u planqd -f
# Check sync status
planqd status 2>&1 | jq .SyncInfo
Copied!
Optimize storage usage by configuring pruning settings.
sed -i.bak -E 's#^(pruning[[:space:]]+=[[:space:]]+).*$#\1"custom"#' ~/.planqd/config/app.toml
sed -i.bak -E 's#^(pruning-keep-recent[[:space:]]+=[[:space:]]+).*$#\1"100"#' ~/.planqd/config/app.toml
sed -i.bak -E 's#^(pruning-keep-every[[:space:]]+=[[:space:]]+).*$#\1"0"#' ~/.planqd/config/app.toml
sed -i.bak -E 's#^(pruning-interval[[:space:]]+=[[:space:]]+).*$#\1"10"#' ~/.planqd/config/app.toml
Copied!
Enable the indexer for better query performance.
sed -i.bak -E 's#^(indexer[[:space:]]+=[[:space:]]+).*$#\1"kv"#' ~/.planqd/config/config.toml
Copied!
Configure minimum gas prices for transactions.
sed -i.bak -E 's#^(minimum-gas-prices[[:space:]]+=[[:space:]]+).*$#\1"0.0001aplanq"#' ~/.planqd/config/app.toml
Copied!
Enable Prometheus metrics for monitoring.
sed -i.bak -E 's#^(prometheus[[:space:]]+=[[:space:]]+).*$#\1true#' ~/.planqd/config/config.toml
Copied!
# Check node status
planqd status 2>&1 | jq .
# Check validator status
planqd query staking validator $(planqd keys show wallet --bech val -a)
# Check node info
planqd query tendermint-validator-set
# Check network info
planqd query staking params
# Check your balance
planqd query bank balances $(planqd keys show wallet -a)
Copied!
If your node is not syncing, try these steps:
If your node is using too much memory:
If you're having connection problems: