From 40416bb4d19bee63da73caa7db62afb50789dfb8 Mon Sep 17 00:00:00 2001 From: Cesar <142530682+cr-fuel@users.noreply.github.com> Date: Tue, 17 Oct 2023 17:52:00 -0300 Subject: [PATCH] Split keygen into a create and a binary Split so it can be inherited from other binaries https://github.com/FuelLabs/sway/issues/5170 --- CHANGELOG.md | 1 + Cargo.lock | 9 +++++++++ Cargo.toml | 4 +++- bin/keygen/Cargo.toml | 6 ++---- crates/keygen/Cargo.toml | 19 +++++++++++++++++++ {bin => crates}/keygen/src/keygen.rs | 0 {bin => crates}/keygen/src/lib.rs | 0 7 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 crates/keygen/Cargo.toml rename {bin => crates}/keygen/src/keygen.rs (100%) rename {bin => crates}/keygen/src/lib.rs (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2883c41b466..fcbd1971117 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ Description of the upcoming release here. ### Added +- [#1426](https://github.com/FuelLabs/fuel-core/pull/1426) Split keygen into a create and a binary - [#1411](https://github.com/FuelLabs/fuel-core/pull/1411) Added WASM and `no_std` compatibility - [#1371](https://github.com/FuelLabs/fuel-core/pull/1371): Add new client function for querying the `MessageStatus` for a specific message (by `Nonce`) - [#1356](https://github.com/FuelLabs/fuel-core/pull/1356): Add peer reputation reporting to heartbeat code diff --git a/Cargo.lock b/Cargo.lock index 9a6ae94a152..597b157dd32 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2950,6 +2950,15 @@ dependencies = [ "serde_json", ] +[[package]] +name = "fuel-core-keygen-bin" +version = "0.20.4" +dependencies = [ + "anyhow", + "clap 4.4.6", + "fuel-core-keygen", +] + [[package]] name = "fuel-core-metrics" version = "0.20.4" diff --git a/Cargo.toml b/Cargo.toml index 9632b05413f..326bf59060d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ members = [ "crates/client", "crates/database", "crates/fuel-core", + "crates/keygen", "crates/metrics", "crates/services", "crates/services/consensus_module", @@ -52,7 +53,8 @@ version = "0.20.4" fuel-core = { version = "0.20.4", path = "./crates/fuel-core", default-features = false } fuel-core-client-bin = { version = "0.20.4", path = "./bin/client" } fuel-core-bin = { version = "0.20.4", path = "./bin/fuel-core" } -fuel-core-keygen = { version = "0.20.4", path = "./bin/keygen" } +fuel-core-keygen = { version = "0.20.4", path = "./crates/keygen" } +fuel-core-keygen-bin = { version = "0.20.4", path = "./bin/keygen" } fuel-core-chain-config = { version = "0.20.4", path = "./crates/chain-config" } fuel-core-client = { version = "0.20.4", path = "./crates/client" } fuel-core-database = { version = "0.20.4", path = "./crates/database" } diff --git a/bin/keygen/Cargo.toml b/bin/keygen/Cargo.toml index b74b70fb958..71735bcc491 100644 --- a/bin/keygen/Cargo.toml +++ b/bin/keygen/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "fuel-core-keygen" +name = "fuel-core-keygen-bin" version = { workspace = true } edition = { workspace = true } homepage = { workspace = true } @@ -12,6 +12,4 @@ description = "Command line utilities for fuel-core key management" [dependencies] anyhow = { workspace = true } clap = { workspace = true, features = ["derive", "env"] } -fuel-core-types = { workspace = true, features = ["serde", "random"] } -libp2p-identity = { version = "0.2.4", features = ["secp256k1", "peerid"] } -serde_json = { workspace = true, features = ["raw_value"] } +fuel-core-keygen = { workspace = true } diff --git a/crates/keygen/Cargo.toml b/crates/keygen/Cargo.toml new file mode 100644 index 00000000000..dc975bec090 --- /dev/null +++ b/crates/keygen/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "fuel-core-keygen" +authors = { workspace = true } +categories = { workspace = true } +version = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +keywords = { workspace = true } +license = { workspace = true } +repository = { workspace = true } +description = "Create to create command line utilities for fuel-core key management" +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +anyhow = { workspace = true } +clap = { workspace = true, features = ["derive", "env"] } +fuel-core-types = { workspace = true, features = ["serde", "random"] } +libp2p-identity = { version = "0.2.4", features = ["secp256k1", "peerid"] } +serde_json = { workspace = true, features = ["raw_value"] } diff --git a/bin/keygen/src/keygen.rs b/crates/keygen/src/keygen.rs similarity index 100% rename from bin/keygen/src/keygen.rs rename to crates/keygen/src/keygen.rs diff --git a/bin/keygen/src/lib.rs b/crates/keygen/src/lib.rs similarity index 100% rename from bin/keygen/src/lib.rs rename to crates/keygen/src/lib.rs