Skip to content

Commit

Permalink
generate chain spec with genesis config preset name
Browse files Browse the repository at this point in the history
Signed-off-by: Iulian Barbu <[email protected]>
  • Loading branch information
iulianbarbu committed Sep 30, 2024
1 parent d13c8dc commit b33a7ce
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 21 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions templates/minimal/node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ pub fn development_config() -> Result<ChainSpec, String> {
.with_name("Development")
.with_id("dev")
.with_chain_type(ChainType::Development)
.with_genesis_config_patch(
minimal_template_runtime::genesis_config_presets::development_config_genesis(),
)
.with_genesis_config_preset_name(sp_genesis_builder::DEV_RUNTIME_PRESET)
.with_properties(props())
.build())
}
23 changes: 11 additions & 12 deletions templates/solochain/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ sp-consensus-aura = { workspace = true, default-features = true }
sc-consensus = { workspace = true, default-features = true }
sc-consensus-grandpa = { workspace = true, default-features = true }
sp-consensus-grandpa = { workspace = true, default-features = true }
sp-genesis-builder = { workspace = true }
sc-client-api = { workspace = true, default-features = true }
sc-basic-authorship = { workspace = true, default-features = true }

Expand Down Expand Up @@ -66,22 +67,20 @@ substrate-build-script-utils = { workspace = true, default-features = true }

[features]
default = ["std"]
std = [
"solochain-template-runtime/std",
]
std = ["solochain-template-runtime/std"]
# Dependencies that are only required if runtime benchmarking should be build.
runtime-benchmarks = [
"frame-benchmarking-cli/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sc-service/runtime-benchmarks",
"solochain-template-runtime/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"frame-benchmarking-cli/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sc-service/runtime-benchmarks",
"solochain-template-runtime/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-system/try-runtime",
"pallet-transaction-payment/try-runtime",
"solochain-template-runtime/try-runtime",
"sp-runtime/try-runtime",
"frame-system/try-runtime",
"pallet-transaction-payment/try-runtime",
"solochain-template-runtime/try-runtime",
"sp-runtime/try-runtime",
]
8 changes: 2 additions & 6 deletions templates/solochain/node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ pub fn development_config() -> Result<ChainSpec, String> {
.with_name("Development")
.with_id("dev")
.with_chain_type(ChainType::Development)
.with_genesis_config_patch(
solochain_template_runtime::genesis_config_presets::development_config_genesis(),
)
.with_genesis_config_preset_name(sp_genesis_builder::DEV_RUNTIME_PRESET)
.build())
}

Expand All @@ -29,8 +27,6 @@ pub fn local_config() -> Result<ChainSpec, String> {
.with_name("Local Testnet")
.with_id("local_testnet")
.with_chain_type(ChainType::Local)
.with_genesis_config_patch(
solochain_template_runtime::genesis_config_presets::local_config_genesis(),
)
.with_genesis_config_preset_name(sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET)
.build())
}

0 comments on commit b33a7ce

Please sign in to comment.