protos

package
v1.5.0-beta2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PullTypeSegment = iota
	PullTypeBackward
	PullTypeForward
	PullTypeBatch
)
View Source
const (
	PovReasonFetch = iota
	PovReasonSync
)
View Source
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

func BulkPushBlockToProto(bp *BulkPush) ([]byte, error)

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(frs *FrontierResponse) ([]byte, error)

ToProto converts domain FrontierResponse into proto FrontierResponse

func MessageAckToProto added in v1.3.0

func MessageAckToProto(messageAck *MessageAckPacket) ([]byte, error)

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 PovStatusToProto(status *PovStatus) ([]byte, error)

func PublishBlockToProto

func PublishBlockToProto(publish *PublishBlock) ([]byte, error)

ToProto converts domain PublishBlock into proto PublishBlock

Types

type Bulk

type Bulk struct {
	StartHash types.Hash
	EndHash   types.Hash
}

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 {
	PullType uint32
	Blocks   types.StateBlockList
}

func BulkPullRspPacketFromProto

func BulkPullRspPacketFromProto(data []byte) (*BulkPullRspPacket, error)

BulkPullPacketFromProto parse the data into BulkPull message

type BulkPush

type BulkPush struct {
	Blocks types.StateBlockList
}

func BulkPushBlockFromProto

func BulkPushBlockFromProto(data []byte) (*BulkPush, error)

BulkPushBlockFromProto parse the data into BulkPush message

type ConfirmAckBlock

type ConfirmAckBlock struct {
	Account   types.Address
	Signature types.Signature
	Sequence  uint32
	Hash      []types.Hash
}

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

type FrontierReq struct {
	StartAddress types.Address
	Age          uint32
	Count        uint32
}

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

type FrontierResponse struct {
	Fs []*types.FrontierBlock
}

func FrontierResponseFromProto

func FrontierResponseFromProto(data []byte) (*FrontierResponse, error)

FrontierResponseFromProto parse the data into frontier message

type MessageAckPacket added in v1.3.0

type MessageAckPacket struct {
	MessageHash types.Hash
}

func MessageAckFromProto added in v1.3.0

func MessageAckFromProto(data []byte) (*MessageAckPacket, error)

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

type PovBulkPullRsp struct {
	Count  uint32
	Reason uint32
	Blocks types.PovBlocks
}

func PovBulkPullRspFromProto added in v1.2.3

func PovBulkPullRspFromProto(data []byte) (*PovBulkPullRsp, error)

type PovPublishBlock added in v1.2.3

type PovPublishBlock struct {
	Blk *types.PovBlock
}

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

func PovStatusFromProto(data []byte) (*PovStatus, error)

type PublishBlock

type PublishBlock struct {
	Blk *types.StateBlock
}

func PublishBlockFromProto

func PublishBlockFromProto(data []byte) (*PublishBlock, error)

PublishBlockFromProto parse the data into PublishBlock message

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL