[][src]Struct beacon_node::ClientBuilder

pub struct ClientBuilder<T> where
    T: BeaconChainTypes
{ /* fields omitted */ }

Builds a Client instance.

Notes

The builder may start some services (e.g.., libp2p, http server) immediately after they are initialized, before the self.build(..) method has been called.

Types may be elided and the compiler will infer them once all required methods have been called.

If type inference errors are raised, ensure all necessary components have been initialized. For example, the compiler will be unable to infer T::Store unless self.disk_store(..) or self.memory_store(..) has been called.

Methods

impl<TStore, TSlotClock, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler> ClientBuilder<Witness<TStore, TSlotClock, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler>> where
    TEth1Backend: Eth1ChainBackend<TEthSpec> + 'static,
    TEthSpec: EthSpec + 'static,
    TEventHandler: EventHandler<TEthSpec> + 'static,
    TLmdGhost: LmdGhost<TStore, TEthSpec> + 'static,
    TSlotClock: SlotClock + Clone + 'static,
    TStore: Store + 'static, 
[src]

pub fn new(
    eth_spec_instance: TEthSpec
) -> ClientBuilder<Witness<TStore, TSlotClock, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler>>
[src]

Instantiates a new, empty builder.

The eth_spec_instance parameter is used to concretize TEthSpec.

pub fn runtime_context(
    self,
    context: RuntimeContext<TEthSpec>
) -> ClientBuilder<Witness<TStore, TSlotClock, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler>>
[src]

Specifies the runtime context (tokio executor, logger, etc) for client services.

pub fn chain_spec(
    self,
    spec: ChainSpec
) -> ClientBuilder<Witness<TStore, TSlotClock, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler>>
[src]

Specifies the ChainSpec.

pub fn beacon_chain_builder(
    self,
    client_genesis: ClientGenesis,
    config: Config
) -> impl Future<Item = ClientBuilder<Witness<TStore, TSlotClock, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler>>, Error = String>
[src]

Initializes the BeaconChainBuilder. The build_beacon_chain method will need to be called later in order to actually instantiate the BeaconChain.

pub fn libp2p_network(
    self,
    config: &Config
) -> Result<ClientBuilder<Witness<TStore, TSlotClock, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler>>, String>
[src]

Immediately starts the libp2p networking stack.

pub fn grpc_server(
    self,
    config: &Config
) -> Result<ClientBuilder<Witness<TStore, TSlotClock, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler>>, String>
[src]

Immediately starts the gRPC server (gRPC is soon to be deprecated).

pub fn http_server(
    self,
    client_config: &Config,
    eth2_config: &Eth2Config
) -> Result<ClientBuilder<Witness<TStore, TSlotClock, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler>>, String>
[src]

Immediately starts the beacon node REST API http server.

pub fn peer_count_notifier(
    self
) -> Result<ClientBuilder<Witness<TStore, TSlotClock, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler>>, String>
[src]

Immediately starts the service that periodically logs about the libp2p peer count.

pub fn slot_notifier(
    self
) -> Result<ClientBuilder<Witness<TStore, TSlotClock, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler>>, String>
[src]

Immediately starts the service that periodically logs information each slot.

pub fn build(
    self
) -> Client<Witness<TStore, TSlotClock, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler>>
[src]

Consumers the builder, returning a Client if all necessary components have been specified.

If type inference errors are being raised, see the comment on the definition of Self.

impl<TStore, TSlotClock, TEth1Backend, TEthSpec, TEventHandler> ClientBuilder<Witness<TStore, TSlotClock, ThreadSafeReducedTree<TStore, TEthSpec>, TEth1Backend, TEthSpec, TEventHandler>> where
    TEth1Backend: Eth1ChainBackend<TEthSpec> + 'static,
    TEthSpec: EthSpec + 'static,
    TEventHandler: EventHandler<TEthSpec> + 'static,
    TSlotClock: SlotClock + Clone + 'static,
    TStore: Store + 'static, 
[src]

pub fn build_beacon_chain(
    self
) -> Result<ClientBuilder<Witness<TStore, TSlotClock, ThreadSafeReducedTree<TStore, TEthSpec>, TEth1Backend, TEthSpec, TEventHandler>>, String>
[src]

