Documentation ¶
Index ¶
- Constants
- func GetHeadersFromHash(startHash Uint256, stopHash Uint256) ([]ledger.Header, uint32, error)
- func HandleNodeMsg(node Noder, buf []byte) error
- func MsgType(buf []byte) (string, error)
- func NewBlock(bk *ledger.Block) ([]byte, error)
- func NewBlockFromHash(hash common.Uint256) (*ledger.Block, error)
- func NewHeaders(headers []ledger.Header, count uint32) ([]byte, error)
- func NewHeadersReq(stopHash Uint256) ([]byte, error)
- func NewIsingConsensus(pld *IsingPayload) ([]byte, error)
- func NewNotFound(hash common.Uint256) ([]byte, error)
- func NewTxn(txn *transaction.Transaction) ([]byte, error)
- func NewTxnFromHash(hash common.Uint256) (*transaction.Transaction, error)
- func PayloadLen(buf []byte) int
- func ReqBlkData(node Noder, hash common.Uint256) error
- func SendMsgSyncHeaders(node Noder, stopHash Uint256)
- func ValidMsgHdr(buf []byte) bool
- type IsingMessage
- type IsingPayload
- type Messenger
- type NotifyInfo
- type RelayMessage
- type RelayPacket
Constants ¶
View Source
const ( MsgHdrLen = 24 MsgCmdLen = 12 MsgCmdOffset = 4 MsgChecksumLen = 4 NetID = 0x00000000 MaxHdrCnt = 500 MaxInvHdrCnt = 500 HashLen = 32 )
Variables ¶
This section is empty.
Functions ¶
func GetHeadersFromHash ¶
func HandleNodeMsg ¶
func NewHeadersReq ¶
func NewIsingConsensus ¶
func NewIsingConsensus(pld *IsingPayload) ([]byte, error)
func NewTxn ¶
func NewTxn(txn *transaction.Transaction) ([]byte, error)
func NewTxnFromHash ¶
func NewTxnFromHash(hash common.Uint256) (*transaction.Transaction, error)
func PayloadLen ¶
func ReqBlkData ¶
func SendMsgSyncHeaders ¶
func SendMsgSyncHeaders(node Noder, stopHash Uint256)
func ValidMsgHdr ¶
Types ¶
type IsingMessage ¶
type IsingMessage struct {
// contains filtered or unexported fields
}
func (*IsingMessage) Deserialize ¶
func (p *IsingMessage) Deserialize(r io.Reader) error
func (IsingMessage) Handle ¶
func (msg IsingMessage) Handle(node Noder) error
type IsingPayload ¶
func (*IsingPayload) DataHash ¶
func (p *IsingPayload) DataHash() ([]byte, error)
func (*IsingPayload) Deserialize ¶
func (p *IsingPayload) Deserialize(r io.Reader) error
func (*IsingPayload) DeserializeUnsigned ¶
func (p *IsingPayload) DeserializeUnsigned(r io.Reader) error
func (*IsingPayload) SerializeUnsigned ¶
func (p *IsingPayload) SerializeUnsigned(w io.Writer) error
type Messenger ¶
type Messenger interface { Verify([]byte) error Handle(Noder) error serialization.SerializableData }
type NotifyInfo ¶
type NotifyInfo struct { Payload *IsingPayload SenderID uint64 }
type RelayMessage ¶
type RelayMessage struct { Packet RelayPacket // contains filtered or unexported fields }
func NewRelayMessage ¶
func NewRelayMessage(packet *RelayPacket) (*RelayMessage, error)
func (*RelayMessage) Deserialize ¶
func (msg *RelayMessage) Deserialize(r io.Reader) error
func (*RelayMessage) ToBytes ¶
func (msg *RelayMessage) ToBytes() ([]byte, error)
type RelayPacket ¶
type RelayPacket struct { SrcAddr string DestID []byte Payload []byte SigChain *por.SigChain MaxHoldingSeconds uint32 }
func NewRelayPacket ¶
func (*RelayPacket) Deserialize ¶
func (packet *RelayPacket) Deserialize(r io.Reader) error
Click to show internal directories.
Click to hide internal directories.