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 OfflineWitnessMsg
- func (self *OfflineWitnessMsg) AddProposeSig(acct *account.Account) error
- func (this *OfflineWitnessMsg) CmdType() string
- func (self *OfflineWitnessMsg) Deserialization(source *common.ZeroCopySource) (err error)
- func (self *OfflineWitnessMsg) Hash() common.Uint256
- func (self *OfflineWitnessMsg) Serialization(sink *common.ZeroCopySink)
- func (self *OfflineWitnessMsg) VerifySigs() error
- func (self *OfflineWitnessMsg) VoteFor(acct *account.Account, index []uint8) error
- type Ping
- type Pong
- type RawBlockHeader
- type SubnetMembers
- type SubnetMembersRequest
- func (self *SubnetMembersRequest) CmdType() string
- func (self *SubnetMembersRequest) Deserialization(source *comm.ZeroCopySource) (err error)
- func (self *SubnetMembersRequest) FromSeed() bool
- func (self *SubnetMembersRequest) Role() string
- func (self *SubnetMembersRequest) Serialization(sink *comm.ZeroCopySink)
- type Trn
- type UnknownMessage
- type UpdatePeerKeyId
- type VerACK
- type Version
- type VersionPayload
- type VoterMsg
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 ¶ added in v1.0.3
func (this *ConsensusPayload) Deserialization(source *common.ZeroCopySource) error
Deserialize message payload
func (*ConsensusPayload) DeserializationUnsigned ¶ added in v1.8.1
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 ¶ added in v1.0.3
func (this *ConsensusPayload) Serialization(sink *common.ZeroCopySink)
func (*ConsensusPayload) SerializationUnsigned ¶ added in v1.8.1
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 ¶ added in v1.10.0
func (*FindNodeReq) CmdType ¶ added in v1.10.0
func (req *FindNodeReq) CmdType() string
CmdType return this message type
func (*FindNodeReq) Deserialization ¶ added in v1.10.0
func (req *FindNodeReq) Deserialization(source *common.ZeroCopySource) error
Deserialization message payload
func (FindNodeReq) Serialization ¶ added in v1.10.0
func (req FindNodeReq) Serialization(sink *common.ZeroCopySink)
Serialization message payload
type FindNodeResp ¶ added in v1.10.0
type FindNodeResp struct { TargetID ncomm.PeerId Success bool Address string CloserPeers []ncomm.PeerIDAddressPair }
func (*FindNodeResp) CmdType ¶ added in v1.10.0
func (resp *FindNodeResp) CmdType() string
CmdType return this message type
func (*FindNodeResp) Deserialization ¶ added in v1.10.0
func (resp *FindNodeResp) Deserialization(source *common.ZeroCopySource) error
Deserialization message payload
func (FindNodeResp) Serialization ¶ added in v1.10.0
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 ¶ added in v1.11.0
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 OfflineWitnessMsg ¶ added in v1.14.1
type OfflineWitnessMsg struct { Timestamp uint32 `json:"timestamp"` View uint32 `json:"view"` NodePubKeys []string `json:"nodePubKeys"` Proposer string `json:"proposer"` ProposerSig []byte `json:"proposerSig"` Voters []VoterMsg `json:"voters"` }
func (*OfflineWitnessMsg) AddProposeSig ¶ added in v1.14.1
func (self *OfflineWitnessMsg) AddProposeSig(acct *account.Account) error
func (*OfflineWitnessMsg) CmdType ¶ added in v1.14.1
func (this *OfflineWitnessMsg) CmdType() string
func (*OfflineWitnessMsg) Deserialization ¶ added in v1.14.1
func (self *OfflineWitnessMsg) Deserialization(source *common.ZeroCopySource) (err error)
func (*OfflineWitnessMsg) Hash ¶ added in v1.14.1
func (self *OfflineWitnessMsg) Hash() common.Uint256
func (*OfflineWitnessMsg) Serialization ¶ added in v1.14.1
func (self *OfflineWitnessMsg) Serialization(sink *common.ZeroCopySink)
func (*OfflineWitnessMsg) VerifySigs ¶ added in v1.14.1
func (self *OfflineWitnessMsg) VerifySigs() error
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 ¶ added in v1.6.2
func (*RawBlockHeader) CmdType ¶ added in v1.6.2
func (this *RawBlockHeader) CmdType() string
func (*RawBlockHeader) Deserialization ¶ added in v1.6.2
func (this *RawBlockHeader) Deserialization(source *common.ZeroCopySource) error
func (*RawBlockHeader) Serialization ¶ added in v1.6.2
func (this *RawBlockHeader) Serialization(sink *common.ZeroCopySink)
type SubnetMembers ¶ added in v1.11.0
type SubnetMembers struct {
Members []MemberInfo
}
func (*SubnetMembers) CmdType ¶ added in v1.11.0
func (self *SubnetMembers) CmdType() string
func (*SubnetMembers) Deserialization ¶ added in v1.11.0
func (self *SubnetMembers) Deserialization(source *comm.ZeroCopySource) error
Deserialize message payload
func (*SubnetMembers) Serialization ¶ added in v1.11.0
func (self *SubnetMembers) Serialization(sink *comm.ZeroCopySink)
func (*SubnetMembers) String ¶ added in v1.11.0
func (self *SubnetMembers) String() string
type SubnetMembersRequest ¶ added in v1.11.0
type SubnetMembersRequest struct { From common.PeerId To common.PeerId Timestamp uint32 PubKey keypair.PublicKey // only valid if Timestamp != 0 Sig []byte }
func NewMembersRequest ¶ added in v1.11.0
func NewMembersRequestFromSeed ¶ added in v1.11.0
func NewMembersRequestFromSeed() *SubnetMembersRequest
func (*SubnetMembersRequest) CmdType ¶ added in v1.11.0
func (self *SubnetMembersRequest) CmdType() string
func (*SubnetMembersRequest) Deserialization ¶ added in v1.11.0
func (self *SubnetMembersRequest) Deserialization(source *comm.ZeroCopySource) (err error)
Deserialize message payload
func (*SubnetMembersRequest) FromSeed ¶ added in v1.11.0
func (self *SubnetMembersRequest) FromSeed() bool
func (*SubnetMembersRequest) Role ¶ added in v1.12.0
func (self *SubnetMembersRequest) Role() string
func (*SubnetMembersRequest) Serialization ¶ added in v1.11.0
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 ¶ added in v1.11.0
func (*UnknownMessage) CmdType ¶ added in v1.11.0
func (self *UnknownMessage) CmdType() string
func (*UnknownMessage) Deserialization ¶ added in v1.11.0
func (self *UnknownMessage) Deserialization(source *comm.ZeroCopySource) error
func (*UnknownMessage) Serialization ¶ added in v1.11.0
func (self *UnknownMessage) Serialization(sink *comm.ZeroCopySink)
type UpdatePeerKeyId ¶ added in v1.10.0
type UpdatePeerKeyId struct { //TODO remove this legecy field when upgrade network layer protocal KadKeyId *common.PeerKeyId }
func (*UpdatePeerKeyId) CmdType ¶ added in v1.10.0
func (this *UpdatePeerKeyId) CmdType() string
func (*UpdatePeerKeyId) Deserialization ¶ added in v1.10.0
func (this *UpdatePeerKeyId) Deserialization(source *common2.ZeroCopySource) error
func (*UpdatePeerKeyId) Serialization ¶ added in v1.10.0
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