Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: small adjustments #39

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

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

20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,20 @@ members = [
resolver = "2"

[workspace.package]
authors = ["Luiz Carvalho <[email protected]>"]
authors = ["Renlabs <[email protected]>"]
edition = "2021"

[workspace.dependencies]

# Local
torus-node = { path = "./node", default-features = false }
torus-runtime = { path = "./runtime", default-features = false }
pallet-governance = { path = "./pallets/governance", default-features = false }
pallet-torus0 = { path = "./pallets/torus0", default-features = false }
pallet-governance-api = { path = "./pallets/governance/api", default-features = false }
pallet-emission0 = { path = "./pallets/emission0", default-features = false }

pallet-torus0-api = { path = "./pallets/torus0/api", default-features = false }
pallet-emission0-api = { path = "./pallets/emission0/api", default-features = false }
pallet-governance-api = { path = "./pallets/governance/api", default-features = false }

pallet-torus0 = { path = "./pallets/torus0", default-features = false }
pallet-torus0-api = { path = "./pallets/torus0/api", default-features = false }
test-utils.path = "./test-utils"

# Substrate
Expand All @@ -34,11 +33,12 @@ polkadot-sdk = { git = "https://github.com/paritytech/polkadot-sdk.git", branch
substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "stable2409", default-features = false }
substrate-fixed = { git = "https://github.com/encointer/substrate-fixed.git", branch = "master", default-features = false }

# Utils
num-traits = { version = "0.2.19", default-features = false, features = [
"libm",
] }

# Frontier
# Frontier / EVM
fc-api = { git = "https://github.com/paritytech/frontier.git", rev = "b9b1c620c8b418bdeeadc79725f9cfa4703c0333" }
fc-cli = { git = "https://github.com/paritytech/frontier.git", rev = "b9b1c620c8b418bdeeadc79725f9cfa4703c0333" }
fc-consensus = { git = "https://github.com/paritytech/frontier.git", rev = "b9b1c620c8b418bdeeadc79725f9cfa4703c0333" }
Expand All @@ -59,13 +59,13 @@ pallet-evm-precompile-modexp = { git = "https://github.com/paritytech/frontier.g
pallet-evm-precompile-sha3fips = { git = "https://github.com/paritytech/frontier.git", rev = "b9b1c620c8b418bdeeadc79725f9cfa4703c0333", default-features = false }
pallet-evm-precompile-simple = { git = "https://github.com/paritytech/frontier.git", rev = "b9b1c620c8b418bdeeadc79725f9cfa4703c0333", default-features = false }

# CLI-specific dependencies
# CLI
clap = { version = "4.5.22", features = ["derive"] }
serde_json = { version = "1.0", default-features = false }

# RPC-specific dependencies
# RPC
jsonrpsee = { version = "0.24", features = ["server"] }

# Async stuff
# Async
futures = "0.3"
futures-timer = "3"
9 changes: 7 additions & 2 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "torus-node"
description = "The Torus substrate node implementation"
description = "Torus Substrate Node"
version = "0.1.0"
license = "MIT-0"
authors.workspace = true
Expand All @@ -14,13 +14,16 @@ runtime-benchmarks = [
"polkadot-sdk/runtime-benchmarks",
]


[dependencies]

clap = { workspace = true, features = ["derive"] }
futures = { workspace = true, features = ["thread-pool"] }
futures-timer.workspace = true
jsonrpsee = { workspace = true, features = ["server"] }
serde_json = { workspace = true, default-features = true }

# Substrate
polkadot-sdk = { workspace = true, features = [
"std",
"frame-benchmarking-cli",
Expand Down Expand Up @@ -87,7 +90,7 @@ polkadot-sdk = { workspace = true, features = [
"substrate-rpc-client",
] }

# Frontier
# Frontier / EVM
fc-api.workspace = true
fc-cli.workspace = true
fc-consensus.workspace = true
Expand All @@ -101,7 +104,9 @@ fp-dynamic-fee = { workspace = true, features = ["default"] }
fp-evm = { workspace = true, features = ["default"] }
fp-rpc = { workspace = true, features = ["default"] }

# Local
torus-runtime.workspace = true


[build-dependencies]
polkadot-sdk = { workspace = true, features = ["substrate-build-script-utils"] }
2 changes: 1 addition & 1 deletion node/src/cli/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn db_config_dir(config: &Configuration) -> PathBuf {
config.base_path.config_dir(config.chain_spec.id())
}

/// Avalailable frontier backend types.
/// Available frontier backend types.
#[derive(Debug, Copy, Clone, Default, clap::ValueEnum)]
pub enum BackendType {
/// Either RocksDb or ParityDb as per inherited from the global backend settings.
Expand Down
6 changes: 3 additions & 3 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ mod benchmarking;

impl SubstrateCli for Cli {
fn impl_name() -> String {
"Substrate Node".into()
"Torus Node".into()
}

fn impl_version() -> String {
Expand All @@ -46,11 +46,11 @@ impl SubstrateCli for Cli {
}

fn support_url() -> String {
"support.anonymous.an".into()
"torus.network".into()
}

fn copyright_start_year() -> i32 {
2017
2025
}

fn load_spec(&self, id: &str) -> Result<Box<dyn sc_service::ChainSpec>, String> {
Expand Down
4 changes: 3 additions & 1 deletion pallets/emission0/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pallet-emission0"
description = "The chain's emission pallet."
description = "Torus emission pallet."
version = "0.1.0"
license = "MIT-0"
authors.workspace = true
Expand All @@ -22,6 +22,7 @@ runtime-benchmarks = [
]
try-runtime = ["polkadot-sdk/try-runtime"]


[dependencies]
codec = { workspace = true, features = ["derive"] }
scale-info = { workspace = true, features = ["derive"] }
Expand All @@ -34,5 +35,6 @@ pallet-torus0-api.workspace = true
pallet-emission0-api.workspace = true
pallet-governance-api.workspace = true


[dev-dependencies]
test-utils.workspace = true
2 changes: 1 addition & 1 deletion pallets/emission0/api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pallet-emission0-api"
description = "The chain's emission pallet API."
description = "Torus emission pallet API."
version = "0.1.0"
license = "MIT-0"
authors.workspace = true
Expand Down
5 changes: 3 additions & 2 deletions pallets/governance/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pallet-governance"
description = "The chain's governance pallet."
description = "Torus governance pallet."
version = "0.1.0"
license = "MIT-0"
authors.workspace = true
Expand All @@ -27,14 +27,15 @@ try-runtime = [
"pallet-emission0/try-runtime",
]


[dependencies]
codec = { workspace = true, features = ["derive"] }
scale-info = { workspace = true, features = ["derive"] }
polkadot-sdk = { workspace = true, features = [
"experimental",
"runtime",
"pallet-sudo",
] }
scale-info = { workspace = true, features = ["derive"] }
substrate-fixed = { workspace = true }

pallet-torus0.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion pallets/governance/api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pallet-governance-api"
description = "The chain's governance pallet api."
description = "Torus governance pallet api."
version = "0.1.0"
license = "MIT-0"
authors.workspace = true
Expand Down
6 changes: 4 additions & 2 deletions pallets/torus0/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pallet-torus0"
description = "The torus initial pallet."
description = "Torus initial pallet."
version = "0.1.0"
license = "MIT-0"
authors.workspace = true
Expand All @@ -21,15 +21,17 @@ runtime-benchmarks = [
]
try-runtime = ["polkadot-sdk/try-runtime", "pallet-torus0-api/try-runtime"]


[dependencies]
codec = { workspace = true, features = ["derive"] }
scale-info = { workspace = true, features = ["derive"] }
substrate-fixed = { workspace = true }
polkadot-sdk = { workspace = true, features = ["experimental", "runtime"] }
substrate-fixed = { workspace = true }

pallet-torus0-api.workspace = true
pallet-emission0-api.workspace = true
pallet-governance-api.workspace = true


[dev-dependencies]
test-utils.workspace = true
5 changes: 4 additions & 1 deletion pallets/torus0/api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
[package]
name = "pallet-torus0-api"
description = "Torus initial pallet API."
version = "0.1.0"
edition = "2021"
license = "MIT-0"
authors.workspace = true
edition.workspace = true

[features]
default = ["std"]
Expand Down
18 changes: 12 additions & 6 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "torus-runtime"
description = "The torus blockchain runtime."
description = "Torus blockchain runtime."
version = "0.1.0"
license = "MIT-0"
authors.workspace = true
Expand Down Expand Up @@ -48,12 +48,14 @@ try-runtime = [
"pallet-governance/try-runtime",
]


[dependencies]
codec = { workspace = true, features = ["derive"] }
scale-info = { features = ["derive", "serde"], workspace = true }

serde_json = { workspace = true, features = ["alloc"] }

# Polkadot SDK
# Substrate
codec = { workspace = true, features = ["derive"] }
scale-info = { features = ["derive", "serde"], workspace = true }
polkadot-sdk = { workspace = true, features = [
"runtime",
"pallet-balances",
Expand All @@ -67,7 +69,7 @@ polkadot-sdk = { workspace = true, features = [
"frame-metadata-hash-extension",
] }

# Frontier
# Frontier / EVM
fp-evm = { workspace = true, features = ["serde"] }
fp-rpc.workspace = true
fp-self-contained = { workspace = true, features = ["serde"] }
Expand All @@ -78,11 +80,15 @@ pallet-evm-precompile-modexp.workspace = true
pallet-evm-precompile-sha3fips.workspace = true
pallet-evm-precompile-simple.workspace = true

# Local dependencies
# Local
pallet-torus0.workspace = true
pallet-emission0.workspace = true
pallet-governance.workspace = true

pallet-torus0-api.workspace = true
pallet-governance-api.workspace = true


[build-dependencies]
substrate-wasm-builder = { optional = true, workspace = true, features = [
"metadata-hash",
Expand Down
2 changes: 1 addition & 1 deletion runtime/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn main() {
#[cfg(feature = "std")]
{
substrate_wasm_builder::WasmBuilder::init_with_defaults()
.enable_metadata_hash("TOR", 18)
.enable_metadata_hash("TOR", 18) // TODO: disable on dev/local? this increases build times 100%+
.build();
}
}