FAQ for PCHAIN Public Test

Plian
5 min readDec 29, 2018

Guidance Questions

Q1: How to get free tPAI to test on PCHAIN Testnet?

A1: You can get 100K free tPAI once a day via https://testnet.pchain.org/vfaucet.html.

Q2: What’s the address that is required to get tPAI?

A2: Recommend to fill you genesis address which is generated by initialization.

But if you fill the address which is generated by PCHAIN Testnet wallet ( https://testnet.pchain.org/wallet.html ), you can send a transaction to the genesis address.

Q3: Which address should I use to vote for Validator?

A3: The genesis address please. Make sure there are at least 100K tPAI in it and get the hash and public key ready before voting.

Q4: Do you plan a reward for Validator testing on PCHAIN Testnet?

A4: Currently we hope more test Validator to work with us and get familiar with PCHAIN which will improve the stability of PCHAIN mainnet greatly. If everything goes well, we will balance the cost and there will be some reward.

For now, If you join our Public Test and run a node, you will be distributed with another 1% annual divided with all of your PAI locked in PANDA Plan & PANDA-X Plan after you become Validator on PCHAIN mainnet.

Q5: Where to find the guidance document to test as Validator ?

A5: Please follow README on Github https://github.com/pchain-org/pchain/ which is the latest guidance version to test as validator.

Q6: Where to find the system requirements for testnet Validator ?

A6: Please go to https://www.reddit.com/r/Pchain_Org_Official/comments/a79ofk/validator_invitation_for_public_test_on_pchain/

Q7: How to use the javascript console?

A7:Please go to https://github.com/pchain-org/pchain/wiki/Command-Line-Options and you will get more console info.

Q8: Is Metamask compatible with PCHAIN multichain architecture?

A8: No. Metamask is a Google browser plug-in of Ethereum. It is not compatible with PCHAIN.

Q9: It seems the files are in Windows endline format which is not understood by Linux. Does it mean PCAHIN only been tested on Windows ?

A9: No. Our testnet is running on Ubuntu 16.04, but we are mainly developing on Windows. Those files with CR/LF endline are there for historical reason, all the newly commit are format as LF endline by gofmt, we will plan to convert all the incorrect endline before the mainnet launch.

Operation Questions

Q1: What does this error “chain reorged during section processing ” mean?

A1: It’s the synchronization issue, but no influence on executing.

Q2: When it starts connecting to 34.221.29.3:30201 node now, but it says that “Genesis block mismatch — 7f721fab51e02481 (!= 15cd944f35cbbaa9)”.

A2: After replacing files, please run this file : run_pchain.sh

Q3: How to check if validator is working well?

A3: Use RPC tdm_getCurrentEpochNumber, tdm_getEpoch to get current validator list and compare local default account to it. If it is in the list, the validator is working well.

RPC documents link: https://github.com/pchain-org/pchain/wiki/JSON-RPC

Q4: Is it ok default account undefined?

A4: It’s ok. If there are accounts when pchain is running, pchain will use accounts[0] as the default account.

Q5: When I do:

curl -X POST — data ‘{“jsonrpc”:”2.0",”method”:”tdm_getEpoch”,”params”:[1],”id”:1}’ http://localhost:6969

it answers:404 page not found

A5: Please comfirm which chain you are operating on, and then revise http://localhost:6969 to http://localhost:6969/chainname. For example, http://localhost:6969/child_0.

Q6: I could not find any info about which chain I’m on?

$ curl -X POST -H “Content-Type:application/json” — data ‘{“jsonrpc”:”2.0",”method”:”tdm_getEpoch”,”params”:[1],”id”:1}’ http://localhost:6969/pchain

{“jsonrpc”:”2.0",”id”:1,”result”:{“number”:1,”reward_per_block”:1253114826441738542,”start_block”:601,”end_block”:1176,”start_time”:”2018–12–20T19:12:16.891+01:00",”end_time”:”2018–12–20T19:22:15.772+01:00",”vote_start_block”:946,”vote_end_block”:1003,”reveal_start_block”:1004,”reveal_end_block”:1147,”status”:3,”validators”:[{“eth_account”:”0x682f57c0737425139d33f0670ab243e6b8ab2e50",”pub_key”:”86E72D5840FCD1797A92CFB285F3A07322843D2626F466A31C37C562F51E68325B3978CDCBD536A544F41FB429E44BE00B4EB02739903E67220E1F2FC8459B215D4E6A1BD50FAD81873AEEB1120B5742021A18BD1F37BD6BC90D156A1E5FB32A26BCEEF878C0827F4BC86A31BDD8EC2DF788751D05104028DE4BA6BA16D5023D”,”amount”:100,”name”:””}]}}

A6: It seems that you have not join PCHAIN Testnet yet. If you join successfully, there will be more than 4 eth accounts. Please try again.

Q7: Some problems to join PCHAIN net.

A7: Please follow 2 steps here and try again.

Step1:

Download Script Files Path: pchain_init_dirs

Use the files in zip to replace 3 files as below in the local folder named pchain

1).pchain/static-nodes.json

2).pchain/pchain/genesis.json

