Ethers uses a middleware-based architecture. You start the middleware stack with a Provider, and wrap it with additional middleware functionalities that you need.

Available Middleware

Example of a middleware stack

```norun use ethersproviders::{Provider, Http}; use etherssigners::{LocalWallet, Signer}; use ethersmiddleware::{ gasescalator::{GasEscalatorMiddleware, GeometricGasPrice, Frequency}, gasoracle::{GasOracleMiddleware, EthGasStation, GasCategory}, signer::SignerMiddleware, noncemanager::NonceManagerMiddleware, }; use etherscore::rand; use std::convert::TryFrom;

// Start the stack let provider = Provider::::try_from("http://localhost:8545").unwrap();

// Escalate gas prices let escalator = GeometricGasPrice::new(1.125, 60u64, None::); let provider = GasEscalatorMiddleware::new(provider, escalator, Frequency::PerBlock);

// Sign transactions with a private key let signer = LocalWallet::new(&mut rand::thread_rng()); let address = signer.address(); let provider = SignerMiddleware::new(provider, signer);

// Use EthGasStation as the gas oracle let gasoracle = EthGasStation::new(None); let provider = GasOracleMiddleware::new(provider, gasoracle);

// Manage nonces locally let provider = NonceManagerMiddleware::new(provider, address);

// ... do something with the provider ```