Registry / networking / jsonrpc-core-client

jsonrpc-core-client

JSON →
library18.0.0rscratesunverified

Transport agnostic JSON-RPC 2.0 client implementation.

# Cargo.toml [dependencies] jsonrpc-core-client = "18.0.0"
INSTALL
IMPORT
SIG · JSONRPC-CORE-CLIEN
J
jsonrpc-core-client
networkingrustv18.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

connect
use jsonrpc_core_client::transports::http::connect;

Connects to a JSON-RPC server via HTTP and calls a method.

use jsonrpc_core_client::transports::http::connect; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { let client = connect::<_, ()>("http://localhost:8545").await?; let result: String = client.call_method("eth_protocolVersion", rpc_params![]).await?; println!("Protocol version: {}", result); Ok(()) }
Debug
Known issues
gotchaRequires an async runtime (e.g., Tokio) for HTTP transport.
fix
Add `tokio` as a dependency and use `#[tokio::main]` or another async runtime.
affects: >=18.0.0
Upgrade
Version history
18.0.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
jsonrpc-core-client — cargo add jsonrpc-core-client · libregistry