Documentation ¶
Index ¶
- type ABCI
- type AppABCI
- type AppMempool
- type BlockAPI
- type BroadcastTxAPI
- type DB
- type EventBus
- type HeadHeader
- type Mempool
- type SelectiveListener
- type StatusAPI
- type SubscribeEventListener
- type SubscriberAPI
- func (s *SubscriberAPI) Subscribe(ctx *jsonrpctypes.Context, query string) (*rpctypes.ResultSubscribe, error)
- func (s *SubscriberAPI) Unsubscribe(ctx *jsonrpctypes.Context, query string) (*rpctypes.ResultUnsubscribe, error)
- func (s *SubscriberAPI) UnsubscribeAll(ctx *jsonrpctypes.Context) (*rpctypes.ResultUnsubscribe, error)
- type TxAPI
- type TxStore
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 (*ABCI) Info ¶
func (s *ABCI) Info(ctx *jsonrpctypes.Context) (*rpctypes.ResultABCIInfo, error)
type AppABCI ¶
type AppABCI interface { Info(context.Context, *abcitypes.RequestInfo) (*abcitypes.ResponseInfo, error) Query(context.Context, *abcitypes.RequestQuery) (*abcitypes.ResponseQuery, 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 (*BlockAPI) ByHash ¶
func (s *BlockAPI) ByHash(_ *jsonrpctypes.Context, hash []byte) (*rpctypes.ResultBlock, error)
func (*BlockAPI) ByHeight ¶
func (s *BlockAPI) ByHeight(_ *jsonrpctypes.Context, height int64) (*rpctypes.ResultBlock, error)
type BroadcastTxAPI ¶
type BroadcastTxAPI struct {
// contains filtered or unexported fields
}
func NewBroadcastTxAPI ¶
func NewBroadcastTxAPI(app AppMempool, mempool Mempool) *BroadcastTxAPI
func (*BroadcastTxAPI) BroadcastTx ¶
func (s *BroadcastTxAPI) BroadcastTx(ctx *jsonrpctypes.Context, tx bfttypes.Tx) (*rpctypes.ResultBroadcastTx, error)
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 HeadHeader ¶
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 StatusAPI ¶
type StatusAPI struct {
// contains filtered or unexported fields
}
func NewStatusAPI ¶
func NewStatusAPI(blockStore HeadHeader, startBlock *bfttypes.Block) *StatusAPI
func (*StatusAPI) Status ¶
func (s *StatusAPI) Status(_ *jsonrpctypes.Context) (*rpctypes.ResultStatus, error)
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 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 (*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"