pub async fn start_arctic_node(
    parachain_config: Configuration,
    polkadot_config: Configuration,
    id: ParaId,
    collator_options: CollatorOptions
) -> sc_service::error::Result<(
    TaskManager,
    Arc<TFullClient<Block, arctic::RuntimeApi, NativeElseWasmExecutor<arctic::Executor>>>,
)> {
    start_contracts_node_impl::<arctic::RuntimeApi, arctic::Executor, _, _>(
        parachain_config,
        polkadot_config,
        id,
        collator_options,
        |client,
         block_import,
         config,
         telemetry,
         task_manager| {
            let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?;
            let can_author_with = sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone());

            cumulus_client_consensus_aura::import_queue::<
                sp_consensus_aura::sr25519::AuthorityPair,
                _,
                _,
                _,
                _,
                _,
                _,
            >(cumulus_client_consensus_aura::ImportQueueParams {
                block_import,
                client,
                create_inherent_data_providers: move |_, _| async move {
                    let time = sp_timestamp::InherentDataProvider::from_system_time();

                    let slot =
                        sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
                            *time,
                            slot_duration,
                        );

                    Ok((time, slot))
                },
                registry: config.prometheus_registry().clone(),
                can_author_with,
                spawner: &task_manager.spawn_essential_handle(),
                telemetry,
            })
            .map_err(Into::into)
        },
        |client,
         prometheus_registry,
         telemetry,
         task_manager,
         relay_chain_interface,
         transaction_pool,
         sync_oracle,
         keystore,
         force_authoring| {
            let spawn_handle = task_manager.spawn_handle();

            let slot_duration =
                cumulus_client_consensus_aura::slot_duration(&*client).unwrap();

            let proposer_factory =
                sc_basic_authorship::ProposerFactory::with_proof_recording(
                    spawn_handle,
                    client.clone(),
                    transaction_pool,
                    prometheus_registry,
                    telemetry.clone(),
                );

            Ok(AuraConsensus::build::<
                sp_consensus_aura::sr25519::AuthorityPair,
                _,
                _,
                _,
                _,
                _,
                _,
            >(BuildAuraConsensusParams {
                proposer_factory,
                create_inherent_data_providers:
                    move |_, (relay_parent, validation_data)| {
                        let relay_chain_for_aura = relay_chain_interface.clone();
                        async move {
                            let parachain_inherent =
                                cumulus_primitives_parachain_inherent::ParachainInherentData::create_at(
                                    relay_parent,
                                    &relay_chain_for_aura,
                                    &validation_data,
                                    id,
                                ).await;
                            let time = sp_timestamp::InherentDataProvider::from_system_time();
                            let slot =
                                sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
                                    *time,
                                    slot_duration,
                                );

                            let parachain_inherent = parachain_inherent.ok_or_else(|| {
                                Box::<dyn std::error::Error + Send + Sync>::from(
                                    "Failed to create parachain inherent",
                                )
                            })?;
                            Ok((time, slot, parachain_inherent))
                        }
                    },
                block_import: client.clone(),
                para_client: client.clone(),
                backoff_authoring_blocks: Option::<()>::None,
                sync_oracle,
                keystore,
                force_authoring,
                slot_duration,
                // We got around 500ms for proposing
                block_proposal_slot_portion: SlotProportion::new(1f32 / 24f32),
                // And a maximum of 750ms if slots are skipped
                max_block_proposal_slot_portion: Some(SlotProportion::new(1f32 / 16f32)),
                telemetry,
            })
        )
    }).await
}
/// Start a parachain node for Arctic.
Start a parachain node for Arctic.
Start a parachain node for Arctic .
pub async fn start_arctic_node(
    parachain_config: Configuration,
    polkadot_config: Configuration,
    id: ParaId,
    collator_options: CollatorOptions
) -> sc_service::error::Result<(
    TaskManager,
    Arc<TFullClient<Block, arctic::RuntimeApi, NativeElseWasmExecutor<arctic::Executor>>>,
)> {
    start_contracts_node_impl::<arctic::RuntimeApi, arctic::Executor, _, _>(
        parachain_config,
        polkadot_config,
        id,
        collator_options,
        |client,
         block_import,
         config,
         telemetry,
         task_manager| {
            let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?;
            let can_author_with = sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone());
            cumulus_client_consensus_aura::import_queue::<
                sp_consensus_aura::sr25519::AuthorityPair,
                _,
                _,
                _,
                _,
                _,
                _,
            >(cumulus_client_consensus_aura::ImportQueueParams {
                block_import,
                client,
                create_inherent_data_providers: move |_, _| async move {
                    let time = sp_timestamp::InherentDataProvider::from_system_time();
                    let slot =
                        sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
                            *time,
                            slot_duration,
                        );
                    Ok((time, slot))
                },
                registry: config.prometheus_registry().clone(),
                can_author_with,
                spawner: &task_manager.spawn_essential_handle(),
                telemetry,
            })
            .map_err(Into::into)
        },
        |client,
         prometheus_registry,
         telemetry,
         task_manager,
         relay_chain_interface,
         transaction_pool,
         sync_oracle,
         keystore,
         force_authoring| {
            let spawn_handle = task_manager.spawn_handle();
            let slot_duration =
                cumulus_client_consensus_aura::slot_duration(&*client).unwrap();
            let proposer_factory =
                sc_basic_authorship::ProposerFactory::with_proof_recording(
                    spawn_handle,
                    client.clone(),
                    transaction_pool,
                    prometheus_registry,
                    telemetry.clone(),
                );
            Ok(AuraConsensus::build::<
                sp_consensus_aura::sr25519::AuthorityPair,
                _,
                _,
                _,
                _,
                _,
                _,
            >(BuildAuraConsensusParams {
                proposer_factory,
                create_inherent_data_providers:
                    move |_, (relay_parent, validation_data)| {
                        let relay_chain_for_aura = relay_chain_interface.clone();
                        async move {
                            let parachain_inherent =
                                cumulus_primitives_parachain_inherent::ParachainInherentData::create_at(
                                    relay_parent,
                                    &relay_chain_for_aura,
                                    &validation_data,
                                    id,
                                ).await;
                            let time = sp_timestamp::InherentDataProvider::from_system_time();
                            let slot =
                                sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
                                    *time,
                                    slot_duration,
                                );
                            let parachain_inherent = parachain_inherent.ok_or_else(|| {
                                Box::<dyn std::error::Error + Send + Sync>::from(
                                    "Failed to create parachain inherent",
                                )
                            })?;
                            Ok((time, slot, parachain_inherent))
                        }
                    },
                block_import: client.clone(),
                para_client: client.clone(),
                backoff_authoring_blocks: Option::<()>::None,
                sync_oracle,
                keystore,
                force_authoring,
                slot_duration,
                // We got around 500ms for proposing
                block_proposal_slot_portion: SlotProportion::new(1f32 / 24f32),
                // And a maximum of 750ms if slots are skipped
                max_block_proposal_slot_portion: Some(SlotProportion::new(1f32 / 16f32)),
                telemetry,
            })
        )
    }).await
}
pub async fn start_arctic_node ( parachain_config : Configuration , polkadot_config : Configuration , id : ParaId , collator_options : CollatorOptions ) -> sc_service :: error :: Result < ( TaskManager , Arc < TFullClient < Block , arctic :: RuntimeApi , NativeElseWasmExecutor < arctic :: Executor > > > , ) > { start_contracts_node_impl :: < arctic :: RuntimeApi , arctic :: Executor , _ , _ > ( parachain_config , polkadot_config , id , collator_options , | client , block_import , config , telemetry , task_manager | { let slot_duration = cumulus_client_consensus_aura :: slot_duration ( & * client ) ? ; let can_author_with = sp_consensus :: CanAuthorWithNativeVersion :: new ( client . executor ( ) . clone ( ) ) ; cumulus_client_consensus_aura :: import_queue :: < sp_consensus_aura :: sr25519 :: AuthorityPair , _ , _ , _ , _ , _ , _ , > ( cumulus_client_consensus_aura :: ImportQueueParams { block_import , client , create_inherent_data_providers : move | _ , _ | async move { let time = sp_timestamp :: InherentDataProvider :: from_system_time ( ) ; let slot = sp_consensus_aura :: inherents :: InherentDataProvider :: from_timestamp_and_slot_duration ( * time , slot_duration , ) ; Ok ( ( time , slot ) ) } , registry : config . prometheus_registry ( ) . clone ( ) , can_author_with , spawner : & task_manager . spawn_essential_handle ( ) , telemetry , } ) . map_err ( Into :: into ) } , | client , prometheus_registry , telemetry , task_manager , relay_chain_interface , transaction_pool , sync_oracle , keystore , force_authoring | { let spawn_handle = task_manager . spawn_handle ( ) ; let slot_duration = cumulus_client_consensus_aura :: slot_duration ( & * client ) . unwrap ( ) ; let proposer_factory = sc_basic_authorship :: ProposerFactory :: with_proof_recording ( spawn_handle , client . clone ( ) , transaction_pool , prometheus_registry , telemetry . clone ( ) , ) ; Ok ( AuraConsensus :: build :: < sp_consensus_aura :: sr25519 :: AuthorityPair , _ , _ , _ , _ , _ , _ , > ( BuildAuraConsensusParams { proposer_factory , create_inherent_data_providers : move | _ , ( relay_parent , validation_data ) | { let relay_chain_for_aura = relay_chain_interface . clone ( ) ; async move { let parachain_inherent = cumulus_primitives_parachain_inherent :: ParachainInherentData :: create_at ( relay_parent , & relay_chain_for_aura , & validation_data , id , ) . await ; let time = sp_timestamp :: InherentDataProvider :: from_system_time ( ) ; let slot = sp_consensus_aura :: inherents :: InherentDataProvider :: from_timestamp_and_slot_duration ( * time , slot_duration , ) ; let parachain_inherent = parachain_inherent . ok_or_else ( | | { Box :: < dyn std :: error :: Error + Send + Sync > :: from ( " " , ) } ) ? ; Ok ( ( time , slot , parachain_inherent ) ) } } , block_import : client . clone ( ) , para_client : client . clone ( ) , backoff_authoring_blocks : Option :: < ( ) > :: None , sync_oracle , keystore , force_authoring , slot_duration , // We got around 500ms for proposing block_proposal_slot_portion : SlotProportion :: new ( 1f32 / 24f32 ) , // And a maximum of 750ms if slots are skipped max_block_proposal_slot_portion : Some ( SlotProportion :: new ( 1f32 / 16f32 ) ) , telemetry , } ) ) } ) . await }
Start a parachain node for Arctic.
Start a parachain node for Arctic .
parachain_config
Configuration
polkadot_config
Configuration
id
ParaId
collator_options
CollatorOptions