Consumes the internal BeaconChainBuilder, attaching the resulting BeaconChain to self.

impl<TStore, TSlotClock, TLmdGhost, TEth1Backend, TEthSpec> ClientBuilder<Witness<TStore, TSlotClock, TLmdGhost, TEth1Backend, TEthSpec, WebSocketSender<TEthSpec>>> where
    TEth1Backend: Eth1ChainBackend<TEthSpec> + 'static,
    TEthSpec: EthSpec + 'static,
    TLmdGhost: LmdGhost<TStore, TEthSpec> + 'static,
    TSlotClock: SlotClock + 'static,
    TStore: Store + 'static, 
[src]

pub fn websocket_event_handler(
    self,
    config: Config
) -> Result<ClientBuilder<Witness<TStore, TSlotClock, TLmdGhost, TEth1Backend, TEthSpec, WebSocketSender<TEthSpec>>>, String>
[src]

Specifies that the BeaconChain should publish events using the WebSocket server.

impl<TSlotClock, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler> ClientBuilder<Witness<LevelDB, TSlotClock, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler>> where
    TEth1Backend: Eth1ChainBackend<TEthSpec> + 'static,
    TEthSpec: EthSpec + 'static,
    TEventHandler: EventHandler<TEthSpec> + 'static,
    TLmdGhost: LmdGhost<LevelDB, TEthSpec> + 'static,
    TSlotClock: SlotClock + 'static, 
[src]

pub fn disk_store(
    self,
    path: &Path
) -> Result<ClientBuilder<Witness<LevelDB, TSlotClock, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler>>, String>
[src]

Specifies that the Client should use a DiskStore database.

impl<TSlotClock, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler> ClientBuilder<Witness<MemoryStore, TSlotClock, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler>> where
    TEth1Backend: Eth1ChainBackend<TEthSpec> + 'static,
    TEthSpec: EthSpec + 'static,
    TEventHandler: EventHandler<TEthSpec> + 'static,
    TLmdGhost: LmdGhost<MemoryStore, TEthSpec> + 'static,
    TSlotClock: SlotClock + 'static, 
[src]

pub fn memory_store(
    self
) -> ClientBuilder<Witness<MemoryStore, TSlotClock, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler>>
[src]

Specifies that the Client should use a MemoryStore database.

impl<TStore, TSlotClock, TLmdGhost, TEthSpec, TEventHandler> ClientBuilder<Witness<TStore, TSlotClock, TLmdGhost, CachingEth1Backend<TEthSpec, TStore>, TEthSpec, TEventHandler>> where
    TEthSpec: EthSpec + 'static,
    TEventHandler: EventHandler<TEthSpec> + 'static,
    TLmdGhost: LmdGhost<TStore, TEthSpec> + 'static,
    TSlotClock: SlotClock + 'static,
    TStore: Store + 'static, 
[src]

pub fn caching_eth1_backend(
    self,
    config: Config
) -> Result<ClientBuilder<Witness<TStore, TSlotClock, TLmdGhost, CachingEth1Backend<TEthSpec, TStore>, TEthSpec, TEventHandler>>, String>
[src]

Specifies that the BeaconChain should cache eth1 blocks/logs from a remote eth1 node (e.g., Parity/Geth) and refer to that cache when collecting deposits or eth1 votes during block production.

pub fn no_eth1_backend(
    self
) -> Result<ClientBuilder<Witness<TStore, TSlotClock, TLmdGhost, CachingEth1Backend<TEthSpec, TStore>, TEthSpec, TEventHandler>>, String>
[src]

Do not use any eth1 backend. The client will not be able to produce beacon blocks.

pub fn dummy_eth1_backend(
    self
) -> Result<ClientBuilder<Witness<TStore, TSlotClock, TLmdGhost, CachingEth1Backend<TEthSpec, TStore>, TEthSpec, TEventHandler>>, String>
[src]

Use an eth1 backend that can produce blocks but is not connected to an Eth1 node.

This backend will never produce deposits so it's impossible to add validators after genesis. The Eth1Data votes will be deterministic junk data.

Notes

