Documentation ¶
Index ¶
- Constants
- func GetBlockByID(ctx context.Context, rpc RPC, id workshare.Bytes32) (rlp.RawValue, error)
- func GetBlockIDByNumber(ctx context.Context, rpc RPC, num uint32) (workshare.Bytes32, error)
- func GetBlocksFromNumber(ctx context.Context, rpc RPC, num uint32) ([]rlp.RawValue, error)
- func GetTxs(ctx context.Context, rpc RPC) (tx.Transactions, error)
- func MsgName(msgCode uint64) string
- func NotifyNewBlock(ctx context.Context, rpc RPC, block *block.Block) error
- func NotifyNewBlockID(ctx context.Context, rpc RPC, id workshare.Bytes32) error
- func NotifyNewTx(ctx context.Context, rpc RPC, tx *tx.Transaction) error
- type RPC
- type Status
Constants ¶
View Source
const ( Name = "workshare" Version uint = 1 Length uint64 = 8 MaxMsgSize = 10 * 1024 * 1024 )
Constants
View Source
const ( MsgGetStatus = iota MsgNewBlockID MsgNewBlock MsgNewTx MsgGetBlockByID MsgGetBlockIDByNumber MsgGetBlocksFromNumber // fetch blocks from given number (including given number) MsgGetTxs )
Protocol messages of workshare
Variables ¶
This section is empty.
Functions ¶
func GetBlockByID ¶
GetBlockByID query block from remote peer by given block ID. It may return nil block even no error.
func GetBlockIDByNumber ¶
GetBlockIDByNumber query block ID from remote peer by given number.
func GetBlocksFromNumber ¶
GetBlocksFromNumber get a batch of blocks starts with num from remote peer.
func NotifyNewBlock ¶
NotifyNewBlock notify new block to remote peer.
func NotifyNewBlockID ¶
NotifyNewBlockID notify new block ID to remote peer.
func NotifyNewTx ¶
NotifyNewTx notify new tx to remote peer.
Types ¶
Click to show internal directories.
Click to hide internal directories.