Registry / networking / solana-rpc

solana-rpc

JSON →
library4.0.0rscratesunverified

Solana RPC provides client types and methods for interacting with the Solana JSON RPC API.

# Cargo.toml [dependencies] solana-rpc = "4.0.0"
INSTALL
IMPORT
SIG · SOLANA-RPC
S
solana-rpc
networkingrustv4.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.

RpcClient
use solana_rpc::rpc::RpcClient;

Creates an RPC client and fetches the current slot.

use solana_rpc::rpc::RpcClient; let client = RpcClient::new("https://api.mainnet-beta.solana.com".to_string()); let slot = client.get_slot().unwrap(); println!("Current slot: {}", slot);
Debug
Known issues
gotchaRequires the `full` feature flag for all RPC methods; otherwise some methods are unavailable.
fix
Add `features = ["full"]` to your Cargo.toml dependency.
affects: >=2.0.0
Upgrade
Version history
4.0.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
Amazon
1
Resources
solana-rpc — cargo add solana-rpc · libregistry