Documentation ¶
Index ¶
- Variables
- func WriteMessage(sink *comm.ZeroCopySink, msg Message)
- type Addr
- type AddrReq
- type BlkHeader
- type Block
- type BlocksReq
- type Consensus
- type ConsensusPayload
- func (this *ConsensusPayload) Deserialization(source *common.ZeroCopySource) error
- func (this *ConsensusPayload) DeserializationUnsigned(source *common.ZeroCopySource) error
- func (this *ConsensusPayload) GetMessage() []byte
- func (this *ConsensusPayload) Hash() common.Uint256
- func (this *ConsensusPayload) Serialization(sink *common.ZeroCopySink)
- func (this *ConsensusPayload) SerializationUnsigned(sink *common.ZeroCopySink)
- func (this *ConsensusPayload) ToArray() []byte
- func (this *ConsensusPayload) Verify() error
- type DataReq
- type FindNodeReq
- type FindNodeResp
- type HeadersReq
- type Inv
- type InvPayload
- type MemberInfo
- type Message
- type MsgPayload
- type NotFound
- type Ping
- type Pong
- type RawBlockHeader
- type SubnetMembers
- type SubnetMembersRequest
- type Trn
- type UnknownMessage
- type UpdatePeerKeyId
- type VerACK
- type Version
- type VersionPayload
Constants ¶
This section is empty.
Variables ¶
var LastInvHash common.Uint256
Functions ¶
func WriteMessage ¶
func WriteMessage(sink *comm.ZeroCopySink, msg Message)
Types ¶
type Addr ¶
func (*Addr) Deserialization ¶
func (this *Addr) Deserialization(source *common.ZeroCopySource) error
func (Addr) Serialization ¶
func (this Addr) Serialization(sink *common.ZeroCopySink)
Serialize message payload
type AddrReq ¶
type AddrReq struct{}
func (*AddrReq) Deserialization ¶
func (this *AddrReq) Deserialization(source *common.ZeroCopySource) error
Deserialize message payload
func (AddrReq) Serialization ¶
func (this AddrReq) Serialization(sink *common.ZeroCopySink)
Serialize message payload
type BlkHeader ¶
func (*BlkHeader) Deserialization ¶
func (this *BlkHeader) Deserialization(source *common.ZeroCopySource) error
Deserialize message payload
func (BlkHeader) Serialization ¶
func (this BlkHeader) Serialization(sink *common.ZeroCopySink)
Serialize message payload
type Block ¶
func (*Block) Deserialization ¶
func (this *Block) Deserialization(source *common.ZeroCopySource) error
Deserialize message payload
func (*Block) Serialization ¶
func (this *Block) Serialization(sink *common.ZeroCopySink)
Serialize message payload
type BlocksReq ¶
func (*BlocksReq) Deserialization ¶
func (this *BlocksReq) Deserialization(source *comm.ZeroCopySource) error
Deserialize message payload
func (*BlocksReq) Serialization ¶
func (this *BlocksReq) Serialization(sink *comm.ZeroCopySink)
Serialize message payload
type Consensus ¶
type Consensus struct {
Cons ConsensusPayload
}
func (*Consensus) Deserialization ¶
func (this *Consensus) Deserialization(source *comm.ZeroCopySource) error
Deserialize message payload
func (*Consensus) Serialization ¶
func (this *Consensus) Serialization(sink *comm.ZeroCopySink)
Serialize message payload
type ConsensusPayload ¶
type ConsensusPayload struct { Version uint32 PrevHash common.Uint256 Height uint32 BookkeeperIndex uint16 Timestamp uint32 Data []byte Owner keypair.PublicKey Signature []byte PeerId common2.PeerId // contains filtered or unexported fields }
func (*ConsensusPayload) Deserialization ¶
func (this *ConsensusPayload) Deserialization(source *common.ZeroCopySource) error
Deserialize message payload
func (*ConsensusPayload) DeserializationUnsigned ¶
func (this *ConsensusPayload) DeserializationUnsigned(source *common.ZeroCopySource) error
func (*ConsensusPayload) GetMessage ¶
func (this *ConsensusPayload) GetMessage() []byte
func (*ConsensusPayload) Hash ¶
func (this *ConsensusPayload) Hash() common.Uint256
get the consensus payload hash
func (*ConsensusPayload) Serialization ¶
func (this *ConsensusPayload) Serialization(sink *common.ZeroCopySink)
func (*ConsensusPayload) SerializationUnsigned ¶
func (this *ConsensusPayload) SerializationUnsigned(sink *common.ZeroCopySink)
func (*ConsensusPayload) ToArray ¶
func (this *ConsensusPayload) ToArray() []byte
serialize the consensus payload
func (*ConsensusPayload) Verify ¶
func (this *ConsensusPayload) Verify() error
Check whether header is correct
type DataReq ¶
type DataReq struct { DataType common.InventoryType Hash common.Uint256 }
func (*DataReq) Deserialization ¶
func (this *DataReq) Deserialization(source *common.ZeroCopySource) error
Deserialize message payload
func (DataReq) Serialization ¶
func (this DataReq) Serialization(sink *common.ZeroCopySink)
Serialize message payload
type FindNodeReq ¶
func (*FindNodeReq) CmdType ¶
func (req *FindNodeReq) CmdType() string
CmdType return this message type
func (*FindNodeReq) Deserialization ¶
func (req *FindNodeReq) Deserialization(source *common.ZeroCopySource) error
Deserialization message payload
func (FindNodeReq) Serialization ¶
func (req FindNodeReq) Serialization(sink *common.ZeroCopySink)
Serialization message payload
type FindNodeResp ¶
type FindNodeResp struct { TargetID ncomm.PeerId Success bool Address string CloserPeers []ncomm.PeerIDAddressPair }
func (*FindNodeResp) CmdType ¶
func (resp *FindNodeResp) CmdType() string
CmdType return this message type
func (*FindNodeResp) Deserialization ¶
func (resp *FindNodeResp) Deserialization(source *common.ZeroCopySource) error
Deserialization message payload
func (FindNodeResp) Serialization ¶
func (resp FindNodeResp) Serialization(sink *common.ZeroCopySink)
Serialization message payload
type HeadersReq ¶
func (*HeadersReq) CmdType ¶
func (this *HeadersReq) CmdType() string
func (*HeadersReq) Deserialization ¶
func (this *HeadersReq) Deserialization(source *common.ZeroCopySource) error
Deserialize message payload
func (*HeadersReq) Serialization ¶
func (this *HeadersReq) Serialization(sink *common.ZeroCopySink)
Serialize message payload
type Inv ¶
type Inv struct {
P InvPayload
}
func (*Inv) Deserialization ¶
func (this *Inv) Deserialization(source *common.ZeroCopySource) error
Deserialize message payload
func (Inv) Serialization ¶
func (this Inv) Serialization(sink *common.ZeroCopySink)
Serialize message payload
type InvPayload ¶
type InvPayload struct { InvType common.InventoryType Blk []common.Uint256 }
type MemberInfo ¶
type Message ¶
type Message interface { Serialization(sink *comm.ZeroCopySink) Deserialization(source *comm.ZeroCopySource) error CmdType() string }
type MsgPayload ¶
type MsgPayload struct { Id common.PeerId //peer ID Addr string //link address PayloadSize uint32 //payload size Payload Message //msg payload }
MsgPayload in link channel
type NotFound ¶
func (*NotFound) Deserialization ¶
func (this *NotFound) Deserialization(source *common.ZeroCopySource) error
Deserialize message payload
func (NotFound) Serialization ¶
func (this NotFound) Serialization(sink *common.ZeroCopySink)
Serialize message payload
type Ping ¶
type Ping struct {
Height uint64
}
func (*Ping) Deserialization ¶
func (this *Ping) Deserialization(source *comm.ZeroCopySource) error
Deserialize message payload
func (Ping) Serialization ¶
func (this Ping) Serialization(sink *comm.ZeroCopySink)
Serialize message payload
type Pong ¶
type Pong struct {
Height uint64
}
func (*Pong) Deserialization ¶
func (this *Pong) Deserialization(source *comm.ZeroCopySource) error
Deserialize message payload
func (Pong) Serialization ¶
func (this Pong) Serialization(sink *comm.ZeroCopySink)
Serialize message payload
type RawBlockHeader ¶
func (*RawBlockHeader) CmdType ¶
func (this *RawBlockHeader) CmdType() string
func (*RawBlockHeader) Deserialization ¶
func (this *RawBlockHeader) Deserialization(source *common.ZeroCopySource) error
func (*RawBlockHeader) Serialization ¶
func (this *RawBlockHeader) Serialization(sink *common.ZeroCopySink)
type SubnetMembers ¶
type SubnetMembers struct {
Members []MemberInfo
}
func (*SubnetMembers) CmdType ¶
func (self *SubnetMembers) CmdType() string
func (*SubnetMembers) Deserialization ¶
func (self *SubnetMembers) Deserialization(source *comm.ZeroCopySource) error
Deserialize message payload
func (*SubnetMembers) Serialization ¶
func (self *SubnetMembers) Serialization(sink *comm.ZeroCopySink)
func (*SubnetMembers) String ¶
func (self *SubnetMembers) String() string
type SubnetMembersRequest ¶
type SubnetMembersRequest struct { From common.PeerId To common.PeerId Timestamp uint32 PubKey keypair.PublicKey // only valid if Timestamp != 0 Sig []byte }
func NewMembersRequest ¶
func NewMembersRequestFromSeed ¶
func NewMembersRequestFromSeed() *SubnetMembersRequest
func (*SubnetMembersRequest) CmdType ¶
func (self *SubnetMembersRequest) CmdType() string
func (*SubnetMembersRequest) Deserialization ¶
func (self *SubnetMembersRequest) Deserialization(source *comm.ZeroCopySource) (err error)
Deserialize message payload
func (*SubnetMembersRequest) FromSeed ¶
func (self *SubnetMembersRequest) FromSeed() bool
func (*SubnetMembersRequest) Serialization ¶
func (self *SubnetMembersRequest) Serialization(sink *comm.ZeroCopySink)
Serialize message payload
type Trn ¶
type Trn struct {
Txn *types.Transaction
}
Transaction message
func (*Trn) Deserialization ¶
func (this *Trn) Deserialization(source *comm.ZeroCopySource) error
Deserialize message payload
func (Trn) Serialization ¶
func (this Trn) Serialization(sink *comm.ZeroCopySink)
Serialize message payload
type UnknownMessage ¶
func (*UnknownMessage) CmdType ¶
func (self *UnknownMessage) CmdType() string
func (*UnknownMessage) Deserialization ¶
func (self *UnknownMessage) Deserialization(source *comm.ZeroCopySource) error
func (*UnknownMessage) Serialization ¶
func (self *UnknownMessage) Serialization(sink *comm.ZeroCopySink)
type UpdatePeerKeyId ¶
type UpdatePeerKeyId struct { //TODO remove this legecy field when upgrade network layer protocal KadKeyId *common.PeerKeyId }
func (*UpdatePeerKeyId) CmdType ¶
func (this *UpdatePeerKeyId) CmdType() string
func (*UpdatePeerKeyId) Deserialization ¶
func (this *UpdatePeerKeyId) Deserialization(source *common2.ZeroCopySource) error
func (*UpdatePeerKeyId) Serialization ¶
func (this *UpdatePeerKeyId) Serialization(sink *common2.ZeroCopySink)
Serialize message payload
type VerACK ¶
type VerACK struct {
// contains filtered or unexported fields
}
func (*VerACK) Deserialization ¶
func (this *VerACK) Deserialization(source *comm.ZeroCopySource) error
Deserialize message payload
func (*VerACK) Serialization ¶
func (this *VerACK) Serialization(sink *comm.ZeroCopySink)
Serialize message payload
type Version ¶
type Version struct {
P VersionPayload
}
func (*Version) Deserialization ¶
func (this *Version) Deserialization(source *comm.ZeroCopySource) error
Deserialize message payload
func (*Version) Serialization ¶
func (this *Version) Serialization(sink *comm.ZeroCopySink)
Serialize message payload