Documentation ¶
Index ¶
- func ConstructBlocksSyncMessage(blocks []*types.Block) []byte
- func ConstructCXReceiptsProof(cxReceiptsProof *types.CXReceiptsProof) []byte
- func ConstructCrossLinkHeadersMessage(headers []*block.Header) []byte
- func ConstructEpochShardStateMessage(epochShardState shard.EpochShardState) []byte
- func ConstructTransactionListMessageAccount(transactions types.Transactions) []byte
- func DeserializeEpochShardStateFromMessage(payload []byte) (*shard.EpochShardState, error)
- func SerializeBlockchainSyncMessage(blockchainSyncMessage *BlockchainSyncMessage) []byte
- type BlockMessageType
- type BlockchainSyncMessage
- type BlockchainSyncMessageType
- type Info
- type MessageType
- type RoleType
- type TransactionMessageType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstructBlocksSyncMessage ¶
ConstructBlocksSyncMessage constructs blocks sync message to send blocks to other nodes
func ConstructCXReceiptsProof ¶
func ConstructCXReceiptsProof(cxReceiptsProof *types.CXReceiptsProof) []byte
ConstructCXReceiptsProof constructs cross shard receipts and related proof including merkle proof, blockHeader and commitSignatures
func ConstructCrossLinkHeadersMessage ¶
ConstructCrossLinkHeadersMessage constructs cross link header message to send to beacon chain
func ConstructEpochShardStateMessage ¶
func ConstructEpochShardStateMessage(epochShardState shard.EpochShardState) []byte
ConstructEpochShardStateMessage contructs epoch shard state message
func ConstructTransactionListMessageAccount ¶
func ConstructTransactionListMessageAccount(transactions types.Transactions) []byte
ConstructTransactionListMessageAccount constructs serialized transactions in account model
func DeserializeEpochShardStateFromMessage ¶
func DeserializeEpochShardStateFromMessage(payload []byte) (*shard.EpochShardState, error)
DeserializeEpochShardStateFromMessage deserializes the shard state Message from bytes payload
func SerializeBlockchainSyncMessage ¶
func SerializeBlockchainSyncMessage(blockchainSyncMessage *BlockchainSyncMessage) []byte
SerializeBlockchainSyncMessage serializes BlockchainSyncMessage.
Types ¶
type BlockMessageType ¶
type BlockMessageType int
BlockMessageType represents the type of messages used for Node/Block
const ( Sync BlockMessageType = iota Header // used for crosslink from beacon chain to shard chain Receipt // cross-shard transaction receipts )
Block sync message subtype
type BlockchainSyncMessage ¶
BlockchainSyncMessage is a struct for blockchain sync message.
func DeserializeBlockchainSyncMessage ¶
func DeserializeBlockchainSyncMessage(d []byte) (*BlockchainSyncMessage, error)
DeserializeBlockchainSyncMessage deserializes BlockchainSyncMessage.
type BlockchainSyncMessageType ¶
type BlockchainSyncMessageType int
BlockchainSyncMessageType represents BlockchainSyncMessageType type.
const ( Done BlockchainSyncMessageType = iota GetLastBlockHashes GetBlock )
Constant of blockchain sync-up message subtype
type Info ¶
type Info struct { IP string Port string PubKey []byte Role RoleType PeerID peer.ID // Peerstore ID }
Info refers to Peer struct in p2p/peer.go this is basically a simplified version of Peer for network transportation
type MessageType ¶
type MessageType byte
MessageType is to indicate the specific type of message under Node category
const ( Transaction MessageType = iota Block Client PING // node send ip/pki to register with leader ShardState Staking )
Constant of the top level Message Type exchanged among nodes
type TransactionMessageType ¶
type TransactionMessageType int
TransactionMessageType representa the types of messages used for Node/Transaction
const ( Send TransactionMessageType = iota Unlock )
Constant of transaction message subtype