pub struct Node {
pub client: Client,
pub params: ConnectParams,
/* private fields */
}Expand description
Struct representing the bitcoind process with related information
Fields§
§client: ClientRpc client linked to this bitcoind process
params: ConnectParamsContains information to connect to this node
Implementations§
Source§impl Node
impl Node
Sourcepub fn new<S: AsRef<OsStr>>(exe: S) -> Result<Node>
pub fn new<S: AsRef<OsStr>>(exe: S) -> Result<Node>
Launch the bitcoind process from the given exe executable with default args.
Waits for the node to be ready to accept connections before returning
Sourcepub fn with_conf<S: AsRef<OsStr>>(exe: S, conf: &Conf<'_>) -> Result<Node>
pub fn with_conf<S: AsRef<OsStr>>(exe: S, conf: &Conf<'_>) -> Result<Node>
Launch the bitcoind process from the given exe executable with given Conf param and create/load the “default” wallet.
Sourcepub fn rpc_url(&self) -> String
pub fn rpc_url(&self) -> String
Returns the rpc URL including the schema eg. http://127.0.0.1:44842
Sourcepub fn rpc_url_with_wallet<T: AsRef<str>>(&self, wallet_name: T) -> String
Available on crate feature 0_19_1 or non-crate feature download only.
pub fn rpc_url_with_wallet<T: AsRef<str>>(&self, wallet_name: T) -> String
0_19_1 or non-crate feature download only.Returns the rpc URL including the schema and the given wallet_name
eg. http://127.0.0.1:44842/wallet/my_wallet
Sourcepub fn p2p_connect(&self, listen: bool) -> Option<P2P>
pub fn p2p_connect(&self, listen: bool) -> Option<P2P>
Returns the P2P enum to connect to this node p2p port
Sourcepub fn stop(&mut self) -> Result<ExitStatus>
pub fn stop(&mut self) -> Result<ExitStatus>
Stop the node, waiting correct process termination
Source§impl Node
impl Node
Sourcepub fn from_downloaded() -> Result<Node>
Available on crate feature download only.
pub fn from_downloaded() -> Result<Node>
download only.create Node struct with the downloaded executable.
Sourcepub fn from_downloaded_with_conf(conf: &Conf<'_>) -> Result<Node>
Available on crate feature download only.
pub fn from_downloaded_with_conf(conf: &Conf<'_>) -> Result<Node>
download only.create Node struct with the downloaded executable and given Conf.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Node
impl !RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl !UnwindSafe for Node
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more