Skip to content

Commit

Permalink
Remove frame dependency (#7)
Browse files Browse the repository at this point in the history
* Remove frame dependency

`frame` pulls a number of dependencies we don't need, this commit
removes several deps.

* Make subcoin-node a library

* Add try-runtime feature in pallet-bitcoin
  • Loading branch information
liuchengxu authored Jul 7, 2024
1 parent a8f5ccb commit 43fe40e
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 140 deletions.
117 changes: 9 additions & 108 deletions Cargo.lock

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

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ tracing = "0.1"
frame-benchmarking-cli = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
frame-support = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
frame-system = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
frame-system-rpc-runtime-api = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
frame-try-runtime = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
frame = { package = "polkadot-sdk-frame", git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
pallet-balances = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
pallet-transaction-payment = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
# Disable the default `rocksdb` feature
Expand All @@ -76,6 +76,7 @@ sc-transaction-pool-api = { git = "https://github.com/liuchengxu/polkadot-sdk",
sc-utils = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin" }
sp-api = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
sp-blockchain = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
sp-block-builder = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
sp-consensus = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
sp-core = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
sp-database = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
Expand All @@ -86,10 +87,12 @@ sp-inherents = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "s
sp-io = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
sp-rpc = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin" }
sp-runtime = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
sp-session = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
sp-state-machine = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin" }
sp-std = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
sp-storage = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
sp-tracing = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
sp-transaction-pool = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
sp-trie = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
sp-version = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin", default-features = false }
substrate-build-script-utils = { git = "https://github.com/liuchengxu/polkadot-sdk", branch = "subcoin" }
Expand Down
4 changes: 4 additions & 0 deletions crates/pallet-bitcoin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ std = [
"sp-std/std",
"subcoin-runtime-primitives/std",
]
try-runtime = [
"frame-system/try-runtime",
"sp-runtime/try-runtime",
]
3 changes: 1 addition & 2 deletions crates/subcoin-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ license.workspace = true

[[bin]]
name = "subcoin"
path = "src/main.rs"
path = "src/bin/subcoin.rs"

[dependencies]
async-trait = { workspace = true }
bitcoin = { workspace = true }
bitcoin-explorer = { workspace = true, default-features = false }
clap = { workspace = true, features = ["derive"] }
codec = { workspace = true }
frame = { workspace = true }
frame-benchmarking-cli = { workspace = true }
futures = { workspace = true }
hex = { workspace = true }
Expand Down
4 changes: 4 additions & 0 deletions crates/subcoin-node/src/bin/subcoin.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main() -> sc_cli::Result<()> {
subcoin_node::run()?;
Ok(())
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ mod cli;
mod commands;
mod substrate_cli;

fn main() -> sc_cli::Result<()> {
cli::run()?;
Ok(())
}
pub use self::cli::run;

pub struct CoinStorageKey;

Expand Down
21 changes: 18 additions & 3 deletions crates/subcoin-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,23 @@ repository.workspace = true

[dependencies]
codec = { workspace = true, default-features = false }
# this is a frame-based runtime, thus importing `frame` with runtime feature enabled.
frame = { workspace = true, default-features = false, features = ["experimental", "runtime"] }
pallet-executive = { workspace = true, default-features = false }
frame-system = { workspace = true, default-features = false }
frame-system-rpc-runtime-api = { workspace = true, default-features = false }
frame-support = { workspace = true, default-features = false }
log = { workspace = true, default-features = false }
pallet-bitcoin = { workspace = true, default-features = false }
scale-info = { workspace = true, default-features = false }
sp-api = { workspace = true, default-features = false }
sp-block-builder = { workspace = true, default-features = false }
sp-core = { workspace = true, default-features = false }
sp-genesis-builder = { workspace = true, default-features = false }
sp-inherents = { workspace = true, default-features = false }
sp-runtime = { workspace = true, default-features = false }
sp-session = { workspace = true, default-features = false }
sp-std = { workspace = true, default-features = false }
sp-transaction-pool = { workspace = true, default-features = false }
sp-version = { workspace = true, default-features = false }
subcoin-runtime-primitives = { workspace = true, default-features = false }

[build-dependencies]
Expand All @@ -28,15 +35,23 @@ substrate-wasm-builder = { workspace = true, optional = true }
default = ["std"]
std = [
"codec/std",
"frame/std",
"pallet-executive/std",
"frame-system/std",
"frame-system-rpc-runtime-api/std",
"frame-support/std",
"log/std",
"pallet-bitcoin/std",
"scale-info/std",
"sp-api/std",
"sp-block-builder/std",
"sp-core/std",
"sp-genesis-builder/std",
"sp-inherents/std",
"sp-runtime/std",
"sp-session/std",
"sp-std/std",
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
"subcoin-runtime-primitives/std",
]
Loading

0 comments on commit 43fe40e

Please sign in to comment.