pub enum Node<N: Network> {
Validator(Arc<Validator<N, ConsensusDB<N>>>),
Prover(Arc<Prover<N, ConsensusMemory<N>>>),
Client(Arc<Client<N, ConsensusDB<N>>>),
}
Variants§
Validator(Arc<Validator<N, ConsensusDB<N>>>)
A validator is a full node, capable of validating blocks.
Prover(Arc<Prover<N, ConsensusMemory<N>>>)
A prover is a light node, capable of producing proofs for consensus.
Client(Arc<Client<N, ConsensusDB<N>>>)
A client node is a full node, capable of querying with the network.
Implementations§
Source§impl<N: Network> Node<N>
impl<N: Network> Node<N>
Sourcepub async fn new_validator(
node_ip: SocketAddr,
bft_ip: Option<SocketAddr>,
rest_ip: Option<SocketAddr>,
rest_rps: u32,
account: Account<N>,
trusted_peers: &[SocketAddr],
trusted_validators: &[SocketAddr],
genesis: Block<N>,
cdn: Option<Uri>,
storage_mode: StorageMode,
allow_external_peers: bool,
dev_txs: bool,
dev: Option<u16>,
shutdown: Arc<AtomicBool>,
) -> Result<Self>
pub async fn new_validator( node_ip: SocketAddr, bft_ip: Option<SocketAddr>, rest_ip: Option<SocketAddr>, rest_rps: u32, account: Account<N>, trusted_peers: &[SocketAddr], trusted_validators: &[SocketAddr], genesis: Block<N>, cdn: Option<Uri>, storage_mode: StorageMode, allow_external_peers: bool, dev_txs: bool, dev: Option<u16>, shutdown: Arc<AtomicBool>, ) -> Result<Self>
Initializes a new validator node.
Sourcepub async fn new_prover(
node_ip: SocketAddr,
account: Account<N>,
trusted_peers: &[SocketAddr],
genesis: Block<N>,
dev: Option<u16>,
shutdown: Arc<AtomicBool>,
) -> Result<Self>
pub async fn new_prover( node_ip: SocketAddr, account: Account<N>, trusted_peers: &[SocketAddr], genesis: Block<N>, dev: Option<u16>, shutdown: Arc<AtomicBool>, ) -> Result<Self>
Initializes a new prover node.
Sourcepub async fn new_client(
node_ip: SocketAddr,
rest_ip: Option<SocketAddr>,
rest_rps: u32,
account: Account<N>,
trusted_peers: &[SocketAddr],
genesis: Block<N>,
cdn: Option<Uri>,
storage_mode: StorageMode,
rotate_external_peers: bool,
dev: Option<u16>,
shutdown: Arc<AtomicBool>,
) -> Result<Self>
pub async fn new_client( node_ip: SocketAddr, rest_ip: Option<SocketAddr>, rest_rps: u32, account: Account<N>, trusted_peers: &[SocketAddr], genesis: Block<N>, cdn: Option<Uri>, storage_mode: StorageMode, rotate_external_peers: bool, dev: Option<u16>, shutdown: Arc<AtomicBool>, ) -> Result<Self>
Initializes a new client node.
Sourcepub fn private_key(&self) -> &PrivateKey<N>
pub fn private_key(&self) -> &PrivateKey<N>
Returns the account private key of the node.
Sourcepub fn ledger(&self) -> Option<&Ledger<N, ConsensusDB<N>>>
pub fn ledger(&self) -> Option<&Ledger<N, ConsensusDB<N>>>
Get the underlying ledger (if any).
Auto Trait Implementations§
impl<N> Freeze for Node<N>
impl<N> !RefUnwindSafe for Node<N>
impl<N> Send for Node<N>
impl<N> Sync for Node<N>
impl<N> Unpin for Node<N>
impl<N> !UnwindSafe for Node<N>
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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