block_feed

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractBlockResultFromRPCResponse

func ExtractBlockResultFromRPCResponse(message []byte) ([]abci.ResponseDeliverTx, error)

Types

type AggregateSubscription

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

func NewAggregateBlockFeed

func NewAggregateBlockFeed(
	currentBlock int64,
	rpcEndpoints []string,
	wsEndpoints []string,
) *AggregateSubscription

func (*AggregateSubscription) Close

func (ags *AggregateSubscription) Close() error

func (*AggregateSubscription) IsSynced

func (ags *AggregateSubscription) IsSynced() bool

func (*AggregateSubscription) Reconnect

func (ags *AggregateSubscription) Reconnect()

Reconnect reestablishes all underlying connections On any reconnection, it is likely that the underlying RPC is having some problem. To mitigate this,

func (*AggregateSubscription) Subscribe

func (ags *AggregateSubscription) Subscribe(rpcIndex int) (chan *BlockResult, error)

type BlockFeed

type BlockFeed interface {
	// Close closes underlying subscriber
	Close() error

	// Subscribe starts subscription to the block source
	Subscribe(rpcIndex int) (chan *BlockResult, error)
}

BlockFeed is a standard interface to provide subscription over blocks There is only one method OnBlockFound and it gives you access to the BlockFeed channel

type BlockResult

type BlockResult struct {
	BlockID *tendermint.BlockID `json:"block_id"`
	Block   *tendermint.Block   `json:"block"`
}

func ExtractBlockFromRPCResponse

func ExtractBlockFromRPCResponse(message []byte) (*BlockResult, error)

type RPCSubscription

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

func NewRpcSubscription

func NewRpcSubscription(rpcEndpoints []string) (*RPCSubscription, error)

func (*RPCSubscription) Close

func (rpc *RPCSubscription) Close() error

func (*RPCSubscription) Subscribe

func (rpc *RPCSubscription) Subscribe(_ int) (chan *BlockResult, error)

func (*RPCSubscription) SyncFromUntil

func (rpc *RPCSubscription) SyncFromUntil(from int64, to int64, rpcIndex int)

type WSSubscription

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

func NewWSSubscription

func NewWSSubscription(wsEndpoints []string) (*WSSubscription, error)

func (*WSSubscription) Close

func (ws *WSSubscription) Close() error

func (*WSSubscription) Subscribe

func (ws *WSSubscription) Subscribe(rpcIndex int) (chan *BlockResult, error)

Jump to

Keyboard shortcuts

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