3).pchain/pchain/eth_genesis.json

Step 2:

init pchain with eth_genesis.json:

./bin/pchain -datadir .pchain init .pchain/pchain/eth_genesis.json

Q8: How to generate a genesis address?

A8: Please follow steps as below:

./pchain — datadir .pchain init_eth_genesis “{100000000000000000000,100}”

./pchain — datadir .pchain init .pchain/pchain/eth_genesis.json

Q9: How to do if I want to use the wallet generated on PCHAIN testnet wallet ( https://testnet.pchain.org/wallet.html) with tPAI for voting?

A9: Open the priv_validator.json file under .pchain/pchain, replace your testnet wallet address to the “address”, and then write your private key into a file and run command “./bin/pchain — datadir=yourDataDirectory account import yourPrivateFile”.

Q10: After creating an account

bin / pchain — datadir “/home/ubuntu/pchain/.pchain” init_eth_genesis “{1000000000000000000000000000000, 100}”

100,000 tPAI will I enroll automatically? Or do I need to transfer to this address 100 000 tPAI ??

A10: You need to transfer 100K tPAI to this address or get 100K tPAI via https://testnet.pchain.org/vfaucet.html.

Q11: How to know when to vote for next Epoch?

Q11:Check the current Epoch number with RPC : tdm_getCurrentEpochNumber

Then Check the Epoch details with RPC: tdm_getEpoch, which enables you to know when to vote and reveal vote for next Epoch Validator.

“vote_start_block”:550402,”vote_end_block”:558469,”reveal_start_block”:558470,”reveal_end_block”:566537,

Q12: How long each Epoch lasted?

A12: Each Epoch is about 24 hours now on Testnet. You need to wait till to the vote_start_block.

Q13: How to get the voteHash parameter? How to make votehash?

A13: Salt can be any string. You can use the web3 API to make votehash with https://github.com/pchain-org/pweb3/wiki/JavaScript-API#web3getVoteHash

Q14: The format of the hash

Q14: <addressKeyAmountSalt>

Q15: How I can sign with a private key if I do not have it from the address generate from genesiss? I am able to unlock, but I do not understand where to find:

“hain_signAddress

Sign the Address with BLS Private Key, return the BLS Signature to proof you are the owner of the BLS Public Key

Parameters

from: address, 20 Bytes — Address which will be signed “

A15: The private key in priv_validator.json is consensus private key to use, not address private key. Your address private key is located at keystore folder.

Q16: Why all this null?

This is a result after reveal:

curl -X POST -H “Content-Type:application/json” — data ‘{“jsonrpc”:”2.0",”method”:”tdm_getNextEpochVote”,”params”:[],”id”:1}’ http://localhost:6969/pchain

{“jsonrpc”:”2.0",”id”:1,”result”:{“vote_for_epoch”:8,”start_block”:651312,”end_block”:732051,”votes”:[{“address”:”0xdf671d03cc038e2bc11e688e7cba8e42b3cd462a”,”public_key”:null,”voting_power”:null,”salt”:””,”vote_hash”:”0x2d4b5eb73e7442d59b424dfbeceb957478e75b1bd970f01f9372b3b3a48e793e”,”tx_hash”:”0x7b6ccb6e378f8a619639eb0fb5c629cef4668ff778cc0764feef8e3129d49e51"}]}}

This is the reveal:

curl -X POST -H “Content-Type:application/json” — data ‘{“jsonrpc”:”2.0",”method”:”tdm_revealVote”,”params”:[“0xDF671D03CC038E2BC11E688E7CBA8E42B3CD462A”, “154723DEF2A64E0A9E671EA2F96496CA1C2F84154C4D786E0D8085AD1D1C8DDF864925662965E3A5510C18098711943ED84210277A25898A8C68BDFF25998CFB67D5D2E2F49298C4B00945E075BFF6450C0C2C88EB75”, “0x186a0”, “MARmar”, “0x83759b6642ba64d76a210bf9bacd5b0211f4987ee3680d6e12b6ab08bc607c476122a458df01b3615b52825f3214430b851048b4e67aeacadeeda9a1517b7eed”],”id”:1}’ http://localhost:6969/pchain

A16: You put 0x186a0 in it. So the amount of tPAI that you voted is less than 100K tPAI. You should vote more than 152d02c7e14af6000000.

Q17: Are there only 4 validators for each epoch ?

A17: No. Total number of validator in new Epoch = the number of current validator + 1/2 * number of new candidates who participated in revealing vote successfully. If there is only one candidate participated in, then we will keep the same number of validator as current.

Thank you for reading!

Welcome to join PCHAIN Public Test Telegram and have further discussion.

You can follow PCHAIN below

Telegram 1, Telegram 2, Telegram(Chinese Community)
Telegram(Russian Community), Telegram(Spanish Community)
Telegram(Germany Community), Telegram (French Community)
Telegram Announcement Channel
Twitter, Steemit, Reddit Founder/CEO’s Twitter

--

--

Plian

Plian positions itself to bring near-instant blockchain transactions without sacrificing decentralisation or security to public and enterprise DeFi.