From c338819126ae6649b03e6eb5d4f2f9e8f7f22596 Mon Sep 17 00:00:00 2001 From: Chris O'Neil Date: Tue, 15 Oct 2024 22:30:36 +0100 Subject: [PATCH] chore: rename autonomi crate and binary The `autonomi_cli` binary is renamed to `autonomi` because the `_cli` suffix is not necessary. The crate is named `autonomi-cli` rather than `autonomi_cli` because we agreed we prefer underscores. --- .../workflows/generate-benchmark-charts.yml | 8 ++--- .github/workflows/merge.yml | 32 +++++++++---------- Cargo.lock | 2 +- Cargo.toml | 6 +--- README.md | 4 +-- {autonomi_cli => autonomi-cli}/Cargo.toml | 6 +++- {autonomi_cli => autonomi-cli}/README.md | 0 .../benches/files.rs | 0 .../src/access/data_dir.rs | 0 .../src/access/keys.rs | 0 .../src/access/mod.rs | 0 .../src/access/network.rs | 0 .../src/actions/connect.rs | 0 .../src/actions/download.rs | 0 .../src/actions/mod.rs | 0 .../src/actions/progress_bar.rs | 0 .../src/commands.rs | 0 .../src/commands/file.rs | 0 .../src/commands/register.rs | 0 .../src/commands/vault.rs | 0 {autonomi_cli => autonomi-cli}/src/main.rs | 2 +- {autonomi_cli => autonomi-cli}/src/opt.rs | 0 {autonomi_cli => autonomi-cli}/src/utils.rs | 0 sn_logging/src/lib.rs | 2 +- 24 files changed, 31 insertions(+), 31 deletions(-) rename {autonomi_cli => autonomi-cli}/Cargo.toml (94%) rename {autonomi_cli => autonomi-cli}/README.md (100%) rename {autonomi_cli => autonomi-cli}/benches/files.rs (100%) rename {autonomi_cli => autonomi-cli}/src/access/data_dir.rs (100%) rename {autonomi_cli => autonomi-cli}/src/access/keys.rs (100%) rename {autonomi_cli => autonomi-cli}/src/access/mod.rs (100%) rename {autonomi_cli => autonomi-cli}/src/access/network.rs (100%) rename {autonomi_cli => autonomi-cli}/src/actions/connect.rs (100%) rename {autonomi_cli => autonomi-cli}/src/actions/download.rs (100%) rename {autonomi_cli => autonomi-cli}/src/actions/mod.rs (100%) rename {autonomi_cli => autonomi-cli}/src/actions/progress_bar.rs (100%) rename {autonomi_cli => autonomi-cli}/src/commands.rs (100%) rename {autonomi_cli => autonomi-cli}/src/commands/file.rs (100%) rename {autonomi_cli => autonomi-cli}/src/commands/register.rs (100%) rename {autonomi_cli => autonomi-cli}/src/commands/vault.rs (100%) rename {autonomi_cli => autonomi-cli}/src/main.rs (97%) rename {autonomi_cli => autonomi-cli}/src/opt.rs (100%) rename {autonomi_cli => autonomi-cli}/src/utils.rs (100%) diff --git a/.github/workflows/generate-benchmark-charts.yml b/.github/workflows/generate-benchmark-charts.yml index 4b077c7cc8..27a737a7a7 100644 --- a/.github/workflows/generate-benchmark-charts.yml +++ b/.github/workflows/generate-benchmark-charts.yml @@ -15,7 +15,7 @@ permissions: env: CARGO_INCREMENTAL: "0" RUST_BACKTRACE: 1 - CLIENT_DATA_PATH: /home/runner/.local/share/safe/autonomi_cli + CLIENT_DATA_PATH: /home/runner/.local/share/safe/autonomi NODE_DATA_PATH: /home/runner/.local/share/safe/node jobs: @@ -46,7 +46,7 @@ jobs: run: wget https://sn-node.s3.eu-west-2.amazonaws.com/the-test-data.zip - name: Build node and cli binaries - run: cargo build --release --features local --bin safenode --bin autonomi_cli + run: cargo build --release --features local --bin safenode --bin autonomi timeout-minutes: 30 - name: Start a local network @@ -67,7 +67,7 @@ jobs: # Criterion outputs the actual bench results to stderr "2>&1 tee output.txt" takes stderr, # passes to tee which displays it in the terminal and writes to output.txt run: | - cargo criterion --features=local --message-format=json 2>&1 -p autonomi_cli | tee -a output.txt + cargo criterion --features=local --message-format=json 2>&1 -p autonomi | tee -a output.txt cat output.txt | rg benchmark-complete | jq -s 'map({ name: (.id | split("/"))[-1], unit: "MiB/s", @@ -100,7 +100,7 @@ jobs: - name: Start a client instance to compare memory usage shell: bash - run: cargo run --bin autonomi_cli --release -- --log-output-dest=data-dir file upload the-test-data.zip + run: cargo run --bin autonomi --release -- --log-output-dest=data-dir file upload the-test-data.zip env: SN_LOG: "all" diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 2a90a5e7ae..98ee999b06 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -160,7 +160,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Build binaries - run: cargo build --release --features local --bin safenode --bin autonomi_cli + run: cargo build --release --features local --bin safenode --bin autonomi timeout-minutes: 30 - name: Start a local network @@ -207,13 +207,13 @@ jobs: shell: pwsh - name: Get file cost - run: ./target/release/autonomi_cli --log-output-dest=data-dir file cost "./resources" + run: ./target/release/autonomi --log-output-dest=data-dir file cost "./resources" env: SN_LOG: "v" timeout-minutes: 15 - name: File upload - run: ./target/release/autonomi_cli --log-output-dest=data-dir file upload "./resources" > ./upload_output 2>&1 + run: ./target/release/autonomi --log-output-dest=data-dir file upload "./resources" > ./upload_output 2>&1 env: SN_LOG: "v" timeout-minutes: 15 @@ -233,16 +233,16 @@ jobs: shell: pwsh - name: File Download - run: ./target/release/autonomi_cli --log-output-dest=data-dir file download ${{ env.UPLOAD_ADDRESS }} ./downloaded_resources + run: ./target/release/autonomi --log-output-dest=data-dir file download ${{ env.UPLOAD_ADDRESS }} ./downloaded_resources env: SN_LOG: "v" timeout-minutes: 5 - name: Generate register signing key - run: ./target/release/autonomi_cli --log-output-dest=data-dir register generate-key + run: ./target/release/autonomi --log-output-dest=data-dir register generate-key - name: Create register (writeable by owner) - run: ./target/release/autonomi_cli --log-output-dest=data-dir register create baobao 123 > ./register_create_output 2>&1 + run: ./target/release/autonomi --log-output-dest=data-dir register create baobao 123 > ./register_create_output 2>&1 env: SN_LOG: "v" timeout-minutes: 10 @@ -262,25 +262,25 @@ jobs: shell: pwsh - name: Get register - run: ./target/release/autonomi_cli --log-output-dest=data-dir register get ${{ env.REGISTER_ADDRESS }} + run: ./target/release/autonomi --log-output-dest=data-dir register get ${{ env.REGISTER_ADDRESS }} env: SN_LOG: "v" timeout-minutes: 5 - name: Edit register - run: ./target/release/autonomi_cli --log-output-dest=data-dir register edit ${{ env.REGISTER_ADDRESS }} 456 + run: ./target/release/autonomi --log-output-dest=data-dir register edit ${{ env.REGISTER_ADDRESS }} 456 env: SN_LOG: "v" timeout-minutes: 10 - name: Get register (after edit) - run: ./target/release/autonomi_cli --log-output-dest=data-dir register get ${{ env.REGISTER_ADDRESS }} + run: ./target/release/autonomi --log-output-dest=data-dir register get ${{ env.REGISTER_ADDRESS }} env: SN_LOG: "v" timeout-minutes: 5 - name: Create Public Register (writeable by anyone) - run: ./target/release/autonomi_cli --log-output-dest=data-dir register create bao 111 --public > ./register_public_create_output 2>&1 + run: ./target/release/autonomi --log-output-dest=data-dir register create bao 111 --public > ./register_public_create_output 2>&1 env: SN_LOG: "v" timeout-minutes: 5 @@ -300,13 +300,13 @@ jobs: shell: pwsh - name: Get Public Register (current key is the owner) - run: ./target/release/autonomi_cli --log-output-dest=data-dir register get ${{ env.PUBLIC_REGISTER_ADDRESS }} + run: ./target/release/autonomi --log-output-dest=data-dir register get ${{ env.PUBLIC_REGISTER_ADDRESS }} env: SN_LOG: "v" timeout-minutes: 5 - name: Edit Public Register (current key is the owner) - run: ./target/release/autonomi_cli --log-output-dest=data-dir register edit ${{ env.PUBLIC_REGISTER_ADDRESS }} 222 + run: ./target/release/autonomi --log-output-dest=data-dir register edit ${{ env.PUBLIC_REGISTER_ADDRESS }} 222 env: SN_LOG: "v" timeout-minutes: 10 @@ -316,22 +316,22 @@ jobs: run: rm -rf ${{ matrix.safe_path }}/client - name: Generate new register signing key - run: ./target/release/autonomi_cli --log-output-dest=data-dir register generate-key + run: ./target/release/autonomi --log-output-dest=data-dir register generate-key - name: Get Public Register (new signing key is not the owner) - run: ./target/release/autonomi_cli --log-output-dest=data-dir register get ${{ env.PUBLIC_REGISTER_ADDRESS }} + run: ./target/release/autonomi --log-output-dest=data-dir register get ${{ env.PUBLIC_REGISTER_ADDRESS }} env: SN_LOG: "v" timeout-minutes: 2 - name: Edit Public Register (new signing key is not the owner) - run: ./target/release/autonomi_cli --log-output-dest=data-dir register edit ${{ env.PUBLIC_REGISTER_ADDRESS }} 333 + run: ./target/release/autonomi --log-output-dest=data-dir register edit ${{ env.PUBLIC_REGISTER_ADDRESS }} 333 env: SN_LOG: "v" timeout-minutes: 10 - name: Get Public Register (new signing key is not the owner) - run: ./target/release/autonomi_cli --log-output-dest=data-dir register get ${{ env.PUBLIC_REGISTER_ADDRESS }} + run: ./target/release/autonomi --log-output-dest=data-dir register get ${{ env.PUBLIC_REGISTER_ADDRESS }} env: SN_LOG: "v" timeout-minutes: 2 diff --git a/Cargo.lock b/Cargo.lock index 8191c7ec60..5d397e2a98 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1112,7 +1112,7 @@ dependencies = [ ] [[package]] -name = "autonomi_cli" +name = "autonomi-cli" version = "0.1.0" dependencies = [ "autonomi", diff --git a/Cargo.toml b/Cargo.toml index c34946d706..779485a2c8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,15 +2,11 @@ resolver = "2" members = [ "autonomi", - "autonomi_cli", + "autonomi-cli", "evmlib", "evm_testnet", - # "sn_auditor", "sn_build_info", "sn_evm", - # "sn_cli", - # "sn_client", - # "sn_faucet", "sn_logging", "sn_metrics", "nat-detection", diff --git a/README.md b/README.md index 60f5cd84b3..31d6c73e43 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ To upload a file or a directory, you need to set the `SECRET_KEY` environment va > When running a local network, you can use the `SECRET_KEY` printed by the `evm_testnet` command [step 2](#2-run-a-local-evm-node) as it has all the money. ```bash -SECRET_KEY= cargo run --bin autonomi_cli --features local -- file upload +SECRET_KEY= cargo run --bin autonomi --features local -- file upload ``` The output will print out the address at which the content was uploaded. @@ -166,7 +166,7 @@ The output will print out the address at which the content was uploaded. Now to download the files again: ```bash -cargo run --bin autonomi_cli --features local -- file download +cargo run --bin autonomi --features local -- file download ``` ### Registers diff --git a/autonomi_cli/Cargo.toml b/autonomi-cli/Cargo.toml similarity index 94% rename from autonomi_cli/Cargo.toml rename to autonomi-cli/Cargo.toml index 55a7caad32..0eea336fdf 100644 --- a/autonomi_cli/Cargo.toml +++ b/autonomi-cli/Cargo.toml @@ -1,8 +1,12 @@ [package] -name = "autonomi_cli" +name = "autonomi-cli" version = "0.1.0" edition = "2021" +[[bin]] +name = "autonomi" +path = "src/main.rs" + [features] default = ["metrics"] local = ["sn_peers_acquisition/local", "autonomi/local"] diff --git a/autonomi_cli/README.md b/autonomi-cli/README.md similarity index 100% rename from autonomi_cli/README.md rename to autonomi-cli/README.md diff --git a/autonomi_cli/benches/files.rs b/autonomi-cli/benches/files.rs similarity index 100% rename from autonomi_cli/benches/files.rs rename to autonomi-cli/benches/files.rs diff --git a/autonomi_cli/src/access/data_dir.rs b/autonomi-cli/src/access/data_dir.rs similarity index 100% rename from autonomi_cli/src/access/data_dir.rs rename to autonomi-cli/src/access/data_dir.rs diff --git a/autonomi_cli/src/access/keys.rs b/autonomi-cli/src/access/keys.rs similarity index 100% rename from autonomi_cli/src/access/keys.rs rename to autonomi-cli/src/access/keys.rs diff --git a/autonomi_cli/src/access/mod.rs b/autonomi-cli/src/access/mod.rs similarity index 100% rename from autonomi_cli/src/access/mod.rs rename to autonomi-cli/src/access/mod.rs diff --git a/autonomi_cli/src/access/network.rs b/autonomi-cli/src/access/network.rs similarity index 100% rename from autonomi_cli/src/access/network.rs rename to autonomi-cli/src/access/network.rs diff --git a/autonomi_cli/src/actions/connect.rs b/autonomi-cli/src/actions/connect.rs similarity index 100% rename from autonomi_cli/src/actions/connect.rs rename to autonomi-cli/src/actions/connect.rs diff --git a/autonomi_cli/src/actions/download.rs b/autonomi-cli/src/actions/download.rs similarity index 100% rename from autonomi_cli/src/actions/download.rs rename to autonomi-cli/src/actions/download.rs diff --git a/autonomi_cli/src/actions/mod.rs b/autonomi-cli/src/actions/mod.rs similarity index 100% rename from autonomi_cli/src/actions/mod.rs rename to autonomi-cli/src/actions/mod.rs diff --git a/autonomi_cli/src/actions/progress_bar.rs b/autonomi-cli/src/actions/progress_bar.rs similarity index 100% rename from autonomi_cli/src/actions/progress_bar.rs rename to autonomi-cli/src/actions/progress_bar.rs diff --git a/autonomi_cli/src/commands.rs b/autonomi-cli/src/commands.rs similarity index 100% rename from autonomi_cli/src/commands.rs rename to autonomi-cli/src/commands.rs diff --git a/autonomi_cli/src/commands/file.rs b/autonomi-cli/src/commands/file.rs similarity index 100% rename from autonomi_cli/src/commands/file.rs rename to autonomi-cli/src/commands/file.rs diff --git a/autonomi_cli/src/commands/register.rs b/autonomi-cli/src/commands/register.rs similarity index 100% rename from autonomi_cli/src/commands/register.rs rename to autonomi-cli/src/commands/register.rs diff --git a/autonomi_cli/src/commands/vault.rs b/autonomi-cli/src/commands/vault.rs similarity index 100% rename from autonomi_cli/src/commands/vault.rs rename to autonomi-cli/src/commands/vault.rs diff --git a/autonomi_cli/src/main.rs b/autonomi-cli/src/main.rs similarity index 97% rename from autonomi_cli/src/main.rs rename to autonomi-cli/src/main.rs index 2c15b82a66..2cf4e9cd61 100644 --- a/autonomi_cli/src/main.rs +++ b/autonomi-cli/src/main.rs @@ -51,7 +51,7 @@ fn init_logging_and_metrics(opt: &Opt) -> Result<(ReloadHandle, Option