Documentation ¶
Index ¶
- Constants
- func BulkPullReqPacketToProto(bp *BulkPullReqPacket) ([]byte, error)
- func BulkPullRspPacketToProto(bp *BulkPullRspPacket) ([]byte, error)
- func BulkPushBlockToProto(bp *BulkPush) ([]byte, error)
- func ConfirmAckBlockToProto(confirmAck *ConfirmAckBlock) ([]byte, error)
- func ConfirmReqBlockToProto(confirmReq *ConfirmReqBlock) ([]byte, error)
- func FrontierReqToProto(fr *FrontierReq) ([]byte, error)
- func FrontierResponseToProto(fr *FrontierResponse) ([]byte, error)
- func PovBulkPullReqToProto(req *PovBulkPullReq) ([]byte, error)
- func PovBulkPullRspToProto(rsp *PovBulkPullRsp) ([]byte, error)
- func PovPublishBlockToProto(publish *PovPublishBlock) ([]byte, error)
- func PovStatusToProto(status *PovStatus) ([]byte, error)
- func PublishBlockToProto(publish *PublishBlock) ([]byte, error)
- type Bulk
- type BulkPullReqPacket
- type BulkPullRspPacket
- type BulkPush
- type ConfirmAckBlock
- type ConfirmReqBlock
- type FrontierReq
- type FrontierResponse
- type PovBulkPullReq
- type PovBulkPullRsp
- type PovPublishBlock
- type PovStatus
- type PublishBlock
Constants ¶
const ( PullTypeSegment = iota PullTypeBackward PullTypeForward PullTypeBatch )
const ( PovReasonFetch = iota PovReasonSync )
const ( PovPullTypeForward = iota PovPullTypeBackward PovPullTypeBatch )
Variables ¶
This section is empty.
Functions ¶
func BulkPullReqPacketToProto ¶
func BulkPullReqPacketToProto(bp *BulkPullReqPacket) ([]byte, error)
ToProto converts domain BulkPull into proto BulkPull
func BulkPullRspPacketToProto ¶
func BulkPullRspPacketToProto(bp *BulkPullRspPacket) ([]byte, error)
ToProto converts domain BulkPull into proto BulkPull
func BulkPushBlockToProto ¶
ToProto converts domain BulkPush into proto BulkPush
func ConfirmAckBlockToProto ¶
func ConfirmAckBlockToProto(confirmAck *ConfirmAckBlock) ([]byte, error)
ToProto converts domain ConfirmAckBlock into proto ConfirmAckBlock
func ConfirmReqBlockToProto ¶
func ConfirmReqBlockToProto(confirmReq *ConfirmReqBlock) ([]byte, error)
ToProto converts domain ConfirmReqBlock into proto ConfirmReqBlock
func FrontierReqToProto ¶
func FrontierReqToProto(fr *FrontierReq) ([]byte, error)
ToProto converts domain frontier into proto frontier
func FrontierResponseToProto ¶
func FrontierResponseToProto(fr *FrontierResponse) ([]byte, error)
ToProto converts domain FrontierResponse into proto FrontierResponse
func PovBulkPullReqToProto ¶ added in v1.2.3
func PovBulkPullReqToProto(req *PovBulkPullReq) ([]byte, error)
func PovBulkPullRspToProto ¶ added in v1.2.3
func PovBulkPullRspToProto(rsp *PovBulkPullRsp) ([]byte, error)
func PovPublishBlockToProto ¶ added in v1.2.3
func PovPublishBlockToProto(publish *PovPublishBlock) ([]byte, error)
func PovStatusToProto ¶ added in v1.2.3
func PublishBlockToProto ¶
func PublishBlockToProto(publish *PublishBlock) ([]byte, error)
ToProto converts domain PublishBlock into proto PublishBlock
Types ¶
type BulkPullReqPacket ¶
type BulkPullReqPacket struct { StartHash types.Hash EndHash types.Hash PullType uint32 Count uint32 Hashes []*types.Hash }
func BulkPullReqPacketFromProto ¶
func BulkPullReqPacketFromProto(data []byte) (*BulkPullReqPacket, error)
BulkPullPacketFromProto parse the data into BulkPull message
func NewBulkPullReqPacket ¶
func NewBulkPullReqPacket(start, end types.Hash) (packet *BulkPullReqPacket)
type BulkPullRspPacket ¶
type BulkPullRspPacket struct { Blk *types.StateBlock Blocks types.StateBlockList }
func BulkPullRspPacketFromProto ¶
func BulkPullRspPacketFromProto(data []byte) (*BulkPullRspPacket, error)
BulkPullPacketFromProto parse the data into BulkPull message
type BulkPush ¶
type BulkPush struct {
Blk *types.StateBlock
}
func BulkPushBlockFromProto ¶
BulkPushBlockFromProto parse the data into BulkPush message
type ConfirmAckBlock ¶
type ConfirmAckBlock struct { Account types.Address Signature types.Signature Sequence uint32 Blk *types.StateBlock }
func ConfirmAckBlockFromProto ¶
func ConfirmAckBlockFromProto(data []byte) (*ConfirmAckBlock, error)
ConfirmAckBlockFromProto parse the data into ConfirmAckBlock message
type ConfirmReqBlock ¶
type ConfirmReqBlock struct {
Blk *types.StateBlock
}
func ConfirmReqBlockFromProto ¶
func ConfirmReqBlockFromProto(data []byte) (*ConfirmReqBlock, error)
ConfirmReqBlockFromProto parse the data into ConfirmReqBlock message
type FrontierReq ¶
func FrontierReqFromProto ¶
func FrontierReqFromProto(data []byte) (*FrontierReq, error)
FrontierReqFromProto parse the data into frontier message
func NewFrontierReq ¶
func NewFrontierReq(addr types.Address, Age, Count uint32) (packet *FrontierReq)
type FrontierResponse ¶
func FrontierResponseFromProto ¶
func FrontierResponseFromProto(data []byte) (*FrontierResponse, error)
FrontierResponseFromProto parse the data into frontier message
func NewFrontierRsp ¶
func NewFrontierRsp(fr *types.Frontier, num uint32) (packet *FrontierResponse)
type PovBulkPullReq ¶ added in v1.2.3
type PovBulkPullReq struct { StartHash types.Hash StartHeight uint64 Count uint32 PullType uint32 Reason uint32 Locators []*types.Hash }
func PovBulkPullReqFromProto ¶ added in v1.2.3
func PovBulkPullReqFromProto(data []byte) (*PovBulkPullReq, error)
type PovBulkPullRsp ¶ added in v1.2.3
func PovBulkPullRspFromProto ¶ added in v1.2.3
func PovBulkPullRspFromProto(data []byte) (*PovBulkPullRsp, error)
type PovPublishBlock ¶ added in v1.2.3
func PovPublishBlockFromProto ¶ added in v1.2.3
func PovPublishBlockFromProto(data []byte) (*PovPublishBlock, error)
type PovStatus ¶ added in v1.2.3
type PovStatus struct { CurrentHeight uint64 CurrentTD []byte CurrentHash types.Hash GenesisHash types.Hash Timestamp int64 }
func PovStatusFromProto ¶ added in v1.2.3
type PublishBlock ¶
type PublishBlock struct {
Blk *types.StateBlock
}
func PublishBlockFromProto ¶
func PublishBlockFromProto(data []byte) (*PublishBlock, error)
PublishBlockFromProto parse the data into PublishBlock message