diff --git a/README.md b/README.md index 025471a2..640329a7 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ use web3::futures::Future; fn main() { let (_eloop, transport) = web3::transports::Http::new("http://localhost:8545").unwrap(); + let web3 = web3::Web3::new(transport); let accounts = web3.eth().accounts().wait().unwrap(); diff --git a/examples/contract.rs b/examples/contract.rs index 7894a230..da4b7357 100644 --- a/examples/contract.rs +++ b/examples/contract.rs @@ -8,7 +8,10 @@ use web3::types::{Address, U256}; fn main() { env_logger::init(); - let (_eloop, http) = web3::transports::Http::new("http://localhost:8545").unwrap(); + let (eloop, http) = web3::transports::Http::new("http://localhost:8545").unwrap(); + // run the event loop in the background + eloop.into_remote(); + let web3 = web3::Web3::new(http); let my_account: Address = "d028d24f16a8893bd078259d413372ac01580769".parse().unwrap();