Protocol Messages
This chapter describes protocol messages, and documents the current protocol messages. Protocol messages are used to share protocol data like blocks and transactions.
Levin
All protocol messages are in the notification levin format. Although there are some messages that fall under requests/responses, levin will treat them as notifications.
All admin messages are in the request/response levin format. This means requests will set the expect response bit and
responses will set the return code to 1
.
Messages
Notify New Block
ID: 2001
1
Fields | Type | Description |
---|---|---|
b | Block Complete Entry | The full block |
current_blockchain_height | u64 | The current chain height |
Notify New Transactions
ID: 2002
2
Fields | Type | Description |
---|---|---|
txs | A vector of bytes | The txs |
_ | Bytes | Padding to prevent traffic volume analysis |
dandelionpp_fluff | bool | True if this message contains fluff txs, false if stem |
Notify Request Get Objects
ID: 2003
3
Fields | Type | Description |
---|---|---|
blocks | A vector of [u8; 32] serialized as a single string | The block IDs requested |
prune | bool | True if we want the blocks in pruned form, false otherwise |
Notify Response Get Objects
ID: 2004
4
Fields | Type | Description |
---|---|---|
blocks | A vector of Block Complete Entry | The blocks that were requested |
missed_ids | A vector of [u8; 32] serialized as a single string | IDs of any missed blocks |
current_blockchain_height | u64 | The current blockchain height |
Notify Request Chain
ID: 2006
5
Fields | Type | Description |
---|---|---|
block_ids | A vector of [u8; 32] serialized as a single string | A list of block IDs in reverse chronological order, the top and genesis block will always be included |
prune | bool | True if we want the response to contain pruned blocks, false otherwise |
Notify Response Chain Entry
ID: 2007
6
Fields | Type | Description |
---|---|---|
start_height | u64 | The start height of the entry |
total_height | u64 | The height of the peer's blockchain |
cumulative_difficulty | u64 | The low 64 bits of the cumulative difficulty |
cumulative_difficulty_top64 | u64 | The high 64 bits of the cumulative difficulty |
m_block_ids | A vector of [u8; 32] serialized as a single string | The block IDs in this entry |
m_block_weights | A vector of u64 serialized as a single string | The block weights |
first_block | bytes (epee string) | The header of the first block in m_block_ids |
Notify New Fluffy Block
ID: 2008
7
Fields | Type | Description |
---|---|---|
b | Block Complete Entry | The block, may or may not contain txs |
current_blockchain_height | u64 | The current chain height |
Notify Request Fluffy Missing Tx
ID: 2009
8
Fields | Type | Description |
---|---|---|
block_hash | [u8; 32] serialized as a string | The block hash txs are needed from |
current_blockchain_height | u64 | The current chain height |
missing_tx_indices | A vector of u64 serialized as a single string | The indices of the needed txs in the block |
Notify Get Txpool Compliment
ID: 2010
9
Fields | Type | Description |
---|---|---|
hashes | A vector of [u8; 32] serialized as a string | The current txpool txs |