Manual setup

Prerequisites

  • Ubuntu (tested on 18.04 and 20.04)
  • sudo apt-get install wget liblz4-tool aria2 jq -y

Get Binaries

Check the appropriate version for the network accordingly:

QPD_RELEASE=v0.35.5
TOFND_RELEASE=v0.10.1
WASMVM_RELEASE=v1.3.1
QPD_RELEASE=v0.35.5
TOFND_RELEASE=v0.10.1
WASMVM_RELEASE=v1.3.1
# verify correct versions
echo $QPD_RELEASE $TOFND_RELEASE $WASMVM_RELEASE

# create a temp dir for binaries
cd $HOME
mkdir binaries && cd binaries


# get QPd, tofnd binaries and rename
wget https://github.com/ferrumnet/QP-core/releases/download/$QPD_RELEASE/QPd-linux-amd64-$QPD_RELEASE
wget https://github.com/ferrumnet/tofnd/releases/download/$TOFND_RELEASE/tofnd-linux-amd64-$TOFND_RELEASE
mv QPd-linux-amd64-$QPD_RELEASE QPd
mv tofnd-linux-amd64-$TOFND_RELEASE tofnd

# make binaries executable
chmod +x *

# move to usr bin
sudo mv * /usr/bin/

# get wasmvm library
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_RELEASE/libwasmvm.x86_64.so -O /usr/local/lib/libwasmvm.x86_64.so

# get out of binaries directory
cd $HOME

# check versions
QPd version
QPd q wasm libwasmvm-version
tofnd --help

Generate keys

To create new keys

QPd keys add broadcaster
QPd keys add validator
tofnd -m create

To recover exsiting keys

QPd keys add broadcaster --recover
QPd keys add validator --recover
tofnd -m import
# type your desired keyring password and enter mnemonics when prompted

Your tofnd secret mnemonic is in a file do cat $HOME/.tofnd/export to check. Save this mnemonic somewhere safe and delete the file by rm $HOME/.tofnd/export.

Set environment variables

echo export CHAIN_ID=QP-dojo-1 >> $HOME/.profile
echo export CHAIN_ID=QP-testnet-lisbon-3 >> $HOME/.profile
echo export MONIKER=PUT_YOUR_MONIKER_HERE >> $HOME/.profile
VALIDATOR_OPERATOR_ADDRESS=`QPd keys show validator --bech val --output json | jq -r .address`
BROADCASTER_ADDRESS=`QPd keys show broadcaster --output json | jq -r .address`
echo export VALIDATOR_OPERATOR_ADDRESS=$VALIDATOR_OPERATOR_ADDRESS >> $HOME/.profile
echo export BROADCASTER_ADDRESS=$BROADCASTER_ADDRESS >> $HOME/.profile
⚠️

Protect your keyring password: The following instructions instruct you to store your keyring plaintext password in a file on disk. This instruction is safe only if you can prevent unauthorized access to the file. Use your discretion---substitute your own preferred method for securing your keyring password.

Choose a secret {KEYRING_PASSWORD} and add the following line to $HOME/.profile:

# it's recommended to manually edit the file and add it
echo export KEYRING_PASSWORD=PUT_YOUR_KEYRING_PASSWORD_HERE >> $HOME/.profile

Apply your changes

source $HOME/.profile

Configuration setup

Initialize your Quantum Portal node, fetch configuration, genesis, seeds.

QPd init $MONIKER --chain-id $CHAIN_ID
wget https://raw.githubusercontent.com/QPnetwork/QPate-community/main/configuration/config.toml -O $HOME/.QP/config/config.toml
wget https://raw.githubusercontent.com/QPnetwork/QPate-community/main/configuration/app.toml -O $HOME/.QP/config/app.toml
wget https://QP-mainnet.s3.us-east-2.amazonaws.com/genesis.json -O $HOME/.QP/config/genesis.json
wget https://raw.githubusercontent.com/QPnetwork/QPate-community/main/resources/mainnet/seeds.toml -O $HOME/.QP/config/seeds.toml

# set external ip to your config.json file
sed -i.bak 's/external_address = \"\"/external_address = \"'"$(curl -4 ifconfig.co)"':26656\"/g' $HOME/.QP/config/config.toml
QPd init $MONIKER --chain-id $CHAIN_ID
wget https://raw.githubusercontent.com/QPnetwork/QPate-community/main/configuration/config.toml -O $HOME/.QP/config/config.toml
wget https://raw.githubusercontent.com/QPnetwork/QPate-community/main/configuration/app.toml -O $HOME/.QP/config/app.toml
wget https://raw.githubusercontent.com/QPnetwork/QPate-community/main/resources/testnet/genesis.json -O $HOME/.QP/config/genesis.json
wget https://raw.githubusercontent.com/QPnetwork/QPate-community/main/resources/testnet/seeds.toml -O $HOME/.QP/config/seeds.toml

# set external ip to your config.json file
sed -i.bak 's/external_address = \"\"/external_address = \"'"$(curl -4 ifconfig.co)"':26656\"/g' $HOME/.QP/config/config.toml

Sync From Snapshot

