Skip to content

Commit

Permalink
Merge pull request #2246 from jacderida/chore-rename_autonomi_cli2
Browse files Browse the repository at this point in the history
chore: rename autonomi crate and binary
  • Loading branch information
jacderida authored Oct 15, 2024
2 parents 147ba8e + c338819 commit 567200e
Show file tree
Hide file tree
Showing 24 changed files with 31 additions and 31 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/generate-benchmark-charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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",
Expand Down Expand Up @@ -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"

Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

6 changes: 1 addition & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ 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=<YOUR_EVM_SECRET_KEY> cargo run --bin autonomi_cli --features local -- file upload <path>
SECRET_KEY=<YOUR_EVM_SECRET_KEY> cargo run --bin autonomi --features local -- file upload <path>
```

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 <addr> <dest_path>
cargo run --bin autonomi --features local -- file download <addr> <dest_path>
```

### Registers
Expand Down
6 changes: 5 additions & 1 deletion autonomi_cli/Cargo.toml → autonomi-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion autonomi_cli/src/main.rs → autonomi-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn init_logging_and_metrics(opt: &Opt) -> Result<(ReloadHandle, Option<WorkerGua
let logging_targets = vec![
("sn_networking".to_string(), Level::INFO),
("sn_build_info".to_string(), Level::TRACE),
("autonomi_cli".to_string(), Level::TRACE),
("autonomi-cli".to_string(), Level::TRACE),
("sn_logging".to_string(), Level::TRACE),
("sn_peers_acquisition".to_string(), Level::TRACE),
("sn_protocol".to_string(), Level::TRACE),
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion sn_logging/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ impl LogBuilder {
let timestamp = chrono::Local::now().format("%Y-%m-%d_%H-%M-%S").to_string();
let path = dir
.join("safe")
.join("autonomi_cli")
.join("autonomi")
.join("logs")
.join(format!("log_{timestamp}"));
LogOutputDest::Path(path)
Expand Down

0 comments on commit 567200e

Please sign in to comment.