mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 09:51:02 +00:00
Add Rococo test network (#1363)
* Add Rococo test network * Correct license header * Add bootNodes address * Fix compile errors * Change bootNodes * Change rococo bootNodes * Add new bootNodes * Fix bootNodes typo * Remove public telemetry * Add rococo-local chain spec * Remove staking * Remove staking from chain spec * use rococo-staging chain spec and preserve bootnodes * Same but with --raw * update chain name and remove telemetry * Empty commit to re-trigger CI * Fix revision (temp. until I merge master) * Revert to branch = master to avoid conflicts * Revert to branch = master to avoid conflicts * Disable test (temp) * Revert to branch = master to avoid conflicts * Revert to branch = master to avoid conflicts * Change bootNodes IPs for second rococo network * Revert "Disable test (temp)" This reverts commit a159f12e3131d1a25dabb1a4d2834642f2bcdc26. * Revert purchase * Update chain spec * FUUU * Update service/src/lib.rs Co-authored-by: Robert Habermeier <rphmeier@gmail.com> * Update runtime/rococo/src/lib.rs Co-authored-by: Robert Habermeier <rphmeier@gmail.com> * Fix compilation Co-authored-by: Evaldo <contato@evaldofelipe.com> Co-authored-by: David Dorgan <david@parity.io> Co-authored-by: Cecile Tonglet <cecile.tonglet@cecton.com> Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
This commit is contained in:
@@ -75,6 +75,13 @@ native_executor_instance!(
|
||||
frame_benchmarking::benchmarking::HostFunctions,
|
||||
);
|
||||
|
||||
native_executor_instance!(
|
||||
pub RococoExecutor,
|
||||
rococo_runtime::api::dispatch,
|
||||
rococo_runtime::native_version,
|
||||
frame_benchmarking::benchmarking::HostFunctions,
|
||||
);
|
||||
|
||||
/// A set of APIs that polkadot-like runtimes must implement.
|
||||
pub trait RuntimeApiCollection:
|
||||
sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>
|
||||
@@ -118,15 +125,23 @@ pub trait IdentifyVariant {
|
||||
|
||||
/// Returns if this is a configuration for the `Westend` network.
|
||||
fn is_westend(&self) -> bool;
|
||||
|
||||
/// Returns if this is a configuration for the `Rococo` network.
|
||||
fn is_rococo(&self) -> bool;
|
||||
}
|
||||
|
||||
impl IdentifyVariant for Box<dyn ChainSpec> {
|
||||
fn is_kusama(&self) -> bool {
|
||||
self.id().starts_with("kusama") || self.id().starts_with("ksm")
|
||||
}
|
||||
|
||||
fn is_westend(&self) -> bool {
|
||||
self.id().starts_with("westend") || self.id().starts_with("wnd")
|
||||
}
|
||||
|
||||
fn is_rococo(&self) -> bool {
|
||||
self.id().starts_with("rococo") || self.id().starts_with("roc")
|
||||
}
|
||||
}
|
||||
|
||||
type FullBackend = service::TFullBackend<Block>;
|
||||
@@ -771,7 +786,7 @@ pub fn kusama_new_full(
|
||||
Ok((service, client, handles))
|
||||
}
|
||||
|
||||
/// Create a new Kusama service for a full node.
|
||||
/// Create a new Westend service for a full node.
|
||||
#[cfg(feature = "full-node")]
|
||||
pub fn westend_new_full(
|
||||
config: Configuration,
|
||||
@@ -804,6 +819,39 @@ pub fn westend_new_full(
|
||||
Ok((service, client, handles))
|
||||
}
|
||||
|
||||
/// Create a new Rococo service for a full node.
|
||||
#[cfg(feature = "full-node")]
|
||||
pub fn rococo_new_full(
|
||||
config: Configuration,
|
||||
collating_for: Option<(CollatorId, parachain::Id)>,
|
||||
max_block_data_size: Option<u64>,
|
||||
authority_discovery_disabled: bool,
|
||||
slot_duration: u64,
|
||||
grandpa_pause: Option<(u32, u32)>,
|
||||
)
|
||||
-> Result<(
|
||||
TaskManager,
|
||||
Arc<impl PolkadotClient<
|
||||
Block,
|
||||
TFullBackend<Block>,
|
||||
rococo_runtime::RuntimeApi
|
||||
>>,
|
||||
FullNodeHandles,
|
||||
), ServiceError>
|
||||
{
|
||||
let (service, client, handles, _, _) = new_full::<rococo_runtime::RuntimeApi, RococoExecutor>(
|
||||
config,
|
||||
collating_for,
|
||||
max_block_data_size,
|
||||
authority_discovery_disabled,
|
||||
slot_duration,
|
||||
grandpa_pause,
|
||||
false,
|
||||
)?;
|
||||
|
||||
Ok((service, client, handles))
|
||||
}
|
||||
|
||||
/// Handles to other sub-services that full nodes instantiate, which consumers
|
||||
/// of the node may use.
|
||||
#[cfg(feature = "full-node")]
|
||||
@@ -838,6 +886,10 @@ impl NodeBuilder {
|
||||
new_light::<westend_runtime::RuntimeApi, WestendExecutor>(
|
||||
self.config,
|
||||
)
|
||||
} else if self.config.chain_spec.is_rococo() {
|
||||
new_light::<rococo_runtime::RuntimeApi, RococoExecutor>(
|
||||
self.config,
|
||||
)
|
||||
} else {
|
||||
new_light::<polkadot_runtime::RuntimeApi, PolkadotExecutor>(
|
||||
self.config,
|
||||
@@ -875,6 +927,16 @@ impl NodeBuilder {
|
||||
grandpa_pause,
|
||||
false,
|
||||
).map(|(task_manager, _, _, _, _)| task_manager)
|
||||
} else if self.config.chain_spec.is_rococo() {
|
||||
new_full::<rococo_runtime::RuntimeApi, RococoExecutor>(
|
||||
self.config,
|
||||
collating_for,
|
||||
max_block_data_size,
|
||||
authority_discovery_disabled,
|
||||
slot_duration,
|
||||
grandpa_pause,
|
||||
false,
|
||||
).map(|(task_manager, _, _, _, _)| task_manager)
|
||||
} else {
|
||||
new_full::<polkadot_runtime::RuntimeApi, PolkadotExecutor>(
|
||||
self.config,
|
||||
|
||||
Reference in New Issue
Block a user