Documentation
¶
Index ¶
- type BlockstreamServer
- func (s *BlockstreamServer) Blocks(r *pbbstream.BlockRequest, stream pbbstream.BlockStream_BlocksServer) error
- func (s *BlockstreamServer) Close()
- func (s *BlockstreamServer) GetHeadInfo(ctx context.Context, req *pbheadinfo.HeadInfoRequest) (*pbheadinfo.HeadInfoResponse, error)
- func (s *BlockstreamServer) Launch(serverAddr string)
- type ForkableHub
- func (h *ForkableHub) GetBlock(num uint64, id string) (out *pbbstream.Block)
- func (h *ForkableHub) GetBlockByHash(id string) (out *pbbstream.Block)
- func (h *ForkableHub) HeadInfo() (headNum uint64, headID string, headTime time.Time, libNum uint64, err error)
- func (h *ForkableHub) HeadNum() uint64
- func (h *ForkableHub) IsReady() bool
- func (h *ForkableHub) LowestBlockNum() uint64
- func (h *ForkableHub) MatchSuffix(req string) bool
- func (h *ForkableHub) NewBlockstreamServer(dgrpcServer ggrpcserver.Server) *BlockstreamServer
- func (h *ForkableHub) ProcessBlock(blk *pbbstream.Block, obj interface{}) error
- func (h *ForkableHub) Run()
- func (h *ForkableHub) SourceFromBlockNum(num uint64, handler bstream.Handler) (out bstream.Source)
- func (h *ForkableHub) SourceFromBlockNumWithForks(num uint64, handler bstream.Handler) (out bstream.Source)
- func (h *ForkableHub) SourceFromCursor(cursor *bstream.Cursor, handler bstream.Handler) (out bstream.Source)
- func (h *ForkableHub) SourceThroughCursor(startBlock uint64, cursor *bstream.Cursor, handler bstream.Handler) (out bstream.Source)
- func (h *ForkableHub) WalkOneBlocksStore(ctx context.Context) ([]string, error)
- func (h *ForkableHub) WalkOneBlocksStoreFrom(ctx context.Context, startingBlock uint64) ([]string, error)
- type Subscription
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 (s *BlockstreamServer) Blocks(r *pbbstream.BlockRequest, stream pbbstream.BlockStream_BlocksServer) error
func (*BlockstreamServer) Close ¶
func (s *BlockstreamServer) Close()
func (*BlockstreamServer) GetHeadInfo ¶
func (s *BlockstreamServer) GetHeadInfo(ctx context.Context, req *pbheadinfo.HeadInfoRequest) (*pbheadinfo.HeadInfoResponse, error)
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) 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 (*ForkableHub) SourceFromBlockNumWithForks ¶
func (*ForkableHub) SourceFromCursor ¶
func (*ForkableHub) SourceThroughCursor ¶
func (*ForkableHub) WalkOneBlocksStore ¶
func (h *ForkableHub) WalkOneBlocksStore(ctx context.Context) ([]string, error)
func (*ForkableHub) WalkOneBlocksStoreFrom ¶
type Subscription ¶
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()
Click to show internal directories.
Click to hide internal directories.