Update template triggered by workflow_dispatch

This commit is contained in:
Template Bot
2024-05-06 09:31:35 +00:00
parent b218abb9bc
commit c908bb14c7
9 changed files with 1200 additions and 633 deletions
+25 -25
View File
@@ -1,6 +1,6 @@
[package]
name = "minimal-template-node"
description = "A miniaml Substrate-based Substrate node, ready for hacking. (polkadot v1.9.0)"
description = "A minimal Substrate-based Substrate node, ready for hacking. (polkadot v1.11.0)"
version = "0.1.0"
license = "MIT-0"
authors.workspace = true
@@ -17,36 +17,36 @@ 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"] }
futures-timer = "3.0.1"
jsonrpsee = { version = "0.22", features = ["server"] }
serde_json = { workspace = true, default-features = true }
sc-cli = { version = "0.39.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-consensus = { version = "0.36.0" }
sc-consensus-manual-seal = { version = "0.38.0" }
sc-rpc-api = { version = "0.36.0" }
sc-basic-authorship = { version = "0.37.0" }
sc-offchain = { version = "32.0.0" }
sc-client-api = { version = "31.0.0" }
sp-timestamp = { 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" }
sp-io = { version = "33.0.0" }
sp-runtime = { version = "34.0.0" }
substrate-frame-rpc-system = { version = "31.0.0" }
sc-cli = { version = "0.41.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-consensus = { version = "0.38.0" }
sc-consensus-manual-seal = { version = "0.40.0" }
sc-rpc-api = { version = "0.38.0" }
sc-basic-authorship = { version = "0.39.0" }
sc-offchain = { version = "34.0.0" }
sc-client-api = { version = "33.0.0" }
sp-timestamp = { 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" }
sp-io = { version = "35.0.0" }
sp-runtime = { version = "36.0.0" }
substrate-frame-rpc-system = { version = "33.0.0" }
# Once the native runtime is gone, there should be little to no dependency on FRAME here, and
# certainly no dependency on the runtime.
frame = { version = "0.1.1", package = "polkadot-sdk-frame", features = ["experimental", "runtime"] }
frame = { version = "0.2.0", package = "polkadot-sdk-frame", features = ["experimental", "runtime"] }
runtime = { package = "minimal-template-runtime", path = "../runtime", version = "0.1.0" }
[build-dependencies]
+9 -1
View File
@@ -119,7 +119,15 @@ 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, cli.consensus).map_err(sc_cli::Error::Service)
match config.network.network_backend {
sc_network::config::NetworkBackendType::Libp2p =>
service::new_full::<sc_network::NetworkWorker<_, _>>(config, cli.consensus)
.map_err(sc_cli::Error::Service),
sc_network::config::NetworkBackendType::Litep2p => service::new_full::<
sc_network::Litep2pNetworkBackend,
>(config, cli.consensus)
.map_err(sc_cli::Error::Service),
}
})
},
}
+15 -3
View File
@@ -22,6 +22,7 @@ use sc_executor::WasmExecutor;
use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
use sc_telemetry::{Telemetry, TelemetryWorker};
use sc_transaction_pool_api::OffchainTransactionPoolFactory;
use sp_runtime::traits::Block as BlockT;
use std::sync::Arc;
use crate::cli::Consensus;
@@ -104,7 +105,10 @@ pub fn new_partial(config: &Configuration) -> Result<Service, ServiceError> {
}
/// Builds a new service for a full client.
pub fn new_full(config: Configuration, consensus: Consensus) -> Result<TaskManager, ServiceError> {
pub fn new_full<Network: sc_network::NetworkBackend<Block, <Block as BlockT>::Hash>>(
config: Configuration,
consensus: Consensus,
) -> Result<TaskManager, ServiceError> {
let sc_service::PartialComponents {
client,
backend,
@@ -116,7 +120,14 @@ pub fn new_full(config: Configuration, consensus: Consensus) -> Result<TaskManag
other: mut telemetry,
} = new_partial(&config)?;
let net_config = sc_network::config::FullNetworkConfiguration::new(&config.network);
let net_config = sc_network::config::FullNetworkConfiguration::<
Block,
<Block as BlockT>::Hash,
Network,
>::new(&config.network);
let metrics = Network::register_notification_metrics(
config.prometheus_config.as_ref().map(|cfg| &cfg.registry),
);
let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) =
sc_service::build_network(sc_service::BuildNetworkParams {
@@ -129,6 +140,7 @@ pub fn new_full(config: Configuration, consensus: Consensus) -> Result<TaskManag
block_announce_validator_builder: None,
warp_sync_params: None,
block_relay: None,
metrics,
})?;
if config.offchain_worker.enabled {
@@ -143,7 +155,7 @@ pub fn new_full(config: Configuration, consensus: Consensus) -> Result<TaskManag
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![],
})