The client is given the CachingEth1Backend type, but the http backend is never started and the caches are never used.

impl<TStore, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler> ClientBuilder<Witness<TStore, SystemTimeSlotClock, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler>> where
    TEth1Backend: Eth1ChainBackend<TEthSpec> + 'static,
    TEthSpec: EthSpec + 'static,
    TEventHandler: EventHandler<TEthSpec> + 'static,
    TLmdGhost: LmdGhost<TStore, TEthSpec> + 'static,
    TStore: Store + 'static, 
[src]

pub fn system_time_slot_clock(
    self
) -> Result<ClientBuilder<Witness<TStore, SystemTimeSlotClock, TLmdGhost, TEth1Backend, TEthSpec, TEventHandler>>, String>
[src]

Specifies that the slot clock should read the time from the computers system clock.

Auto Trait Implementations

impl<T> Send for ClientBuilder<T> where
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::EpochsPerHistoricalVector: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::EpochsPerSlashingsVector: Send + Sync,
    <T as BeaconChainTypes>::Eth1Chain: Send + Sync,
    <T as BeaconChainTypes>::EthSpec: EthSpec + Send + Sync,
    <T as BeaconChainTypes>::EventHandler: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::HistoricalRootsLimit: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::JustificationBitsLength: Send + Sync,
    <T as BeaconChainTypes>::LmdGhost: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxAttestations: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxAttesterSlashings: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxDeposits: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxPendingAttestations: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxProposerSlashings: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxTransfers: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxValidatorsPerCommittee: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxVoluntaryExits: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::ShardCount: Send + Sync,
    <T as BeaconChainTypes>::SlotClock: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::SlotsPerEth1VotingPeriod: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::SlotsPerHistoricalRoot: Send + Sync,
    <T as BeaconChainTypes>::Store: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::ValidatorRegistryLimit: Send + Sync

impl<T> Unpin for ClientBuilder<T> where
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::EpochsPerHistoricalVector: Unpin,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::EpochsPerSlashingsVector: Unpin,
    <T as BeaconChainTypes>::Eth1Chain: Unpin,
    <T as BeaconChainTypes>::EthSpec: EthSpec + Unpin,
    <T as BeaconChainTypes>::EventHandler: Unpin,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::HistoricalRootsLimit: Unpin,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::JustificationBitsLength: Unpin,
    <T as BeaconChainTypes>::LmdGhost: Unpin,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxAttestations: Unpin,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxAttesterSlashings: Unpin,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxDeposits: Unpin,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxPendingAttestations: Unpin,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxProposerSlashings: Unpin,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxTransfers: Unpin,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxValidatorsPerCommittee: Unpin,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxVoluntaryExits: Unpin,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::ShardCount: Unpin,
    <T as BeaconChainTypes>::SlotClock: Unpin,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::SlotsPerEth1VotingPeriod: Unpin,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::SlotsPerHistoricalRoot: Unpin,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::ValidatorRegistryLimit: Unpin

impl<T> Sync for ClientBuilder<T> where
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::EpochsPerHistoricalVector: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::EpochsPerSlashingsVector: Send + Sync,
    <T as BeaconChainTypes>::Eth1Chain: Send + Sync,
    <T as BeaconChainTypes>::EthSpec: EthSpec + Send + Sync,
    <T as BeaconChainTypes>::EventHandler: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::HistoricalRootsLimit: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::JustificationBitsLength: Send + Sync,
    <T as BeaconChainTypes>::LmdGhost: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxAttestations: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxAttesterSlashings: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxDeposits: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxPendingAttestations: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxProposerSlashings: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxTransfers: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxValidatorsPerCommittee: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxVoluntaryExits: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::ShardCount: Send + Sync,
    <T as BeaconChainTypes>::SlotClock: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::SlotsPerEth1VotingPeriod: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::SlotsPerHistoricalRoot: Send + Sync,
    <T as BeaconChainTypes>::Store: Send + Sync,
    <<T as BeaconChainTypes>::EthSpec as EthSpec>::ValidatorRegistryLimit: Send + Sync

impl<T> !UnwindSafe for ClientBuilder<T>

impl<T> !RefUnwindSafe for ClientBuilder<T>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err

impl<T> Erased for T