Plian
Search…
Node Status

How to check if your node is still running?

Attach to your server, and run the command
1
ps ax|grep pchain
Copied!
if it returns a string such as
1
6931 pts/0 Rl 0:01 /home/ubuntu/pchain/bin/pchain --datadir=~/pchain/.pchain --rpc --rpcapi=eth,web3,admin,tdm,miner,personal,chain,txpool,del --gcmode=archive --verbosity=0 --prune
Copied!
your pchain is still running. If not, please run
1
sudo ./pchain/run.sh
Copied!

How to check if your node is caught up to the latest block?

if you want to check the main chain:
1
cd ~/pchain
2
sudo ./bin/pchain attach .pchain/pchain/pchain.ipc
3
pi.blockNumber
Copied!
if you want to check the subchain:
1
cd ~/pchain
2
sudo ./bin/pchain attach .pchain/child_0/pchain.ipc
3
pi.blockNumber
Copied!
it will return the latest block on your node, and then check if the height is the same as our Monitor.

How to check pchain’s version?

1
cd ~/pchain ./bin/pchain version
Copied!
it will return the version of pchain, you can check the latest version on our github.
Note: if the version of pchain is different from the version in file “~/pchain/version”, plz delete the file, the auto-update script will update pchain 10 mins later.

How to check if your node is syncing?

if you want to check the main chain:
1
cd ~/pchain
2
sudo ./bin/pchain attach .pchain/pchain/pchain.ipc
3
pi.syncing
Copied!
if you want to check the subchain:
1
cd ~/pchain
2
sudo ./bin/pchain attach .pchain/child_0/pchain.ipc
3
pi.syncing
Copied!
if it returns true, your node is syncing now. Also, you can type pi.blockNumber every min to check if the height is growing continuously. If so, your node is syncing.
If your node has not synchronized block until 10 minutes, please have a try:
1
admin.addPeer("b421876668c8c950697561408d6d2527460c4aa3c0798cee6f1b6a8a41244a914[email protected]35.165.181.32:30308")
2
admin.addPeer("6df9c925e216eac54b7d23f107f6c333ab60a7f57034886ddf118437bdd7bf155[email protected]13.49.131.60:30308")
3
admin.addPeer("e691768b7f6628df079265b947f7f5c5ff633465a53caa11d338955bd7759a62a[email protected]34.215.192.255:30308")
4
admin.addPeer("568981e222c25bfa7813c333c88253f27d65122090e43c22bea0b2d137534d072[email protected]15.207.188.58:30308")
Copied!

How to check if my node is validating blocks?

Go to piscan, enter your address and search, you can check the last block you validated. Usually, the last block you validate should be mined several mins ago.

How to collect logs?

Set verbosity=3 in file “run.sh” and restart pchain, there will be a “log” folder under the same directory you run the “run.sh”.

What are the hardware requirements to run a node on Pchain?

Can I run the main chain and subchain on one machine?

Yes, currently Pchain’s mainnet has one main chain and one subchain, you can run and mine both chains on one machine.

How to migrate my Pchain to another computer?

If you want to migrate your pchain to another computer, just install pchain on your new computer, and copy priv_validator.json and the nodekey to your new computer.

How to check if my node is running correctly after setting up the node?

First, check if you are running the latest version, you can find the latest verison from our github. Then make sure the peers connected to your node is more than 2/3 validator number by RPC. And also check if you are syncing to the latest height, you can check the latest height on our Monitor.

How to check your node status when running on Pchain?

How many tokens do I need to run a node on Pchain?

You need to stake at least 100K PI to run alone on Pchain. If you want to run a node with others’ delegation, then you need 10K PI to apply for the Candidate node first.

How to resync pchain from block 0?

If you run into bad block issue then you should re-sync pchain from block 0.
First, stop crontab and stop pchain as explained in steps 1 and 3 of question below, then delete the data except your priv_validator.json and nodekey, after delete, your datadir should look like this:
1
datadir/
2
-nodekey
3
-pchain/
4
-priv_validator.json
5
-keystore/
Copied!
If you are running subchain, your datadir should look like this:
1
datadir/
2
-nodekey
3
-pchain/
4
-priv_validator.json
5
-keystore/
6
-child_0/
7
-priv_validator.json
8
-genesis.json
9
-eth_genesis.json
10
-keystore/
Copied!
Make sure your datadir is excactly like above. Now you can re-sync blocks, if you are running child_0, remember initialize subchain first:
1
cd ~/pchain
2
./bin/pchain --datadir=~/pchain/.pchain init ~/pchain/.pchain/child_0/eth_genesis.json child_0
3
./run.sh
Copied!
If you run main chain only, just run
1
cd ~/pchain
2
./run.sh
Copied!

What should I do if I got bad blocks often?

pchain supplies an official data package. Please back up your priv_validator.json and keystore file first, and follow the steps below:
1.stop crontab
1
crontab -e
Copied!
Open it with your familiar editor, you will see something like this:
1
*/10 * * * * ~/pchain/scripts/updatefile.sh > ~/pchain/scripts/update.log
2
*/2 * * * * ~/pchain/scripts/monitor.sh > ~/pchain/scripts/monitor.log
Copied!
Comment out this two line with symbol #, and save file.
2.download the package
If you are running mainchain only please run:
1
cd ~/pchain
2
wget https://pchainblockdata.s3-us-west-2.amazonaws.com/blockData.tar.gz
Copied!
If you are running main chain and subchain please run:
1
cd ~/pchain
2
wget https://pchainblockdata.s3-us-west-2.amazonaws.com/blockDataWithChild.tar.gz
Copied!
3.stop pchain
1
killall pchain
Copied!
4.delete your datadir and monitoring files(please make sure you already backed up your priv_validator.json and keystore file)
1
rm -r .pchain stuck_times epoch
Copied!
5.replace datadir
If you are running mainchain only please run:
1
cd ~/pchain
2
tar -xzf blockData.tar.gz
Copied!
If you are running main chain and subchain please run:
1
cd ~/pchain
2
tar -xzf blockDataWithChild.tar.gz
Copied!
6.copy your priv_validator.json
If you are running mainchain only please run:
1
cp youpathway/priv_validator.json ~/pchain/.pchain/pchain/
Copied!
If you are running main chain and subchain please run:
1
cp youpathway/priv_validator.json ~/pchain/.pchain/pchain/
2
cp youpathway/priv_validator.json ~/pchain/.pchain/child_0/
Copied!
7.start pchain
1
./run.sh
Copied!
8.check
1
./bin/pchain attach .pchain/pchain/pchain.ipc
2
>pi.blockNumber
Copied!
9.set crontab
1
crontab -u yourusername ~/pchain/scripts/pchain.cron
Copied!

How to resolve handle crash on subchain?

If you got the error on the subchain like the following two screens, it means the handle crashed due to the number of handles increased. Please follow the steps below to recover it.
Run
1
cat /proc/sys/fs/file-max
Copied!
to check the maximum number of files.
Run
1
sudo vi /etc/security/limits.conf
Copied!
to set file number (should be less than or equal to the max number of files above).
  • soft nofile 512000
  • hard nofile 512000
Run
1
sudo vi /etc/pam.d/common-session
Copied!
and enter session required pam_limits.so
Run
1
sudo vi /etc/profile
Copied!
and enter ulimit -SHn 512000 ulimit -v unlimited
Click this link for Reference for Ubuntu system on setting the number of files to recover the handle crash.
Last modified 2mo ago