hub

package
v0.0.2-0...-bcc9fc4 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockstreamServer

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

func (*BlockstreamServer) Blocks

func (*BlockstreamServer) Close

func (s *BlockstreamServer) Close()

func (*BlockstreamServer) GetHeadInfo

func (*BlockstreamServer) Launch

func (s *BlockstreamServer) Launch(serverAddr string)

type ForkableHub

type ForkableHub struct {
	*shutter.Shutter

	Ready chan struct{}
	// contains filtered or unexported fields
}

ForkableHub gives you block Sources for blocks close to head it keeps reversible segment in a Forkable it keeps small final segment in a buffer

func NewForkableHub

func NewForkableHub(liveSourceFactory bstream.SourceFactory, keepFinalBlocks int, oneBlocksStore dstore.Store, extraForkableOptions ...forkable.Option) *ForkableHub

func (*ForkableHub) GetBlock

func (h *ForkableHub) GetBlock(num uint64, id string) (out *pbbstream.Block)

func (*ForkableHub) GetBlockByHash

func (h *ForkableHub) GetBlockByHash(id string) (out *pbbstream.Block)

func (*ForkableHub) HeadInfo

func (h *ForkableHub) HeadInfo() (headNum uint64, headID string, headTime time.Time, libNum uint64, err error)

func (*ForkableHub) HeadNum

func (h *ForkableHub) HeadNum() uint64

func (*ForkableHub) IsReady

func (h *ForkableHub) IsReady() bool

func (*ForkableHub) LowestBlockNum

func (h *ForkableHub) LowestBlockNum() uint64

func (*ForkableHub) MatchSuffix

func (h *ForkableHub) MatchSuffix(req string) bool

func (*ForkableHub) NewBlockstreamServer

func (h *ForkableHub) NewBlockstreamServer(dgrpcServer ggrpcserver.Server) *BlockstreamServer

implementation of blockstream.Server from the hub

func (*ForkableHub) ProcessBlock

func (h *ForkableHub) ProcessBlock(blk *pbbstream.Block, obj interface{}) error

func (*ForkableHub) Run

func (h *ForkableHub) Run()

func (*ForkableHub) SourceFromBlockNum

func (h *ForkableHub) SourceFromBlockNum(num uint64, handler bstream.Handler) (out bstream.Source)

func (*ForkableHub) SourceFromBlockNumWithForks

func (h *ForkableHub) SourceFromBlockNumWithForks(num uint64, handler bstream.Handler) (out bstream.Source)

func (*ForkableHub) SourceFromCursor

func (h *ForkableHub) SourceFromCursor(cursor *bstream.Cursor, handler bstream.Handler) (out bstream.Source)

func (*ForkableHub) SourceThroughCursor

func (h *ForkableHub) SourceThroughCursor(startBlock uint64, cursor *bstream.Cursor, handler bstream.Handler) (out bstream.Source)

func (*ForkableHub) WalkOneBlocksStore

func (h *ForkableHub) WalkOneBlocksStore(ctx context.Context) ([]string, error)

func (*ForkableHub) WalkOneBlocksStoreFrom

func (h *ForkableHub) WalkOneBlocksStoreFrom(ctx context.Context, startingBlock uint64) ([]string, error)

type Subscription

type Subscription struct {
	*shutter.Shutter
	// contains filtered or unexported fields
}

Subscription is a bstream.Source and has the following guarantees:

func NewSubscription

func NewSubscription(handler bstream.Handler, chanSize int) *Subscription

s.hub.unsubscribe(sub)

func (*Subscription) Run

func (s *Subscription) Run()

Jump to

Keyboard shortcuts

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