← Back to Cosmos Documentation

PushChain Installation

TESTNET • pushchain-testnet

Installation

Install Dependencies

sudo apt update && sudo apt upgrade -y && sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y

Go Version

cd $HOME
sudo rm -rf /usr/local/go
VER="1.25.8"
curl -Ls https://go.dev/dl/go$VER.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile
mkdir -p ~/go/bin
go version

Install Binary

cd $HOME
mkdir -p ~/go/bin
wget https://github.com/pushchain/push-chain-node/releases/download/v0.0.41/push-chain_0.0.41_linux_amd64.tar.gz -O pchaind.tar.gz 
tar -xzf pchaind.tar.gz 
chmod +x pchaind 
mv pchaind ~/go/bin/

Initialize Node

pchaind init "Your_Validator_Name" --chain-id pushchain-testnet --home $HOME/.pchaind

Download Genesis and Addrbook

wget -O $HOME/.pchaind/config/genesis.json https://backup.codeblocklabs.com/republic/genesis.json 
wget -O $HOME/.pchaind/config/addrbook.json https://backup.codeblocklabs.com/republic/addrbook.json

Configure Pruning

pruning="custom"
pruning_keep_recent="100" 
pruning_keep_every="0" 
pruning_interval="19" 
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.pchaind/config/app.toml 
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.pchaind/config/app.toml 
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.pchaind/config/app.toml 
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.pchaind/config/app.toml

Set Minimum Gas Price

sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "2500000000upc"|g' $HOME/.pchaind/config/app.toml

Configure Indexer

sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.pchaind/config/config.toml

Wasm

mkdir -p $HOME/.pchaind/data/wasm
wget https://ss-t.pushchain.nodestake.org/wasm.tar.lz4 -O $HOME/wasm.lz4 
mv $HOME/wasm.lz4 $HOME/.pchaind/data/wasm 

Create Service

sudo tee /etc/systemd/system/pchaind.service > /dev/null <<EOF
[Unit] 
Description=PushChain node 
After=network-online.target 
[Service] 
User=$USER 
WorkingDirectory=$HOME/.pchaind 
ExecStart=$(which pchaind) start --home $HOME/.pchaind 
Restart=on-failure 
RestartSec=5 
LimitNOFILE=65535 
[Install] 
WantedBy=multi-user.target 
EOF
mkdir -p $HOME/.pchaind/cosmovisor/genesis/bin
mv $HOME/go/bin/pchaind $HOME/.pchaind/cosmovisor/genesis/bin/ 
sudo ln -s $HOME/.pchaind/cosmovisor/genesis $HOME/.pchaind/cosmovisor/current -f 
sudo ln -s $HOME/.pchaind/cosmovisor/current/bin/pchaind /usr/local/bin/pchaind -f 

go install cosmossdk.io/tools/cosmovisor/cmd/[email protected] 

sudo tee /etc/systemd/system/pchaind.service > /dev/null <<EOF
[Unit] 
Description=PushChain node service 
After=network-online.target 

[Service] 
User=$USER 
ExecStart=$(which cosmovisor) run start --home $HOME/.pchaind 
Restart=on-failure 
RestartSec=10 
LimitNOFILE=65535 
Environment="DAEMON_HOME=$HOME/.pchaind" 
Environment="DAEMON_NAME=pchaind" 
Environment="UNSAFE_SKIP_BACKUP=true" 

[Install] 
WantedBy=multi-user.target 
EOF

Enable and Start Service

sudo systemctl daemon-reload 
sudo systemctl enable pchaind 
sudo systemctl restart pchaind && sudo journalctl -u pchaind -f

Create Wallet

# Create new wallet
pchaind keys add wallet --home $HOME/.pchaind 

# Restore existing wallet
pchaind keys add wallet --recover --home $HOME/.pchaind 

# Check sync status (false = fully synced)
pchaind status --home $HOME/.pchaind 2>&1 | jq .sync_info

Create Validator

Create validator.json

