ismp-parachain-inherent

Crates.ioismp-parachain-inherent
lib.rsismp-parachain-inherent
version
sourcesrc
created_at2024-05-02 14:21:23.712482
updated_at2024-12-10 14:03:11.801584
descriptionISMP parachain consensus client inherent provider
homepagehttps://docs.hyperbridge.network/developers/polkadot/getting-started
repositoryhttps://github.com/polytope-labs/hyperbridge
max_upload_size
id1227785
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Core Devs (github:polytope-labs:core-devs)

documentation

https://docs.rs/ismp-parachain-inherent

README

ISMP Parachain Inherent

This exports the inherent provider which includes ISMP parachain consensus updates as block inherents.

Usage

To use this, you'll need to include the inherent into your collator parameters like so:

fn start_consensus(
    client: Arc<FullClient>,
    backend: Arc<FullBackend>,
    block_import: ParachainBlockImport,
    prometheus_registry: Option<&Registry>,
    telemetry: Option<TelemetryHandle>,
    task_manager: &TaskManager,
    relay_chain_interface: Arc<dyn RelayChainInterface>,
    transaction_pool: Arc<sc_transaction_pool::FullPool<opaque::Block, FullClient>>,
    sync_oracle: Arc<SyncingService<opaque::Block>>,
    keystore: KeystorePtr,
    relay_chain_slot_duration: Duration,
    para_id: ParaId,
    collator_key: CollatorPair,
    overseer_handle: OverseerHandle,
    announce_block: Arc<dyn Fn(opaque::Hash, Option<Vec<u8>>) + Send + Sync>,
) {
    // .. omitted calls

    let (client_clone, relay_chain_interface_clone) =
        (client.clone(), relay_chain_interface.clone());
    let params = lookahead::Params {
        create_inherent_data_providers: move |parent, ()| {
            let client = client_clone.clone();
            let relay_chain_interface = relay_chain_interface_clone.clone();
            async move {
                let inherent = ismp_parachain_inherent::ConsensusInherentProvider::create(
                    parent,
                    client,
                    relay_chain_interface,
                ).await?;

                Ok(inherent)
            }
        },
        ..Default::default()
        // omitted fields
    };
    
    // ..omitted calls
}

License

This library is licensed under the Apache 2.0 License, Copyright (c) 2024 Polytope Labs.

Commit count: 710

cargo fmt