Protocol Documentation¶
This reference is auto-generated from aergoio/aergo-protobuf.
- rpc.proto
- AergoRPCService
- NodeState
- Metric
- Blockchain
- GetChainInfo
- 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
- AergoRPCService
- [AccountAddress](#types.AccountAddress)
- [AccountAndRoot](#types.AccountAndRoot)
- [AccountVoteInfo](#types.AccountVoteInfo)
- [BlockBodyPaged](#types.BlockBodyPaged)
- [BlockBodyParams](#types.BlockBodyParams)
- [BlockHeaderList](#types.BlockHeaderList)
- [BlockMetadata](#types.BlockMetadata)
- [BlockMetadataList](#types.BlockMetadataList)
- [BlockchainStatus](#types.BlockchainStatus)
- [ChainId](#types.ChainId)
- [ChainInfo](#types.ChainInfo)
- [CommitResult](#types.CommitResult)
- [CommitResultList](#types.CommitResultList)
- [ConfigItem](#types.ConfigItem)
- [ConfigItem.PropsEntry](#types.ConfigItem.PropsEntry)
- [ConsensusInfo](#types.ConsensusInfo)
- [Empty](#types.Empty)
- [EventList](#types.EventList)
- [ImportFormat](#types.ImportFormat)
- [Input](#types.Input)
- [KeyParams](#types.KeyParams)
- [ListParams](#types.ListParams)
- [Name](#types.Name)
- [NameInfo](#types.NameInfo)
- [NodeReq](#types.NodeReq)
- [Output](#types.Output)
- [PageParams](#types.PageParams)
- [Peer](#types.Peer)
- [PeerList](#types.PeerList)
- [PeersParams](#types.PeersParams)
- [Personal](#types.Personal)
- [ServerInfo](#types.ServerInfo)
- [ServerInfo.ConfigEntry](#types.ServerInfo.ConfigEntry)
- [ServerInfo.StatusEntry](#types.ServerInfo.StatusEntry)
- [SingleBytes](#types.SingleBytes)
- [Staking](#types.Staking)
- [VerifyResult](#types.VerifyResult)
- [Vote](#types.Vote)
- [VoteInfo](#types.VoteInfo)
- [VoteList](#types.VoteList)
- [VoteParams](#types.VoteParams)
- [CommitStatus](#types.CommitStatus)
- [VerifyStatus](#types.VerifyStatus)
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
Returns status of consensus and bps
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 |
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 |
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 |
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 |
ContractVarProof¶
| Field | Type | Label | Description |
|---|---|---|---|
| value | bytes | ||
| inclusion | bool | ||
| key | string | ||
| proofKey | bytes | ||
| proofVal | bytes | ||
| bitmap | bytes | ||
| height | uint32 | ||
| auditPath | bytes | repeated |
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 |
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 |
State¶
| Field | Type | Label | Description |
|---|---|---|---|
| nonce | uint64 | ||
| balance | bytes | ||
| codeHash | bytes | ||
| storageRoot | bytes | ||
| sqlRecoveryPoint | uint64 |
StateQuery¶
| Field | Type | Label | Description |
|---|---|---|---|
| contractAddress | bytes | ||
| storageKeys | string | repeated | |
| root | bytes | ||
| compressed | bool |
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 |