Struct ethers_core::utils::Geth
source · pub struct Geth { /* private fields */ }
Expand description
Builder for launching geth
.
Panics
If spawn
is called without geth
being available in the user’s $PATH
Example
use ethers_core::utils::Geth;
let port = 8545u16;
let url = format!("http://localhost:{}", port).to_string();
let geth = Geth::new()
.port(port)
.block_time(5000u64)
.spawn();
drop(geth); // this will kill the instance
Implementations§
source§impl Geth
impl Geth
sourcepub fn new() -> Self
pub fn new() -> Self
Creates an empty Geth builder. The default port is 8545. The mnemonic is chosen randomly.
sourcepub fn port<T: Into<u16>>(self, port: T) -> Self
pub fn port<T: Into<u16>>(self, port: T) -> Self
Sets the port which will be used when the geth-cli
instance is launched.
sourcepub fn block_time<T: Into<u64>>(self, block_time: T) -> Self
pub fn block_time<T: Into<u64>>(self, block_time: T) -> Self
Sets the block-time which will be used when the geth-cli
instance is launched.
sourcepub fn ipc_path<T: Into<PathBuf>>(self, path: T) -> Self
pub fn ipc_path<T: Into<PathBuf>>(self, path: T) -> Self
Manually sets the IPC path for the socket manually.
sourcepub fn spawn(self) -> GethInstance
pub fn spawn(self) -> GethInstance
Consumes the builder and spawns geth
with stdout redirected
to /dev/null.