mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 23:18:01 +00:00
The network configuration now makes more sense (#2706)
* The network configuration now makes more sense * Reexport ProtocolConfig
This commit is contained in:
committed by
Gavin Wood
parent
3a0c52f2b1
commit
f8303a6b57
@@ -34,7 +34,7 @@ use crate::on_demand::{OnDemandCore, OnDemandNetwork, RequestData};
|
||||
use crate::specialization::NetworkSpecialization;
|
||||
use crate::sync::{ChainSync, Context as SyncContext, Status as SyncStatus, SyncState};
|
||||
use crate::service::{TransactionPool, ExHashT};
|
||||
use crate::config::{ProtocolConfig, Roles};
|
||||
use crate::config::Roles;
|
||||
use rustc_hex::ToHex;
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
use std::sync::Arc;
|
||||
@@ -273,6 +273,21 @@ struct ContextData<B: BlockT, H: ExHashT> {
|
||||
pub chain: Arc<Client<B>>,
|
||||
}
|
||||
|
||||
/// Configuration for the Substrate-specific part of the networking layer.
|
||||
#[derive(Clone)]
|
||||
pub struct ProtocolConfig {
|
||||
/// Assigned roles.
|
||||
pub roles: Roles,
|
||||
}
|
||||
|
||||
impl Default for ProtocolConfig {
|
||||
fn default() -> ProtocolConfig {
|
||||
ProtocolConfig {
|
||||
roles: Roles::FULL,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<B: BlockT, S: NetworkSpecialization<B>, H: ExHashT> Protocol<B, S, H> {
|
||||
/// Create a new instance.
|
||||
pub fn new(
|
||||
|
||||
Reference in New Issue
Block a user