mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 09:21:04 +00:00
Prefix logs of parachain and relaychain differently + remove light client of relay chain (#109)
This commit is contained in:
@@ -18,6 +18,7 @@ parking_lot = '0.9.0'
|
||||
trie-root = '0.15.2'
|
||||
codec = { package = 'parity-scale-codec', version = '1.0.0' }
|
||||
structopt = "0.3.3"
|
||||
ansi_term = "0.12.1"
|
||||
|
||||
# Parachain dependencies
|
||||
parachain-runtime = { package = "cumulus-test-parachain-runtime", path = "runtime" }
|
||||
|
||||
@@ -20,7 +20,7 @@ use sc_cli;
|
||||
use structopt::StructOpt;
|
||||
|
||||
/// Sub-commands supported by the collator.
|
||||
#[derive(Debug, StructOpt, Clone)]
|
||||
#[derive(Debug, StructOpt)]
|
||||
pub enum Subcommand {
|
||||
#[structopt(flatten)]
|
||||
Base(sc_cli::Subcommand),
|
||||
@@ -37,14 +37,14 @@ pub enum Subcommand {
|
||||
}
|
||||
|
||||
/// Command for exporting the genesis state of the parachain
|
||||
#[derive(Debug, StructOpt, Clone)]
|
||||
#[derive(Debug, StructOpt)]
|
||||
pub struct ExportGenesisStateCommand {
|
||||
/// Output file name or stdout if unspecified.
|
||||
#[structopt(parse(from_os_str))]
|
||||
pub output: Option<PathBuf>,
|
||||
}
|
||||
|
||||
#[derive(Debug, StructOpt, Clone)]
|
||||
#[derive(Debug, StructOpt)]
|
||||
#[structopt(settings = &[
|
||||
structopt::clap::AppSettings::GlobalVersion,
|
||||
structopt::clap::AppSettings::ArgsNegateSubcommands,
|
||||
@@ -62,7 +62,7 @@ pub struct Cli {
|
||||
pub relaychain_args: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, StructOpt, Clone)]
|
||||
#[derive(Debug, StructOpt)]
|
||||
pub struct PolkadotCli {
|
||||
#[structopt(flatten)]
|
||||
pub base: polkadot_cli::RunCmd,
|
||||
|
||||
@@ -24,8 +24,7 @@ use sc_cli::{
|
||||
SubstrateCli,
|
||||
};
|
||||
use sc_executor::NativeExecutionDispatch;
|
||||
use sc_network::config::TransportConfig;
|
||||
use sc_service::config::{NetworkConfiguration, NodeKeyConfig, PrometheusConfig};
|
||||
use sc_service::config::PrometheusConfig;
|
||||
use sp_core::hexdisplay::HexDisplay;
|
||||
use sp_runtime::{
|
||||
traits::{Block as BlockT, Hash as HashT, Header as HeaderT, Zero},
|
||||
@@ -186,7 +185,8 @@ pub fn run() -> Result<()> {
|
||||
None,
|
||||
authority_discovery_enabled,
|
||||
6000,
|
||||
grandpa_pause
|
||||
grandpa_pause,
|
||||
None,
|
||||
).map(|(s, _, _)| s)
|
||||
},
|
||||
polkadot_service::PolkadotExecutor::native_version().runtime_version
|
||||
@@ -203,7 +203,6 @@ pub fn run() -> Result<()> {
|
||||
|
||||
// TODO
|
||||
let key = Arc::new(sp_core::Pair::from_seed(&[10; 32]));
|
||||
let key2 = Arc::new(sp_core::Pair::from_seed(&[10; 32]));
|
||||
|
||||
let mut polkadot_cli = PolkadotCli::from_iter(
|
||||
[PolkadotCli::executable_name().to_string()]
|
||||
@@ -213,20 +212,7 @@ pub fn run() -> Result<()> {
|
||||
|
||||
polkadot_cli.base_path = cli.run.base_path()?.map(|x| x.join("polkadot"));
|
||||
|
||||
runner.run_node(
|
||||
|config| {
|
||||
let task_executor = config.task_executor.clone();
|
||||
let polkadot_config = SubstrateCli::create_configuration(
|
||||
&polkadot_cli,
|
||||
&polkadot_cli,
|
||||
task_executor,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
info!("Parachain id: {:?}", crate::PARA_ID);
|
||||
|
||||
crate::service::run_collator(config, key2, polkadot_config)
|
||||
},
|
||||
runner.run_full_node(
|
||||
|config| {
|
||||
let task_executor = config.task_executor.clone();
|
||||
let polkadot_config = SubstrateCli::create_configuration(
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use ansi_term::Color;
|
||||
use std::sync::Arc;
|
||||
use sc_executor::native_executor_instance;
|
||||
use sc_service::{AbstractService, Configuration};
|
||||
@@ -91,6 +92,7 @@ pub fn run_collator(
|
||||
let block_announce_validator = DelayedBlockAnnounceValidator::new();
|
||||
let block_announce_validator_copy = block_announce_validator.clone();
|
||||
let service = builder
|
||||
.with_informant_prefix(format!("[{}] ", Color::Yellow.bold().paint("Parachain")))?
|
||||
.with_finality_proof_provider(|client, backend| {
|
||||
// GenesisAuthoritySetProvider is implemented for StorageAndProofProvider
|
||||
let provider = client as Arc<dyn StorageAndProofProvider<_, _>>;
|
||||
@@ -130,6 +132,7 @@ pub fn run_collator(
|
||||
crate::PARA_ID,
|
||||
key,
|
||||
polkadot_config,
|
||||
Some(format!("[{}] ", Color::Blue.bold().paint("Relaychain"))),
|
||||
).map(|_| ());
|
||||
service.spawn_essential_task("polkadot", polkadot_future);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user