QPd tendermint unsafe-reset-all
URL=\`curl -L https://quicksync.io/QP.json | jq -r '.[] |select(.file=="QP-dojo-1-pruned")|.url'\`
echo $URL
cd $HOME/.QP/
wget -O - $URL | lz4 -d | tar -xvf -
cd $HOME
QPd tendermint unsafe-reset-all
URL=\`curl -L https://quicksync.io/QP.json | jq -r '.[] |select(.file=="QPtestnet-lisbon-3-pruned")|.url'\`
echo $URL
cd $HOME/.QP/
wget -O - $URL | lz4 -d | tar -xvf -
cd $HOME

Create services

Use systemctl to set up services for QPd, tofnd, vald.

QPd

sudo tee <<EOF >/dev/null /etc/systemd/system/QPd.service
[Unit]
Description=QPd Cosmos daemon
After=network-online.target

[Service]
User=$USER
ExecStart=/usr/bin/QPd start
Restart=always
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target
EOF

cat /etc/systemd/system/QPd.service
sudo systemctl enable QPd

tofnd

sudo tee <<EOF >/dev/null /etc/systemd/system/tofnd.service
[Unit]
Description=Tofnd daemon
After=network-online.target

[Service]
User=$USER
ExecStart=/usr/bin/sh -c 'echo $KEYRING_PASSWORD | tofnd -m existing -d $HOME/.tofnd'
Restart=always
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target
EOF

cat /etc/systemd/system/tofnd.service
sudo systemctl enable tofnd

vald

sudo tee <<EOF >/dev/null /etc/systemd/system/vald.service
[Unit]
Description=Vald daemon
After=network-online.target tofnd.service
[Service]
User=$USER
ExecStart=/usr/bin/sh -c 'echo $KEYRING_PASSWORD | /usr/bin/QPd vald-start --validator-addr $VALIDATOR_OPERATOR_ADDRESS --log_level debug --chain-id $CHAIN_ID --from broadcaster'
Restart=always
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target
EOF

cat /etc/systemd/system/vald.service
sudo systemctl enable vald

Start all services

Order of operations:

  1. QPd: ensure it’s fully synced before proceeding
  2. tofnd: required for vald
  3. vald
sudo systemctl daemon-reload
sudo systemctl restart QPd
sudo systemctl restart tofnd
sudo systemctl restart vald

Check logs

# change log settings to persistent if not already
sed -i 's/#Storage=auto/Storage=persistent/g' /etc/systemd/journald.conf
sudo systemctl restart systemd-journald

journalctl -u QPd.service -f -n 100
journalctl -u tofnd.service -f -n 100
journalctl -u vald.service -f -n 100

Register broadcaster proxy

📝

Note: Fund your validator and broadcaster accounts before proceeding.

QPd tx snapshot register-proxy $BROADCASTER_ADDRESS --from validator --chain-id $CHAIN_ID

Create validator

# set temporary variables for create-validator command
IDENTITY="YOUR_KEYBASE_IDENTITY" # optional
AMOUNT=PUT_AMOUNT_OF_TOKEN_YOU_WANT_TO_DELEGATE
DENOM=uaxl

QPd tx staking create-validator --yes \
 --amount $AMOUNT$DENOM \
 --moniker $MONIKER \
 --commission-rate="0.10" \
 --commission-max-rate="0.20" \
 --commission-max-change-rate="0.01" \
 --min-self-delegation="1" \
 --pubkey="$(QPd tendermint show-validator)" \
 --from validator \
 -b block \
 --identity=$IDENTITY \
 --chain-id $CHAIN_ID

Register external chains

See Support external chains.

Upgrade Process

cd $HOME
cd binaries
# put the tag/version that we are upgrading to
# set versions: the below is an example and the numbers should be replaced
# QPD_RELEASE=v0.17.1
# TOFND_RELEASE=v0.10.1

QPD_RELEASE=<GIVE_VERSION>
TOFND_RELEASE=<GIVE_VERSION>  # if we are upgrading tofnd too

echo $QPD_RELEASE $TOFND_RELEASE

# get QPd, tofnd binaries and rename
wget https://github.com/ferrumnet/QP-core/releases/download/$QPD_RELEASE/QPd-linux-amd64-$QPD_RELEASE
# if we are upgrading tofnd too
wget https://github.com/ferrumnet/tofnd/releases/download/$TOFND_RELEASE/tofnd-linux-amd64-$TOFND_RELEASE


mv QPd-linux-amd64-$QPD_RELEASE QPd # if we are upgrading tofnd too
mv tofnd-linux-amd64-$TOFND_RELEASE tofnd

# make binaries executable
chmod +x *

# move to usr bin
sudo mv * /usr/bin/


# check versions
QPd version
echo $QPD_RELEASE
# QPd version and echo $RELEASE should have same tag/version


# check versions
tofnd --help
echo $TOFND_RELEASE
# tofnd version and echo $TOFND_RELEASE should have same tag/version

# restart services
sudo systemctl restart QPd
sudo systemctl restart tofnd # if we are upgrading tofnd too
sudo systemctl restart vald

# check logs
journalctl -u QPd.service -f -n 100
journalctl -u tofnd.service -f -n 100
journalctl -u vald.service -f -n 1000
Edit this page