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) Deserialize(r io.Reader) error
- func (this *ConsensusPayload) DeserializeUnsigned(r io.Reader) error
- func (this *ConsensusPayload) GetMessage() []byte
- func (this *ConsensusPayload) Hash() common.Uint256
- func (this *ConsensusPayload) InventoryType() common.InventoryType
- func (this *ConsensusPayload) Serialization(sink *common.ZeroCopySink)
- func (this *ConsensusPayload) Serialize(w io.Writer) error
- func (this *ConsensusPayload) SerializeUnsigned(w io.Writer) error
- func (this *ConsensusPayload) ToArray() []byte
- func (this *ConsensusPayload) Type() common.InventoryType
- func (this *ConsensusPayload) Verify() error
- type DataReq
- type Disconnected
- type HeadersReq
- type Inv
- type InvPayload
- type Message
- type MsgPayload
- type NotFound
- type Ping
- type Pong
- type RawBlockHeader
- type Trn
- 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 uint64 // contains filtered or unexported fields }
func (*ConsensusPayload) Deserialization ¶
func (this *ConsensusPayload) Deserialization(source *common.ZeroCopySource) error
Deserialize message payload
func (*ConsensusPayload) Deserialize ¶
func (this *ConsensusPayload) Deserialize(r io.Reader) error
Deserialize message payload
func (*ConsensusPayload) DeserializeUnsigned ¶
func (this *ConsensusPayload) DeserializeUnsigned(r io.Reader) error
Deserialize message payload
func (*ConsensusPayload) GetMessage ¶
func (this *ConsensusPayload) GetMessage() []byte
func (*ConsensusPayload) Hash ¶
func (this *ConsensusPayload) Hash() common.Uint256
get the consensus payload hash
func (*ConsensusPayload) InventoryType ¶
func (this *ConsensusPayload) InventoryType() common.InventoryType
return inventory type
func (*ConsensusPayload) Serialization ¶
func (this *ConsensusPayload) Serialization(sink *common.ZeroCopySink)
func (*ConsensusPayload) Serialize ¶
func (this *ConsensusPayload) Serialize(w io.Writer) error
Serialize message payload
func (*ConsensusPayload) SerializeUnsigned ¶
func (this *ConsensusPayload) SerializeUnsigned(w io.Writer) error
Serialize message payload
func (*ConsensusPayload) ToArray ¶
func (this *ConsensusPayload) ToArray() []byte
serialize the consensus payload
func (*ConsensusPayload) Type ¶
func (this *ConsensusPayload) Type() common.InventoryType
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 Disconnected ¶
type Disconnected struct{}
func (Disconnected) CmdType ¶
func (this Disconnected) CmdType() string
func (*Disconnected) Deserialization ¶
func (this *Disconnected) Deserialization(source *comm.ZeroCopySource) error
Deserialize message payload
func (Disconnected) Serialization ¶
func (this Disconnected) Serialization(sink *comm.ZeroCopySink)
Serialize 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 Message ¶
type Message interface { Serialization(sink *comm.ZeroCopySink) Deserialization(source *comm.ZeroCopySource) error CmdType() string }
func MakeEmptyMessage ¶
type MsgPayload ¶
type MsgPayload struct { Id uint64 //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 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 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