Documentation ¶
Index ¶
- Constants
- type CometBFTBroadcaster
- func (c *CometBFTBroadcaster) Broadcast(ctx context.Context, txBytes []byte) ([]byte, error)
- func (c *CometBFTBroadcaster) Consensus() string
- func (c *CometBFTBroadcaster) Invoke(ctx context.Context, method string, req, reply interface{}, ...) (err error)
- func (c *CometBFTBroadcaster) NewStream(_ context.Context, _ *grpc.StreamDesc, _ string, _ ...grpc.CallOption) (grpc.ClientStream, error)
- type CometRPC
Constants ¶
const ( // BroadcastSync defines a tx broadcasting mode where the client waits for // a CheckTx execution response only. BroadcastSync = "sync" // BroadcastAsync defines a tx broadcasting mode where the client returns // immediately. BroadcastAsync = "async" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CometBFTBroadcaster ¶
type CometBFTBroadcaster struct {
// contains filtered or unexported fields
}
CometBFTBroadcaster implements the Broadcaster interface for CometBFT consensus engine.
func NewCometBFTBroadcaster ¶
func NewCometBFTBroadcaster(rpcURL, mode string, cdc codec.Codec) (*CometBFTBroadcaster, error)
NewCometBFTBroadcaster creates a new CometBFTBroadcaster.
func (*CometBFTBroadcaster) Broadcast ¶
Broadcast sends a transaction to the network and returns the result. returns a byte slice containing the JSON-encoded result and an error if the broadcast failed.
func (*CometBFTBroadcaster) Consensus ¶
func (c *CometBFTBroadcaster) Consensus() string
Consensus returns the consensus engine name used by the broadcaster. It always returns "comet" for CometBFTBroadcaster.
func (*CometBFTBroadcaster) Invoke ¶
func (c *CometBFTBroadcaster) Invoke(ctx context.Context, method string, req, reply interface{}, opts ...grpc.CallOption) (err error)
Invoke implements the gRPC ClientConn interface by forwarding the RPC call to CometBFT's ABCI Query. It marshals the request, sends it as an ABCI query, and unmarshals the response.
func (*CometBFTBroadcaster) NewStream ¶
func (c *CometBFTBroadcaster) NewStream(_ context.Context, _ *grpc.StreamDesc, _ string, _ ...grpc.CallOption) (grpc.ClientStream, error)
type CometRPC ¶
type CometRPC interface { rpcclient.ABCIClient Validators(ctx context.Context, height *int64, page, perPage *int) (*coretypes.ResultValidators, error) Status(context.Context) (*coretypes.ResultStatus, error) Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error) BlockByHash(ctx context.Context, hash []byte) (*coretypes.ResultBlock, error) BlockResults(ctx context.Context, height *int64) (*coretypes.ResultBlockResults, error) BlockchainInfo(ctx context.Context, minHeight, maxHeight int64) (*coretypes.ResultBlockchainInfo, error) Commit(ctx context.Context, height *int64) (*coretypes.ResultCommit, error) Tx(ctx context.Context, hash []byte, prove bool) (*coretypes.ResultTx, error) TxSearch( ctx context.Context, query string, prove bool, page, perPage *int, orderBy string, ) (*coretypes.ResultTxSearch, error) BlockSearch( ctx context.Context, query string, page, perPage *int, orderBy string, ) (*coretypes.ResultBlockSearch, error) }
CometRPC defines the interface of a CometBFT RPC client needed for queries and transaction handling.