Protocol Documentation

This reference is auto-generated from aergoio/aergo-protobuf.

Top

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.

Method Name Request Type Response Type Description
NodeState NodeReq SingleBytes Returns the current state of this node
Metric MetricsRequest Metrics Returns node metrics according to request
Blockchain Empty BlockchainStatus Returns current blockchain status (best block's height and hash)
GetChainInfo Empty ChainInfo Returns current blockchain's basic information
ListBlockHeaders ListParams BlockHeaderList Returns list of Blocks without body according to request
ListBlockMetadata ListParams BlockMetadataList Returns list of block metadata (hash, header, and number of transactions) according to request
ListBlockStream Empty Block Returns a stream of new blocks as they get added to the blockchain
ListBlockMetadataStream Empty BlockMetadata Returns a stream of new block's metadata as they get added to the blockchain
GetBlock SingleBytes Block Return a single block incl. header and body, queried by hash or number
GetBlockMetadata SingleBytes BlockMetadata Return a single block's metdata (hash, header, and number of transactions), queried by hash or number
GetBlockBody BlockBodyParams BlockBodyPaged Return a single block's body, queried by hash or number and list parameters
GetTX SingleBytes Tx Return a single transaction, queried by transaction hash
GetBlockTX SingleBytes TxInBlock Return information about transaction in block, queried by transaction hash
GetReceipt SingleBytes Receipt Return transaction receipt, queried by transaction hash
GetABI SingleBytes ABI Return ABI stored at contract address
SendTX Tx CommitResult Sign and send a transaction from an unlocked account
SignTX Tx Tx Sign transaction with unlocked account
VerifyTX Tx VerifyResult Verify validity of transaction
CommitTX TxList CommitResultList Commit a signed transaction
GetState SingleBytes State Return state of account
GetStateAndProof AccountAndRoot AccountProof Return state of account, including merkle proof
CreateAccount Personal Account Create a new account in this node
GetAccounts Empty AccountList Return list of accounts in this node
LockAccount Personal Account Lock account in this node
UnlockAccount Personal Account Unlock account in this node
ImportAccount ImportFormat Account Import account to this node
ExportAccount Personal SingleBytes Export account stored in this node
QueryContract Query SingleBytes Query a contract method
QueryContractState StateQuery StateQueryProof Query contract state
GetPeers Empty PeerList Return list of peers of this node and their state
GetVotes SingleBytes VoteList Return list of votes
GetStaking SingleBytes Staking Return staking information
GetNameInfo Name NameInfo Return name information

AccountAndRoot

Field Type Label Description
Account bytes
Root bytes
Compressed bool

BlockBodyPaged

Field Type Label Description
total uint32
offset uint32
size uint32
body BlockBody

BlockBodyParams

Field Type Label Description
hashornumber bytes
paging PageParams

BlockHeaderList

Field Type Label Description
blocks Block repeated

BlockMetadata

Field Type Label Description
hash bytes
header BlockHeader
txcount int32

BlockMetadataList

Field Type Label Description
blocks BlockMetadata repeated

BlockchainStatus

BlockchainStatus is current status of blockchain

Field Type Label Description
best_block_hash bytes
best_height uint64

ChainId

Field Type Label Description
magic string
public bool
mainnet bool
coinbasefee bytes
consensus string

ChainInfo

ChainInfo returns chain configuration

Field Type Label Description
chainid ChainId
bpnumber uint32
maxblocksize uint64
maxtokens bytes
stakingminimum bytes

CommitResult

Field Type Label Description
hash bytes
error CommitStatus
detail string

CommitResultList

Field Type Label Description
results CommitResult repeated

Empty

ImportFormat

Field Type Label Description
wif SingleBytes
oldpass string
newpass string

Input

Field Type Label Description
hash bytes
address bytes repeated
value bytes
script bytes

ListParams

Field Type Label Description
hash bytes
height uint64
size uint32
offset uint32
asc bool

Name

Field Type Label Description
name string

NameInfo

Field Type Label Description
name Name
owner bytes

NodeReq

Field Type Label Description
timeout bytes
component bytes

Output

Field Type Label Description
index uint32
address bytes
value bytes
script bytes

PageParams

Field Type Label Description
offset uint32
size uint32

Peer

Field Type Label Description
address PeerAddress
bestblock NewBlockNotice
state int32
hidden bool
lashCheck int64

PeerList

Field Type Label Description
peers Peer repeated

Personal

Field Type Label Description
passphrase string
account Account

SingleBytes

Field Type Label Description
value bytes

Staking

Field Type Label Description
amount bytes
when uint64

VerifyResult

Field Type Label Description
tx Tx
error VerifyStatus

Vote

Field Type Label Description
candidate bytes
amount bytes

VoteList

Field Type Label Description
votes Vote 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

VerifyStatus

Name Number Description
VERIFY_STATUS_OK 0
VERIFY_STATUS_SIGN_NOT_MATCH 1
VERIFY_STATUS_INVALID_HASH 2 TODO: not yet impl

Top

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

Block

Field Type Label Description
hash bytes
header BlockHeader
body BlockBody

BlockBody

Field Type Label Description
txs Tx 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

FnArgument

Field Type Label Description
name string

Function

Field Type Label Description
name string
arguments FnArgument repeated

Query

Field Type Label Description
contractAddress bytes
queryinfo bytes

Receipt

Field Type Label Description
contractAddress bytes
status string
ret string

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

StateVar

Field Type Label Description
name string
type string

Tx

Field Type Label Description
hash bytes
body TxBody

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
limit uint64 currently not used
price bytes variable-length big integer. currently not used
type TxType
sign bytes sender's signature for this TxBody

TxIdx

TxIdx specifies a transaction’s block hash and index within the block body

Field Type Label Description
blockHash bytes
idx int32

TxInBlock

Field Type Label Description
txIdx TxIdx
tx Tx

TxList

Field Type Label Description
txs Tx repeated

TxType

Name Number Description
NORMAL 0
GOVERNANCE 1

Top

metric.proto

Metrics

Field Type Label Description
peers PeerMetric repeated

MetricsRequest

Field Type Label Description
types MetricType repeated

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

Scalar Value Types

.proto Type Notes C++ Type Java Type Python Type
double double double float
float float float float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long
uint32 Uses variable-length encoding. uint32 int int/long
uint64 Uses variable-length encoding. uint64 long int/long
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long
sfixed32 Always four bytes. int32 int int
sfixed64 Always eight bytes. int64 long int/long
bool bool boolean boolean
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode
bytes May contain any arbitrary sequence of bytes. string ByteString str