[package]
name = "polkadot-service"
rust-version = "1.60"
version = "19.0.0"
authors.workspace = true
edition.workspace = true
license.workspace = true
description = "Utils to tie different Polkadot components together and allow instantiation of a node."

[lints]
workspace = true

[dependencies]
sc-authority-discovery.workspace = true
sc-authority-discovery.default-features = true
sc-consensus-babe.workspace = true
sc-consensus-babe.default-features = true
sc-consensus-beefy.workspace = true
sc-consensus-beefy.default-features = true
sc-consensus-grandpa.workspace = true
sc-consensus-grandpa.default-features = true
mmr-gadget.workspace = true
mmr-gadget.default-features = true
sp-mmr-primitives.workspace = true
sp-mmr-primitives.default-features = true
sp-genesis-builder.workspace = true
sp-genesis-builder.default-features = true
sc-chain-spec.workspace = true
sc-chain-spec.default-features = true
sc-client-api.workspace = true
sc-client-api.default-features = true
sc-consensus.workspace = true
sc-consensus.default-features = true
sc-consensus-slots.workspace = true
sc-consensus-slots.default-features = true
sc-executor.workspace = true
sc-executor.default-features = true
sc-network.workspace = true
sc-network.default-features = true
sc-network-sync.workspace = true
sc-network-sync.default-features = true
sc-transaction-pool.workspace = true
sc-transaction-pool.default-features = true
sc-transaction-pool-api.workspace = true
sc-transaction-pool-api.default-features = true
sc-sync-state-rpc.workspace = true
sc-sync-state-rpc.default-features = true
sc-keystore.workspace = true
sc-keystore.default-features = true
sc-basic-authorship.workspace = true
sc-basic-authorship.default-features = true
sc-offchain.workspace = true
sc-offchain.default-features = true
sc-sysinfo.workspace = true
sc-sysinfo.default-features = true
sc-service.workspace = true
sc-telemetry.workspace = true
sc-telemetry.default-features = true
sp-authority-discovery.workspace = true
sp-authority-discovery.default-features = true
sp-consensus.workspace = true
sp-consensus.default-features = true
sp-consensus-beefy.workspace = true
sp-consensus-beefy.default-features = true
sp-consensus-grandpa.workspace = true
sp-consensus-grandpa.default-features = true
sp-inherents.workspace = true
sp-inherents.default-features = true
sp-keyring.workspace = true
sp-keyring.default-features = true
sp-api.workspace = true
sp-api.default-features = true
sp-block-builder.workspace = true
sp-block-builder.default-features = true
sp-blockchain.workspace = true
sp-blockchain.default-features = true
sp-core.workspace = true
sp-core.default-features = true
sp-io.workspace = true
sp-io.default-features = true
sp-offchain.workspace = true
sp-offchain.default-features = true
sp-runtime.workspace = true
sp-runtime.default-features = true
sp-session.workspace = true
sp-session.default-features = true
sp-transaction-pool.workspace = true
sp-transaction-pool.default-features = true
pallet-transaction-payment.workspace = true
pallet-transaction-payment.default-features = true
sp-timestamp.workspace = true
sp-timestamp.default-features = true
sp-consensus-babe.workspace = true
sp-consensus-babe.default-features = true
sp-weights.workspace = true
sp-weights.default-features = true
sp-version.workspace = true
sp-version.default-features = true
pallet-transaction-payment-rpc-runtime-api.workspace = true
pallet-transaction-payment-rpc-runtime-api.default-features = true
frame-metadata-hash-extension = { optional = true, workspace = true, default-features = true }
frame-system.workspace = true
frame-system.default-features = true
frame-system-rpc-runtime-api.workspace = true
frame-system-rpc-runtime-api.default-features = true
prometheus-endpoint.workspace = true
prometheus-endpoint.default-features = true
frame-benchmarking-cli.workspace = true
frame-benchmarking-cli.default-features = true
frame-benchmarking.workspace = true
frame-benchmarking.default-features = true

