Crate cometbft_rpc

source ·
Expand description

CometBFT RPC definitions and types.

§Client

This crate optionally provides access to different types of RPC client functionality and different client transports based on which features you select when using it.

Several client-related features are provided at present:

  • http-client - Provides HttpClient, which is a basic RPC client that interacts with remote CometBFT nodes via JSON-RPC over HTTP or HTTPS. This client does not provide event::Event subscription functionality. See the CometBFT RPC for more details.
  • websocket-client - Provides WebSocketClient, which provides full client functionality, including general RPC functionality as well as event::Event subscription functionality. Can be used over secure (wss://) and unsecure (ws://) connections.

§Mock Clients

Mock clients are included when either of the http-client or websocket-client features are enabled to aid in testing. This includes MockClient, which implements both Client and SubscriptionClient traits.

Re-exports§

Modules§

  • CometBFT RPC client.
  • Helper types to generalize differences in serialization between CometBFT RPC protocol versions.
  • CometBFT JSON-RPC endpoints
  • JSON-RPC error types
  • RPC subscription event-related data structures.
  • Structured querying for the CometBFT RPC event subscription system.
  • JSON-RPC requests
  • JSON-RPC response types
  • Serde serializers

Structs§

  • A page number in paginated RPC responses.
  • The number of items to return per page, for paginated RPC responses.
  • A uniform resource locator (URL), with support for only those schemes/protocols supported by CometBFT RPC clients.
  • JSON-RPC version
  • The configuration for WebSocket connection.

Enums§

  • JSON-RPC ID: request-specific identifier
  • JSON-RPC request methods.
  • Ordering of paginated RPC responses.
  • Pagination control for those RPC client methods supporting pagination.
  • The various schemes supported by CometBFT RPC clients.