Protocol Documentation¶
This reference is auto-generated from aergoio/aergo-protobuf.
- rpc.proto
- AergoRPCService
- NodeState
- Metric
- Blockchain
- GetChainInfo
- ChainStat
- ListBlockHeaders
- ListBlockMetadata
- ListBlockStream
- ListBlockMetadataStream
- GetBlock
- GetBlockMetadata
- GetBlockBody
- GetTX
- GetBlockTX
- GetReceipt
- GetABI
- SendTX
- SignTX
- VerifyTX
- CommitTX
- GetState
- GetStateAndProof
- CreateAccount
- GetAccounts
- LockAccount
- UnlockAccount
- ImportAccount
- ExportAccount
- QueryContract
- QueryContractState
- GetPeers
- GetVotes
- GetAccountVotes
- GetStaking
- GetNameInfo
- ListEventStream
- ListEvents
- GetServerInfo
- GetConsensusInfo
- ChangeMembership
- GetEnterpriseConfig
- GetConfChangeProgress
- AccountAddress
- AccountAndRoot
- AccountVoteInfo
- BlockBodyPaged
- BlockBodyParams
- BlockHeaderList
- BlockMetadata
- BlockMetadataList
- BlockchainStatus
- ChainId
- ChainInfo
- ChainStats
- CommitResult
- CommitResultList
- ConfigItem
- ConfigItem.PropsEntry
- ConsensusInfo
- Empty
- EnterpriseConfig
- EnterpriseConfigKey
- EventList
- ImportFormat
- Input
- KeyParams
- ListParams
- Name
- NameInfo
- NodeReq
- Output
- PageParams
- Peer
- PeerList
- PeersParams
- Personal
- ServerInfo
- ServerInfo.ConfigEntry
- ServerInfo.StatusEntry
- SingleBytes
- SingleString
- Staking
- VerifyResult
- Vote
- VoteInfo
- VoteList
- VoteParams
- CommitStatus
- VerifyStatus
- AergoRPCService
- blockchain.proto
- metric.proto
- Scalar Value Types
rpc.proto¶
AergoRPCService¶
AergoRPCService is the main RPC service providing endpoints to interact with the node and blockchain. If not otherwise noted, methods are unary requests.
Metric¶
Request Type: MetricsRequest
Response Type: Metrics
Blockchain¶
Request Type: Empty
Response Type: BlockchainStatus
Returns current blockchain status (best block’s height and hash)
ListBlockHeaders¶
Request Type: ListParams
Response Type: BlockHeaderList
ListBlockMetadata¶
Request Type: ListParams
Response Type: BlockMetadataList
Returns list of block metadata (hash, header, and number of transactions) according to request
ListBlockStream¶
Request Type: Empty
Response Type: Block
Returns a stream of new blocks as they get added to the blockchain
ListBlockMetadataStream¶
Request Type: Empty
Response Type: BlockMetadata
Returns a stream of new block’s metadata as they get added to the blockchain
GetBlock¶
Request Type: SingleBytes
Response Type: Block
Return a single block incl. header and body, queried by hash or number
GetBlockMetadata¶
Request Type: SingleBytes
Response Type: BlockMetadata
Return a single block’s metdata (hash, header, and number of transactions), queried by hash or number
GetBlockBody¶
Request Type: BlockBodyParams
Response Type: BlockBodyPaged
Return a single block’s body, queried by hash or number and list parameters
GetTX¶
Request Type: SingleBytes
Response Type: Tx
GetBlockTX¶
Request Type: SingleBytes
Response Type: TxInBlock
Return information about transaction in block, queried by transaction hash
GetReceipt¶
Request Type: SingleBytes
Response Type: Receipt
SendTX¶
Request Type: Tx
Response Type: CommitResult
GetStateAndProof¶
Request Type: AccountAndRoot
Response Type: AccountProof
GetPeers¶
Request Type: PeersParams
Response Type: PeerList
GetAccountVotes¶
Request Type: AccountAddress
Response Type: AccountVoteInfo
ListEventStream¶
Request Type: FilterInfo
Response Type: Event
Returns a stream of event as they get added to the blockchain
GetServerInfo¶
Request Type: KeyParams
Response Type: ServerInfo
GetConsensusInfo¶
Request Type: Empty
Response Type: ConsensusInfo
ChangeMembership¶
Request Type: MembershipChange
Response Type: MembershipChangeReply
GetEnterpriseConfig¶
Request Type: EnterpriseConfigKey
Response Type: EnterpriseConfig
GetConfChangeProgress¶
Request Type: SingleBytes
Response Type: ConfChangeProgress
Return a status of changeCluster enterprise tx, queried by requestID
BlockMetadata¶
Field | Type | Label | Description |
---|---|---|---|
hash | bytes | ||
header | BlockHeader | ||
txcount | int32 | ||
size | int64 | blocksize in bytes |
BlockchainStatus¶
BlockchainStatus is current status of blockchain
Field | Type | Label | Description |
---|---|---|---|
best_block_hash | bytes | ||
best_height | uint64 | ||
consensus_info | string | ||
best_chain_id_hash | bytes | ||
chain_info | ChainInfo |
ChainId¶
Field | Type | Label | Description |
---|---|---|---|
magic | string | ||
public | bool | ||
mainnet | bool | ||
consensus | string | ||
version | int32 |
ChainInfo¶
ChainInfo returns chain configuration
Field | Type | Label | Description |
---|---|---|---|
id | ChainId | ||
bpNumber | uint32 | ||
maxblocksize | uint64 | ||
maxtokens | bytes | ||
stakingminimum | bytes | ||
totalstaking | bytes | ||
gasprice | bytes | ||
nameprice | bytes | ||
totalvotingpower | bytes | ||
votingreward | bytes |
ChainStats¶
ChainStats corresponds to a chain statistics report.
Field | Type | Label | Description |
---|---|---|---|
report | string |
ConsensusInfo¶
info and bps is json string
Field | Type | Label | Description |
---|---|---|---|
type | string | ||
info | string | ||
bps | string | repeated |
Empty¶
ListParams¶
Field | Type | Label | Description |
---|---|---|---|
hash | bytes | ||
height | uint64 | ||
size | uint32 | ||
offset | uint32 | ||
asc | bool |
Peer¶
Field | Type | Label | Description |
---|---|---|---|
address | PeerAddress | ||
bestblock | NewBlockNotice | ||
state | int32 | ||
hidden | bool | ||
lashCheck | int64 | ||
selfpeer | bool | ||
version | string | ||
certificates | AgentCertificate | repeated | |
acceptedRole | PeerRole |
ServerInfo¶
Field | Type | Label | Description |
---|---|---|---|
status | ServerInfo.StatusEntry | repeated | |
config | ServerInfo.ConfigEntry | repeated |
CommitStatus¶
Name | Number | Description |
---|---|---|
TX_OK | 0 | |
TX_NONCE_TOO_LOW | 1 | |
TX_ALREADY_EXISTS | 2 | |
TX_INVALID_HASH | 3 | |
TX_INVALID_SIGN | 4 | |
TX_INVALID_FORMAT | 5 | |
TX_INSUFFICIENT_BALANCE | 6 | |
TX_HAS_SAME_NONCE | 7 | |
TX_INTERNAL_ERROR | 9 |
blockchain.proto¶
ABI¶
Field | Type | Label | Description |
---|---|---|---|
version | string | ||
language | string | ||
functions | Function | repeated | |
state_variables | StateVar | repeated |
AccountProof¶
Field | Type | Label | Description |
---|---|---|---|
state | State | ||
inclusion | bool | ||
key | bytes | ||
proofKey | bytes | ||
proofVal | bytes | ||
bitmap | bytes | ||
height | uint32 | ||
auditPath | bytes | repeated |
BlockHeader¶
Field | Type | Label | Description |
---|---|---|---|
chainID | bytes | chain identifier | |
prevBlockHash | bytes | hash of previous block | |
blockNo | uint64 | block number | |
timestamp | int64 | block creation time stamp | |
blocksRootHash | bytes | hash of root of block merkle tree | |
txsRootHash | bytes | hash of root of transaction merkle tree | |
receiptsRootHash | bytes | hash of root of receipt merkle tree | |
confirms | uint64 | number of blocks this block is able to confirm | |
pubKey | bytes | block producer's public key | |
coinbaseAccount | bytes | address of account to receive fees | |
sign | bytes | block producer's signature of BlockHeader | |
consensus | bytes | consensus meta |
ContractVarProof¶
Field | Type | Label | Description |
---|---|---|---|
value | bytes | ||
inclusion | bool | ||
proofKey | bytes | ||
proofVal | bytes | ||
bitmap | bytes | ||
height | uint32 | ||
auditPath | bytes | repeated | |
key | bytes |
Event¶
Field | Type | Label | Description |
---|---|---|---|
contractAddress | bytes | ||
eventName | string | ||
jsonArgs | string | ||
eventIdx | int32 | ||
txHash | bytes | ||
blockHash | bytes | ||
blockNo | uint64 | ||
txIndex | int32 |
FilterInfo¶
Field | Type | Label | Description |
---|---|---|---|
contractAddress | bytes | ||
eventName | string | ||
blockfrom | uint64 | ||
blockto | uint64 | ||
desc | bool | ||
argFilter | bytes | ||
recentBlockCnt | int32 |
Function¶
Field | Type | Label | Description |
---|---|---|---|
name | string | ||
arguments | FnArgument | repeated | |
payable | bool | ||
view | bool | ||
fee_delegation | bool |
Receipt¶
Field | Type | Label | Description |
---|---|---|---|
contractAddress | bytes | ||
status | string | ||
ret | string | ||
txHash | bytes | ||
feeUsed | bytes | ||
cumulativeFeeUsed | bytes | ||
bloom | bytes | ||
events | Event | repeated | |
blockNo | uint64 | ||
blockHash | bytes | ||
txIndex | int32 | ||
from | bytes | ||
to | bytes | ||
feeDelegation | bool | ||
gasUsed | uint64 |
State¶
Field | Type | Label | Description |
---|---|---|---|
nonce | uint64 | ||
balance | bytes | ||
codeHash | bytes | ||
storageRoot | bytes | ||
sqlRecoveryPoint | uint64 |
StateQuery¶
Field | Type | Label | Description |
---|---|---|---|
contractAddress | bytes | ||
root | bytes | ||
compressed | bool | ||
storageKeys | bytes | repeated |
StateQueryProof¶
Field | Type | Label | Description |
---|---|---|---|
contractProof | AccountProof | ||
varProofs | ContractVarProof | repeated |
TxBody¶
Field | Type | Label | Description |
---|---|---|---|
nonce | uint64 | increasing number used only once per sender account | |
account | bytes | decoded account address | |
recipient | bytes | decoded account address | |
amount | bytes | variable-length big integer | |
payload | bytes | ||
gasLimit | uint64 | currently not used | |
gasPrice | bytes | variable-length big integer. currently not used | |
type | TxType | ||
chainIdHash | bytes | hash value of chain identifier in the block | |
sign | bytes | sender's signature for this TxBody |
metric.proto¶
PeerMetric¶
Field | Type | Label | Description |
---|---|---|---|
peerID | bytes | ||
sumIn | int64 | ||
avrIn | int64 | ||
sumOut | int64 | ||
avrOut | int64 |
MetricType¶
Name | Number | Description |
---|---|---|
NOTHING | 0 | NOTHING should not be used. |
P2P_NETWORK | 1 | Metric for p2p network transfer |