Skip to main content

System contract api

PlatON System Contract Api#

json-RPC#

For system contract interfaces involving data modifications, use the way to create a transaction on the chain (Platon_SendTransaction), the call parameters are as follows:

Field namelengthdescribe
from20bytesSend a transaction account
nonce8bytesThe first few transactions sent by the current account
gasPrice32bytesCurrent transaction GAS price
gas8bytesThe largest GAS that currently transaction allows consumption
to20bytesSystem contract address
databytesThe command code and parameters of the contract interface, the coding rules are seen

We extend the DATA field, and the contract interface needs to be called and the parameter encoding is filled out here. Coding rules, after encoding the command code of the interface, order, order in the array, and then perform RLP encoding for arrays.

 Such as enhanced quality  rlp([rlp(1002), rlp('')....])

Complete example:

// Requestcurl -X POST --data '{"jsonrpc":"2.0","method":"platon_sendTransaction","params":[  {  "from": "lat1nwc2am8ple8rpuqx3rsv6txljkuetsm6890u6d",  "to": "lat1zqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzlh5ge3",  "gas": "0x76c0", // 30400  "gasPrice": "0x9184e72a000", // 10000000000000  "value": "0x9184e72a", // 2441406250  "data": "0xf856838203eab842b840acae6c5bd52f6807d67da902164c6d6e3e9b8f84a06b04500961d211d3793cabbf54b25a652463967fcccde1b615680edd21321736df34b29000a39f44f78b3081808b8a01e7e4171bf4d3a00000"}],"id":1}'
// Result{  "id":1,  "jsonrpc": "2.0",  "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"}

Conversely, use the Platon_Call mode to call, the call parameters are as follows:

Field namelengthdescribe
from20bytesSend a transaction account
to20bytesSystem contract address
databytesThe command code and parameters of the contract interface, the coding rules are seen

We extend the DATA field, and the contract interface needs to be called and the parameter encoding is filled out here. Coding rules, after encoding the command code of the interface, order, order in the array, and then perform RLP encoding for arrays.

  Such as query pledge operation   rlp([rlp(1105), rlp('')....])

The return value is as follows:

nametypedescribe
Codeuint32Indicates the error code returned by the PPOS built-in contract
Retinterface{}(Universal Type) When the code is: 0, return JSON's query result (list or individual object), see the following query related interface return value; when the code is non-0, return error prompt information string
// Requestcurl -X POST --data '{"jsonrpc":"2.0","method":"platon_call","params":[{  "from": "lat1nwc2am8ple8rpuqx3rsv6txljkuetsm6890u6d",  "to": "lat1zqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzlh5ge3",  "data": "0xf856838203eab842b840acae6c5bd52f6807d67da902164c6d6e3e9b8f84a06b04500961d211d3793cabbf54b25a652463967fcccde1b615680edd21321736df34b29000a39f44f78b3081808b8a01e7e4171bf4d3a00000"}],"id":1}'
// Result{  "id":1,  "jsonrpc": "2.0",  "result": {      "Code":0,      "Ret":{}  }}

SOLIDITY contract call#

staking Contract interface parameter description#

The contract address of the following stakeing related interface is:
Main network:lat1zqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzsjx8h7
EIP55 address:0x1000000000000000000000000000000000000002

  1. createStaking: Pledge
parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(1000)Y
typuint16(2bytes)Indicates the use of the free amount of the account or the list of locks, 0: Free amount; 1: Locking amount; 2: Priority to use the latch balance, the latch balance is insufficient, the remaining part is used for free amountY
benefitAddress20bytesRevenue account for accepting block rewards and pledge rewardsY, client can transmit: '0x00000 ... 000' (zero account address, zero address representative is considered to lose the benefit von)
nodeId64bytesThe pledged node ID (also called the node ID of the candidate)Y
externalIdstringExternal ID (have longitudinally limited, ID)Y, client can be default: '' (empty string)
nodeNamestringThe name of the pledge node (with long limit, indicating the name of the node)Y, the client can default: '' (empty string)
websitestringA third-party home page (long limit, indicating the home page of the node)Y, the client can default: '' (empty string)
detailsstringThe description of the node (has a length limit, indicating the description of the node)Y, the client can default: '' (empty string)
amount*big.Int(bytes)Pledgeful VonY
rewardPeruint16(2bytes)The proportion of rewards obtained, BasePoint 1BP = 0.01%Y
programVersionuint32Program real version, governance RPCY
programVersionSign65bytesProgram real version signature, governance RPC getY
blsPubKey96bytesBLS public keyY
blsProof64bytesProof of BLS, acquired by pulling a certificate interfaceY
  1. editCandidate: Modify the pledge information
parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(1001)Y
benefitAddress20bytesRevenue account for accepting block rewards and pledge rewardsN, Default: NIL (0x00 ... zero account address, zero address representative is considered to drop the benefits von)
nodeId64bytesThe pledged node ID (also called the node ID of the candidate)Y
rewardPeruint16(2bytes)The proportion of the rewards obtained, using BasePoint 1BP = 0.01%, Example: Biography 500 is 5% of the rewards as a delegate rewardN, default: nil (empty Byte)
externalIdstringExternal ID (have a length limit, giving the third party pull the ID)N, the default value: nil (empty Byte)
nodeNamestringThe name of the decociated node (has a length limit, indicating the name of the node)n, default: nil (empty Byte)
websitestringA third-party home page of the node (length limit, indicating the home page of the node)n, default: nil (empty Byte)
detailsstringDescription of the node (have a length limit, indicating the description of the node)N, the default value: nil (empty Byte)
  1. increaseStaking: Increasing pledge
parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(1002)Y
nodeId64bytesThe pledged node ID (also called the node ID of the candidate)Y
typuint16(2bytes)Indicates the use of account free amount or the latch amount of the account, 0: Free amount; 1: Locking amountY
amount*big.Int(bytes)Increasing VonY
  1. withdrewStaking: Undo pledge (all revocation, multiple arrivals)
parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(1003)Y
nodeId64bytesNodeID of the pledged nodeY
  1. delegate: Initiate
parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(1004)Y
typuint16(2bytes)Indicates the latch amount of the account free amount or the account of the account, 0: Free amount; 1: Locking amountY
nodeId64bytesNodeID of the pledged nodeY
amount*big.Int(bytes)The amount delegated (calculated according to the minimum unit, 1 lat = 10 ** 18 von)Y
  1. withdrewDelegation: Reduce / revocation (all reduction is revoked)
parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(1005)Y
stakingBlockNumuint64(8bytes)A unique identity representing a certain pledge of a nodeY
nodeId64bytesNodeID of the pledged nodeY
amount*big.Int(bytes)The amount of entrusted entrusted (according to the minimum unit, 1 lat = 10 ** 18 von)Y

return value:

Note: The trading result is stored in the log.Data of the transaction receipt, if it is redeemed all delegate, store rlp.encode ([][] byte {[] byte (status 0), RLP.Encode (entrusted)} ), Otherwise the same as before

parametertypedescribemust
delegateIncome*big.intEntrusted incomeN
  1. getVerifierList: Query the verification person queue of the current settlement cycle

parameter:

parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(1100)Y

return value: array

nametypedescribeIs it empty (zero)
NodeId64bytesThe pledged node ID (also called the node ID of the candidate)N
StakingAddress20bytesThe account used when launching pledge (subsequent operation pledge information can only use this account, withdraw the pledge, VON will be returned to the account or the lock information of the account)N
BenefitAddress20bytesRevenue account for accepting block rewards and pledge rewardsY, Zero account address
RewardPeruint16(2bytes)The current settlement cycle reward is divided into proportion, using BasePoint 1BP = 0.01%Y
NextRewardPeruint16(2bytes)The next settlement cycle reward is divided into proportion, using BasePoint 1BP = 0.01%Y
StakingTxIndexuint32(4bytes)Transaction index when launching pledgeN
ProgramVersionuint32The real version number of the PLATON process of the pledge node (get the version number of the interface is provided by governance)N
StakingBlockNumuint64(8bytes)Block height when launching pledgeN
Shares*big.Int(bytes)Current candidate's total pledge plus VON numberN
ExternalIdstringExternal ID (have long limit, give the third party pull the ID)Y, default is empty string
NodeNamestringThe name of the pledge node (with long limit, indicating the name of the node)Y, default is empty string
WebsitestringA third-party home page (long limit, indicating the home page of the node)Y, default is empty string
DetailsstringDescription of the node (have a length limit, indicating the description of the node)Y, default is empty string
ValidatorTermuint32(4bytes)The verification person's term (101 verifier snapshots in the settlement cycle is always 0, only if the verification person of the consensus wheel will be worthless, it is also 0, it is also 0, continue to stay, +1)Y, default is 0
DelegateTotal*big.Int(bytes)The total commission of the current candidate takes effectY
DelegateRewardTotal*big.Int(bytes)Total entrustment reward for candidatesY
  1. getValidatorList: Query the list of verifiers for the current consensus cycle

parameter:

parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(1101)Y

return value: array

