Skip to content

Commit

Permalink
Merge pull request #1129 from dusk-network/rm-recovery-bin
Browse files Browse the repository at this point in the history
Remove rusk-recovery binaries
  • Loading branch information
herr-seppia authored Nov 9, 2023
2 parents 57e38c3 + df0a10f commit ceea487
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 363 deletions.
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUN ARCH="$(echo $TARGETPLATFORM | sed 's/linux\///')" && \
# Generate keys, compile genesis contracts and generate genesis state
RUN make keys && make wasm
RUN mkdir -p /.dusk/rusk && cp examples/consensus.keys /.dusk/rusk/consensus.keys
RUN cargo r --release -p rusk-recovery --features state --bin rusk-recovery-state -- --init examples/genesis.toml -o /tmp/example.state
RUN cargo r --release -p rusk -- recovery-state --init examples/genesis.toml -o /tmp/example.state
RUN cargo b --release -p rusk

# --- Run stage ---
Expand All @@ -44,8 +44,6 @@ EXPOSE 9000/udp
# Copy only the necessary files from the build stage
COPY --from=build-stage /.dusk/rusk /.dusk/rusk
COPY --from=build-stage /opt/rusk/target/release/rusk /opt/rusk/
COPY --from=build-stage /opt/rusk/target/release/rusk-recovery-keys /opt/rusk/
COPY --from=build-stage /opt/rusk/target/release/rusk-recovery-state /opt/rusk/
COPY --from=build-stage /opt/rusk/examples/consensus.keys /.dusk/rusk/consensus.keys
COPY --from=build-stage /tmp/example.state /tmp/example.state

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ circuits: ## Compress and store all circuits
$(MAKE) -C ./circuits $@

keys: circuits ## Create the keys for the circuits
$(MAKE) -C ./rusk-recovery keys
$(MAKE) -C ./rusk recovery-keys

state: keys wasm ## Create the network state
$(MAKE) -C ./rusk-recovery state
$(MAKE) -C ./rusk recovery-state

wasm: ## Generate the WASM for all the contracts
$(MAKE) -C ./contracts $@
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Run a single-node cluster with example's data

```bash
# Generate genesis state
cargo r --release -p rusk-recovery --features state --bin rusk-recovery-state -- --init examples/genesis.toml -o /tmp/example.state
cargo r --release -p rusk -- recovery-state --init examples/genesis.toml -o /tmp/example.state

# Launch a local ephemeral node
DUSK_CONSENSUS_KEYS_PASS=password cargo r --release -p rusk -- -s /tmp/example.state
Expand Down
17 changes: 0 additions & 17 deletions rusk-recovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,20 @@ description = "Tool to restore Rusk to factory settings"
name = "rusk_recovery_tools"
path = "src/lib.rs"

[[bin]]
name = "rusk-recovery-keys"
path = "src/bin/keys.rs"
required-features = ["keys"]

[[bin]]
name = "rusk-recovery-state"
path = "src/bin/state.rs"
required-features = ["state"]

[build-dependencies]
rustc_tools_util = "=0.2.0"

[dependencies]
hex = "0.4"
rustc_tools_util = "0.2"
dusk-plonk = { version = "0.16", features = ["rkyv-impl"] }
dusk-pki ="0.13"
phoenix-core = { version = "0.21", features = ["rkyv-impl", "alloc"] }
rand = "0.8"
dusk-merkle = "0.5"
rusk-profile = { version = "0.6", path = "../rusk-profile" }
rusk-abi = { version = "0.11", path = "../rusk-abi", default-features = false, features = ["host"] }
once_cell = "1.13"
dusk-bytes = "0.1"
dusk-bls12_381 = "0.12"
dusk-bls12_381-sign = "0.5"
clap = { version = "4", features = ["env", "derive"] }
thiserror = "1.0"
tracing = { version = "0.1", features = ["log"] }
tracing-subscriber = { version = "0.2.0", features = ["fmt"] }
http_req = "0.8"
zip = "0.5"
url = "2.3"
Expand Down
17 changes: 6 additions & 11 deletions rusk-recovery/Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
INITFILE?=./config/localnet.toml

help: ## Display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'

keys: ## Build circuit keys
cargo run --release --bin rusk-recovery-keys --features keys

state: ## Build network state
cargo run --release --bin rusk-recovery-state --features state -- --init $(INITFILE)

test: ## Run Rusk tests
test: ## Run tests
@cargo test \
--release \
--all-features \
-- --nocapture \
--test-threads 1

clippy: ## Run clippy
@cargo clippy --all-features --release -- -D warnings
@cargo clippy --release --all-features -- -D warnings
@cargo clippy --release --no-default-features -- -D warnings
@cargo clippy --release --no-default-features --features state -- -D warnings
@cargo clippy --release --no-default-features --features keys -- -D warnings

.PHONY: keys state test help
.PHONY: test clippy help
20 changes: 0 additions & 20 deletions rusk-recovery/build.rs

This file was deleted.

2 changes: 1 addition & 1 deletion rusk-recovery/config/example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# The url can be either remote or local (eg: file:///path/state.zip)
# The content of the file shall be the same format generated
# by `rusk-recovery-state --output <state.zip>` command
# by `rusk recovery-state --output <state.zip>` command
# If no base_state is specified a local one will be generated
base_state = "https://dusk-infra.ams3.digitaloceanspaces.com/keys/genesis.zip"

Expand Down
45 changes: 0 additions & 45 deletions rusk-recovery/src/bin/keys.rs

This file was deleted.

157 changes: 0 additions & 157 deletions rusk-recovery/src/bin/state.rs

This file was deleted.

Loading

0 comments on commit ceea487

Please sign in to comment.