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.

NodeState

Request Type: NodeReq
Response Type: SingleBytes

Returns the current state of this node

Metric

Request Type: MetricsRequest
Response Type: Metrics

Returns node metrics according to request

Blockchain

Request Type: Empty
Response Type: BlockchainStatus

Returns current blockchain status (best block’s height and hash)

GetChainInfo

Request Type: Empty
Response Type: ChainInfo

Returns current blockchain’s basic information

ChainStat

Request Type: Empty
Response Type: ChainStats

Returns current chain statistics

ListBlockHeaders

Request Type: ListParams
Response Type: BlockHeaderList

Returns list of Blocks without body according to request

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

Return a single transaction, queried by transaction hash

GetBlockTX

Request Type: SingleBytes
Response Type: TxInBlock

Return information about transaction in block, queried by transaction hash

GetReceipt

Request Type: SingleBytes
Response Type: Receipt

Return transaction receipt, queried by transaction hash

GetABI

Request Type: SingleBytes
Response Type: ABI

Return ABI stored at contract address

SendTX

Request Type: Tx
Response Type: CommitResult

Sign and send a transaction from an unlocked account

SignTX

Request Type: Tx
Response Type: Tx

Sign transaction with unlocked account

VerifyTX

Request Type: Tx
Response Type: VerifyResult

Verify validity of transaction

CommitTX

Request Type: TxList
Response Type: CommitResultList

Commit a signed transaction

GetState

Request Type: SingleBytes
Response Type: State

Return state of account

GetStateAndProof

Request Type: AccountAndRoot
Response Type: AccountProof

Return state of account, including merkle proof

CreateAccount

Request Type: Personal
Response Type: Account

Create a new account in this node

GetAccounts

Request Type: Empty
Response Type: AccountList

Return list of accounts in this node

LockAccount

Request Type: Personal
Response Type: Account

Lock account in this node

UnlockAccount

Request Type: Personal
Response Type: Account

Unlock account in this node

ImportAccount

Request Type: ImportFormat
Response Type: Account

Import account to this node

ExportAccount

Request Type: Personal
Response Type: SingleBytes

Export account stored in this node

QueryContract

Request Type: Query
Response Type: SingleBytes

Query a contract method

QueryContractState

Request Type: StateQuery
Response Type: StateQueryProof

Query contract state

GetPeers

Request Type: PeersParams
Response Type: PeerList

Return list of peers of this node and their state

GetVotes

Request Type: VoteParams
Response Type: VoteList

Return result of vote

GetAccountVotes

Request Type: AccountAddress
Response Type: AccountVoteInfo

Return staking, voting info for account

GetStaking

Request Type: AccountAddress
Response Type: Staking

Return staking information

GetNameInfo

Request Type: Name
Response Type: NameInfo

Return name information

ListEventStream

Request Type: FilterInfo
Response Type: Event

Returns a stream of event as they get added to the blockchain

ListEvents

Request Type: FilterInfo
Response Type: EventList

Returns list of event

GetServerInfo

Request Type: KeyParams
Response Type: ServerInfo

Returns configs and statuses of server

GetConsensusInfo

Request Type: Empty
Response Type: ConsensusInfo

Returns status of consensus and bps

ChangeMembership

Request Type: MembershipChange
Response Type: MembershipChangeReply

Add & remove member of raft cluster

AccountAddress

Field Type Label Description
value bytes

AccountAndRoot

Field Type Label Description
Account bytes
Root bytes
Compressed bool

AccountVoteInfo

Field Type Label Description
staking Staking
voting VoteInfo repeated

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
size int64 blocksize in bytes

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
consensus_info string
best_chain_id_hash bytes

ChainId

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

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

ChainStats

ChainStats corresponds to a chain statistics report.

Field Type Label Description
report string

CommitResult

Field Type Label Description
hash bytes
error CommitStatus
detail string

CommitResultList

Field Type Label Description
results CommitResult repeated

ConfigItem

Field Type Label Description
props ConfigItem.PropsEntry repeated

ConfigItem.PropsEntry

Field Type Label Description
key string
value string

ConsensusInfo

info and bps is json string

Field Type Label Description
type string
info string
bps string repeated

Empty

EventList

Field Type Label Description
events Event repeated

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

KeyParams

Field Type Label Description
key string repeated

ListParams

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

Name

Field Type Label Description
name string
blockNo uint64

NameInfo

Field Type Label Description
name Name
owner bytes
destination 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
selfpeer bool
version string

PeerList

Field Type Label Description
peers Peer repeated

PeersParams

Field Type Label Description
noHidden bool
showSelf bool

Personal

Field Type Label Description
passphrase string
account Account

ServerInfo

Field Type Label Description
status ServerInfo.StatusEntry repeated
config ServerInfo.ConfigEntry repeated

ServerInfo.ConfigEntry

Field Type Label Description
key string
value ConfigItem

ServerInfo.StatusEntry

Field Type Label Description
key string
value string

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

VoteInfo

Field Type Label Description
id string
candidates string repeated

VoteList

Field Type Label Description
votes Vote repeated
id string

VoteParams

Field Type Label Description
id string
count uint32

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

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

FnArgument

Field Type Label Description
name string

Function

Field Type Label Description
name string
arguments FnArgument repeated
payable bool
view bool

Query

Field Type Label Description
contractAddress bytes
queryinfo bytes

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

StateVar

Field Type Label Description
name string
type string
len int32

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
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

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