nametypedescribeIs it empty (zero)
NodeId64bytesThe pledged node ID (also called the node ID of the candidate)N
StakingAddress20bytesThe account used when launching pledge (subsequent operation pledge information can only use this account, withdraw the pledge, VON will be returned to the account or the lock information of the account)N
BenefitAddress20bytesRevenue account for accepting block rewards and pledge rewardsY, the default is the zero account address
RewardPeruint16(2bytes)The current settlement cycle reward is divided into proportion, using BasePoint 1BP = 0.01%Y
NextRewardPeruint16(2bytes)The next settlement cycle reward is divided into proportion, using BasePoint 1BP = 0.01%Y
StakingTxIndexuint32(4bytes)Transaction index when launching pledgeN
ProgramVersionuint32(4bytes)The real version number of the PLATON process of the pledge node (get the version number of the interface is provided by governance)N
StakingBlockNumuint64(8bytes)Block height when launching pledgeN
Shares*big.Int(bytes)Current candidate's total pledge plus VON numberN
ExternalIdstringExternal ID (have long limit, give the third party pull the ID)Y, Default is empty string
NodeNamestringThe name of the pledge node (with long limit, indicating the name of the node)Y, default is empty string
WebsitestringA third-party home page (long limit, indicating the home page of the node)Y, default is empty string
DetailsstringDescription of the node (have a length limit, indicating the description of the node)Y, default is empty string
ValidatorTermuint32(4bytes)The verification person's term (101 verifier snapshots in the settlement cycle is always 0, only if the verification person of the consensus wheel will be worthless, it is also 0, it is also 0, continue to stay, +1)N
DelegateTotal*big.Int(bytes)The total commission of the current candidate takes effectY
DelegateRewardTotal*big.Int(bytes)Total entrustment reward for candidatesY
  1. getCandidateList: Query all real-time candidates list

parameter:

parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(1102)Y

return value: array