tee $HOME/validator.json > /dev/null <<EOF
{
  "pubkey": $(pchaind comet show-validator), 
  "amount": "1000000000000000000upc", 
  "moniker": "CodeBlockLabs", 
  "identity": "E1ADDC27DCE641C2", 
  "website": "https://codeblocklabs.com", 
  "details": "Join Our Community on Telegram @CodeBlockLabs", 
  "commission-rate": "0.05", 
  "commission-max-rate": "0.2", 
  "commission-max-change-rate": "0.1", 
  "min-self-delegation": "1" 
}
EOF

Create Validator

pchaind tx staking create-validator $HOME/validator.json --from wallet --chain-id pushchain-testnet --home $HOME/.pchaind --gas auto --gas-adjustment 1.5 --gas-prices 2500000000upc -y

Delete Node

sudo systemctl stop pchaind 
sudo systemctl disable pchaind 
sudo rm -rf /etc/systemd/system/pchaind.service 
sudo rm $(which pchaind) 
sudo rm -rf $HOME/.pchaind

Service Operations

Check logs

sudo journalctl -u pchaind -f

Sync info

pchaind status --home $HOME/.pchaind 2>&1 | jq .sync_info

Node info

pchaind status --home $HOME/.pchaind 2>&1 | jq .node_info

Your node peer

