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
sourceimpl 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.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Geth
impl Send for Geth
impl Sync for Geth
impl Unpin for Geth
impl UnwindSafe for Geth
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more