nametypedescribeis nil
NodeId64bytesThe pledged node ID (also called the node ID of the candidate)N
StakingAddress20bytesThe account used when launching pledge (subsequent operation pledge information can only use this account, withdraw the pledge, VON will be returned to the account or the lock information of the account)N
BenefitAddress20bytesRevenue account for accepting block rewards and pledge rewardsY, the default is the zero account address
RewardPeruint16(2bytes)The current settlement cycle reward is divided into proportion, using BasePoint 1BP = 0.01%Y
NextRewardPeruint16(2bytes)The next settlement cycle reward is divided into proportion, using BasePoint 1BP = 0.01%Y
StakingTxIndexuint32(4bytes)Transaction index when launching pledgeN
ProgramVersionuint32(4bytes)The real version number of the PLATON process of the pledge node (get the version number of the interface is provided by governance)N
Statusuint32(4bytes)The status of the candidate (status is placed according to the 32bit of UINT 32, can be present at the same time, the value is a plurality of simultaneous state values plus [0: node available (32 Bit all 0); 1: Node Not available (only the last bit is 1); 2: Node zero blocks need to be locked but do not need to be released (only the second bit of 1); 4: Node's VON is less than the lowest quality (only the number of countdown, third bit is 1 ); 8: Node is reported to be double-signed (only the countdown fourth bit is 1)); 16: Node zero block requires locking and unlocking the pledge (the fifth bit of the countdown is 1); 32: Node initiative to revoke (only countdown The sixth bit bit is 1)]N
StakingEpochuint32(4bytes)Current change cycle when the pledge amount is changedN
StakingBlockNumuint64(8bytes)Block height when launching pledgeN
Sharesstring(0x hexadecimal string)Current candidate's total pledge plus VON numberN
Releasedstring(0x hexadecimal string)Local pledge of the free amount of the pledged accountY,Default is 0
ReleasedHesstring(0x hexadecimal string)The free amount of the percentage of the pledged accountY,Default is 0
RestrictingPlanstring(0x hexadecimal string)Locking amount of latch lottery launches pledgeY,Default is 0
RestrictingPlanHesstring(0x hexadecimal string)Locking amount launched a pledge account,Herdity pledged VonY,Default is 0
ExternalIdstringExternal ID (have long limit, give the third party pull the ID)Y, Default is empty string
NodeNamestringThe name of the pledge node (with long limit, indicating the name of the node)Y, Default is empty string
WebsitestringA third-party home page (long limit, indicating the home page of the node)Y, Default is empty string
DetailsstringDescription of the node (have a length limit, indicating the description of the node)Y, Default is empty string
DelegateEpochuint32(4bytes)Number of settlement cycles for the last entrustedY
DelegateTotalstring(0x hexadecimal string)Number of nodes is entrustedY
DelegateTotalHesstring(0x hexadecimal string)The total quantity of the node is entrustedY
DelegateRewardTotal*big.Int(bytes)Total entrustment reward for candidatesY
  1. getRelatedListByDelAddr: Query the NodeID and Pledge ID of the node delegated by the current account address

parameter:

parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(1103)Y
addrcommon.address(20bytes)Principal account addressY

return value: array

nametypedescribeIs it empty (zero)
Addr20bytesPrincipal account addressN
NodeId64bytesVerifiable person's node IDN
StakingBlockNumuint64(8bytes)Block height when launching pledgeN
  1. getDelegateInfo: Query the principal information of the current single node

parameter:

parametertypedescribemust
funcTypeuint16Representing method type code(1104)Y
stakingBlockNumuint64(8bytes)Block height when launching pledgeY
delAddr20bytesPrincipal account addressY
nodeId64bytesVerifiable person's node IDY

return value:

nametypedescribeis nil
Addr20bytesPrincipal account addressN
NodeId64bytesVerifiable person's node IDN
StakingBlockNumuint64(8bytes)Block height when launching pledgeN
DelegateEpochuint32(4bytes)The last time the settlement cycle of the candidate initiatedN
Releasedstring(0x hexadecimal string)Locked the latch of the secreted amount of the confusedY,Default is 0
ReleasedHesstring(0x hexadecimal string)Voncounted Von, a free amount that launches a delegate accountY,Default is 0
RestrictingPlanstring(0x hexadecimal string)Locking amount of lock bin in the entrustment accountY,Default is 0
RestrictingPlanHesstring(0x hexadecimal string)Temperators to launch the latch of the entrustment accountY,Default is 0
CumulativeIncomestring(0x hexadecimal string)Entrusted income to be takenY,Default is 0
  1. getCandidateInfo: Query the pledge information of the current node

parameter:

parametertypedescribemust
funcTypeuint16Representing method type code(1105)Y
nodeId64bytesVerifiable person's node IDY

return value: List

nametypedescribeIs it empty (zero)
NodeId64bytesThe pledged node ID (also called the node ID of the candidate)N
StakingAddress20bytesThe account used when launching pledge (subsequent operation pledge information can only use this account, withdraw the pledge, VON will be returned to the account or the lock information of the account)N
BenefitAddress20bytesRevenue account for accepting block rewards and pledge rewardsY,By default is the zero account address
RewardPeruint16(2bytes)The current settlement cycle reward is divided into proportion, using BasePoint 1BP = 0.01%Y
NextRewardPeruint16(2bytes)The next settlement cycle reward is divided into proportion, using BasePoint 1BP = 0.01%Y
StakingTxIndexuint32(4bytes)Transaction index when launching pledgeN
ProgramVersionuint32(4bytes)The real version number of the PLATON process of the pledge node (get the version number of the interface is provided by governance)N
Statusuint32(4bytes)The status of the candidate (status is placed according to the 32bit of UINT 32, can be present at the same time, the value is a plurality of simultaneous state values plus [0: node available (32 Bit all 0); 1: Node Not available (only the last bit is 1); 2: Node zero blocks need to be locked but do not need to be released (only the second bit of 1); 4: Node's VON is less than the lowest quality (only the number of countdown, third bit is 1 ); 8: Node is reported to be double-signed (only the countdown fourth bit is 1)); 16: Node zero block requires locking and unlocking the pledge (the fifth bit of the countdown is 1); 32: Node initiative to revoke (only countdown The sixth bit bit is 1)]N
StakingEpochuint32(4bytes)Current change cycle when the pledge amount is changedN
StakingBlockNumuint64(8bytes)Block height when launching pledgeN
Sharesstring(0x hexadecimal string)Current candidate's total pledge plus VON numberY,Default is 0
Releasedstring(0x hexadecimal string)Local pledge of the free amount of the pledged accountY,Default is 0
ReleasedHesstring(0x hexadecimal string)The free amount of the percentage of the pledged accountY,Default is 0
RestrictingPlanstring(0x hexadecimal string)Locking amount of latch lottery launches pledgeY,Default is 0
RestrictingPlanHesstring(0x hexadecimal string)Locking amount launched a pledge account,Herdity pledged VonY,Default is 0
ExternalIdstringExternal ID (have long limit, give the third party pull the ID)Y, Default is empty string
NodeNamestringThe name of the pledge node (with long limit, indicating the name of the node)Y, Default is empty string
WebsitestringA third-party home page (long limit, indicating the home page of the node)Y, Default is empty string
DetailsstringDescription of the node (have a length limit, indicating the description of the node)Y, Default is empty string
DelegateEpochuint32(4bytes)The settlement cycle of the last commissioned settlementY,Default is 0
DelegateTotalstring(0x hexadecimal string)Number of nodes is entrustedY,Default is 0
DelegateTotalHesstring(0x hexadecimal string)The total number of unnifunctioned nodes is commissionedY,Default is 0
DelegateRewardTotal*big.Int(bytes)Total entrustment reward for candidatesY
  1. getPackageReward: Query the block reward of the current settlement cycle

parameter:

parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(1200)Y

return value:

typedescribeIs it empty (zero)
string(0x hexadecimal string)Block rewardN
  1. getStakingReward: Query the current settlement cycle pledge reward

parameter:

parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(1201)Y

return value:

typedescribeIs it empty (zero)
string(0x hexadecimal string)Pledge rewardN
  1. getAvgPackTime: Query the average time of package blocking blocks

parameter:

parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(1202)Y

return value:

typedescribeIs it empty (zero)
uint64The average time (unit of millisecond) package block (unit of millisecond) package blockN

Governance contract interface parameter description#

The contract address of the following governance related interface is:
Main network:lat1zqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq93t3hkm
EIP55 address:0x1000000000000000000000000000000000000005

  1. submitText: Submit a text proposal
parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(2000)Y
verifierdiscover.NodeID(64bytes)Submit the verifierY
pIDIDstring(uint64)PIPIDY
  1. submitVersion: Submit an upgrade proposal
parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(2001)Y
verifierdiscover.NodeID(64bytes)Submit the verifierY
pIDIDstring(uint64)PIPIDY
newVersionuint32(4bytes)updated versionY
endVotingRoundsuint64Voting consensus wheel number. Description: Suppose submitted transactions 20 blocks high in advance, 250, 20 are configurable),Where 0 < endvotingrounds <= 4840 (approximately 2 weeks, the actual discussion can be calculated according to the configuration), and is an integer)Y
  1. submitParam: Submit parameter proposal
parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(2002)Y
verifierdiscover.NodeID(64bytes)Alternative to submit proposalsY
pIDIDstring(uint64)PIPIDY
modulestringParameter moduleY
namestringparameter nameY
newValuestringNew value of parametersY
  1. submitCancel: Submit cancellation proposal
parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(2005)Y
verifierdiscover.NodeID(64bytes)Submit the verifierY
pIDIDstring(uint64)PIPIDY
endVotingRoundsuint64Voting consensus wheel number. Refer to the instructions for submitting the upgrade proposal, at the same time, the value of this parameter in this interface cannot be greater than the value in the corresponding upgrade proposal.Y
tobeCanceledProposalIDcommon.hash(32bytes)Upgrade proposal ID to be canceledY
  1. vote: Vote for proposals
parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(2003)Y
verifierdiscover.NodeID(64bytes)VictorY
proposalIDcommon.Hash(32bytes)Proposal IDY
optionuint8(1byte) 0x01: Support 0x02: Objecting Other values: abstainVoting optionsY
programVersionuint32(4bytes)Node code version, GetProgramVersion interface with RPCY
versionSigncommon.VesionSign(65bytes)Code version signature, GetProgramVersion interface with RPCY
  1. declareVersion: Version statement
parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(2004)Y
verifierdiscover.NodeID(64bytes)The node that is declared can only be a verification person / candidate.Y
programVersionuint32(4bytes)Declare version, GetProgramVersion interface with RPCY
versionSigncommon.VesionSign(65bytes)Declare version signature, GetProgramVersion interface with RPCY
  1. getProposal: Query proposal

parameter:

parametertypedescribemust
funcTypeuint16(2bytes)2100Y
proposalIDcommon.Hash(32bytes)Proposal IDY

Returns one of the following four types:

TextProposal:Text proposal#
  • Field description:
Fieldtypedescribe
ProposalIDcommon.Hash(32bytes)Proposal ID
Proposercommon.NodeID(64bytes)Proposal node ID
ProposalTypebyteProposal type, 0x01: text proposal; 0x02: upgrade proposal; 0x03 parameter proposal; 0x04 cancel proposal.
PIPIDstringProposal PIPID
SubmitBlock8bytesSubmit the proposal
EndVotingBlock8bytesThe block is high, the system is high, and the system is based on Submitblock.
VersionProposal:Upgrade proposal#
  • Field description:
Fieldtypedescribe
ProposalIDcommon.Hash(32bytes)Proposal ID
Proposercommon.NodeID(64bytes)Proposal node ID
ProposalTypebyteProposal type, 0x01: text proposal; 0x02: upgrade proposal; 0x03 parameter proposal; 0x04 cancel proposal.
PIPIDstringProposal PIPID
SubmitBlock8bytesSubmit the proposal
EndVotingRounds8bytesVoting sustainable consensus period quantity
EndVotingBlock8bytesThe block is high, the system is high, and the system is calculated according to Submitblock, EndvotingRounds.
ActiveBlock8bytesThe proposal is high, and the system is calculated according to endvotingblock.
NewVersionuintupdated version
CancelProposal:Cancel proposal#
  • Field description:
Fieldtypedescribe
ProposalIDcommon.Hash(32bytes)Proposal ID
Proposercommon.NodeID(64bytes)Proposal node ID
ProposalTypebyteProposal type, 0x01: text proposal; 0x02: upgrade proposal; 0x03 parameter proposal; 0x04 cancel proposal.
PIPIDstringProposal PIPID
SubmitBlock8bytesSubmit the proposal
EndVotingRounds8bytesVoting sustainable consensus period quantity
EndVotingBlock8bytesThe block is high, the system is high, and the system is calculated according to Submitblock, EndvotingRounds.
TobeCanceledcommon.Hash(32bytes)Proposal to cancel the upgrade proposal ID
ParamProposal:Parameter proposal#
  • Field description:
Fieldtypedescribe
ProposalIDcommon.Hash(32bytes)Proposal ID
Proposercommon.NodeID(64bytes)Proposal node ID
ProposalTypebyteProposal type, 0x01: text proposal; 0x02: upgrade proposal; 0x03 parameter proposal; 0x04 cancel proposal.
PIPIDstringProposal PIPID
SubmitBlock8bytesSubmit the proposal
EndVotingBlock8bytesThe block is high, the system is high, and the system is calculated according to Submitblock, EndvotingePochrounds.
MoudulestringParameter module name
Namestringparameter name
NewVersionuintNew value of parameters
  1. getTallyResult: Query proposal results

parameter:

parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(2101)Y
proposalIDcommon.Hash(32bytes)Proposal IDY

return value:

Fieldtypedescribe
proposalIDcommon.Hash(32bytes)Proposal ID
yeasuint64(8bytes)Vote
naysuint64(8bytes)Opposition
abstentionsuint64(8bytes)Abandonment
accuVerifiersuint64(8bytes)Total number of verifiers for voting qualifications throughout the voting period
statusbytecondition
canceledBycommon.Hash(32bytes)When status = 0x06, record the Proposalid that initiates canceled
  1. listProposal: Query proposal list

parameter:

parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(2102)Y

return value:

Refer to the GetProposal interface return value

  1. getActiveVersion: Query node chain life effect version

parameter:

parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(2103)Y

return value:

The JSON string of the version number, such as {65536}, said version is: 1.0.0. When parsing, Ver needs to be converted to 4 bytes. Main version: Second byte; small version: third byte, Patch version, fourth byte.

  1. getGovernParamValue: Query the high governance parameter value of the current block

parameter:

parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(2104)Y
modulestringParameter moduleY
namestringparameter nameY

return value:

The JSON string of the parameter value, such as {"32"}. Returns are all strings, and the client is turned to the target type.

  1. getAccuVerifiersCount: Cumulative voter number of query proposals

parameter:

parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(2105)Y
proposalIDcommon.Hash(32bytes)Proposal IDY
blockHashcommon.Hash(32bytes)Block HashY

return value: Is a [] UINT16 array

nametypedescribe
uint16Cumulative voter
uint16Number of votes
uint16Objection
uint16Abandonment
  1. listGovernParam: Query governance parameters list

parameter:

parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(2106)Y
modulestringParameter module. If you enter an empty string "," indicate all governance parametersY

return value:

Is a [] governparam array

nametypedescribe
ParamItemParamItemParameter item
ParamValueParamValueParameter value

in:

ParamItem

nametypedescribe
ModulestringParameter module
Namestrigparameter name
DescstringParameter Description

ParamValue

nametypedescribe
StaleValuestringOld parameter value
ValuestringParameter value
ActiveBlockuint64High block. (> = ActiveBlock, will take value; otherwise STALEVALUE)

The following is a definition of the type of governance#

ProposalType: Proposal type definition#
typevaluedescribe
TextProposal0x01Text proposal
VersionProposal0x02Upgrade proposal
ParamProposal0x03Parameter proposal
CancelProposal0x04Cancel proposal
ProposalStatus: Proposal state definition#

For text proposals, there are three states: 0x01, 0x02, 0x03; For the upgrade proposal, there are: 0x01, 0x03, 0x04, 0x05, 0x06 five states. For parameters proposals, there are: 0x01, 0x02, 0x03, 0x6 four states; For canceled proposals, there are: 0x01, 0x02, 0x03 three states;

typevaluedescribe
Voting0x01Vote
Pass0x02Vote
Failed0x03Vote failed
PreActive0x04(Upgrade proposal) presuppose
Active0x05(Upgrade proposal) take effect
Canceled0x06got canceled

Report penalty contract interface parameter description#

The contract address of the following slashing related interfaces is:
Main network:lat1zqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqyva9ztf
EIP55 address:0x1000000000000000000000000000000000000004

  1. ReportDuplicateSign: Report double sign

parameter:

parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(3000)Y
typuint8Represents double sign type,1:prepareBlock,2:prepareVote,3:viewChangeY
datastringA single evidence JSON value, format refer to evidens_interfaceY
  1. CheckDuplicateSign: Whether the query node has been reported to have been reported

parameter:

parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(3001)Y
typuint32Represents Double Sign Type, 1: Prepareblock, 2: Preparevote, 3: ViewChangeY
nodeId64bytesReported node IDY
blockNumberuint64Multi-signed block highY

带来:

typedescribeWill it be empty?
stringReport transaction HASHY, may be zero trading hash, namely: 0x000 ... 000
  1. ZeroProduceNodeList: Query the list of nodes from zero

parameter:

parametertypeillustratemust
funcTypeuint16(2bytes)Representing method type code(3002)Y

带来:

typedescribeWill it be empty?
List(NodeId)Zero block node list, NodeID listY

Locking contract interface parameter description#

The contract address of the following lock-related interface is:
Main network:lat1zqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqp7pn3ep
EIP55 address:0x1000000000000000000000000000000000000001

  1. CreateRestrictingPlan: Create a lock plan plan

parameter:

parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(4000)Y
account20bytesLocklet release to the account accountY
plan[] RestrictingPLANPlan is a list of restrictingplan types (arrays), and restrictingplan is defined as follows: Type RestrictingPlan Struct {EPOCH UINT64 AMOUCT: BIG.INT} where EPOCH: Indicates the multiple of the settlement cycle, more than 0, EPOCH is 1 represented in the transaction The settlement cycle releases the lock bin. The product of the number of pieces per settlement period is represented in the target block height to release the locked funds. The number of EPOCHs is at least greater than the highest irreversible zone height. Amount: Indicates the amount to be released to the target block.Y
  1. GetRestrictingInfo: Get the lock information

Note: This interface supports acquisition history data, which can be attached with a high block when requested, and the data of the latest block is queried by default.

parameter:

parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(4100)Y
account20bytesLocklet release to the account accountY

return value:

Returns the parameter to the JSON format string of the following fields

nametypedescribeWill it be empty?
balancestring(0x hexadecimal string)Total lock bin balance - released amountN
pledgestring(0x hexadecimal string)Pledge / mortgageY, 默认为 0
debtstring(0x hexadecimal string)DepositY, 默认为 0
plansbytesLock-locking information, JSON array:[{"blockNumber":"","amount":""},...,{"blockNumber":"","amount":""}]。Among them: blocknumber: BIG.INT, release block height amount:\string(0x hexadecimal string), Release the amountN

Reward contract interface parameter description#

The contract address of the reward associated interface is:

Main network:lat1zqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqxlcypcy
EIP55 address:0x1000000000000000000000000000000000000006

  1. withdrawDelegateReward: Extract all of the currently extracted delegation rewards

parameter:

parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(5000)Y

return value:

Note: The trading results are stored in logs.data in the transaction receipt, such as transaction success, storage rlp.encode ([] byte {[] Byte (status code 0), rlp.encode (Node Receals list)}) If the transaction is unsuccessful, it is consistent with the previous manner.storage rlp.encode ([] byte {[] Byte (status code 0), rlp.encode (Node Receals list)}) If the transaction is unsuccessful, it is consistent with the previous manner.

Node Reception List As an array, receive up to 20 nodes at a time at least one time.

parametertypedescribeis nil
NodeIDdiscover.NodeID(64bytes)Node IDN
StakingNumuint64The decoration block of the node is highN
Reward*big.IntReceiving incomeN
  1. getDelegateReward: The query account has not extracted a reward in each node.

parameter:

parametertypedescribemust
funcTypeuint16(2bytes)Representing method type code(5100)Y
address20bytesTo check the address of your accountY
nodeIDs[]discover.NodeIDTo query the nodes, if you are empty, check all the nodes entrusted by your account.(Sort by returning all nodes, press DelegateEPoch ascending, the same time is arranged in the fast row results)N

return value:

Is a [] Reward array

nametypedescribe
nodeIDdiscover.NodeID(64bytes)Node ID
stakingNumuint64The decoration block of the node is high
rewardstring(0x hexadecimal string)Unpaged entrusted revenue

PPOS RPC Interface Description#

Query double out, double visa according to interface#

  • Method name:platon_evidences
  • parameter:without
  • return value:
parametertypedescribe
jsonrpcstringRPC version number
idintID serial number
resultstringEvidence string

Result is evidence string, including 3 evidence types, named: DuplicatePrepare, DuPlicateViewChange Each type contains multiple evidence, so it is an array structure and needs attention when parsing

duplicatePrepare

nametypedescribe
prepareAepochuint64Connectic wheel EPOCH value
viewNumberuint64Consensus wheel View value
blockHashstringBlock Hash
blockNumberuint64Block Number
blockIndexuint32Index value of blocks in a round of VIEW
blockDatastringBlock RLP encoding value
validateNodeindexuint32Verify the index value in a round of EPOCH
nodeIdstringVerifier NodeID
blsPubKeyobjectVerifier BLS public key
signaturebyte[]Message signature
prepareBepochuint64Connectic wheel EPOCH value
viewNumberuint64Consensus wheel View value
blockHashstringBlock Hash
blockNumberuint64Block Number
blockIndexuint32Index value of blocks in a round of VIEW
blockDatastringBlock RLP encoding value
validateNodeindexuint32Verify the index value in a round of EPOCH
nodeIdstringVerifier NodeID
blsPubKeyobjectVerifier BLS public key
signaturebyte[]Message signature

duplicateVote

nametypedescribe
voteAepochuint64Connectic wheel EPOCH value
viewNumberuint64Consensus wheel View value
blockHashstringBlock Hash
blockNumberuint64Block Number
blockIndexuint32Index value of blocks in a round of VIEW
validateNodeindexuint32Verify the index value in a round of EPOCH
nodeIdstringVerifier NodeID
blsPubKeyobjectVerifier BLS public key
signaturebyte[]Message signature
voteBepochuint64Connectic wheel EPOCH value
viewNumberuint64Consensus wheel View value
blockHashstringBlock Hash
blockNumberuint64Block Number
blockIndexuint32Index value of blocks in a round of VIEW
validateNodeindexuint32Verify the index value in a round of EPOCH
nodeIdstringVerifier NodeID
blsPubKeyobjectVerifier BLS public key
signaturebyte[]Message signature

duplicateViewchange

nametypedescribe
viewAepochuint64Connectic wheel EPOCH value
viewNumberuint64Consensus wheel View value
blockHashstringBlock Hash
blockNumberuint64Block Number
validateNodeindexuint32Verify the index value in a round of EPOCH
nodeIdstringVerifier NodeID
blsPubKeyobjectVerifier BLS public key
blockEpochuint32EPOCH value generated by blocks
blockViewuint32VIEW value generated by blocks
signaturebyte[]Message signature
viewBepochuint64Connectic wheel EPOCH value
viewNumberuint64Consensus wheel View value
blockHashstringBlock Hash
blockNumberuint64Block Number
validateNodeindexuint32Verify the index value in a round of EPOCH
nodeIdstringVerifier NodeID
blsPubKeyobjectVerifier BLS public key
blockEpochuint32EPOCH value generated by blocks
blockViewuint32VIEW value generated by blocks
signaturebyte[]Message signature

Query block aggregate signature interface#

  • Method name:platon_getPrepareQC
  • parameter:blockNumber (must)
  • return value:
parametertypedescribe
jsonrpcstringRPC version number
idintID serial number
resultstringAggregate signature structure

QuorumCert

nametypedescribe
epochuint64Connectic wheel EPOCH value
viewNumberuint64Consensus wheel View value
blockHashstringBlock Hash
blockNumberuint64Block Number
blockIndexuint32Index value of blocks in a round of VIEW
signaturestringAggregate signature string
validatorSetstringVerifier index collection

Query code versions and signatures#

  • Method name:admin_getProgramVersion
  • parameter:none
  • return value:
parameterTypes ofdescribeWill it be empty?
jsonrpcstringRPC version numberN
idintID serial numberN
resultstringStringN

Result is a JSON string, contains two fields of Version and SIGN

Query BLS certification#

  • Method name:admin_getSchnorrNIZKProve
  • parameter:none
  • return value:none
parameterTypes ofdescribeWill it be empty?
jsonrpcstringRPC version numberN
idintID serial numberN
resultstringBLS proofN

Open database garbage collection#

  • Method name: debug_disableDBGC
  • parameter: none
  • return value: none

Turn off database garbage collection#

  • Method name: debug_enableDBGC
  • parameter: none
  • return value: none