# CometBFT
echo $(pchaind comet show-node-id --home $HOME/.pchaind)'@'$(wget -qO- eth0.me)':'$(cat $HOME/.pchaind/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')
# Tendermint (legacy)
# echo $(pchaind tendermint show-node-id --home $HOME/.pchaind)'@'$(wget -qO- eth0.me)':'$(cat $HOME/.pchaind/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')

Key Management

Add New Wallet

pchaind keys add wallet --home $HOME/.pchaind

Restore existing wallet

pchaind keys add wallet --recover --home $HOME/.pchaind

List All Wallets

pchaind keys list --home $HOME/.pchaind

Delete wallet

pchaind keys delete wallet --home $HOME/.pchaind

Check Balance

pchaind q bank balances $(pchaind keys show wallet -a --home $HOME/.pchaind) --home $HOME/.pchaind

Export Key (save to wallet.backup)

pchaind keys export wallet --home $HOME/.pchaind

Export Key to EVM

pchaind keys export wallet --unarmored-hex --unsafe --home $HOME/.pchaind

Import Key (restore from wallet.backup)

pchaind keys import wallet wallet.backup --home $HOME/.pchaind

Tokens

Withdraw all rewards

pchaind tx distribution withdraw-all-rewards --from wallet --chain-id pushchain-testnet --home $HOME/.pchaind --gas auto --gas-adjustment 1.5 --gas-prices 2500000000upc -y

Withdraw rewards and commission from your validator

pchaind tx distribution withdraw-rewards $(pchaind keys show wallet --bech val -a --home $HOME/.pchaind) --from wallet --commission --chain-id pushchain-testnet --home $HOME/.pchaind --gas auto --gas-adjustment 1.5 --gas-prices 2500000000upc -y

Delegate to Yourself

pchaind tx staking delegate $(pchaind keys show wallet --bech val -a --home $HOME/.pchaind) 1000000000000000000upc --from wallet --chain-id pushchain-testnet --home $HOME/.pchaind --gas auto --gas-adjustment 1.5 --gas-prices 2500000000upc -y

Delegate to Other Validator

pchaind tx staking delegate <TO_VALOPER_ADDRESS> 1000000000000000000upc --from wallet --chain-id pushchain-testnet --home $HOME/.pchaind --gas auto --gas-adjustment 1.5 --gas-prices 2500000000upc -y

Redelegate Stake to Another Validator

pchaind tx staking redelegate $(pchaind keys show wallet --bech val -a --home $HOME/.pchaind) <TO_VALOPER_ADDRESS> 1000000000000000000upc --from wallet --chain-id pushchain-testnet --home $HOME/.pchaind --gas auto --gas-adjustment 1.5 --gas-prices 2500000000upc -y

Unbond

pchaind tx staking unbond $(pchaind keys show wallet --bech val -a --home $HOME/.pchaind) 1000000000000000000upc --from wallet --chain-id pushchain-testnet --home $HOME/.pchaind --gas auto --gas-adjustment 1.5 --gas-prices 2500000000upc -y

Transfer Funds

pchaind tx bank send $(pchaind keys show wallet -a --home $HOME/.pchaind) <TO_WALLET_ADDRESS> 1000000000000000000upc --chain-id pushchain-testnet --home $HOME/.pchaind --gas auto --gas-adjustment 1.5 --gas-prices 2500000000upc -y

Validator Operations

Edit Existing Validator

pchaind tx staking edit-validator \
--commission-rate 0.1 \
--new-moniker "$MONIKER" \
--identity "" \
--details "I am validator" \
--from wallet \
--chain-id pushchain-testnet \
--home $HOME/.pchaind \
--gas auto --gas-adjustment 1.5 --gas-prices 2500000000upc  \
-y

Validator info

pchaind status --home $HOME/.pchaind 2>&1 | jq .validator_info

Validator Details

pchaind q staking validator $(pchaind keys show wallet --bech val -a --home $HOME/.pchaind) --home $HOME/.pchaind

Jailing info

# CometBFT
pchaind q slashing signing-info $(pchaind comet show-validator --home $HOME/.pchaind) --home $HOME/.pchaind# Tendermint (legacy)
# pchaind q slashing signing-info $(pchaind tendermint show-validator --home $HOME/.pchaind) --home $HOME/.pchaind

Slashing parameters

pchaind q slashing params --home $HOME/.pchaind

Unjail validator

pchaind tx slashing unjail --from wallet --chain-id pushchain-testnet --home $HOME/.pchaind --gas auto --gas-adjustment 1.5 --gas-prices 2500000000upc -y

Active Validators List

pchaind q staking validators -oj --limit=2000 --home $HOME/.pchaind | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " 	 " + .description.moniker' | sort -gr | nl

Check Validator key

# CometBFT
[[ $(pchaind q staking validator $(pchaind keys show wallet --bech val -a --home $HOME/.pchaind) -oj --home $HOME/.pchaind | jq -r .consensus_pubkey.key) = $(pchaind status --home $HOME/.pchaind 2>&1 | jq -r .ValidatorInfo.PubKey.value) ]] && echo -e "Your key status is ok" || echo -e "Your key status is error"
# Tendermint (legacy)
# [[ $(pchaind q staking validator $(pchaind keys show wallet --bech val -a --home $HOME/.pchaind) -oj --home $HOME/.pchaind | jq -r .consensus_pubkey.key) = $(pchaind status --home $HOME/.pchaind 2>&1 | jq -r .ValidatorInfo.PubKey.value) ]] && echo -e "Your key status is ok" || echo -e "Your key status is error"

Signing info

# CometBFT
pchaind q slashing signing-info $(pchaind comet show-validator --home $HOME/.pchaind) --home $HOME/.pchaind# Tendermint (legacy)
# pchaind q slashing signing-info $(pchaind tendermint show-validator --home $HOME/.pchaind) --home $HOME/.pchaind

Governance

Create New Text Proposal

pchaind tx gov submit-proposal \
--title "" \
--description "" \
--deposit 1000000000000000000upc \
--type Text \
--from wallet \
--home $HOME/.pchaind \
--gas auto --gas-adjustment 1.5 --gas-prices 2500000000upc  \
-y

Proposals List

pchaind query gov proposals --home $HOME/.pchaind

View proposal

pchaind query gov proposal 1 --home $HOME/.pchaind

Vote

pchaind tx gov vote 1 yes --from wallet --chain-id pushchain-testnet --home $HOME/.pchaind --gas auto --gas-adjustment 1.5 --gas-prices 2500000000upc -y