referrerpolicy=no-referrer-when-downgrade

polkadot_parachain/
main.rs

1// Copyright (C) Parity Technologies (UK) Ltd.
2// This file is part of Cumulus.
3// SPDX-License-Identifier: Apache-2.0
4
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9// 	http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16
17//! Polkadot parachain node.
18
19#![warn(missing_docs)]
20#![warn(unused_extern_crates)]
21
22mod chain_spec;
23
24use polkadot_omni_node_lib::{run, CliConfig as CliConfigT, RunConfig, NODE_VERSION};
25
26struct CliConfig;
27
28impl CliConfigT for CliConfig {
29	fn impl_version() -> String {
30		let commit_hash = env!("SUBSTRATE_CLI_COMMIT_HASH");
31		format!("{}-{commit_hash}", NODE_VERSION)
32	}
33
34	fn author() -> String {
35		env!("CARGO_PKG_AUTHORS").into()
36	}
37
38	fn support_url() -> String {
39		"https://github.com/paritytech/polkadot-sdk/issues/new".into()
40	}
41
42	fn copyright_start_year() -> u16 {
43		2017
44	}
45}
46
47fn main() -> color_eyre::eyre::Result<()> {
48	color_eyre::install()?;
49	let config = RunConfig::new(
50		Box::new(chain_spec::RuntimeResolver),
51		Box::new(chain_spec::ChainSpecLoader),
52	);
53	// This enables polkadot-parachain to support additional subcommands like `export-chain-spec`.
54	// To add more, extend the `ExtraSubcommands` enum in
55	// `cumulus/polkadot-omni-node/lib/src/extra_subcommand` and handle them in
56	// `ExtraSubcommands::handle`.
57	Ok(run::<CliConfig>(config)?)
58}