Phu Quoc Dog
Search…
Running a validator on PQD
This guide will instruct you on how to set up a Phu Quoc Doge validator node on Phu Quoc Dog networks (Testnet/Mainnet).

πŸ‘‰ Must Read Before Start.

Running a validator is a serious thing, you have a lot of responsibility for the staked tokens of you and nominators. You take the risk of losing your staked tokens as a slash might happen if your validator node is not properly configured. Please make sure you or your team have the necessary knowledge to run a validator node.
​Polkadot Wiki has an awesome introduction of running a validator node on the Polkadot network. As a member of the Polkadot ecosystem, Phu Quoc Dog follows a similar process to run and setup a validator node. We may skip some basics steps in this tutorial.

πŸ›  Hardware Requirements

  • CPU - Recent released high end cpu, e.g. Intel 10700/Amd 5800X.
  • Memory - 32GB for Testnet, 64GB for Sakura and Mainnet.
  • Storage - 300GB SSD, Storage usage could increase by time, you might need to increase the capacity as the chain data grows..
  • OS: Linux, Debian/Ubuntu LTS distributions are recommended.

πŸ”§ Prepare Environment

Once you choose your cloud service provider and set-up your new server, the first thing you will do is install the necessary dependencies.
1
sudo apt install make clang pkg-config libssl-dev build-essential curl git
Copied!
If you intend to build from source you need to install Rust first.
If you have already installed Rust, run the following command to make sure you are using the latest version.
1
rustup update
Copied!
If not, this command will fetch the latest version of Rust and install it.
1
curl https://sh.rustup.rs -sSf | sh -s -- -y
Copied!
Add the required toolchains with rustup
1
source $HOME/.cargo/env
2
rustup toolchain add nightly-2021-05-11
3
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-05-11
4
rustup target add x86_64-unknown-linux-gnu --toolchain nightly-2021-05-11
5
​
Copied!
Verify your installation.
1
rustc --version
Copied!
Note - if you are using OSX and you have Homebrew installed, you can issue the following equivalent command INSTEAD of the previous one:
1
brew install cmake pkg-config openssl git llvm
Copied!

​

Install & Configure Network Time Protocol (NTP) Client

​NTP is a networking protocol designed to synchronize the clocks of computers over a network. NTP allows you to synchronize the clocks of all the systems within the network. Currently it is required that validators' local clocks stay reasonably in sync, so you should be running NTP or a similar service. You can check whether you have the NTP client by running:
If you are using Ubuntu 18.04 / 20.04, NTP Client should be installed by default.
1
timedatectl
Copied!
If NTP is installed and running, you should see System clock synchronized: yes or a similar message. If you do not see it, you can install it by executing:
1
sudo apt-get install ntp
Copied!
ntpd will be started automatically after install. You can query ntpd for status information to verify that everything is working:
1
sudo ntpq -p
Copied!

βš™ Setup PhuQuoc Doge Validator Node

Currently, we only have PhuQuoc Doge Testnet(Quarks) and Phu Quoc Dog Mainnet(Bosons) launched. Phu Quoc Dog Testnet opens for validators to join. Phu Quoc Doge Mainnet operates in the NPOS mode and maintained by 6 nodes belongs to the Phu Quoc Dog Foundation.
Validator Configuration for Phu Quoc Dog Mainnet will be updated later once it's ready for staking and validators can join.
Build from source
To build the Phuquocdog binary from the Node repository on GitHub using the source code available in the 1.0.1 release.
1
git clone https://github.com/phuquocdog/node.git
2
cd node
Copied!
Build native code with the cargo release profile.
1
cargo build --release
Copied!
This step will take a while (generally 10 - 40 minutes, depending on your hardware).
Using a prebuilt
If you don't want to build the binary from the source and simply prefer to download it, use the following command. Then continue at Synchronize Chain Data
1
curl -O -L -o phuquocdog-node https://portal.phuquoc.dog/binary/phuquocdog-node
Copied!
If your server running on ARM you need to download the file below
1
curl -O -L -o phuquocdog-node https://portal.phuquoc.dog/binary/phuquocdog-node-arm
Copied!

