alloy_node_bindings/
node.rs1use alloy_primitives::hex;
4use std::time::Duration;
5use thiserror::Error;
6
7pub const NODE_STARTUP_TIMEOUT: Duration = Duration::from_secs(10);
9
10pub const NODE_DIAL_LOOP_TIMEOUT: Duration = Duration::from_secs(20);
12
13#[derive(Debug, Error)]
15pub enum NodeError {
16 #[error("no stderr was captured from the process")]
18 NoStderr,
19 #[error("no stdout was captured from the process")]
21 NoStdout,
22 #[error("timed out waiting for node to spawn; is the node binary installed?")]
24 Timeout,
25 #[error("fatal error: {0}")]
27 Fatal(String),
28 #[error("could not read line from node stderr: {0}")]
30 ReadLineError(std::io::Error),
31
32 #[error("the chain ID was not set")]
34 ChainIdNotSet,
35 #[error("could not create directory: {0}")]
37 CreateDirError(std::io::Error),
38
39 #[error("genesis error occurred: {0}")]
41 GenesisError(String),
42 #[error("node init error occurred")]
44 InitError,
45 #[error("could not spawn node: {0}")]
47 SpawnError(std::io::Error),
48 #[error("could not wait for node to exit: {0}")]
50 WaitError(std::io::Error),
51
52 #[error("clique address error: {0}")]
54 CliqueAddressError(String),
55
56 #[error("could not parse private key")]
58 ParsePrivateKeyError,
59 #[error("could not deserialize private key from bytes")]
61 DeserializePrivateKeyError,
62 #[error(transparent)]
64 FromHexError(#[from] hex::FromHexError),
65 #[error("no keys available in this node instance")]
67 NoKeysAvailable,
68}