mirror of
https://github.com/pezkuwichain/pez-solochain-template.git
synced 2026-04-22 02:08:04 +00:00
Update template triggered by workflow_dispatch
This commit is contained in:
+33
-37
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solochain-template-node"
|
||||
description = "A solochain node template built with Substrate, part of Polkadot Sdk. (polkadot v1.9.0)"
|
||||
description = "A solochain node template built with Substrate, part of Polkadot Sdk. (polkadot v1.11.0)"
|
||||
version = "0.1.0"
|
||||
license = "MIT-0"
|
||||
authors.workspace = true
|
||||
@@ -18,45 +18,42 @@ workspace = true
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
clap = { version = "4.5.1", features = ["derive"] }
|
||||
futures = { version = "0.3.21", features = ["thread-pool"] }
|
||||
clap = { version = "4.5.3", features = ["derive"] }
|
||||
futures = { version = "0.3.30", features = ["thread-pool"] }
|
||||
serde_json = { workspace = true, default-features = true }
|
||||
jsonrpsee = { version = "0.22", features = ["server"] }
|
||||
sc-cli = { version = "0.39.0" }
|
||||
sp-core = { version = "31.0.0" }
|
||||
sc-executor = { version = "0.35.0" }
|
||||
sc-network = { version = "0.37.0" }
|
||||
sc-service = { version = "0.38.0" }
|
||||
sc-telemetry = { version = "17.0.0" }
|
||||
sc-transaction-pool = { version = "31.0.0" }
|
||||
sc-transaction-pool-api = { version = "31.0.0" }
|
||||
sc-offchain = { version = "32.0.0" }
|
||||
sc-consensus-aura = { version = "0.37.0" }
|
||||
sp-consensus-aura = { version = "0.35.0" }
|
||||
sc-consensus = { version = "0.36.0" }
|
||||
sc-consensus-grandpa = { version = "0.22.0" }
|
||||
sp-consensus-grandpa = { version = "16.0.0" }
|
||||
sc-client-api = { version = "31.0.0" }
|
||||
sc-rpc-api = { version = "0.36.0" }
|
||||
sc-basic-authorship = { version = "0.37.0" }
|
||||
sp-runtime = { version = "34.0.0" }
|
||||
sp-io = { version = "33.0.0" }
|
||||
sp-timestamp = { version = "29.0.0" }
|
||||
sp-inherents = { version = "29.0.0" }
|
||||
sp-keyring = { version = "34.0.0" }
|
||||
sp-api = { version = "29.0.0" }
|
||||
sp-blockchain = { version = "31.0.0" }
|
||||
sp-block-builder = { version = "29.0.0" }
|
||||
frame-system = { version = "31.0.0" }
|
||||
pallet-transaction-payment = { version = "31.0.0", default-features = false }
|
||||
pallet-transaction-payment-rpc = { version = "33.0.0" }
|
||||
substrate-frame-rpc-system = { version = "31.0.0" }
|
||||
frame-benchmarking-cli = { version = "35.0.1" }
|
||||
sc-cli = { version = "0.41.0" }
|
||||
sp-core = { version = "32.0.0" }
|
||||
sc-executor = { version = "0.37.0" }
|
||||
sc-network = { version = "0.39.0" }
|
||||
sc-service = { version = "0.40.0" }
|
||||
sc-telemetry = { version = "19.0.0" }
|
||||
sc-transaction-pool = { version = "33.0.0" }
|
||||
sc-transaction-pool-api = { version = "33.0.0" }
|
||||
sc-offchain = { version = "34.0.0" }
|
||||
sc-consensus-aura = { version = "0.39.0" }
|
||||
sp-consensus-aura = { version = "0.37.0" }
|
||||
sc-consensus = { version = "0.38.0" }
|
||||
sc-consensus-grandpa = { version = "0.24.0" }
|
||||
sp-consensus-grandpa = { version = "18.0.0" }
|
||||
sc-client-api = { version = "33.0.0" }
|
||||
sc-rpc-api = { version = "0.38.0" }
|
||||
sc-basic-authorship = { version = "0.39.0" }
|
||||
sp-runtime = { version = "36.0.0" }
|
||||
sp-io = { version = "35.0.0" }
|
||||
sp-timestamp = { version = "31.0.0" }
|
||||
sp-inherents = { version = "31.0.0" }
|
||||
sp-keyring = { version = "36.0.0" }
|
||||
sp-api = { version = "31.0.0" }
|
||||
sp-blockchain = { version = "33.0.0" }
|
||||
sp-block-builder = { version = "31.0.0" }
|
||||
frame-system = { version = "33.0.0" }
|
||||
pallet-transaction-payment = { version = "33.0.0", default-features = false }
|
||||
pallet-transaction-payment-rpc = { version = "35.0.0" }
|
||||
substrate-frame-rpc-system = { version = "33.0.0" }
|
||||
frame-benchmarking-cli = { version = "37.0.0" }
|
||||
solochain-template-runtime = { version = "0.1.0", path = "../runtime" }
|
||||
|
||||
# CLI-specific dependencies
|
||||
try-runtime-cli = { version = "0.41.0", optional = true }
|
||||
|
||||
[build-dependencies]
|
||||
substrate-build-script-utils = { version = "11.0.0" }
|
||||
|
||||
@@ -77,5 +74,4 @@ try-runtime = [
|
||||
"pallet-transaction-payment/try-runtime",
|
||||
"solochain-template-runtime/try-runtime",
|
||||
"sp-runtime/try-runtime",
|
||||
"try-runtime-cli/try-runtime",
|
||||
]
|
||||
|
||||
@@ -41,11 +41,6 @@ pub enum Subcommand {
|
||||
#[command(subcommand)]
|
||||
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
|
||||
|
||||
/// Try-runtime has migrated to a standalone CLI
|
||||
/// (<https://github.com/paritytech/try-runtime-cli>). The subcommand exists as a stub and
|
||||
/// deprecation notice. It will be removed entirely some time after January 2024.
|
||||
TryRuntime,
|
||||
|
||||
/// Db meta columns information.
|
||||
ChainInfo(sc_cli::ChainInfoCmd),
|
||||
}
|
||||
|
||||
+15
-8
@@ -117,7 +117,9 @@ pub fn run() -> sc_cli::Result<()> {
|
||||
)
|
||||
}
|
||||
|
||||
cmd.run::<sp_runtime::traits::HashingFor<Block>, ()>(config)
|
||||
cmd.run_with_spec::<sp_runtime::traits::HashingFor<Block>, ()>(Some(
|
||||
config.chain_spec,
|
||||
))
|
||||
},
|
||||
BenchmarkCmd::Block(cmd) => {
|
||||
let PartialComponents { client, .. } = service::new_partial(&config)?;
|
||||
@@ -168,12 +170,6 @@ pub fn run() -> sc_cli::Result<()> {
|
||||
}
|
||||
})
|
||||
},
|
||||
#[cfg(feature = "try-runtime")]
|
||||
Some(Subcommand::TryRuntime) => Err(try_runtime_cli::DEPRECATION_NOTICE.into()),
|
||||
#[cfg(not(feature = "try-runtime"))]
|
||||
Some(Subcommand::TryRuntime) => Err("TryRuntime wasn't enabled when building the node. \
|
||||
You can enable it with `--features try-runtime`."
|
||||
.into()),
|
||||
Some(Subcommand::ChainInfo(cmd)) => {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
runner.sync_run(|config| cmd.run::<Block>(&config))
|
||||
@@ -181,7 +177,18 @@ pub fn run() -> sc_cli::Result<()> {
|
||||
None => {
|
||||
let runner = cli.create_runner(&cli.run)?;
|
||||
runner.run_node_until_exit(|config| async move {
|
||||
service::new_full(config).map_err(sc_cli::Error::Service)
|
||||
match config.network.network_backend {
|
||||
sc_network::config::NetworkBackendType::Libp2p => service::new_full::<
|
||||
sc_network::NetworkWorker<
|
||||
solochain_template_runtime::opaque::Block,
|
||||
<solochain_template_runtime::opaque::Block as sp_runtime::traits::Block>::Hash,
|
||||
>,
|
||||
>(config)
|
||||
.map_err(sc_cli::Error::Service),
|
||||
sc_network::config::NetworkBackendType::Litep2p =>
|
||||
service::new_full::<sc_network::Litep2pNetworkBackend>(config)
|
||||
.map_err(sc_cli::Error::Service),
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
+20
-5
@@ -124,7 +124,11 @@ pub fn new_partial(config: &Configuration) -> Result<Service, ServiceError> {
|
||||
}
|
||||
|
||||
/// Builds a new service for a full client.
|
||||
pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
|
||||
pub fn new_full<
|
||||
N: sc_network::NetworkBackend<Block, <Block as sp_runtime::traits::Block>::Hash>,
|
||||
>(
|
||||
config: Configuration,
|
||||
) -> Result<TaskManager, ServiceError> {
|
||||
let sc_service::PartialComponents {
|
||||
client,
|
||||
backend,
|
||||
@@ -136,14 +140,24 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
|
||||
other: (block_import, grandpa_link, mut telemetry),
|
||||
} = new_partial(&config)?;
|
||||
|
||||
let mut net_config = sc_network::config::FullNetworkConfiguration::new(&config.network);
|
||||
let mut net_config = sc_network::config::FullNetworkConfiguration::<
|
||||
Block,
|
||||
<Block as sp_runtime::traits::Block>::Hash,
|
||||
N,
|
||||
>::new(&config.network);
|
||||
let metrics = N::register_notification_metrics(config.prometheus_registry());
|
||||
|
||||
let peer_store_handle = net_config.peer_store_handle();
|
||||
let grandpa_protocol_name = sc_consensus_grandpa::protocol_standard_name(
|
||||
&client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"),
|
||||
&config.chain_spec,
|
||||
);
|
||||
let (grandpa_protocol_config, grandpa_notification_service) =
|
||||
sc_consensus_grandpa::grandpa_peers_set_config(grandpa_protocol_name.clone());
|
||||
sc_consensus_grandpa::grandpa_peers_set_config::<_, N>(
|
||||
grandpa_protocol_name.clone(),
|
||||
metrics.clone(),
|
||||
peer_store_handle,
|
||||
);
|
||||
net_config.add_notification_protocol(grandpa_protocol_config);
|
||||
|
||||
let warp_sync = Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new(
|
||||
@@ -163,6 +177,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
|
||||
block_announce_validator_builder: None,
|
||||
warp_sync_params: Some(WarpSyncParams::WithProvider(warp_sync)),
|
||||
block_relay: None,
|
||||
metrics,
|
||||
})?;
|
||||
|
||||
if config.offchain_worker.enabled {
|
||||
@@ -177,7 +192,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
|
||||
transaction_pool: Some(OffchainTransactionPoolFactory::new(
|
||||
transaction_pool.clone(),
|
||||
)),
|
||||
network_provider: network.clone(),
|
||||
network_provider: Arc::new(network.clone()),
|
||||
enable_http_requests: true,
|
||||
custom_extensions: |_| vec![],
|
||||
})
|
||||
@@ -205,7 +220,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
|
||||
};
|
||||
|
||||
let _rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams {
|
||||
network: network.clone(),
|
||||
network: Arc::new(network.clone()),
|
||||
client: client.clone(),
|
||||
keystore: keystore_container.keystore(),
|
||||
task_manager: &mut task_manager,
|
||||
|
||||
Reference in New Issue
Block a user