# External Crates
async-trait = { workspace = true }
futures = { workspace = true }
is_executable = { workspace = true }
gum.workspace = true
gum.default-features = true
log = { workspace = true, default-features = true }
serde = { features = ["derive"], workspace = true, default-features = true }
serde_json = { workspace = true, default-features = true }
thiserror = { workspace = true }
kvdb = { workspace = true }
kvdb-rocksdb = { optional = true, workspace = true }
parity-db = { optional = true, workspace = true }
codec = { workspace = true, default-features = true }
parking_lot = { workspace = true, default-features = true }
polkadot-core-primitives.workspace = true
polkadot-core-primitives.default-features = true
polkadot-node-core-parachains-inherent.workspace = true
polkadot-node-core-parachains-inherent.default-features = true
polkadot-overseer.workspace = true
polkadot-overseer.default-features = true
polkadot-primitives.workspace = true
polkadot-primitives.default-features = true
polkadot-node-primitives.workspace = true
polkadot-node-primitives.default-features = true
polkadot-rpc.workspace = true
polkadot-rpc.default-features = true
polkadot-node-subsystem.workspace = true
polkadot-node-subsystem.default-features = true
polkadot-node-subsystem-util.workspace = true
polkadot-node-subsystem-util.default-features = true
polkadot-node-subsystem-types.workspace = true
polkadot-node-subsystem-types.default-features = true
polkadot-runtime-parachains.workspace = true
polkadot-runtime-parachains.default-features = true
polkadot-node-network-protocol.workspace = true
polkadot-node-network-protocol.default-features = true
rococo-runtime-constants = { optional = true, workspace = true, default-features = true }
westend-runtime-constants = { optional = true, workspace = true, default-features = true }
westend-runtime = { optional = true, workspace = true }
rococo-runtime = { optional = true, workspace = true }
polkadot-approval-distribution = { optional = true, workspace = true, default-features = true }
polkadot-availability-bitfield-distribution = { optional = true, workspace = true, default-features = true }
polkadot-availability-distribution = { optional = true, workspace = true, default-features = true }
polkadot-availability-recovery = { optional = true, workspace = true, default-features = true }
polkadot-collator-protocol = { optional = true, workspace = true, default-features = true }
polkadot-dispute-distribution = { optional = true, workspace = true, default-features = true }
polkadot-gossip-support = { optional = true, workspace = true, default-features = true }
polkadot-network-bridge = { optional = true, workspace = true, default-features = true }
polkadot-node-collation-generation = { optional = true, workspace = true, default-features = true }
polkadot-node-core-approval-voting = { optional = true, workspace = true, default-features = true }
polkadot-node-core-av-store = { optional = true, workspace = true, default-features = true }
polkadot-node-core-backing = { optional = true, workspace = true, default-features = true }
polkadot-node-core-bitfield-signing = { optional = true, workspace = true, default-features = true }
polkadot-node-core-candidate-validation = { optional = true, workspace = true, default-features = true }
polkadot-node-core-chain-api = { optional = true, workspace = true, default-features = true }
polkadot-node-core-chain-selection = { optional = true, workspace = true, default-features = true }
polkadot-node-core-dispute-coordinator = { optional = true, workspace = true, default-features = true }
polkadot-node-core-prospective-parachains = { optional = true, workspace = true, default-features = true }
polkadot-node-core-provisioner = { optional = true, workspace = true, default-features = true }
polkadot-node-core-pvf = { optional = true, workspace = true, default-features = true }
polkadot-node-core-pvf-checker = { optional = true, workspace = true, default-features = true }
polkadot-node-core-runtime-api = { optional = true, workspace = true, default-features = true }
polkadot-statement-distribution = { optional = true, workspace = true, default-features = true }
xcm.workspace = true
xcm.default-features = true
xcm-runtime-apis.workspace = true
xcm-runtime-apis.default-features = true

[dev-dependencies]
polkadot-test-client = { path = "../test/client" }
polkadot-node-subsystem-test-helpers = { path = "../subsystem-test-helpers" }
polkadot-primitives-test-helpers = { path = "../../primitives/test-helpers" }
sp-tracing = { path = "../../../substrate/primitives/tracing", default-features = false }
assert_matches = { workspace = true }
serial_test = { workspace = true }
tempfile = { workspace = true }

[features]
default = ["db", "full-node"]

db = ["sc-service/rocksdb"]

full-node = [
	"kvdb-rocksdb",
	"parity-db",
	"polkadot-approval-distribution",
	"polkadot-availability-bitfield-distribution",
	"polkadot-availability-distribution",
	"polkadot-availability-recovery",
	"polkadot-collator-protocol",
	"polkadot-dispute-distribution",
	"polkadot-gossip-support",
	"polkadot-network-bridge",
	"polkadot-node-collation-generation",
	"polkadot-node-core-approval-voting",
	"polkadot-node-core-av-store",
	"polkadot-node-core-backing",
	"polkadot-node-core-bitfield-signing",
	"polkadot-node-core-candidate-validation",
	"polkadot-node-core-chain-api",
	"polkadot-node-core-chain-selection",
	"polkadot-node-core-dispute-coordinator",
	"polkadot-node-core-prospective-parachains",
	"polkadot-node-core-provisioner",
	"polkadot-node-core-pvf",
	"polkadot-node-core-pvf-checker",
	"polkadot-node-core-runtime-api",
	"polkadot-statement-distribution",
]

# Configure the native runtimes to use.
westend-native = [
	"frame-metadata-hash-extension",
	"westend-runtime",
	"westend-runtime-constants",
]
rococo-native = [
	"frame-metadata-hash-extension",
	"rococo-runtime",
	"rococo-runtime-constants",
]

# Generate the metadata hash needed for CheckMetadataHash
# in the test runtimes.
metadata-hash = [
	"rococo-runtime?/metadata-hash",
	"westend-runtime?/metadata-hash",
]

runtime-benchmarks = [
	"frame-benchmarking-cli/runtime-benchmarks",
	"frame-benchmarking/runtime-benchmarks",
	"frame-system/runtime-benchmarks",
	"polkadot-primitives/runtime-benchmarks",
	"polkadot-runtime-parachains/runtime-benchmarks",
	"rococo-runtime?/runtime-benchmarks",
	"sc-service/runtime-benchmarks",
	"sp-runtime/runtime-benchmarks",
	"westend-runtime?/runtime-benchmarks",
	"xcm-runtime-apis/runtime-benchmarks",
]
try-runtime = [
	"frame-system/try-runtime",
	"pallet-transaction-payment/try-runtime",
	"polkadot-runtime-parachains/try-runtime",
	"rococo-runtime?/try-runtime",
	"sp-runtime/try-runtime",
	"westend-runtime?/try-runtime",
]
fast-runtime = ["rococo-runtime?/fast-runtime", "westend-runtime?/fast-runtime"]

malus = ["full-node"]
runtime-metrics = [
	"polkadot-runtime-parachains/runtime-metrics",
	"rococo-runtime?/runtime-metrics",
	"westend-runtime?/runtime-metrics",
]