Files
pezkuwi-subxt/substrate/bin/node/cli/Cargo.toml
T
Michal Kucharczyk f910a15c1c GenesisConfig presets for runtime (#2714)
The runtime now can provide a number of predefined presets of
`RuntimeGenesisConfig` struct. This presets are intended to be used in
different deployments, e.g.: `local`, `staging`, etc, and should be
included into the corresponding chain-specs.

Having `GenesisConfig` presets in runtime allows to fully decouple node
from runtime types (the problem is described in #1984).

**Summary of changes:**
- The `GenesisBuilder` API was adjusted to enable this functionality
(and provide better naming - #150):
   ```rust
    fn preset_names() -> Vec<PresetId>;
fn get_preset(id: Option<PresetId>) -> Option<serde_json::Value>;
//`None` means default
    fn build_state(value: serde_json::Value);
    pub struct PresetId(Vec<u8>);
   ```

- **Breaking change**: Old `create_default_config` method was removed,
`build_config` was renamed to `build_state`. As a consequence a node
won't be able to interact with genesis config for older runtimes. The
cleanup was made for sake of API simplicity. Also IMO maintaining
compatibility with old API is not so crucial.
- Reference implementation was provided for `substrate-test-runtime` and
`rococo` runtimes. For rococo new
[`genesis_configs_presets`](https://github.com/paritytech/polkadot-sdk/blob/3b41d66b97c5ff0ec4a1989da5ffd8b9f3f588e3/polkadot/runtime/rococo/src/genesis_config_presets.rs#L530)
module was added and is used in `GenesisBuilder`
[_presets-related_](https://github.com/paritytech/polkadot-sdk/blob/3b41d66b97c5ff0ec4a1989da5ffd8b9f3f588e3/polkadot/runtime/rococo/src/lib.rs#L2462-L2485)
methods.

- The `chain-spec-builder` util was also improved and allows to
([_doc_](https://github.com/paritytech/polkadot-sdk/blob/3b41d66b97c5ff0ec4a1989da5ffd8b9f3f588e3/substrate/bin/utils/chain-spec-builder/src/lib.rs#L19)):
   - list presets provided by given runtime (`list-presets`),
- display preset or default config provided by the runtime
(`display-preset`),
   - build chain-spec using named preset (`create ... named-preset`),


- The `ChainSpecBuilder` is extended with
[`with_genesis_config_preset_name`](https://github.com/paritytech/polkadot-sdk/blob/3b41d66b97c5ff0ec4a1989da5ffd8b9f3f588e3/substrate/client/chain-spec/src/chain_spec.rs#L447)
method which allows to build chain-spec using named preset provided by
the runtime. Sample usage on the node side
[here](https://github.com/paritytech/polkadot-sdk/blob/2caffaae803e08a3d5b46c860e8016da023ff4ce/polkadot/node/service/src/chain_spec.rs#L404).

Implementation of #1984.
fixes: #150
part of: #25

---------

Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2024-04-04 18:30:54 +00:00

249 lines
10 KiB
TOML

[package]
name = "staging-node-cli"
version = "3.0.0-dev"
authors.workspace = true
description = "Generic Substrate node implementation in Rust."
build = "build.rs"
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
default-run = "substrate-node"
homepage = "https://substrate.io"
repository.workspace = true
publish = false
[lints]
workspace = true
[package.metadata.wasm-pack.profile.release]
# `wasm-opt` has some problems on linux, see
# https://github.com/rustwasm/wasm-pack/issues/781 etc.
wasm-opt = false
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[badges]
travis-ci = { repository = "paritytech/substrate" }
maintenance = { status = "actively-developed" }
is-it-maintained-issue-resolution = { repository = "paritytech/substrate" }
is-it-maintained-open-issues = { repository = "paritytech/substrate" }
# The same node binary as the `substrate` (defined in the workspace `Cargo.toml`) binary,
# but just exposed by this crate here.
[[bin]]
name = "substrate-node"
path = "bin/main.rs"
required-features = ["cli"]
[lib]
crate-type = ["cdylib", "rlib"]
[dependencies]
# third-party dependencies
array-bytes = "6.1"
clap = { version = "4.5.3", features = ["derive"], optional = true }
codec = { package = "parity-scale-codec", version = "3.6.1" }
serde = { features = ["derive"], workspace = true, default-features = true }
jsonrpsee = { version = "0.22", features = ["server"] }
futures = "0.3.30"
log = { workspace = true, default-features = true }
rand = "0.8"
# primitives
sp-authority-discovery = { path = "../../../primitives/authority-discovery" }
sp-consensus-babe = { path = "../../../primitives/consensus/babe" }
beefy-primitives = { package = "sp-consensus-beefy", path = "../../../primitives/consensus/beefy" }
grandpa-primitives = { package = "sp-consensus-grandpa", path = "../../../primitives/consensus/grandpa" }
sp-api = { path = "../../../primitives/api" }
sp-core = { path = "../../../primitives/core" }
sp-runtime = { path = "../../../primitives/runtime" }
sp-timestamp = { path = "../../../primitives/timestamp" }
sp-genesis-builder = { path = "../../../primitives/genesis-builder" }
sp-inherents = { path = "../../../primitives/inherents" }
sp-keyring = { path = "../../../primitives/keyring" }
sp-keystore = { path = "../../../primitives/keystore" }
sp-consensus = { path = "../../../primitives/consensus/common" }
sp-transaction-storage-proof = { path = "../../../primitives/transaction-storage-proof" }
sp-io = { path = "../../../primitives/io" }
sp-mixnet = { path = "../../../primitives/mixnet" }
sp-mmr-primitives = { path = "../../../primitives/merkle-mountain-range" }
sp-statement-store = { path = "../../../primitives/statement-store" }
# client dependencies
sc-client-api = { path = "../../../client/api" }
sc-chain-spec = { path = "../../../client/chain-spec" }
sc-consensus = { path = "../../../client/consensus/common" }
sc-transaction-pool = { path = "../../../client/transaction-pool" }
sc-transaction-pool-api = { path = "../../../client/transaction-pool/api" }
sc-statement-store = { path = "../../../client/statement-store" }
sc-network = { path = "../../../client/network" }
sc-network-common = { path = "../../../client/network/common" }
sc-network-sync = { path = "../../../client/network/sync" }
sc-network-statement = { path = "../../../client/network/statement" }
sc-consensus-slots = { path = "../../../client/consensus/slots" }
sc-consensus-babe = { path = "../../../client/consensus/babe" }
beefy = { package = "sc-consensus-beefy", path = "../../../client/consensus/beefy" }
grandpa = { package = "sc-consensus-grandpa", path = "../../../client/consensus/grandpa" }
mmr-gadget = { path = "../../../client/merkle-mountain-range" }
sc-rpc = { path = "../../../client/rpc" }
sc-basic-authorship = { path = "../../../client/basic-authorship" }
sc-service = { path = "../../../client/service", default-features = false }
sc-telemetry = { path = "../../../client/telemetry" }
sc-executor = { path = "../../../client/executor" }
sc-authority-discovery = { path = "../../../client/authority-discovery" }
sc-mixnet = { path = "../../../client/mixnet" }
sc-sync-state-rpc = { path = "../../../client/sync-state-rpc" }
sc-sysinfo = { path = "../../../client/sysinfo" }
sc-storage-monitor = { path = "../../../client/storage-monitor" }
sc-offchain = { path = "../../../client/offchain" }
# frame dependencies
frame-benchmarking = { path = "../../../frame/benchmarking" }
frame-system = { path = "../../../frame/system" }
frame-system-rpc-runtime-api = { path = "../../../frame/system/rpc/runtime-api" }
pallet-assets = { path = "../../../frame/assets" }
pallet-asset-conversion-tx-payment = { path = "../../../frame/transaction-payment/asset-conversion-tx-payment" }
pallet-asset-tx-payment = { path = "../../../frame/transaction-payment/asset-tx-payment" }
pallet-im-online = { path = "../../../frame/im-online", default-features = false }
pallet-skip-feeless-payment = { path = "../../../frame/transaction-payment/skip-feeless-payment", default-features = false }
# node-specific dependencies
kitchensink-runtime = { path = "../runtime" }
node-rpc = { path = "../rpc" }
node-primitives = { path = "../primitives" }
# CLI-specific dependencies
sc-cli = { path = "../../../client/cli", optional = true }
frame-benchmarking-cli = { path = "../../../utils/frame/benchmarking-cli", optional = true }
node-inspect = { package = "staging-node-inspect", path = "../inspect", optional = true }
try-runtime-cli = { path = "../../../utils/frame/try-runtime/cli", optional = true }
serde_json = { workspace = true, default-features = true }
[dev-dependencies]
sc-keystore = { path = "../../../client/keystore" }
sc-client-db = { path = "../../../client/db" }
sc-consensus = { path = "../../../client/consensus/common" }
sc-consensus-babe = { path = "../../../client/consensus/babe" }
sc-consensus-epochs = { path = "../../../client/consensus/epochs" }
sc-service-test = { path = "../../../client/service/test" }
sc-block-builder = { path = "../../../client/block-builder" }
sp-tracing = { path = "../../../primitives/tracing" }
sp-blockchain = { path = "../../../primitives/blockchain" }
sp-crypto-hashing = { path = "../../../primitives/crypto/hashing" }
futures = "0.3.30"
tempfile = "3.1.0"
assert_cmd = "2.0.2"
nix = { version = "0.26.1", features = ["signal"] }
regex = "1.6.0"
platforms = "3.0"
soketto = "0.7.1"
criterion = { version = "0.4.0", features = ["async_tokio"] }
tokio = { version = "1.22.0", features = ["macros", "parking_lot", "time"] }
tokio-util = { version = "0.7.4", features = ["compat"] }
wait-timeout = "0.2"
substrate-rpc-client = { path = "../../../utils/frame/rpc/client" }
pallet-timestamp = { path = "../../../frame/timestamp" }
substrate-cli-test-utils = { path = "../../../test-utils/cli" }
wat = "1.0"
frame-support = { path = "../../../frame/support" }
node-testing = { path = "../testing" }
pallet-balances = { path = "../../../frame/balances" }
pallet-contracts = { path = "../../../frame/contracts" }
pallet-glutton = { path = "../../../frame/glutton" }
pallet-sudo = { path = "../../../frame/sudo" }
pallet-treasury = { path = "../../../frame/treasury" }
pallet-transaction-payment = { path = "../../../frame/transaction-payment" }
sp-application-crypto = { path = "../../../primitives/application-crypto" }
pallet-root-testing = { path = "../../../frame/root-testing" }
sp-consensus-babe = { path = "../../../primitives/consensus/babe" }
sp-externalities = { path = "../../../primitives/externalities" }
sp-keyring = { path = "../../../primitives/keyring" }
sp-runtime = { path = "../../../primitives/runtime" }
serde_json = { workspace = true, default-features = true }
scale-info = { version = "2.11.1", features = ["derive", "serde"] }
sp-trie = { path = "../../../primitives/trie" }
sp-state-machine = { path = "../../../primitives/state-machine" }
[build-dependencies]
clap = { version = "4.5.3", optional = true }
clap_complete = { version = "4.0.2", optional = true }
node-inspect = { package = "staging-node-inspect", path = "../inspect", optional = true }
frame-benchmarking-cli = { path = "../../../utils/frame/benchmarking-cli", optional = true }
substrate-build-script-utils = { path = "../../../utils/build-script-utils", optional = true }
substrate-frame-cli = { path = "../../../utils/frame/frame-utilities-cli", optional = true }
try-runtime-cli = { path = "../../../utils/frame/try-runtime/cli", optional = true }
sc-cli = { path = "../../../client/cli", optional = true }
pallet-balances = { path = "../../../frame/balances" }
sc-storage-monitor = { path = "../../../client/storage-monitor" }
[features]
default = ["cli"]
cli = [
"clap",
"clap_complete",
"frame-benchmarking-cli",
"node-inspect",
"sc-cli",
"sc-service/rocksdb",
"substrate-build-script-utils",
"substrate-frame-cli",
"try-runtime-cli",
]
runtime-benchmarks = [
"frame-benchmarking-cli/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"kitchensink-runtime/runtime-benchmarks",
"node-inspect?/runtime-benchmarks",
"pallet-asset-tx-payment/runtime-benchmarks",
"pallet-assets/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-contracts/runtime-benchmarks",
"pallet-glutton/runtime-benchmarks",
"pallet-im-online/runtime-benchmarks",
"pallet-skip-feeless-payment/runtime-benchmarks",
"pallet-sudo/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
"pallet-treasury/runtime-benchmarks",
"sc-client-db/runtime-benchmarks",
"sc-service/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
# Enable features that allow the runtime to be tried and debugged. Name might be subject to change
# in the near future.
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"kitchensink-runtime/try-runtime",
"pallet-asset-conversion-tx-payment/try-runtime",
"pallet-asset-tx-payment/try-runtime",
"pallet-assets/try-runtime",
"pallet-balances/try-runtime",
"pallet-contracts/try-runtime",
"pallet-glutton/try-runtime",
"pallet-im-online/try-runtime",
"pallet-root-testing/try-runtime",
"pallet-skip-feeless-payment/try-runtime",
"pallet-sudo/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-treasury/try-runtime",
"sp-runtime/try-runtime",
"substrate-cli-test-utils/try-runtime",
"try-runtime-cli/try-runtime",
]
[[bench]]
name = "transaction_pool"
harness = false
[[bench]]
name = "block_production"
harness = false
[[bench]]
name = "executor"
harness = false