diff --git a/rpc/README.md b/rpc/README.md index b4540488..87f32c40 100644 --- a/rpc/README.md +++ b/rpc/README.md @@ -3,9 +3,9 @@ See the [repo root] for build status, license, rust version, etc. -# tendermint-rpc +# cometbft-rpc -A Rust implementation of the core types returned by a Tendermint node's RPC +A Rust implementation of the core types returned by a CometBFT node's RPC endpoint. These can be used to deserialize JSON-RPC responses. All networking related features will be feature guarded to keep the @@ -24,9 +24,9 @@ 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 Tendermint nodes via **JSON-RPC over HTTP or + interacts with remote CometBFT nodes via **JSON-RPC over HTTP or HTTPS**. This client does not provide `Event` subscription - functionality. See the [Tendermint RPC] for more details. + 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`] subscription functionality. Can be used over secure @@ -34,20 +34,20 @@ Several client-related features are provided at present: ### CLI -A `tendermint-rpc` console application is provided for testing/experimentation +A `cometbft-rpc` console application is provided for testing/experimentation purposes. To build this application: ```bash -# From the tendermint-rpc crate's directory +# From the cometbft-rpc crate's directory cd rpc -cargo build --bin tendermint-rpc --features cli +cargo build --bin cometbft-rpc --features cli # To run directly and show usage information -cargo run --bin tendermint-rpc --features cli -- --help +cargo run --bin cometbft-rpc --features cli -- --help # To install the binary to your Cargo binaries path # (should be globally accessible) -cargo install --bin tendermint-rpc --features cli --path . +cargo install --bin cometbft-rpc --features cli --path . ``` The application sends its logs to **stderr** and its output to **stdout**, so @@ -57,35 +57,35 @@ it's relatively easy to capture RPC output. ```bash # Check which RPC commands/endpoints are supported. -tendermint-rpc --help +cometbft-rpc --help -# Query the status of the Tendermint node bound to tcp://127.0.0.1:26657 -tendermint-rpc status +# Query the status of the CometBFT node bound to tcp://127.0.0.1:26657 +cometbft-rpc status -# Submit a transaction to the key/value store ABCI app via a Tendermint node +# Submit a transaction to the key/value store ABCI app via a CometBFT node # bound to tcp://127.0.0.1:26657 -tendermint-rpc broadcast-tx-async somekey=somevalue +cometbft-rpc broadcast-tx-async somekey=somevalue # Query the value associated with key "somekey" (still assuming a key/value # store ABCI app) -tendermint-rpc abci-query somekey +cometbft-rpc abci-query somekey # To use an HTTP/S proxy to access your RPC endpoint -tendermint-rpc --proxy-url http://yourproxy:8080 abci-query somekey +cometbft-rpc --proxy-url http://yourproxy:8080 abci-query somekey # To set your HTTP/S proxy for multiple subsequent queries export HTTP_PROXY=http://yourproxy:8080 -tendermint-rpc abci-query somekey +cometbft-rpc abci-query somekey # Subscribe to receive new blocks (must use the WebSocket endpoint) # Prints out all incoming events -tendermint-rpc -u ws://127.0.0.1:26657/websocket subscribe "tm.event='NewBlock'" +cometbft-rpc -u ws://127.0.0.1:26657/websocket subscribe "tm.event='NewBlock'" # If you want to execute a number of queries against a specific endpoint and # don't feel like re-typing the URL over and over again, just set the -# TENDERMINT_RPC_URL environment variable -export TENDERMINT_RPC_URL=ws://127.0.0.1:26657/websocket -tendermint-rpc subscribe "tm.event='Tx'" +# COMETBFT_RPC_URL environment variable +export COMETBFT_RPC_URL=ws://127.0.0.1:26657/websocket +cometbft-rpc subscribe "tm.event='Tx'" ``` ### Mock Clients @@ -100,13 +100,13 @@ traits. - RPC [core types] in golang - RPC endpoints REST interface documentation: - + ## Testing The RPC types are directly tested through the [integration tests](./tests/integration.rs). These tests use fixtures taken from running -Tendermint nodes to ensure compatibility without needing access to a running +CometBFT nodes to ensure compatibility without needing access to a running node during testing. All of these fixtures were generated manually, and automatic regeneration of the fixtures is [on our roadmap][autogen-fixtures]. @@ -117,40 +117,40 @@ To run these tests locally: cargo test --all-features ``` -The RPC client is also indirectly tested through the [Tendermint integration -tests](../tendermint/tests/integration.rs), which happens during +The RPC client is also indirectly tested through the [CometBFT integration +tests](../cometbft/tests/integration.rs), which happens during [CI](../.github/workflows/test.yml). All of these tests require a running -Tendermint node, and are therefore ignored by default. To run these tests +CometBFT node, and are therefore ignored by default. To run these tests locally: ```bash -# In one terminal, spin up a Tendermint node -docker pull tendermint/tendermint:latest -docker run -it --rm -v "/tmp/tendermint:/tendermint" \ - tendermint/tendermint init -docker run -it --rm -v "/tmp/tendermint:/tendermint" \ +# In one terminal, spin up a CometBFT node +docker pull cometbft/cometbft:latest +docker run -it --rm -v "/tmp/cometbft:/cometbft" \ + cometbft/cometbft init +docker run -it --rm -v "/tmp/cometbft:/cometbft" \ -p 26657:26657 \ - tendermint/tendermint node --proxy_app=kvstore + cometbft/cometbft node --proxy_app=kvstore -# In another terminal, run the ignored Tendermint tests to connect to the node +# In another terminal, run the ignored CometBFT tests to connect to the node # running at tcp://127.0.0.1:26657 -cd ../tendermint +cd ../cometbft cargo test --all-features -- --ignored ``` [//]: # (badges) -[crate-image]: https://img.shields.io/crates/v/tendermint-rpc.svg -[crate-link]: https://crates.io/crates/tendermint-rpc -[docs-image]: https://docs.rs/tendermint-rpc/badge.svg -[docs-link]: https://docs.rs/tendermint-rpc/ +[crate-image]: https://img.shields.io/crates/v/cometbft-rpc.svg +[crate-link]: https://crates.io/crates/cometbft-rpc +[docs-image]: https://docs.rs/cometbft-rpc/badge.svg +[docs-link]: https://docs.rs/cometbft-rpc/ [//]: # (general links) -[repo root]: https://github.com/informalsystems/tendermint-rs -[tendermint]: https://github.com/tendermint/tendermint -[core types]: https://github.com/tendermint/tendermint/blob/8b4a30fada85fccd8f0cb15009344f1cbd8de616/rpc/core/types/responses.go#L1 -[tendermint.rs]: https://crates.io/crates/tendermint -[Tendermint RPC]: https://docs.tendermint.com/v0.34/rpc/ -[`/subscribe` endpoint]: https://docs.tendermint.com/v0.34/rpc/#/Websocket/subscribe +[repo root]: https://github.com/cometbft/cometbft-rs +[cometbft]: https://github.com/cometbft/cometbft +[core types]: https://github.com/cometbft/cometbft/blob/8b4a30fada85fccd8f0cb15009344f1cbd8de616/rpc/core/types/responses.go#L1 +[cometbft.rs]: https://crates.io/crates/cometbft +[CometBFT RPC]: https://docs.cometbft.com/v1/rpc/ +[`/subscribe` endpoint]: https://docs.cometbft.com/v1/rpc/#/Websocket/subscribe [autogen-fixtures]: https://github.com/informalsystems/tendermint-rs/issues/612 diff --git a/rpc/src/client.rs b/rpc/src/client.rs index f3084357..43a1cc0f 100644 --- a/rpc/src/client.rs +++ b/rpc/src/client.rs @@ -1,4 +1,4 @@ -//! Tendermint RPC client. +//! CometBFT RPC client. mod compat; pub use compat::CompatMode; @@ -38,7 +38,7 @@ use crate::{ Error, Order, SimpleRequest, }; -/// Provides lightweight access to the Tendermint RPC. It gives access to all +/// Provides lightweight access to the CometBFT RPC. It gives access to all /// endpoints with the exception of the event subscription-related ones. /// /// To access event subscription capabilities, use a client that implements the @@ -272,7 +272,7 @@ pub trait Client { self.perform(net_info::Request).await } - /// `/status`: get Tendermint status including node info, pubkey, latest + /// `/status`: get CometBFT status including node info, pubkey, latest /// block hash, app hash, block height and time. async fn status(&self) -> Result { self.perform(status::Request).await diff --git a/rpc/src/client/bin/main.rs b/rpc/src/client/bin/main.rs index 6a7d3bca..a771eb83 100644 --- a/rpc/src/client/bin/main.rs +++ b/rpc/src/client/bin/main.rs @@ -1,4 +1,4 @@ -//! CLI for performing simple interactions against a Tendermint node's RPC. +//! CLI for performing simple interactions against a CometBFT node's RPC. use core::str::FromStr; @@ -15,22 +15,22 @@ use structopt::StructOpt; use tokio::{task::JoinHandle, time::Duration}; use tracing::{debug, error, info, level_filters::LevelFilter, warn}; -/// CLI for performing simple interactions against a Tendermint node's RPC. +/// CLI for performing simple interactions against a CometBFT node's RPC. /// /// Supports HTTP, HTTPS, WebSocket and secure WebSocket (wss://) URLs. #[derive(Debug, StructOpt)] struct Opt { - /// The URL of the Tendermint node's RPC endpoint. + /// The URL of the CometBFT node's RPC endpoint. #[structopt( short, long, default_value = "http://127.0.0.1:26657", - env = "TENDERMINT_RPC_URL" + env = "COMETBFT_RPC_URL" )] url: Url, /// An optional HTTP/S proxy through which to submit requests to the - /// Tendermint node's RPC endpoint. Only available for HTTP/HTTPS endpoints + /// CometBFT node's RPC endpoint. Only available for HTTP/HTTPS endpoints /// (i.e. WebSocket proxies are not supported). #[structopt(long)] proxy_url: Option, @@ -148,7 +148,7 @@ enum ClientRequest { LatestCommit, /// Obtain information about the P2P stack and other network connections. NetInfo, - /// Get Tendermint status (node info, public key, latest block hash, etc.). + /// Get CometBFT status (node info, public key, latest block hash, etc.). Status, /// Fetch a transaction by way of its hash. Tx { diff --git a/rpc/src/client/compat.rs b/rpc/src/client/compat.rs index ed99e0ce..c8ac670f 100644 --- a/rpc/src/client/compat.rs +++ b/rpc/src/client/compat.rs @@ -7,7 +7,7 @@ use cometbft::Version; use crate::prelude::*; use crate::Error; -/// Protocol compatibility mode for a Tendermint RPC client. +/// Protocol compatibility mode for a CometBFT RPC client. #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum CompatMode { /// Use version 0.34 of the protocol. @@ -28,7 +28,7 @@ impl CompatMode { Self::V0_37 } - /// Parse the Tendermint version string to determine + /// Parse the CometBFT version string to determine /// the compatibility mode. /// /// The version can be obtained by querying the `/status` endpoint. @@ -41,16 +41,16 @@ impl CompatMode { /// be handled by the same server. In the future, the RPC protocol should /// follow versioning practices designed to avoid ambiguities with /// message formats. - pub fn from_version(tendermint_version: Version) -> Result { - let raw_version: String = tendermint_version.into(); + pub fn from_version(cometbft_version: Version) -> Result { + let raw_version: String = cometbft_version.into(); let version = semver::Version::parse(raw_version.trim_start_matches('v')) - .map_err(|_| Error::invalid_tendermint_version(raw_version))?; + .map_err(|_| Error::invalid_cometbft_version(raw_version))?; match (version.major, version.minor) { (0, 34) => Ok(CompatMode::V0_34), (0, 37) => Ok(CompatMode::V0_37), (0, 38) => Ok(CompatMode::V0_37), - _ => Err(Error::unsupported_tendermint_version(version.to_string())), + _ => Err(Error::unsupported_cometbft_version(version.to_string())), } } } diff --git a/rpc/src/client/sync.rs b/rpc/src/client/sync.rs index 72d99b3d..f33c7edc 100644 --- a/rpc/src/client/sync.rs +++ b/rpc/src/client/sync.rs @@ -1,4 +1,4 @@ -//! Synchronization primitives specific to the Tendermint RPC client. +//! Synchronization primitives specific to the CometBFT RPC client. //! //! At present, this wraps Tokio's synchronization primitives and provides some //! convenience methods. We also only implement unbounded channels at present. diff --git a/rpc/src/client/transport.rs b/rpc/src/client/transport.rs index 3eb72ee5..bb845214 100644 --- a/rpc/src/client/transport.rs +++ b/rpc/src/client/transport.rs @@ -1,4 +1,4 @@ -//! Tendermint RPC client implementations for different transports. +//! CometBFT RPC client implementations for different transports. mod auth; pub mod mock; diff --git a/rpc/src/client/transport/http.rs b/rpc/src/client/transport/http.rs index 71fecaae..f74d63a1 100644 --- a/rpc/src/client/transport/http.rs +++ b/rpc/src/client/transport/http.rs @@ -1,4 +1,4 @@ -//! HTTP-based transport for Tendermint RPC Client. +//! HTTP-based transport for CometBFT RPC Client. use core::{ convert::{TryFrom, TryInto}, @@ -23,11 +23,11 @@ use crate::{ Error, Order, Scheme, SimpleRequest, Url, }; -const USER_AGENT: &str = concat!("tendermint.rs/", env!("CARGO_PKG_VERSION")); +const USER_AGENT: &str = concat!("cometbft.rs/", env!("CARGO_PKG_VERSION")); -/// A JSON-RPC/HTTP Tendermint RPC client (implements [`crate::Client`]). +/// A JSON-RPC/HTTP CometBFT RPC client (implements [`crate::Client`]). /// -/// Supports both HTTP and HTTPS connections to Tendermint RPC endpoints, and +/// Supports both HTTP and HTTPS connections to CometBFT RPC endpoints, and /// allows for the use of HTTP proxies (see [`HttpClient::new_with_proxy`] for /// details). /// @@ -66,7 +66,7 @@ pub struct Builder { } impl Builder { - /// Use the specified compatibility mode for the Tendermint RPC protocol. + /// Use the specified compatibility mode for the CometBFT RPC protocol. /// /// The default is the latest protocol version supported by this crate. pub fn compat_mode(mut self, mode: CompatMode) -> Self { @@ -108,7 +108,7 @@ impl Builder { } impl HttpClient { - /// Construct a new Tendermint RPC HTTP/S client connecting to the given + /// Construct a new CometBFT RPC HTTP/S client connecting to the given /// URL. pub fn new(url: U) -> Result where @@ -118,7 +118,7 @@ impl HttpClient { Self::builder(url).build() } - /// Construct a new Tendermint RPC HTTP/S client connecting to the given + /// Construct a new CometBFT RPC HTTP/S client connecting to the given /// URL, but via the specified proxy's URL. /// /// If the RPC endpoint is secured (HTTPS), the proxy will automatically @@ -134,7 +134,7 @@ impl HttpClient { Self::builder(url).proxy_url(proxy_url.try_into()?).build() } - /// Initiate a builder for a Tendermint RPC HTTP/S client connecting + /// Initiate a builder for a CometBFT RPC HTTP/S client connecting /// to the given URL, so that more configuration options can be specified /// with the builder. pub fn builder(url: HttpClientUrl) -> Builder { diff --git a/rpc/src/client/transport/websocket.rs b/rpc/src/client/transport/websocket.rs index 6fbd8ae5..4d21b3d6 100644 --- a/rpc/src/client/transport/websocket.rs +++ b/rpc/src/client/transport/websocket.rs @@ -1,4 +1,4 @@ -//! WebSocket-based clients for accessing Tendermint RPC functionality. +//! WebSocket-based clients for accessing CometBFT RPC functionality. use alloc::{borrow::Cow, collections::BTreeMap as HashMap, fmt}; use core::{ @@ -46,20 +46,20 @@ use crate::{ // WebSocket connection times out if we haven't heard anything at all from the // server in this long. // -// Taken from https://github.com/tendermint/tendermint/blob/309e29c245a01825fc9630103311fd04de99fa5e/rpc/jsonrpc/server/ws_handler.go#L27 +// Taken from https://github.com/cometbft/cometbft/blob/309e29c245a01825fc9630103311fd04de99fa5e/rpc/jsonrpc/server/ws_handler.go#L27 const RECV_TIMEOUT_SECONDS: u64 = 30; const RECV_TIMEOUT: Duration = Duration::from_secs(RECV_TIMEOUT_SECONDS); // How frequently to send ping messages to the WebSocket server. // -// Taken from https://github.com/tendermint/tendermint/blob/309e29c245a01825fc9630103311fd04de99fa5e/rpc/jsonrpc/server/ws_handler.go#L28 +// Taken from https://github.com/cometbft/cometbft/blob/309e29c245a01825fc9630103311fd04de99fa5e/rpc/jsonrpc/server/ws_handler.go#L28 const PING_INTERVAL: Duration = Duration::from_secs((RECV_TIMEOUT_SECONDS * 9) / 10); /// Low-level WebSocket configuration pub use async_tungstenite::tungstenite::protocol::WebSocketConfig; -/// Tendermint RPC client that provides access to all RPC functionality +/// CometBFT RPC client that provides access to all RPC functionality /// (including [`Event`] subscription) over a WebSocket connection. /// /// The `WebSocketClient` itself is effectively just a handle to its driver @@ -89,7 +89,7 @@ pub use async_tungstenite::tungstenite::protocol::WebSocketConfig; /// /// The WebSocket client implements a keep-alive mechanism whereby it sends a /// PING message to the server every 27 seconds, matching the PING cadence of -/// the Tendermint server (see [this code][tendermint-websocket-ping] for +/// the CometBFT server (see [this code][cometbft-websocket-ping] for /// details). /// /// This is not configurable at present. @@ -137,7 +137,7 @@ pub use async_tungstenite::tungstenite::protocol::WebSocketConfig; /// } /// ``` /// -/// [tendermint-websocket-ping]: https://github.com/tendermint/tendermint/blob/309e29c245a01825fc9630103311fd04de99fa5e/rpc/jsonrpc/server/ws_handler.go#L28 +/// [cometbft-websocket-ping]: https://github.com/cometbft/cometbft/blob/309e29c245a01825fc9630103311fd04de99fa5e/rpc/jsonrpc/server/ws_handler.go#L28 #[derive(Debug, Clone)] pub struct WebSocketClient { inner: sealed::WebSocketClient, @@ -152,7 +152,7 @@ pub struct Builder { } impl Builder { - /// Use the specified compatibility mode for the Tendermint RPC protocol. + /// Use the specified compatibility mode for the CometBFT RPC protocol. /// /// The default is the latest protocol version supported by this crate. pub fn compat_mode(mut self, mode: CompatMode) -> Self { @@ -182,7 +182,7 @@ impl Builder { impl WebSocketClient { /// Construct a new WebSocket-based client connecting to the given - /// Tendermint node's RPC endpoint. + /// CometBFT node's RPC endpoint. /// /// Supports both `ws://` and `wss://` protocols. pub async fn new(url: U) -> Result<(Self, WebSocketClientDriver), Error> @@ -194,7 +194,7 @@ impl WebSocketClient { } /// Construct a new WebSocket-based client connecting to the given - /// Tendermint node's RPC endpoint. + /// CometBFT node's RPC endpoint. /// /// Supports both `ws://` and `wss://` protocols. pub async fn new_with_config( @@ -209,7 +209,7 @@ impl WebSocketClient { } /// Initiate a builder for a WebSocket-based client connecting to the given - /// Tendermint node's RPC endpoint. + /// CometBFT node's RPC endpoint. /// /// Supports both `ws://` and `wss://` protocols. pub fn builder(url: WebSocketClientUrl) -> Builder { diff --git a/rpc/src/dialect.rs b/rpc/src/dialect.rs index bf867fca..a1505207 100644 --- a/rpc/src/dialect.rs +++ b/rpc/src/dialect.rs @@ -1,5 +1,5 @@ //! Helper types to generalize differences in serialization between -//! Tendermint RPC protocol versions. +//! CometBFT RPC protocol versions. pub mod v0_34; pub mod v0_37; diff --git a/rpc/src/dialect/check_tx.rs b/rpc/src/dialect/check_tx.rs index 875e80ca..a3901548 100644 --- a/rpc/src/dialect/check_tx.rs +++ b/rpc/src/dialect/check_tx.rs @@ -13,7 +13,7 @@ pub struct CheckTx { /// /// Transactions where `code != 0` will be rejected; these transactions will /// not be broadcast to other nodes or included in a proposal block. - /// Tendermint attributes no other value to the response code. + /// CometBFT attributes no other value to the response code. pub code: Code, /// Result bytes, if any. #[serde(with = "serializers::nullable")] @@ -41,7 +41,7 @@ pub struct CheckTx { /// The transaction's priority (for mempool ordering). #[serde(with = "serializers::from_str")] pub priority: i64, - /// mempool_error is set by Tendermint. + /// mempool_error is set by CometBFT. /// ABCI applictions should not set mempool_error. pub mempool_error: String, } diff --git a/rpc/src/dialect/v0_34.rs b/rpc/src/dialect/v0_34.rs index b0001e86..39c29840 100644 --- a/rpc/src/dialect/v0_34.rs +++ b/rpc/src/dialect/v0_34.rs @@ -53,7 +53,7 @@ pub struct EventAttribute { deserialize_with = "base64string::deserialize_to_string" )] pub value: String, - /// Whether Tendermint's indexer should index this event. + /// Whether CometBFT's indexer should index this event. /// /// **This field is nondeterministic**. pub index: bool, diff --git a/rpc/src/endpoint.rs b/rpc/src/endpoint.rs index f04c2a0d..0e915047 100644 --- a/rpc/src/endpoint.rs +++ b/rpc/src/endpoint.rs @@ -1,4 +1,4 @@ -//! Tendermint JSON-RPC endpoints +//! CometBFT JSON-RPC endpoints pub mod abci_info; pub mod abci_query; diff --git a/rpc/src/endpoint/block_results.rs b/rpc/src/endpoint/block_results.rs index 4094545c..8f92bf06 100644 --- a/rpc/src/endpoint/block_results.rs +++ b/rpc/src/endpoint/block_results.rs @@ -92,7 +92,7 @@ pub struct Response { impl crate::Response for Response {} -/// Serialization for /block_results endpoint format in Tendermint 0.34 +/// Serialization for /block_results endpoint format in CometBFT 0.34 pub mod v0_34 { use super::Response; use crate::dialect::v0_34::Event; diff --git a/rpc/src/endpoint/broadcast/tx_commit.rs b/rpc/src/endpoint/broadcast/tx_commit.rs index e8e839ad..442e90cd 100644 --- a/rpc/src/endpoint/broadcast/tx_commit.rs +++ b/rpc/src/endpoint/broadcast/tx_commit.rs @@ -71,7 +71,7 @@ pub struct Response { impl crate::Response for Response {} -/// Serialization for /broadcast_tx_commit endpoint format in Tendermint 0.34 +/// Serialization for /broadcast_tx_commit endpoint format in CometBFT 0.34 pub mod v0_34 { use super::Response; use crate::dialect; diff --git a/rpc/src/endpoint/consensus_state.rs b/rpc/src/endpoint/consensus_state.rs index a9cc837c..0bfae945 100644 --- a/rpc/src/endpoint/consensus_state.rs +++ b/rpc/src/endpoint/consensus_state.rs @@ -12,7 +12,7 @@ use subtle_encoding::hex; use crate::{dialect::Dialect, prelude::*, request::RequestMessage, Error, Method}; -// From +// From const NIL_VOTE_STR: &str = "nil-Vote"; /// Get the current consensus state. @@ -41,7 +41,7 @@ impl crate::SimpleRequest for Request { /// The current consensus state (UNSTABLE). /// -/// Currently based on +/// Currently based on #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Response { pub round_state: RoundState, @@ -125,7 +125,7 @@ impl<'de> Deserialize<'de> for HeightRoundStep { /// Details of all votes for a particular consensus round. #[derive(Debug, Clone, Serialize, Deserialize)] pub struct RoundVotes { - // A Tendermint node currently serializes this particular field as an + // A CometBFT node currently serializes this particular field as an // integer and not a string (unlike that which is expected from the `Round` // type). pub round: u32, diff --git a/rpc/src/endpoint/subscribe.rs b/rpc/src/endpoint/subscribe.rs index df99dc6d..afd433d8 100644 --- a/rpc/src/endpoint/subscribe.rs +++ b/rpc/src/endpoint/subscribe.rs @@ -17,7 +17,7 @@ pub struct Request { } impl Request { - /// Query the Tendermint nodes event and stream events (by default over a + /// Query the CometBFT nodes event and stream events (by default over a /// WebSocket connection). pub fn new(query: String) -> Self { Self { query } diff --git a/rpc/src/endpoint/tx.rs b/rpc/src/endpoint/tx.rs index 1e6e963a..cd2cdd0c 100644 --- a/rpc/src/endpoint/tx.rs +++ b/rpc/src/endpoint/tx.rs @@ -55,7 +55,7 @@ pub struct Response { /// /// Deserialized from a hex-encoded string (there is a discrepancy between /// the format used for the request and the format used for the response in - /// the Tendermint RPC). + /// the CometBFT RPC). pub hash: Hash, pub height: block::Height, pub index: u32, @@ -68,7 +68,7 @@ pub struct Response { impl crate::Response for Response {} -/// Serialization for /tx endpoint format in Tendermint 0.34 +/// Serialization for /tx endpoint format in CometBFT 0.34 pub mod v0_34 { use super::Response; use crate::dialect::v0_34::Event; @@ -84,7 +84,7 @@ pub mod v0_34 { /// /// Deserialized from a hex-encoded string (there is a discrepancy between /// the format used for the request and the format used for the response in - /// the Tendermint RPC). + /// the CometBFT RPC). pub hash: Hash, pub height: block::Height, pub index: u32, diff --git a/rpc/src/endpoint/tx_search.rs b/rpc/src/endpoint/tx_search.rs index e936405d..9ff03689 100644 --- a/rpc/src/endpoint/tx_search.rs +++ b/rpc/src/endpoint/tx_search.rs @@ -73,7 +73,7 @@ pub struct Response { impl crate::Response for Response {} -/// Serialization for /tx_search endpoint format in Tendermint 0.34 +/// Serialization for /tx_search endpoint format in CometBFT 0.34 pub mod v0_34 { use super::{tx, Response}; use crate::prelude::*; diff --git a/rpc/src/endpoint/validators.rs b/rpc/src/endpoint/validators.rs index a9bb0bd4..c5a6aa61 100644 --- a/rpc/src/endpoint/validators.rs +++ b/rpc/src/endpoint/validators.rs @@ -28,10 +28,10 @@ pub struct Request { impl Request { /// List validators for a specific block. /// - /// See the [Tendermint RPC] for the defaults for each option when set to + /// See the [CometBFT RPC] for the defaults for each option when set to /// `None`. /// - /// [Tendermint RPC]: https://docs.tendermint.com/v0.34/rpc/#/Info/validators + /// [CometBFT RPC]: https://docs.cometbft.com/v1/rpc/#/Info/validators pub fn new( height: Option, page: Option, diff --git a/rpc/src/error.rs b/rpc/src/error.rs index 51a257b1..230a4a5a 100644 --- a/rpc/src/error.rs +++ b/rpc/src/error.rs @@ -138,9 +138,9 @@ define_error! { ) }, - Tendermint + Cometbft [ cometbft::Error ] - | _ | { "tendermint error" }, + | _ | { "CometBFT error" }, ParseInt [ DisplayOnly ] @@ -201,20 +201,20 @@ define_error! { e.version, e.supported) }, - InvalidTendermintVersion + InvalidCometbftVersion { version: String, } | e | { - format_args!("invalid Tendermint version reported by the node: {}", e.version) + format_args!("invalid CometBFT version reported by the node: {}", e.version) }, - UnsupportedTendermintVersion + UnsupportedCometbftVersion { version: String, } | e | { - format_args!("unsupported Tendermint version reported by the node: {}", e.version) + format_args!("unsupported CometBFT version reported by the node: {}", e.version) }, } } diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index 1e8d05c2..db166242 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -1,4 +1,4 @@ -//! Tendermint RPC definitions and types. +//! CometBFT RPC definitions and types. //! //! ## Client //! @@ -9,8 +9,8 @@ //! Several client-related features are provided at present: //! //! * `http-client` - Provides [`HttpClient`], which is a basic RPC client that interacts with -//! remote Tendermint nodes via **JSON-RPC over HTTP or HTTPS**. This client does not provide -//! [`event::Event`] subscription functionality. See the [Tendermint RPC] for more details. +//! 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. @@ -22,8 +22,8 @@ //! [`MockClient`], which implements both [`Client`] and [`SubscriptionClient`] //! traits. //! -//! [Tendermint RPC]: https://docs.tendermint.com/v0.34/rpc/ -//! [`/subscribe` endpoint]: https://docs.tendermint.com/v0.34/rpc/#/Websocket/subscribe +//! [CometBFT RPC]: https://docs.cometbft.com/v1/rpc/ +//! [`/subscribe` endpoint]: https://docs.cometbft.com/v1/rpc/#/Websocket/subscribe #![no_std] diff --git a/rpc/src/paging.rs b/rpc/src/paging.rs index c3273eb0..ecf6479d 100644 --- a/rpc/src/paging.rs +++ b/rpc/src/paging.rs @@ -1,4 +1,4 @@ -//! Pagination-related data structures for the Tendermint RPC. +//! Pagination-related data structures for the CometBFT RPC. use core::{convert::TryInto, str::FromStr}; diff --git a/rpc/src/query.rs b/rpc/src/query.rs index 47571374..7afed731 100644 --- a/rpc/src/query.rs +++ b/rpc/src/query.rs @@ -1,4 +1,4 @@ -//! Structured querying for the Tendermint RPC event subscription system. +//! Structured querying for the CometBFT RPC event subscription system. //! //! See [`Query`] for details as to how to construct queries. //! @@ -14,7 +14,7 @@ use time::{ use crate::{prelude::*, serializers::timestamp, Error}; -/// A structured query for use in interacting with the Tendermint RPC event +/// A structured query for use in interacting with the CometBFT RPC event /// subscription system. /// /// Allows for compile-time validation of queries. @@ -53,7 +53,7 @@ use crate::{prelude::*, serializers::timestamp, Error}; /// assert_eq!(query, Query::from(EventType::Tx).and_gte("tx.height", 100_u64)); /// ``` /// -/// [subscribe endpoint documentation]: https://docs.tendermint.com/v0.34/rpc/#/Websocket/subscribe +/// [subscribe endpoint documentation]: https://docs.cometbft.com/v1/rpc/#/Websocket/subscribe #[derive(Debug, Clone, PartialEq)] pub struct Query { // We can only have at most one event type at present in a query. @@ -174,7 +174,7 @@ impl Query { impl Default for Query { /// An empty query matches any set of events. See [these docs]. /// - /// [these docs]: https://godoc.org/github.com/tendermint/tendermint/libs/pubsub/query#Empty + /// [these docs]: https://godoc.org/github.com/cometbft/cometbft/libs/pubsub/query#Empty fn default() -> Self { Self { event_type: None, @@ -392,7 +392,7 @@ where Ok(()) } -/// The types of Tendermint events for which we can query at present. +/// The types of CometBFT events for which we can query at present. #[derive(Debug, Clone, PartialEq, Eq)] pub enum EventType { NewBlock, @@ -510,12 +510,12 @@ pub enum Operation { /// A typed operand for use in an [`Condition`]. /// -/// According to the [Tendermint RPC subscribe docs][tm-subscribe], +/// According to the [CometBFT RPC subscribe docs][tm-subscribe], /// an operand can be a string, number, date or time. We differentiate here /// between integer and floating point numbers. /// /// [`Condition`]: enum.Condition.html -/// [tm-subscribe]: https://docs.tendermint.com/v0.34/rpc/#/Websocket/subscribe +/// [tm-subscribe]: https://docs.cometbft.com/v1/rpc/#/Websocket/subscribe #[derive(Debug, Clone, PartialEq)] pub enum Operand { String(String), diff --git a/rpc/src/response_error.rs b/rpc/src/response_error.rs index d74d116a..eb724a3c 100644 --- a/rpc/src/response_error.rs +++ b/rpc/src/response_error.rs @@ -16,10 +16,10 @@ pub struct ResponseError { data: Option, } -// /// Tendermint RPC error codes. +// /// CometBFT RPC error codes. // /// /// See `func RPC*Error()` definitions in: -/// +/// #[derive(Copy, Clone, Debug, Eq, thiserror::Error, Hash, PartialEq, PartialOrd, Ord)] pub enum Code { /// Low-level HTTP error @@ -35,7 +35,7 @@ pub enum Code { /// This is an error unique to this client, and is not available in the /// [Go client]. /// - /// [Go client]: https://github.com/tendermint/tendermint/tree/main/rpc/jsonrpc/client + /// [Go client]: https://github.com/cometbft/cometbft/tree/main/rpc/jsonrpc/client #[error("Client internal error")] ClientInternalError, diff --git a/rpc/src/rpc_url.rs b/rpc/src/rpc_url.rs index 52ee3e0c..790cec0f 100644 --- a/rpc/src/rpc_url.rs +++ b/rpc/src/rpc_url.rs @@ -6,7 +6,7 @@ use serde::{de::Error as SerdeError, Deserialize, Deserializer, Serialize, Seria use crate::{error::Error, prelude::*}; -/// The various schemes supported by Tendermint RPC clients. +/// The various schemes supported by CometBFT RPC clients. #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum Scheme { Http, @@ -41,7 +41,7 @@ impl FromStr for Scheme { } /// A uniform resource locator (URL), with support for only those -/// schemes/protocols supported by Tendermint RPC clients. +/// schemes/protocols supported by CometBFT RPC clients. /// /// Re-implements relevant parts of [`url::Url`]'s interface with convenience /// mechanisms for transformation to/from other types. diff --git a/rpc/src/serializers/opt_tm_hash_base64.rs b/rpc/src/serializers/opt_tm_hash_base64.rs index 31053f17..9304c034 100644 --- a/rpc/src/serializers/opt_tm_hash_base64.rs +++ b/rpc/src/serializers/opt_tm_hash_base64.rs @@ -1,4 +1,4 @@ -//! Encoding/decoding Option Tendermint hashes to/from base64. +//! Encoding/decoding Option CometBFT hashes to/from base64. use cometbft::hash::Hash; use serde::{Deserialize, Deserializer, Serialize, Serializer}; diff --git a/rpc/src/serializers/tm_hash_base64.rs b/rpc/src/serializers/tm_hash_base64.rs index d194b38a..a330a76b 100644 --- a/rpc/src/serializers/tm_hash_base64.rs +++ b/rpc/src/serializers/tm_hash_base64.rs @@ -1,4 +1,4 @@ -//! Encoding/decoding Tendermint hashes to/from base64. +//! Encoding/decoding CometBFT hashes to/from base64. use cometbft::hash::{Algorithm::Sha256, Hash, SHA256_HASH_SIZE}; use serde::{Deserialize, Deserializer, Serializer}; diff --git a/rpc/src/utils.rs b/rpc/src/utils.rs index 8f8000b8..53ab7d77 100644 --- a/rpc/src/utils.rs +++ b/rpc/src/utils.rs @@ -1,4 +1,4 @@ -//! Utility methods for the Tendermint RPC crate. +//! Utility methods for the CometBFT RPC crate. use getrandom::getrandom; diff --git a/rpc/tests/kvstore_fixtures.rs b/rpc/tests/kvstore_fixtures.rs index dfad920c..3ed30365 100644 --- a/rpc/tests/kvstore_fixtures.rs +++ b/rpc/tests/kvstore_fixtures.rs @@ -1,4 +1,4 @@ -//! Tendermint kvstore RPC endpoint testing. +//! CometBFT kvstore RPC endpoint testing. use core::str::FromStr; use std::{collections::BTreeMap as HashMap, fs, path::PathBuf};