blocksync

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: Apache-2.0, MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BSOptBlocks   = 1 << 0
	BSOptMessages = 1 << 1
)
View Source
const BlockSyncProtocolID = "/fil/sync/blk/0.0.1"

Variables

This section is empty.

Functions

This section is empty.

Types

type BSOptions

type BSOptions struct {
	IncludeBlocks   bool
	IncludeMessages bool
}

func ParseBSOptions

func ParseBSOptions(optfield uint64) *BSOptions

type BSTipSet

type BSTipSet struct {
	Blocks []*types.BlockHeader

	BlsMessages    []*types.Message
	BlsMsgIncludes [][]uint64

	SecpkMessages    []*types.SignedMessage
	SecpkMsgIncludes [][]uint64
}

func (*BSTipSet) MarshalCBOR

func (t *BSTipSet) MarshalCBOR(w io.Writer) error

func (*BSTipSet) UnmarshalCBOR

func (t *BSTipSet) UnmarshalCBOR(r io.Reader) error

type BlockSync

type BlockSync struct {
	// contains filtered or unexported fields
}

func NewBlockSyncClient

func NewBlockSyncClient(bserv dtypes.ChainBlockService, h host.Host, pmgr peermgr.MaybePeerMgr) *BlockSync

func (*BlockSync) AddPeer

func (bs *BlockSync) AddPeer(p peer.ID)

func (*BlockSync) FetchMessagesByCids

func (bs *BlockSync) FetchMessagesByCids(ctx context.Context, cids []cid.Cid) ([]*types.Message, error)

func (*BlockSync) FetchSignedMessagesByCids

func (bs *BlockSync) FetchSignedMessagesByCids(ctx context.Context, cids []cid.Cid) ([]*types.SignedMessage, error)

func (*BlockSync) GetBlock

func (bs *BlockSync) GetBlock(ctx context.Context, c cid.Cid) (*types.BlockHeader, error)

func (*BlockSync) GetBlocks

func (bs *BlockSync) GetBlocks(ctx context.Context, tsk types.TipSetKey, count int) ([]*types.TipSet, error)

func (*BlockSync) GetChainMessages

func (bs *BlockSync) GetChainMessages(ctx context.Context, h *types.TipSet, count uint64) ([]*BSTipSet, error)

func (*BlockSync) GetFullTipSet

func (bs *BlockSync) GetFullTipSet(ctx context.Context, p peer.ID, tsk types.TipSetKey) (*store.FullTipSet, error)

func (*BlockSync) RemovePeer

func (bs *BlockSync) RemovePeer(p peer.ID)

type BlockSyncRequest

type BlockSyncRequest struct {
	Start         []cid.Cid
	RequestLength uint64

	Options uint64
}

func (*BlockSyncRequest) MarshalCBOR

func (t *BlockSyncRequest) MarshalCBOR(w io.Writer) error

func (*BlockSyncRequest) UnmarshalCBOR

func (t *BlockSyncRequest) UnmarshalCBOR(r io.Reader) error

type BlockSyncResponse

type BlockSyncResponse struct {
	Chain []*BSTipSet

	Status  uint64
	Message string
}

func (*BlockSyncResponse) MarshalCBOR

func (t *BlockSyncResponse) MarshalCBOR(w io.Writer) error

func (*BlockSyncResponse) UnmarshalCBOR

func (t *BlockSyncResponse) UnmarshalCBOR(r io.Reader) error

type BlockSyncService

type BlockSyncService struct {
	// contains filtered or unexported fields
}

func NewBlockSyncService

func NewBlockSyncService(cs *store.ChainStore) *BlockSyncService

func (*BlockSyncService) HandleStream

func (bss *BlockSyncService) HandleStream(s inet.Stream)

type NewStreamFunc

type NewStreamFunc func(context.Context, peer.ID, ...protocol.ID) (inet.Stream, error)

Jump to

Keyboard shortcuts

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