Skip to content

How to Become a Candidate

far-far-away edited this page Mar 13, 2019 · 10 revisions

Pchain is a blockchain system based on the PDBFT consensus mechanism, which requires regular replacement of Validators to ensure system security.

EPOCH is the update cycle of the Validator, which is about 30 days on mainnet, 48 hours on testnet.

You can apply to become a Pchain's Candidate.

EPOCH Phase Operation
0%~75% applyCandidate, cancelCandidate
75%~100% Prohibit Operation

Choose A Way to Interact With Pchain(RPC Or IPC)

you can read How To Interact With Pchain

Recommend To Use IPC

$pchain attach <datadir>/pchain.ipc

Welcome to the Pchain JavaScript console!

instance: pchain/darwin-amd64/go1.11.4
coinbase: 0x06cd108ab24d663e465089846cdc9c587960cfb6
at block: 0 (Thu, 01 Jan 1970 08:00:00 CST)
datadir: /Users/skykingit/Library/Pchain
modules: admin:1.0 chain:1.0 debug:1.0 del:1.0 eth:1.0 miner:1.0 personal:1.0 rpc:1.0 tdm:1.0 txpool:1.0 web3:1.0
>   //use pweb3 Javascript API

pweb3 Javascript API

Get Current Epoch Details

Get the Epoch Details By RPC tdm_getEpoch(currentEpochNumber)

Get the Epoch Details By IPC tdm.getEpoch(currentEpochNumber)

you can get the Epoch Details

IPC Console
>var currentRpochNumber = tdm.getCurrentEpochNumber();
>tdm.getEpoch(currentRpochNumber);
{
  end_block: 328584,
  end_time: "0001-01-01T00:00:00Z",
  number: 1,
  reveal_end_block: 320794,
  reveal_start_block: 305217,
  reward_per_block: 1330744769484664000,
  start_block: 172801,
  start_time: "2019-01-24T08:08:20.97Z",
  status: 3,
  validators: [{
      address: "0x8f014d412022c8b7558adce1932bf02aa33f0183",
      public_key: "53E8D63D3904F32EED8D6FE9CCDF4601E7223200334301BAD321139EB2EE13B313B3E4A126844A6C917FA6207D16CC2F049B6C0E163C6685F8AF758D5DDF39706F837CE1E93FDFF65DF6B4225F76CE196499D659333C0D28357CE7327EA7CFDE8D3EED91CCDDC77C1EFAAC9E59BD85B46DA1F8A0803019934D359FEC0E5FEB29",
      voting_power: 2.6912897304777747e+23
  }],
  vote_end_block: 305216,
  vote_start_block: 289639
}

Apply To Become A Candidate For Next Epoch(start_block <= currentBlockNumber <= vote_start_block)

applyCandidate By RPC del_applyCandidate

applyCandidate By IPC del.applyCandidate

Tips:If your accounts are locked,you need to Unlock Your Account

IPC Console
>var from = "0xB3544059698177F14968D29A25AFD0D6D65F4534";
>var securityDeposit = "0x152D02C7E14AF6800000";
>var commission = 10;
>var gasPrice = null:
>web3.del.applyCandidate(from,securityDeposit,commission,gasPrice);
>0xab258f6c0d3cbcf1e8b2735033045147e23db1577917cc6f0c95ee9747aaffcf

You can check transaction status By getTransactionReceipt

Importantly Noticed: Please go to Join Candidate List to submit your introduction. Once your submission has been validated, you will be publicly listed on Recommended Candidates on PWALLET. Detailed information increases your chances of convincing Delegators to support your candidacy.

Cancel A Candidate For Next Epoch(start_block <= currentBlockNumber <= vote_start_block)

cancelCandidate By RPC del_cancelCandidate

cancelCandidate By IPC del.cancelCandidate

Tips:If your accounts are locked, you need to Unlock Your Account

IPC Console
>var from = "0xB3544059698177F14968D29A25AFD0D6D65F4534";
>var gasPrice = null:
>web3.del.cancelCandidate(from,gasPrice);
>0xab258f6c0d3cbcf1e8b2735033045147e23db1577917cc6f0c95ee9747aaffcf

You can check transaction status By getTransactionReceipt

If you want to delegate your balance to a candidate ,read How To Delegate

You can’t perform that action at this time.