Registry / networking / ethers

ethers

JSON →
library2.0.14rscratesunverified

A complete Ethereum and Celo Rust library for interacting with the Ethereum blockchain.

# Cargo.toml [dependencies] ethers = "2.0.14"
INSTALL
IMPORT
SIG · ETHERS
E
ethers
networkingrustv2.0.14
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.

Provider
✓ use ethers::prelude::*;

Connects to Ethereum mainnet and fetches the current block number.

use ethers::prelude::*; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { let provider = Provider::<Http>::try_from("https://mainnet.infura.io/v3/YOUR_API_KEY")?; let block_number = provider.get_block_number().await?; println!("Current block: {}", block_number); Ok(()) }
Debug
Known issues
gotchaRequires an async runtime (tokio) and feature flags for transports
fix
Add tokio as a dependency and enable the 'rustls' or 'openssl' feature for HTTPS.
affects: >=2.0.0
Upgrade
Version history
2.0.14latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
24 hits · last 30 days
node
20
Amazon
1
OpenAI (training)
1
Resources
ethers — cargo add ethers · libregistry