alloy_node_bindings/
node.rsuse alloy_primitives::hex;
use std::time::Duration;
use thiserror::Error;
pub const NODE_STARTUP_TIMEOUT: Duration = Duration::from_secs(10);
pub const NODE_DIAL_LOOP_TIMEOUT: Duration = Duration::from_secs(20);
#[derive(Debug, Error)]
pub enum NodeError {
#[error("no stderr was captured from the process")]
NoStderr,
#[error("no stdout was captured from the process")]
NoStdout,
#[error("timed out waiting for node to spawn; is the node binary installed?")]
Timeout,
#[error("fatal error: {0}")]
Fatal(String),
#[error("could not read line from node stderr: {0}")]
ReadLineError(std::io::Error),
#[error("the chain ID was not set")]
ChainIdNotSet,
#[error("could not create directory: {0}")]
CreateDirError(std::io::Error),
#[error("genesis error occurred: {0}")]
GenesisError(String),
#[error("node init error occurred")]
InitError,
#[error("could not spawn node: {0}")]
SpawnError(std::io::Error),
#[error("could not wait for node to exit: {0}")]
WaitError(std::io::Error),
#[error("clique address error: {0}")]
CliqueAddressError(String),
#[error("could not parse private key")]
ParsePrivateKeyError,
#[error("could not deserialize private key from bytes")]
DeserializePrivateKeyError,
#[error(transparent)]
FromHexError(#[from] hex::FromHexError),
#[error("no keys available in this node instance")]
NoKeysAvailable,
}