Synchronize Chain Data

Download phuquocdog.json file for the Phuquocdog mainnet
1
cd $HOME
2
curl -O -L https://raw.githubusercontent.com/phuquocdog/node/master/node/res/phuquocdog.json
Copied!
You can begin syncing your node by running the following commands if you do not want to start in validator mode right away:
1
chmod +x $HOME/phuquocdog-node
2
$HOME/phuquocdog-node --chain $HOME/phuquocdog.json --validator --rpc-cors=all --name PQD-G01 --base-path $HOME/data
Copied!
Then the result should be like that
1
[email protected]:~$ $HOME/phuquocdog-node --chain $HOME/phuquocdog.json --validator --rpc-cors=all --bootnodes /ip4/34.209.135.220/tcp/30333/p2p/12D3KooWEc9LZpacBXG48bVVjZNUaXaQHR4qoW74Xf9tmNw1Sk4P --name PQD-G01 --base-path $HOME/data
2
2021-10-06 15:20:42 Phuquocdog Node
3
2021-10-06 15:20:42 ✌️ version 3.0.0-d7a4013-x86_64-linux-gnu
4
2021-10-06 15:20:42 ❀️ by Phu Quoc Dog <https://phuquoc.dog>, 2017-2021
5
2021-10-06 15:20:42 πŸ“‹ Chain specification: Phuquocdog Main Network
6
2021-10-06 15:20:42 🏷 Node name: PQD-G01
7
2021-10-06 15:20:42 πŸ‘€ Role: AUTHORITY
8
2021-10-06 15:20:42 πŸ’Ύ Database: RocksDb at /home/tranduythien/data/chains/phuquocdog_main_network/db/full
9
2021-10-06 15:20:42 β›“ Native runtime: node-270 (phuquocdog-official-0.tx2.au10)
10
2021-10-06 15:20:43 πŸ”¨ Initializing Genesis block/state (state: 0x4bba…5ae2, header-hash: 0xbbe6…1d84)
11
2021-10-06 15:20:43 πŸ‘΄ Loading GRANDPA authority set from genesis on what appears to be first startup.
12
2021-10-06 15:20:46 ⏱ Loaded block-time = 12s from block 0xbbe65b0d6c309386a01b852ce910965607a926ac8263c640559d783539851d84
13
2021-10-06 15:20:46 πŸ‘Ά Creating empty BABE epoch changes on what appears to be first startup.
14
2021-10-06 15:20:46 🏷 Local node identity is: 12D3KooWCjogLMicHPuFwK63Cs8RUsLGKF97HeiiVhPi6aGSeWnx
15
2021-10-06 15:20:46 πŸ“¦ Highest known block at #0
16
2021-10-06 15:20:46 〽️ Prometheus exporter started at 127.0.0.1:9615
17
2021-10-06 15:20:46 Listening for new connections on 127.0.0.1:9944.
18
2021-10-06 15:20:46 πŸ‘Ά Starting BABE Authorship worker
19
2021-10-06 15:20:47 πŸ” Discovered new external address for our node: /ip4/104.197.250.61/tcp/30333/p2p/12D3KooWCjogLMicHPuFwK63Cs8RUsLGKF97HeiiVhPi6aGSeWnx
20
2021-10-06 15:20:51 βš™οΈ Syncing, target=#5909 (2 peers), best: #2815 (0xdfda…31d9), finalized #2560 (0xc10e…8950), ⬇ 266.0kiB/s ⬆ 4.1kiB/s
21
2021-10-06 15:20:53 [#3967] πŸ—³ creating a snapshot with metadata SolutionOrSnapshotSize { voters: 5, targets: 4 }
22
2021-10-06 15:20:53 [#3967] πŸ—³ Starting signed phase round 1.
23
2021-10-06 15:20:54 [#4267] πŸ—³ Starting unsigned phase round 1 enabled true.
24
2021-10-06 15:20:54 [#4268] πŸ—³ queued unsigned solution with score [153846153846, 46461538461537, 1550343195266213964497041421]
25
2021-10-06 15:20:54 [4567] πŸ’Έ new validator set of size 3 has been processed for era 1
26
2021-10-06 15:20:56 πŸ’€ Idle (2 peers), best: #5731 (0xfb0c…e0b2), finalized #5632 (0x6685…972c), ⬇ 52.5kiB/s ⬆ 0.8kiB/s
27
2021-10-06 15:21:01 πŸ’€ Idle (2 peers), best: #5909 (0x4ea9…8ba3), finalized #5767 (0xc2c2…48b8), ⬇ 0.5kiB/s ⬆ 0.4kiB/s
28
2021-10-06 15:21:06 πŸ’€ Idle (2 peers), best: #5909 (0x4ea9…8ba3), finalized #5767 (0xc2c2…48b8), ⬇ 0.2kiB/s ⬆ 0.1kiB/s
29
2021-10-06 15:21:11 πŸ’€ Idle (2 peers), best: #5909 (0x4ea9…8ba3), finalized #5767 (0xc2c2…48b8), ⬇ 0 ⬆ 0
30
2021-10-06 15:21:16 πŸ’€ Idle (2 peers), best: #5909 (0x4ea9…8ba3), finalized #5767 (0xc2c2…48b8), ⬇ 0 ⬆ 0.2kiB/s
31
2021-10-06 15:21:21 πŸ’€ Idle (2 peers), best: #5909 (0x4ea9…8ba3), finalized #5767 (0xc2c2…48b8), ⬇ 0.6kiB/s ⬆ 0.1kiB/s
32
2021-10-06 15:21:26 πŸ’€ Idle (2 peers), best: #5909 (0x4ea9…8ba3), finalized #5767 (0xc2c2…48b8), ⬇ 0 ⬆ 0
Copied!

Running a validator as a service

Prepare a phuquocdog.service file
1
[Unit]
2
Description=Phuquocdog Mainnet Validator Service
3
After=network-online.target
4
Wants=network-online.target
5
​
6
[Service]
7
User=ubuntu
8
Group=ubuntu
9
ExecStart=/home/ubuntu/phuquocdog-node --chain /home/ubuntu/phuquocdog.json --validator --rpc-cors=all --bootnodes /ip4/34.209.135.220/tcp/30333/p2p/12D3KooWEc9LZpacBXG48bVVjZNUaXaQHR4qoW74Xf9tmNw1Sk4P --name PQD-G01 --base-path /home/ubuntu/data
10
Restart=on-failure
11
​
12
[Install]
13
WantedBy=multi-user.target
Copied!
Run a validator as a service
1
sudo systemctl daemon-reload
2
sudo systemctl start phuquocdog
3
sudo systemctl status phuquocdog
4
​
Copied!

πŸ’Ή Bond PQD

Checkout Polkadot Bond documentation.

πŸ— Set the session keys

Checkout Polkadot Session Keys documentation.
If you are on a remote server, it is easier to run this command on the same machine (while the node is running with the default HTTP RPC port configured):
1
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys", "params":[]}' http://localhost:9933
Copied!
The output will have a hex-encoded "result" field. The result is the concatenation of the four public keys. Save this result for a later step.
1
// Some code
2
[email protected]:~$ curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys", "params":[]}' http://localhost:9934
3
{"jsonrpc":"2.0","result":"0x061f966857e02a4c6e3604b833ae98f7e8e39bd734579780a56220dd0bf3a73fb003b16fbf420636ec3624f6068d26b9b7eadf16eba366ef183929adbb51b65c9e7e338ff4a848a24e80d4e4eed0a45834befec2819e6ad3523f96937ff3332a00bb8a7bba6c0b72b2d382375732b4967a48df0992a28a0261c58dc170d16177","id":1}
Copied!
You can restart your node at this point.

Submitting the setKeys Transaction

You need to tell the chain your Session keys by signing and submitting an extrinsic. This is what associates your validator with your Controller account.
Go to Staking > Account Actions > Validator, and click "Set Session Key" on the bonding account you generated earlier. Enter the output from author_rotateKeys in the field and click "Set Session Key".
​
​

🌠 Validate

Checkout Polkadot Validate documentation.

πŸ”± Links