comet

package
v0.0.0-...-2220e9e Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ABCI

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

func NewABCI

func NewABCI(app AppABCI) *ABCI

func (*ABCI) Info

func (*ABCI) Query

func (s *ABCI) Query(
	ctx *jsonrpctypes.Context,
	path string,
	data bftbytes.HexBytes,
	height int64,
	prove bool,
) (*rpctypes.ResultABCIQuery, error)

type AppMempool

type AppMempool interface {
	CheckTx(context.Context, *abcitypes.RequestCheckTx) (*abcitypes.ResponseCheckTx, error)
}

type BlockAPI

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

func NewBlockAPI

func NewBlockAPI(blockStore DB) *BlockAPI

type BroadcastTxAPI

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

func NewBroadcastTxAPI

func NewBroadcastTxAPI(app AppMempool, mempool Mempool) *BroadcastTxAPI

func (*BroadcastTxAPI) BroadcastTx

BroadcastTxSync returns with the response from CheckTx, but does not wait for DeliverTx (tx execution). More: https://docs.cometbft.com/main/rpc/#/Tx/broadcast_tx_sync

type DB

type DB interface {
	BlockByHash(common.Hash) (*monomer.Block, error)
	BlockByHeight(uint64) (*monomer.Block, error)
}

type EventBus

type EventBus interface {
	Subscribe(ctx context.Context, subscriber string, query bftpubsub.Query, outCapacity ...int) (bfttypes.Subscription, error)
	Unsubscribe(ctx context.Context, subscriber string, query bftpubsub.Query) error
	UnsubscribeAll(ctx context.Context, subscriber string) error
}

type HeadHeader

type HeadHeader interface {
	HeadHeader() (*monomer.Header, error)
}

type Mempool

type Mempool interface {
	Enqueue(userTxn bfttypes.Tx) error
}

type SelectiveListener

type SelectiveListener struct {
	OnSubscriptionWriteErrCb func(error)
	OnSubscriptionCanceledCb func(error)
}

func (*SelectiveListener) OnSubscriptionCanceled

func (s *SelectiveListener) OnSubscriptionCanceled(err error)

func (*SelectiveListener) OnSubscriptionWriteErr

func (s *SelectiveListener) OnSubscriptionWriteErr(err error)

type Status

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

func NewStatus

func NewStatus(blockStore HeadHeader, startBlock *bfttypes.Block) *Status

func (*Status) Status

Status returns CometBFT status including node info, pubkey, latest block hash, app hash, block height, and block time. More: https://docs.cometbft.com/main/rpc/#/ABCI/status

type SubscribeEventListener

type SubscribeEventListener interface {
	// err will never be nil.
	OnSubscriptionWriteErr(err error)
	// err may be nil.
	OnSubscriptionCanceled(err error)
}

type SubscriberAPI

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

func NewSubscriberAPI

func NewSubscriberAPI(eventBus EventBus, wg *conc.WaitGroup, eventListener SubscribeEventListener) *SubscriberAPI

func (*SubscriberAPI) Subscribe

func (s *SubscriberAPI) Subscribe(ctx *jsonrpctypes.Context, query string) (*rpctypes.ResultSubscribe, error)

Subscribe to events via websocket.

func (*SubscriberAPI) Unsubscribe

func (s *SubscriberAPI) Unsubscribe(ctx *jsonrpctypes.Context, query string) (*rpctypes.ResultUnsubscribe, error)

Unsubscribe from events via websocket. More: https://docs.cometbft.com/main/rpc/#/ABCI/unsubscribe

func (*SubscriberAPI) UnsubscribeAll

func (s *SubscriberAPI) UnsubscribeAll(ctx *jsonrpctypes.Context) (*rpctypes.ResultUnsubscribe, error)

UnsubscribeAll unsubscribes from all events via websocket. More: https://docs.cometbft.com/main/rpc/#/ABCI/unsubscribe_all

type TxAPI

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

func NewTxAPI

func NewTxAPI(txStore TxStore) *TxAPI

func (*TxAPI) ByHash

func (s *TxAPI) ByHash(_ *jsonrpctypes.Context, hash []byte, prove bool) (*rpctypes.ResultTx, error)

https://docs.cometbft.com/main/rpc/#/Tx/tx NOTE: arg `hash` should be a hex string without 0x prefix

func (*TxAPI) Search

func (s *TxAPI) Search(
	ctx *jsonrpctypes.Context,
	query string,
	prove bool,
	pagePtr,
	perPagePtr *int,
	orderBy string,
) (*rpctypes.ResultTxSearch, error)

TxSearch queries for multiple tx results. It returns a list of txs (max ?per_page_entries) and total count. More: https://docs.cometbft.com/main/rpc/#/Tx/tx_search

param pagePtr: 1-based page number, default (when pagePtr == nil) to 1 param perPagePtr: number of txs per page, default (when perPagePtr == nil) to 30 param orderBy: {"", "asc", "desc"}, default (when orderBy == "") to "asc"

type TxStore

type TxStore interface {
	Get(hash []byte) (*abcitypes.TxResult, error)
	Search(ctx context.Context, q *bftquery.Query) ([]*abcitypes.TxResult, error)
}

Jump to

Keyboard shortcuts

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