public abstract class NetworkMessage
extends java.lang.Object
Each network message has a common prefix followed by the message payload
Modifier and Type | Class and Description |
---|---|
static class |
NetworkMessage.AddPeersMessage
The AddPeers message is sent to a peer to update its peer list and it is also returned
as an asynchronous response to the GetPeers message
Peer list
|
static class |
NetworkMessage.BlockchainStateMessage
The BlockchainState message is sent when blockchain state changes.
|
static class |
NetworkMessage.BlockIdsMessage
The BlockIds message is returned in response to the GetNextBlockIds message.
|
static class |
NetworkMessage.BlockInventoryMessage
The BlockInventory message is sent when a peer has received a new block.
|
static class |
NetworkMessage.BlocksMessage
The Blocks message is returned in response to the GetBlock and GetNextBlocks message.
|
static class |
NetworkMessage.BundlerRateMessage
The BundlerRate message is periodically broadcast when the
peer has one or more active bundlers.
|
static class |
NetworkMessage.CumulativeDifficultyMessage
The CumulativeDifficulty message is returned in response to the GetCumulativeDifficulty message.
|
static class |
NetworkMessage.ErrorMessage
The Error message is returned when a error is detected while processing a
request.
|
static class |
NetworkMessage.GetBlockMessage
The GetBlock message is sent when a peer is notified that a new block is available.
|
static class |
NetworkMessage.GetCumulativeDifficultyMessage
The GetCumulativeDifficulty message is sent to a peer to get the current blockchain status.
|
static class |
NetworkMessage.GetInfoMessage
The GetInfo message is exchanged when a peer connection is established.
|
static class |
NetworkMessage.GetMilestoneBlockIdsMessage
The GetMilestoneBlockIds message is sent when a peer is downloading the blockchain.
|
static class |
NetworkMessage.GetNextBlockIdsMessage
The GetNextBlockIds message is sent when a peer is downloading the blockchain.
|
static class |
NetworkMessage.GetNextBlocksMessage
The GetNextBlocks message is sent when a peer is downloading the blockchain.
|
static class |
NetworkMessage.GetPeersMessage
The GetPeers message is sent to a peer to request a list of connected peers.
|
static class |
NetworkMessage.GetTransactionsMessage
The GetTransactions message is sent to retrieve one or more transactions.
|
static class |
NetworkMessage.GetUnconfirmedTransactionsMessage
The GetUnconfirmedTransactions message is sent to retrieve the current set
of unconfirmed transactions.
|
static class |
NetworkMessage.MilestoneBlockIdsMessage
The MilestoneBlockIds message is returned in response to the GetMilestoneBlockIds message.
|
static class |
NetworkMessage.TransactionsInventoryMessage
The TransactionsInventory message is sent when a peer has received new transactions.
|
static class |
NetworkMessage.TransactionsMessage
The Transactions message is returned in response to the GetTransactions and
GetUnconfirmedTransactions messages.
|
Modifier and Type | Field and Description |
---|---|
static int |
MAX_ARRAY_LENGTH
Maximum byte array length
|
static int |
MAX_LIST_SIZE
Maximum list size
|
static int |
MAX_LIST_SIZE_PRE_2_3_3
The max list size used in versions 2.3.2 and before.
|
protected long |
messageId
Message identifier
|
Modifier and Type | Method and Description |
---|---|
protected NetworkMessage |
constructMessage(java.nio.ByteBuffer bytes)
Construct the message
|
public static final int MAX_ARRAY_LENGTH
public static final int MAX_LIST_SIZE
public static final int MAX_LIST_SIZE_PRE_2_3_3
protected long messageId
protected NetworkMessage constructMessage(java.nio.ByteBuffer bytes) throws java.nio.BufferOverflowException, java.nio.BufferUnderflowException, nxt.peer.NetworkException
bytes
- Message bytes following the message namejava.nio.BufferOverflowException
- Message buffer is too smalljava.nio.BufferUnderflowException
- Message is too shortNetworkException
- Message is not valid