Documentation ¶
Index ¶
- Constants
- Variables
- func GetHeadersFromHash(startHash common.Uint256, stopHash common.Uint256) ([]types.Header, uint32, error)
- func HandleNodeMsg(node protocol.Noder, buf []byte, len int) error
- func LocateMsgHdr(buf []byte) []byte
- func MsgType(buf []byte) (string, error)
- func NewAddrs(nodeaddrs []protocol.NodeAddr, count uint64) ([]byte, error)
- func NewBlock(bk *types.Block) ([]byte, error)
- func NewBlockFromHash(hash common.Uint256) (*types.Block, error)
- func NewBlocksReq(n protocol.Noder) ([]byte, error)
- func NewConsensus(cp *ConsensusPayload) ([]byte, error)
- func NewHeaders(headers []types.Header, count uint32) ([]byte, error)
- func NewHeadersReq() ([]byte, error)
- func NewInv(inv *InvPayload) ([]byte, error)
- func NewMsg(t string, n protocol.Noder) ([]byte, error)
- func NewNotFound(hash common.Uint256) ([]byte, error)
- func NewPingMsg() ([]byte, error)
- func NewPongMsg() ([]byte, error)
- func NewTxn(txn *types.Transaction) ([]byte, error)
- func NewTxnFromHash(hash common.Uint256) (*types.Transaction, error)
- func NewVerack() ([]byte, error)
- func NewVersion(n protocol.Noder) ([]byte, error)
- func PayloadLen(buf []byte) int
- func ReqBlkData(node protocol.Noder, hash common.Uint256) error
- func SendMsgSyncHeaders(node protocol.Noder)
- func ValidMsgHdr(buf []byte) bool
- type ConsensusPayload
- func (cp *ConsensusPayload) Deserialize(r io.Reader) error
- func (cp *ConsensusPayload) DeserializeUnsigned(r io.Reader) error
- func (cp *ConsensusPayload) GetMessage() []byte
- func (cp *ConsensusPayload) Hash() common.Uint256
- func (cp *ConsensusPayload) InvertoryType() common.InventoryType
- func (cp *ConsensusPayload) Serialize(w io.Writer) error
- func (cp *ConsensusPayload) SerializeUnsigned(w io.Writer) error
- func (cp *ConsensusPayload) ToArray() []byte
- func (cp *ConsensusPayload) Type() common.InventoryType
- func (cp *ConsensusPayload) Verify() error
- type Inv
- type InvPayload
- type Messager
Constants ¶
View Source
const (
HTTP_INFO_FLAG = 0
)
Variables ¶
View Source
var LastInvHash common.Uint256
Functions ¶
func GetHeadersFromHash ¶
func LocateMsgHdr ¶
func NewConsensus ¶
func NewConsensus(cp *ConsensusPayload) ([]byte, error)
func NewHeadersReq ¶
func NewInv ¶
func NewInv(inv *InvPayload) ([]byte, error)
func NewPingMsg ¶
func NewPongMsg ¶
func NewTxnFromHash ¶
func NewTxnFromHash(hash common.Uint256) (*types.Transaction, error)
func PayloadLen ¶
func SendMsgSyncHeaders ¶
func ValidMsgHdr ¶
Types ¶
type ConsensusPayload ¶
type ConsensusPayload struct { Version uint32 PrevHash common.Uint256 Height uint32 BookkeeperIndex uint16 Timestamp uint32 Data []byte Owner keypair.PublicKey Signature []byte // contains filtered or unexported fields }
func (*ConsensusPayload) Deserialize ¶
func (cp *ConsensusPayload) Deserialize(r io.Reader) error
func (*ConsensusPayload) DeserializeUnsigned ¶
func (cp *ConsensusPayload) DeserializeUnsigned(r io.Reader) error
func (*ConsensusPayload) GetMessage ¶
func (cp *ConsensusPayload) GetMessage() []byte
func (*ConsensusPayload) Hash ¶
func (cp *ConsensusPayload) Hash() common.Uint256
func (*ConsensusPayload) InvertoryType ¶
func (cp *ConsensusPayload) InvertoryType() common.InventoryType
func (*ConsensusPayload) SerializeUnsigned ¶
func (cp *ConsensusPayload) SerializeUnsigned(w io.Writer) error
func (*ConsensusPayload) ToArray ¶
func (cp *ConsensusPayload) ToArray() []byte
func (*ConsensusPayload) Type ¶
func (cp *ConsensusPayload) Type() common.InventoryType
func (*ConsensusPayload) Verify ¶
func (cp *ConsensusPayload) Verify() error
type Inv ¶
type Inv struct { Hdr msgHdr P InvPayload }
func (*Inv) Deserialization ¶
func (Inv) Serialization ¶
type InvPayload ¶
type InvPayload struct { InvType common.InventoryType Cnt uint32 Blk []byte }
func GetInvFromBlockHash ¶
func NewInvPayload ¶
func NewInvPayload(invType common.InventoryType, count uint32, msg []byte) *InvPayload
func (*InvPayload) Serialization ¶
func (msg *InvPayload) Serialization(w io.Writer)
Click to show internal directories.
Click to hide internal directories.