polkadot_parachain_lib/
lib.rs

1// Copyright (C) Parity Technologies (UK) Ltd.
2// This file is part of Cumulus.
3
4// Cumulus is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8
9// Cumulus is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12// GNU General Public License for more details.
13
14// You should have received a copy of the GNU General Public License
15// along with Cumulus.  If not, see <http://www.gnu.org/licenses/>.
16
17//! Helper library that can be used to run a parachain node.
18//!
19//! ## Overview
20//!
21//! This library can be used to run a parachain node while also customizing the chain specs
22//! that are supported by default by the `--chain-spec` argument of the node's `CLI`
23//! and the parameters of the runtime that is associated with each of these chain specs.
24//!
25//! ## API
26//!
27//! The library exposes the possibility to provide a [`RunConfig`]. Through this structure
28//! 2 optional configurations can be provided:
29//! - a chain spec loader (an implementation of [`chain_spec::LoadSpec`]): this can be used for
30//!   providing the chain specs that are supported by default by the `--chain-spec` argument of the
31//!   node's `CLI` and the actual chain config associated with each one.
32//! - a runtime resolver (an implementation of [`runtime::RuntimeResolver`]): this can be used for
33//!   providing the parameters of the runtime that is associated with each of the chain specs
34//!
35//! Apart from this, a [`CliConfig`] can also be provided, that can be used to customize some
36//! user-facing binary author, support url, etc.
37//!
38//! ## Examples
39//!
40//! For an example, see the `polkadot-parachain-bin` crate.
41
42#![deny(missing_docs)]
43
44mod cli;
45mod command;
46mod common;
47mod fake_runtime_api;
48mod service;
49
50pub use cli::CliConfig;
51pub use command::{run, RunConfig};
52pub use common::{chain_spec, runtime};