Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressAndTime ¶
AddressAndTime payload.
func NewAddressAndTime ¶
func NewAddressAndTime(e util.Endpoint, t time.Time) *AddressAndTime
NewAddressAndTime creates a new AddressAndTime object.
func (*AddressAndTime) DecodeBinary ¶
func (p *AddressAndTime) DecodeBinary(r io.Reader) error
DecodeBinary implements the Payload interface.
func (*AddressAndTime) EncodeBinary ¶
func (p *AddressAndTime) EncodeBinary(w io.Writer) error
EncodeBinary implements the Payload interface.
type AddressList ¶
type AddressList struct {
Addrs []*AddressAndTime
}
AddressList is a list with AddrAndTime.
func (*AddressList) DecodeBinary ¶
func (p *AddressList) DecodeBinary(r io.Reader) error
DecodeBinary implements the Payload interface.
func (*AddressList) EncodeBinary ¶
func (p *AddressList) EncodeBinary(w io.Writer) error
EncodeBinary implements the Payload interface.
type GetBlocks ¶
type GetBlocks struct { // hash of latest block that node requests HashStart []util.Uint256 // hash of last block that node requests HashStop util.Uint256 }
GetBlocks contains fields and methods to be shared with the
func NewGetBlocks ¶
NewGetBlocks return a pointer to a GetBlocks object.
func (*GetBlocks) DecodeBinary ¶
DecodeBinary implements the payload interface.
func (*GetBlocks) EncodeBinary ¶
EncodeBinary implements the payload interface.
type Headers ¶
Headers payload
func (*Headers) DecodeBinary ¶
DecodeBinary implements the Payload interface.
type Inventory ¶
type Inventory struct { // Type if the object hash. Type InventoryType // A list of hashes. Hashes []util.Uint256 }
Inventory payload
func NewInventory ¶
func NewInventory(typ InventoryType, hashes []util.Uint256) *Inventory
NewInventory return a pointer to an Inventory.
func (*Inventory) DecodeBinary ¶
DecodeBinary implements the Payload interface.
type InventoryType ¶
type InventoryType uint8
InventoryType is the type of an object in the Inventory message.
const ( TXType InventoryType = 0x01 // 1 BlockType InventoryType = 0x02 // 2 ConsensusType InventoryType = 0xe0 // 224 )
List of valid InventoryTypes.
func (InventoryType) String ¶
func (i InventoryType) String() string
String implements the Stringer interface.
func (InventoryType) Valid ¶
func (i InventoryType) Valid() bool
Valid returns true if the inventory (type) is known.
type MerkleBlock ¶
func (*MerkleBlock) DecodeBinary ¶
func (m *MerkleBlock) DecodeBinary(r io.Reader) error
func (*MerkleBlock) EncodeBinary ¶
func (m *MerkleBlock) EncodeBinary(w io.Writer) error
type Version ¶
type Version struct { // currently the version of the protocol is 0 Version uint32 // currently 1 Services uint64 // timestamp Timestamp uint32 // port this server is listening on Port uint16 // it's used to distinguish the node from public IP Nonce uint32 // client id UserAgent []byte // Height of the block chain StartHeight uint32 // Whether to receive and forward Relay bool }
Version payload.
func NewVersion ¶
NewVersion returns a pointer to a Version payload.
func (*Version) DecodeBinary ¶
DecodeBinary implements the Payload interface.
func (*Version) EncodeBinary ¶
EncodeBinary implements the Payload interface.