pub struct NodeBase {
pub base_config: NodeBaseConfig,
pub global_config: GlobalConfig,
pub initial_peer_count: usize,
pub keypair: Arc<KeyPair>,
pub network: Network,
pub dht_client: DhtClient,
pub peer_resolver: PeerResolver,
pub overlay_service: OverlayService,
pub storage_context: StorageContext,
pub core_storage: CoreStorage,
pub blockchain_rpc_client: BlockchainRpcClient,
}Fields§
§base_config: NodeBaseConfig§global_config: GlobalConfig§initial_peer_count: usize§keypair: Arc<KeyPair>§network: Network§dht_client: DhtClient§peer_resolver: PeerResolver§overlay_service: OverlayService§storage_context: StorageContext§core_storage: CoreStorage§blockchain_rpc_client: BlockchainRpcClientImplementations§
Source§impl NodeBase
impl NodeBase
pub fn builder<'a>( base_config: &'a NodeBaseConfig, global_config: &'a GlobalConfig, ) -> NodeBaseBuilder<'a, ()>
Sourcepub async fn init(
&self,
boot_type: ColdBootType,
import_zerostate: Option<Vec<PathBuf>>,
queue_state_handler: Option<Box<dyn QueueStateHandler>>,
) -> Result<BlockId>
pub async fn init( &self, boot_type: ColdBootType, import_zerostate: Option<Vec<PathBuf>>, queue_state_handler: Option<Box<dyn QueueStateHandler>>, ) -> Result<BlockId>
Wait for some peers and boot the node.
Sourcepub async fn init_ext(&self, args: NodeBootArgs) -> Result<BlockId>
pub async fn init_ext(&self, args: NodeBootArgs) -> Result<BlockId>
Wait for some peers and boot the node.
Sourcepub async fn wait_for_neighbours(&self, count: usize)
pub async fn wait_for_neighbours(&self, count: usize)
Wait for at least count public overlay peers to resolve.
Sourcepub async fn boot(
&self,
boot_type: ColdBootType,
zerostates: Option<Vec<PathBuf>>,
queue_state_handler: Option<Box<dyn QueueStateHandler>>,
) -> Result<BlockId>
pub async fn boot( &self, boot_type: ColdBootType, zerostates: Option<Vec<PathBuf>>, queue_state_handler: Option<Box<dyn QueueStateHandler>>, ) -> Result<BlockId>
Initialize the node and return the init block id.
Sourcepub async fn boot_ext(&self, args: NodeBootArgs) -> Result<BlockId>
pub async fn boot_ext(&self, args: NodeBootArgs) -> Result<BlockId>
Initialize the node and return the init block id.
pub fn validator_resolver(&self) -> &ValidatorsResolver
Sourcepub fn update_validator_set(&self, vset: &ValidatorSet)
pub fn update_validator_set(&self, vset: &ValidatorSet)
Update current validator targets with the specified set.
Sourcepub async fn update_validator_set_from_shard_state(
&self,
block_id: &BlockId,
) -> Result<()>
pub async fn update_validator_set_from_shard_state( &self, block_id: &BlockId, ) -> Result<()>
Update current validator targets using the validator set from the provider
pub fn build_archive_block_provider(&self) -> ArchiveBlockProvider
pub fn build_blockchain_block_provider(&self) -> BlockchainBlockProvider
pub fn build_storage_block_provider(&self) -> StorageBlockProvider
Sourcepub fn build_strider<P, S>(
&self,
provider: P,
subscriber: S,
) -> BlockStrider<PersistentBlockStriderState, P, S>where
P: BlockProvider,
S: BlockSubscriber,
pub fn build_strider<P, S>(
&self,
provider: P,
subscriber: S,
) -> BlockStrider<PersistentBlockStriderState, P, S>where
P: BlockProvider,
S: BlockSubscriber,
Creates a new BlockStrider using options from the base config.
Auto Trait Implementations§
impl Freeze for NodeBase
impl !RefUnwindSafe for NodeBase
impl Send for NodeBase
impl Sync for NodeBase
impl Unpin for NodeBase
impl !UnwindSafe for NodeBase
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