From e7826e40d619e99f638c147c408dc6c77508be93 Mon Sep 17 00:00:00 2001 From: Chris O'Neil Date: Mon, 2 Dec 2024 14:21:43 +0000 Subject: [PATCH 1/2] chore: rename `autonomi-cli` crate and binary The crate is renamed to `ant-cli` and the binary is renamed from `autonomi` to `ant`. --- .github/workflows/benchmark-prs.yml | 10 +-- .../workflows/generate-benchmark-charts.yml | 4 +- .github/workflows/memcheck.yml | 25 +++--- .github/workflows/merge.yml | 88 +++++++++---------- .github/workflows/merge_websocket.yml | 6 +- .github/workflows/nightly.yml | 32 +++---- Cargo.lock | 60 ++++++------- Cargo.toml | 2 +- README.md | 28 +++--- {autonomi-cli => ant-cli}/Cargo.toml | 8 +- {autonomi-cli => ant-cli}/README.md | 2 +- {autonomi-cli => ant-cli}/benches/files.rs | 0 .../src/access/data_dir.rs | 0 {autonomi-cli => ant-cli}/src/access/keys.rs | 0 {autonomi-cli => ant-cli}/src/access/mod.rs | 0 .../src/access/network.rs | 0 .../src/access/user_data.rs | 0 .../src/actions/connect.rs | 0 .../src/actions/download.rs | 0 {autonomi-cli => ant-cli}/src/actions/mod.rs | 0 .../src/actions/progress_bar.rs | 0 {autonomi-cli => ant-cli}/src/commands.rs | 0 .../src/commands/file.rs | 0 .../src/commands/register.rs | 0 .../src/commands/vault.rs | 0 .../src/commands/wallet.rs | 0 {autonomi-cli => ant-cli}/src/main.rs | 0 {autonomi-cli => ant-cli}/src/opt.rs | 0 {autonomi-cli => ant-cli}/src/utils.rs | 0 .../src/wallet/encryption.rs | 0 {autonomi-cli => ant-cli}/src/wallet/error.rs | 0 {autonomi-cli => ant-cli}/src/wallet/fs.rs | 0 {autonomi-cli => ant-cli}/src/wallet/input.rs | 0 {autonomi-cli => ant-cli}/src/wallet/mod.rs | 0 34 files changed, 135 insertions(+), 130 deletions(-) rename {autonomi-cli => ant-cli}/Cargo.toml (97%) rename {autonomi-cli => ant-cli}/README.md (98%) rename {autonomi-cli => ant-cli}/benches/files.rs (100%) rename {autonomi-cli => ant-cli}/src/access/data_dir.rs (100%) rename {autonomi-cli => ant-cli}/src/access/keys.rs (100%) rename {autonomi-cli => ant-cli}/src/access/mod.rs (100%) rename {autonomi-cli => ant-cli}/src/access/network.rs (100%) rename {autonomi-cli => ant-cli}/src/access/user_data.rs (100%) rename {autonomi-cli => ant-cli}/src/actions/connect.rs (100%) rename {autonomi-cli => ant-cli}/src/actions/download.rs (100%) rename {autonomi-cli => ant-cli}/src/actions/mod.rs (100%) rename {autonomi-cli => ant-cli}/src/actions/progress_bar.rs (100%) rename {autonomi-cli => ant-cli}/src/commands.rs (100%) rename {autonomi-cli => ant-cli}/src/commands/file.rs (100%) rename {autonomi-cli => ant-cli}/src/commands/register.rs (100%) rename {autonomi-cli => ant-cli}/src/commands/vault.rs (100%) rename {autonomi-cli => ant-cli}/src/commands/wallet.rs (100%) rename {autonomi-cli => ant-cli}/src/main.rs (100%) rename {autonomi-cli => ant-cli}/src/opt.rs (100%) rename {autonomi-cli => ant-cli}/src/utils.rs (100%) rename {autonomi-cli => ant-cli}/src/wallet/encryption.rs (100%) rename {autonomi-cli => ant-cli}/src/wallet/error.rs (100%) rename {autonomi-cli => ant-cli}/src/wallet/fs.rs (100%) rename {autonomi-cli => ant-cli}/src/wallet/input.rs (100%) rename {autonomi-cli => ant-cli}/src/wallet/mod.rs (100%) diff --git a/.github/workflows/benchmark-prs.yml b/.github/workflows/benchmark-prs.yml index 0d78c05c58..94e503169d 100644 --- a/.github/workflows/benchmark-prs.yml +++ b/.github/workflows/benchmark-prs.yml @@ -43,7 +43,7 @@ jobs: # it will be better to execute bench test with `local`, # to make the measurement results reflect speed improvement or regression more accurately. - name: Build binaries - run: cargo build --release --features local --bin antnode --bin autonomi + run: cargo build --release --features local --bin antnode --bin ant timeout-minutes: 30 - name: Start a local network @@ -71,7 +71,7 @@ jobs: - name: Start a client instance to compare memory usage shell: bash - run: ./target/release/autonomi --log-output-dest=data-dir file upload "./the-test-data.zip" + run: ./target/release/ant --log-output-dest=data-dir file upload "./the-test-data.zip" env: SN_LOG: "all" timeout-minutes: 5 @@ -93,7 +93,7 @@ jobs: client_avg_mem_limit_mb="512" # mb peak_mem_usage=$( - rg '"memory_used_mb":[^,]*' $CLIENT_DATA_PATH/logs --glob autonomi.* -o --no-line-number --no-filename | + rg '"memory_used_mb":[^,]*' $CLIENT_DATA_PATH/logs --glob ant.* -o --no-line-number --no-filename | awk -F':' '/"memory_used_mb":/{print $2}' | sort -n | tail -n 1 @@ -105,11 +105,11 @@ jobs: fi total_mem=$( - rg '"memory_used_mb":[^,]*' $CLIENT_DATA_PATH/logs --glob autonomi.* -o --no-line-number --no-filename | + rg '"memory_used_mb":[^,]*' $CLIENT_DATA_PATH/logs --glob ant.* -o --no-line-number --no-filename | awk -F':' '/"memory_used_mb":/ {sum += $2} END {printf "%.0f\n", sum}' ) num_of_times=$( - rg "\"memory_used_mb\"" $CLIENT_DATA_PATH/logs --glob autonomi.* -c --stats | + rg "\"memory_used_mb\"" $CLIENT_DATA_PATH/logs --glob ant.* -c --stats | rg "(\d+) matches" | rg "\d+" -o ) diff --git a/.github/workflows/generate-benchmark-charts.yml b/.github/workflows/generate-benchmark-charts.yml index 43c499133c..401275643a 100644 --- a/.github/workflows/generate-benchmark-charts.yml +++ b/.github/workflows/generate-benchmark-charts.yml @@ -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 antnode --bin autonomi + run: cargo build --release --features local --bin antnode --bin ant timeout-minutes: 30 - name: Start a local network @@ -100,7 +100,7 @@ jobs: - name: Start a client instance to compare memory usage shell: bash - run: cargo run --bin autonomi --release -- --log-output-dest=data-dir file upload the-test-data.zip + run: cargo run --bin ant --release -- --log-output-dest data-dir file upload the-test-data.zip env: SN_LOG: "all" diff --git a/.github/workflows/memcheck.yml b/.github/workflows/memcheck.yml index bc280bf916..89a3d517fa 100644 --- a/.github/workflows/memcheck.yml +++ b/.github/workflows/memcheck.yml @@ -36,7 +36,7 @@ jobs: run: sudo apt-get install -y ripgrep - name: Build binaries - run: cargo build --release --features local --bin antnode --bin autonomi + run: cargo build --release --features local --bin antnode --bin ant timeout-minutes: 30 - name: Start a local network @@ -70,7 +70,7 @@ jobs: shell: bash - name: File upload - run: ./target/release/autonomi --log-output-dest=data-dir file upload --public "./the-test-data.zip" > ./upload_output 2>&1 + run: ./target/release/ant --log-output-dest=data-dir file upload --public "./the-test-data.zip" > ./upload_output 2>&1 env: SN_LOG: "v" timeout-minutes: 5 @@ -99,8 +99,8 @@ jobs: mkdir $ANT_DATA_PATH/client ls -l $ANT_DATA_PATH cp ./the-test-data.zip ./the-test-data_1.zip - ./target/release/autonomi --log-output-dest=data-dir file upload "./the-test-data_1.zip" > ./second_upload 2>&1 - env: + ./target/release/ant --log-output-dest data-dir file_TYPE upload "" > ./second_upload 2>&1 + enrelease-candidatev: SN_LOG: "all" timeout-minutes: 25 @@ -110,12 +110,15 @@ jobs: if: always() - name: Stop the restart node - run: kill $( cat $RESTART_TEST_NODE_DATA_PATH/antnode.pid ) + run: kill $(cat $RESTART_TEST_NODE_DATA_PATH/antnode.pid) - name: Start the restart node again run: | ./target/release/antnode \ - --root-dir $RESTART_TEST_NODE_DATA_PATH --log-output-dest $RESTART_TEST_NODE_DATA_PATH --local --rewards-address "0x03B770D9cD32077cC0bF330c13C114a87643B124" & + --root-dir-type PARESTART_TEST_NODE_DATA_PATH \ + --log-output-dest $RESTART_TEST_NODE_DATA_PATH \ + --local \ + --rewards-address "0x03B770D9cD32077cC0bF330c13C114a87643B124" & sleep 10 env: SN_LOG: "all" @@ -147,7 +150,9 @@ jobs: if: always() - name: File Download - run: ./target/release/autonomi --log-output-dest=data-dir file download ${{ env.UPLOAD_ADDRESS }} ./downloaded_resources + run: > + ./target/release/ant + --log-output-dest=data-dir file download ${{ env.UPLOAD_ADDRESS }} ./downloaded_resources env: SN_LOG: "v" timeout-minutes: 2 @@ -203,7 +208,7 @@ jobs: client_avg_mem_limit_mb="512" # mb peak_mem_usage=$( - rg '"memory_used_mb":[^,]*' $CLIENT_DATA_PATH/logs --glob autonomi.* -o --no-line-number --no-filename | + rg '"memory_used_mb":[^,]*' $CLIENT_DATA_PATH/logs --glob ant.* -o --no-line-number --no-filename | awk -F':' '/"memory_used_mb":/{print $2}' | sort -n | tail -n 1 @@ -215,11 +220,11 @@ jobs: fi total_mem=$( - rg '"memory_used_mb":[^,]*' $CLIENT_DATA_PATH/logs --glob autonomi.* -o --no-line-number --no-filename | + rg '"memory_used_mb":[^,]*' $CLIENT_DATA_PATH/logs --glob ant.* -o --no-line-number --no-filename | awk -F':' '/"memory_used_mb":/ {sum += $2} END {printf "%.0f\n", sum}' ) num_of_times=$( - rg "\"memory_used_mb\"" $CLIENT_DATA_PATH/logs --glob autonomi.* -c --stats | + rg "\"memory_used_mb\"" $CLIENT_DATA_PATH/logs --glob ant.* -c --stats | rg "(\d+) matches" | rg "\d+" -o ) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 47e96c2084..cb6d69baee 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -190,7 +190,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Build binaries - run: cargo build --release --features local --bin antnode --bin autonomi + run: cargo build --release --features local --bin antnode --bin ant timeout-minutes: 30 - name: Start a local network @@ -237,13 +237,13 @@ jobs: shell: pwsh - name: Get file cost - run: ./target/release/autonomi --log-output-dest=data-dir file cost "./resources" + run: ./target/release/ant --log-output-dest=data-dir file cost "./resources" env: SN_LOG: "v" timeout-minutes: 15 - name: File upload - run: ./target/release/autonomi --log-output-dest=data-dir file upload "./resources" > ./upload_output 2>&1 + run: ./target/release/ant --log-output-dest=data-dir file upload "./resources" > ./upload_output 2>&1 env: SN_LOG: "v" timeout-minutes: 15 @@ -263,16 +263,16 @@ jobs: shell: pwsh - name: File Download - run: ./target/release/autonomi --log-output-dest=data-dir file download ${{ env.UPLOAD_ADDRESS }} ./downloaded_resources + run: ./target/release/ant --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 --log-output-dest=data-dir register generate-key + run: ./target/release/ant --log-output-dest=data-dir register generate-key - name: Create register (writeable by owner) - run: ./target/release/autonomi --log-output-dest=data-dir register create baobao 123 > ./register_create_output 2>&1 + run: ./target/release/ant --log-output-dest=data-dir register create baobao 123 > ./register_create_output 2>&1 env: SN_LOG: "v" timeout-minutes: 10 @@ -292,25 +292,25 @@ jobs: shell: pwsh - name: Get register - run: ./target/release/autonomi --log-output-dest=data-dir register get ${{ env.REGISTER_ADDRESS }} + run: ./target/release/ant --log-output-dest=data-dir register get ${{ env.REGISTER_ADDRESS }} env: SN_LOG: "v" timeout-minutes: 5 - name: Edit register - run: ./target/release/autonomi --log-output-dest=data-dir register edit ${{ env.REGISTER_ADDRESS }} 456 + run: ./target/release/ant --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 --log-output-dest=data-dir register get ${{ env.REGISTER_ADDRESS }} + run: ./target/release/ant --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 --log-output-dest=data-dir register create bao 111 --public > ./register_public_create_output 2>&1 + run: ./target/release/ant --log-output-dest=data-dir register create bao 111 --public > ./register_public_create_output 2>&1 env: SN_LOG: "v" timeout-minutes: 5 @@ -330,13 +330,13 @@ jobs: shell: pwsh - name: Get Public Register (current key is the owner) - run: ./target/release/autonomi --log-output-dest=data-dir register get ${{ env.PUBLIC_REGISTER_ADDRESS }} + run: ./target/release/ant --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 --log-output-dest=data-dir register edit ${{ env.PUBLIC_REGISTER_ADDRESS }} 222 + run: ./target/release/ant --log-output-dest=data-dir register edit ${{ env.PUBLIC_REGISTER_ADDRESS }} 222 env: SN_LOG: "v" timeout-minutes: 10 @@ -346,22 +346,22 @@ jobs: run: rm -rf ${{ matrix.ant_path }}/client - name: Generate new register signing key - run: ./target/release/autonomi --log-output-dest data-dir register generate-key + run: ./target/release/ant --log-output-dest data-dir register generate-key - name: Get Public Register (new signing key is not the owner) - run: ./target/release/autonomi --log-output-dest data-dir register get ${{ env.PUBLIC_REGISTER_ADDRESS }} + run: ./target/release/ant --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 --log-output-dest data-dir register edit ${{ env.PUBLIC_REGISTER_ADDRESS }} 333 + run: ./target/release/ant --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 --log-output-dest data-dir register get ${{ env.PUBLIC_REGISTER_ADDRESS }} + run: ./target/release/ant --log-output-dest data-dir register get ${{ env.PUBLIC_REGISTER_ADDRESS }} env: SN_LOG: "v" timeout-minutes: 2 @@ -373,25 +373,25 @@ jobs: timeout-minutes: 2 - name: file upload - run: ./target/release/autonomi --log-output-dest data-dir file upload random.txt + run: ./target/release/ant --log-output-dest data-dir file upload random.txt env: SN_LOG: "v" timeout-minutes: 2 - name: create a local register - run: ./target/release/autonomi --log-output-dest data-dir register create sample_new_register 1234 + run: ./target/release/ant --log-output-dest data-dir register create sample_new_register 1234 env: SN_LOG: "v" timeout-minutes: 2 - name: Estimate cost to create a vault - run: ./target/release/autonomi --log-output-dest data-dir vault cost + run: ./target/release/ant --log-output-dest data-dir vault cost env: SN_LOG: "v" timeout-minutes: 2 - name: create a vault with existing user data as above - run: ./target/release/autonomi --log-output-dest data-dir vault create + run: ./target/release/ant --log-output-dest data-dir vault create env: SN_LOG: "v" timeout-minutes: 2 @@ -402,9 +402,9 @@ jobs: set -e for i in {1..100}; do dd if=/dev/urandom of=random_file_$i.bin bs=1M count=1 status=none - ./target/release/autonomi --log-output-dest data-dir file upload random_file_$i.bin --public - ./target/release/autonomi --log-output-dest data-dir file upload random_file_$i.bin - ./target/release/autonomi --log-output-dest data-dir register create $i random_file_$i.bin + ./target/release/ant --log-output-dest data-dir file upload random_file_$i.bin --public + ./target/release/ant --log-output-dest data-dir file upload random_file_$i.bin + ./target/release/ant --log-output-dest data-dir register create $i random_file_$i.bin done env: SN_LOG: "v" @@ -421,22 +421,22 @@ jobs: [System.IO.File]::WriteAllBytes($fileName, $byteArray) # Run autonomi commands - ./target/release/autonomi --log-output-dest data-dir file upload "random_file_$i.bin" --public - ./target/release/autonomi --log-output-dest data-dir file upload "random_file_$i.bin" - ./target/release/autonomi --log-output-dest data-dir register create $i "random_file_$i.bin" + ./target/release/ant --log-output-dest data-dir file upload "random_file_$i.bin" --public + ./target/release/ant --log-output-dest data-dir file upload "random_file_$i.bin" + ./target/release/ant --log-output-dest data-dir register create $i "random_file_$i.bin" } env: SN_LOG: "v" timeout-minutes: 25 - name: sync the vault - run: ./target/release/autonomi --log-output-dest data-dir vault sync + run: ./target/release/ant --log-output-dest data-dir vault sync env: SN_LOG: "v" timeout-minutes: 2 - name: load the vault from network - run: ./target/release/autonomi --log-output-dest data-dir vault load + run: ./target/release/ant --log-output-dest data-dir vault load env: SN_LOG: "v" timeout-minutes: 2 @@ -453,9 +453,9 @@ jobs: NUM_OF_PRIVATE_FILES_IN_VAULT="" NUM_OF_REGISTERS_IN_VAULT="" - ./target/release/autonomi --log-output-dest data-dir file list 2>&1 > file_list.txt + ./target/release/ant --log-output-dest data-dir file list 2>&1 > file_list.txt - ./target/release/autonomi register list | grep register > register_list.txt + ./target/release/ant register list | grep register > register_list.txt NUM_OF_PUBLIC_FILES=`cat file_list.txt | grep "public" | grep -o '[0-9]\+'` NUM_OF_PRIVATE_FILES=`cat file_list.txt | grep "private" | grep -o '[0-9]\+'` @@ -463,7 +463,7 @@ jobs: # when obtaining registers we get random garbage, this is the only hack that works. NUM_OF_REGISTERS_first=${NUM_OF_REGISTERS%%[ $'\n']*} echo "NUM_OF_REGISTERS is $NUM_OF_REGISTERS_first" - ./target/release/autonomi --log-output-dest data-dir vault load 2>&1 > vault_data.txt + ./target/release/ant --log-output-dest data-dir vault load 2>&1 > vault_data.txt NUM_OF_PUBLIC_FILES_IN_VAULT=`cat vault_data.txt | grep "public" | grep -o '[0-9]\+'` NUM_OF_PRIVATE_FILES_IN_VAULT=`cat vault_data.txt| grep "private" | grep -o '[0-9]\+'` @@ -488,9 +488,9 @@ jobs: shell: pwsh run: | $ErrorActionPreference = "Stop" - ./target/release/autonomi --log-output-dest data-dir file list > file_list.txt 2>&1 - ./target/release/autonomi register list > register_list.txt 2>&1 - ./target/release/autonomi --log-output-dest data-dir vault load > vault_data.txt 2>&1 + ./target/release/ant --log-output-dest data-dir file list > file_list.txt 2>&1 + ./target/release/ant register list > register_list.txt 2>&1 + ./target/release/ant --log-output-dest data-dir vault load > vault_data.txt 2>&1 env: SN_LOG: "v" timeout-minutes: 15 @@ -542,7 +542,7 @@ jobs: timeout-minutes: 2 - name: load an existing vault from the network - run: ./target/release/autonomi --log-output-dest=data-dir vault load + run: ./target/release/ant --log-output-dest=data-dir vault load env: SN_LOG: "v" timeout-minutes: 2 @@ -560,12 +560,12 @@ jobs: # 1 GB python3 -c "with open('random_1GB.bin', 'wb') as f: f.write(bytearray([0xff] * 1000 * 1024 * 1024))" - ./target/release/autonomi --log-output-dest=data-dir file list - time ./target/release/autonomi --log-output-dest=data-dir file upload random_1MB.bin - time ./target/release/autonomi --log-output-dest=data-dir file upload random_10MB.bin - time ./target/release/autonomi --log-output-dest=data-dir file upload random_100MB.bin - time ./target/release/autonomi --log-output-dest=data-dir file upload random_1GB.bin - ./target/release/autonomi --log-output-dest=data-dir vault sync + ./target/release/ant --log-output-dest=data-dir file list + time ./target/release/ant --log-output-dest=data-dir file upload random_1MB.bin + time ./target/release/ant --log-output-dest=data-dir file upload random_10MB.bin + time ./target/release/ant --log-output-dest=data-dir file upload random_100MB.bin + time ./target/release/ant --log-output-dest=data-dir file upload random_1GB.bin + ./target/release/ant --log-output-dest=data-dir vault sync rm -rf random*.bin rm -rf ${{ matrix.ant_path }}/autonomi env: @@ -1283,7 +1283,7 @@ jobs: ls -l - name: Build binaries - run: cargo build --release --features local --bin antnode --bin autonomi + run: cargo build --release --features local --bin antnode --bin ant timeout-minutes: 30 - name: Start a local network @@ -1326,7 +1326,7 @@ jobs: shell: bash - name: File upload - run: ./target/release/autonomi --log-output-dest=data-dir file upload "./test_data_1.tar.gz" > ./upload_output 2>&1 + run: ./target/release/ant --log-output-dest data-dir file upload "./test_data_1.tar.gz" > ./upload_output 2>&1 env: SN_LOG: "v" timeout-minutes: 5 @@ -1343,7 +1343,7 @@ jobs: shell: bash - name: File Download - run: ./target/release/autonomi --log-output-dest=data-dir file download ${{ env.UPLOAD_ADDRESS }} ./downloaded_resources > ./download_output 2>&1 + run: ./target/release/ant --log-output-dest data-dir file download ${{ env.UPLOAD_ADDRESS }} ./downloaded_resources > ./download_output 2>&1 env: SN_LOG: "v" timeout-minutes: 5 diff --git a/.github/workflows/merge_websocket.yml b/.github/workflows/merge_websocket.yml index 27d7315398..2cb42ebfde 100644 --- a/.github/workflows/merge_websocket.yml +++ b/.github/workflows/merge_websocket.yml @@ -56,7 +56,7 @@ jobs: ls -l - name: Build binaries - run: cargo build --release --features local,websockets --bin antnode --bin autonomi + run: cargo build --release --features local,websockets --bin antnode --bin ant timeout-minutes: 30 - name: Start a local network @@ -100,7 +100,7 @@ jobs: shell: bash - name: File upload - run: ./target/release/autonomi --log-output-dest=data-dir file upload "./test_data_1.tar.gz" > ./upload_output 2>&1 + run: ./target/release/ant --log-output-dest=data-dir file upload "./test_data_1.tar.gz" > ./upload_output 2>&1 env: SN_LOG: "v" timeout-minutes: 5 @@ -117,7 +117,7 @@ jobs: shell: bash - name: File Download - run: ./target/release/autonomi --log-output-dest=data-dir file download ${{ env.UPLOAD_ADDRESS }} ./downloaded_resources > ./download_output 2>&1 + run: ./target/release/ant --log-output-dest=data-dir file download ${{ env.UPLOAD_ADDRESS }} ./downloaded_resources > ./download_output 2>&1 env: SN_LOG: "v" timeout-minutes: 5 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index cddb37f259..23f24c63e3 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -32,7 +32,7 @@ jobs: continue-on-error: true - name: Build binaries - run: cargo build --release --features local --bin antnode --bin autonomi + run: cargo build --release --features local --bin antnode --bin ant timeout-minutes: 30 - name: Start a local network @@ -80,13 +80,13 @@ jobs: shell: pwsh - name: Get file cost - run: ./target/release/autonomi --log-output-dest=data-dir file cost "./resources" + run: ./target/release/ant --log-output-dest=data-dir file cost "./resources" env: SN_LOG: "v" timeout-minutes: 15 - name: File upload - run: ./target/release/autonomi --log-output-dest=data-dir file upload "./resources" > ./upload_output 2>&1 + run: ./target/release/ant --log-output-dest=data-dir file upload "./resources" > ./upload_output 2>&1 env: SN_LOG: "v" timeout-minutes: 15 @@ -106,16 +106,16 @@ jobs: shell: pwsh - name: File Download - run: ./target/release/autonomi --log-output-dest=data-dir file download ${{ env.UPLOAD_ADDRESS }} ./downloaded_resources + run: ./target/release/ant --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 --log-output-dest=data-dir register generate-key + run: ./target/release/ant --log-output-dest=data-dir register generate-key - name: Create register (writeable by owner) - run: ./target/release/autonomi --log-output-dest=data-dir register create baobao 123 > ./register_create_output 2>&1 + run: ./target/release/ant --log-output-dest=data-dir register create baobao 123 > ./register_create_output 2>&1 env: SN_LOG: "v" timeout-minutes: 10 @@ -135,25 +135,25 @@ jobs: shell: pwsh - name: Get register - run: ./target/release/autonomi --log-output-dest=data-dir register get ${{ env.REGISTER_ADDRESS }} + run: ./target/release/ant --log-output-dest=data-dir register get ${{ env.REGISTER_ADDRESS }} env: SN_LOG: "v" timeout-minutes: 5 - name: Edit register - run: ./target/release/autonomi --log-output-dest=data-dir register edit ${{ env.REGISTER_ADDRESS }} 456 + run: ./target/release/ant --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 --log-output-dest=data-dir register get ${{ env.REGISTER_ADDRESS }} + run: ./target/release/ant --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 --log-output-dest=data-dir register create bao 111 --public > ./register_public_create_output 2>&1 + run: ./target/release/ant --log-output-dest=data-dir register create bao 111 --public > ./register_public_create_output 2>&1 env: SN_LOG: "v" timeout-minutes: 5 @@ -173,13 +173,13 @@ jobs: shell: pwsh - name: Get Public Register (current key is the owner) - run: ./target/release/autonomi --log-output-dest=data-dir register get ${{ env.PUBLIC_REGISTER_ADDRESS }} + run: ./target/release/ant --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 --log-output-dest=data-dir register edit ${{ env.PUBLIC_REGISTER_ADDRESS }} 222 + run: ./target/release/ant --log-output-dest=data-dir register edit ${{ env.PUBLIC_REGISTER_ADDRESS }} 222 env: SN_LOG: "v" timeout-minutes: 10 @@ -189,22 +189,22 @@ jobs: run: rm -rf ${{ matrix.autonomi_path }}/autonomi - name: Generate new register signing key - run: ./target/release/autonomi --log-output-dest=data-dir register generate-key + run: ./target/release/ant --log-output-dest=data-dir register generate-key - name: Get Public Register (new signing key is not the owner) - run: ./target/release/autonomi --log-output-dest=data-dir register get ${{ env.PUBLIC_REGISTER_ADDRESS }} + run: ./target/release/ant --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 --log-output-dest=data-dir register edit ${{ env.PUBLIC_REGISTER_ADDRESS }} 333 + run: ./target/release/ant --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 --log-output-dest=data-dir register get ${{ env.PUBLIC_REGISTER_ADDRESS }} + run: ./target/release/ant --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 f1a3b26934..a6dc00c65d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -731,6 +731,36 @@ dependencies = [ "vergen", ] +[[package]] +name = "ant-cli" +version = "0.1.5" +dependencies = [ + "ant-build-info", + "ant-logging", + "ant-peers-acquisition", + "autonomi", + "clap", + "color-eyre", + "const-hex", + "criterion", + "dirs-next", + "eyre", + "hex 0.4.3", + "indicatif", + "prettytable", + "rand 0.8.5", + "rayon", + "ring 0.17.8", + "rpassword", + "serde", + "serde_json", + "tempfile", + "thiserror 1.0.69", + "tokio", + "tracing", + "walkdir", +] + [[package]] name = "ant-evm" version = "0.1.4" @@ -1512,36 +1542,6 @@ dependencies = [ "xor_name", ] -[[package]] -name = "autonomi-cli" -version = "0.1.5" -dependencies = [ - "ant-build-info", - "ant-logging", - "ant-peers-acquisition", - "autonomi", - "clap", - "color-eyre", - "const-hex", - "criterion", - "dirs-next", - "eyre", - "hex 0.4.3", - "indicatif", - "prettytable", - "rand 0.8.5", - "rayon", - "ring 0.17.8", - "rpassword", - "serde", - "serde_json", - "tempfile", - "thiserror 1.0.69", - "tokio", - "tracing", - "walkdir", -] - [[package]] name = "axum" version = "0.6.20" diff --git a/Cargo.toml b/Cargo.toml index 2d93ea57c5..175e0dfa2c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ resolver = "2" members = [ "ant-build-info", + "ant-cli", "ant-evm", "ant-logging", "ant-metrics", @@ -15,7 +16,6 @@ members = [ "ant-service-management", "ant-token-supplies", "autonomi", - "autonomi-cli", "evmlib", "evm-testnet", "nat-detection", diff --git a/README.md b/README.md index 64e147539e..014ea96496 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,11 @@ Libp2p.
### For Users -- [CLI](https://github.com/maidsafe/autonomi/blob/main/autonomi-cli/README.md) The Command Line - Interface, allowing users to interact with the network from their terminal. +- [CLI](https://github.com/maidsafe/autonomi/blob/main/ant-cli/README.md) The client command line + interface that enables users to interact with the network from their terminal. - [Node](https://github.com/maidsafe/autonomi/blob/main/ant-node/README.md) The backbone of the - Autonomi network. Nodes can be run on commodity hardware and provide storage space and validation of - transactions to the network. + Autonomi network. Nodes can run on commodity hardware and provide storage space and validate + transactions on the network. - Web App: Coming Soon! #### Building the Node from Source @@ -60,11 +60,11 @@ cargo build --release --features network-contacts --bin antnode #### Main Crates - [Autonomi API](https://github.com/maidsafe/autonomi/blob/main/autonomi/README.md) The client APIs - allowing use of the Autonomi Network to users and developers. -- [Autonomi CLI](https://github.com/maidsafe/autonomi/blob/main/autonomi-cli/README.md) The Command Line - Interface, allowing users to interact with the network from their terminal. + allowing use of the Autonomi network to users and developers. +- [Autonomi CLI](https://github.com/maidsafe/autonomi/blob/main/ant-cli/README.md) The client command line + interface that enables users to interact with the network from their terminal. - [Node](https://github.com/maidsafe/autonomi/blob/main/ant-node/README.md) The backbone of the - autonomi network. Nodes can be run on commodity hardware and run the Network. + Autonomi network. Nodes can be run on commodity hardware and connect to the network. - [Node Manager](https://github.com/maidsafe/autonomi/blob/main/ant-node-manager/README.md) Use to create a local network for development and testing. - [Node RPC](https://github.com/maidsafe/autonomi/blob/main/ant-node-rpc-client/README.md) The @@ -72,7 +72,7 @@ cargo build --release --features network-contacts --bin antnode #### Transport Protocols and Architectures -The Autonomi Network uses `quic` as the default transport protocol. +The Autonomi network uses `quic` as the default transport protocol. The `websockets` feature is available for the `ant-networking` crate, and above, and will allow for tcp over websockets. @@ -104,8 +104,8 @@ WASM support for the autonomi API is currently under active development. More do ### Using a Local Network -We can explore the network's features by using multiple node processes to form a local network. We also need to run a -local EVM network for our nodes and client to connect to. +We can explore the network's features by using multiple node processes to form a local network. We +also need to run a local EVM network for our nodes and client to connect to. Follow these steps to create a local network: @@ -142,7 +142,7 @@ The EVM Network parameters are loaded from the CSV file in your data directory a cargo run --bin antctl --features local -- status ``` -The node manager's `run` command starts the node processes. The `status` command should show twenty-five +The Antctl `run` command starts the node processes. The `status` command should show twenty-five running nodes. ##### 5. Uploading and Downloading Data @@ -152,7 +152,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 --features local -- file upload +SECRET_KEY= cargo run --bin ant --features local -- file upload ``` The output will print out the address at which the content was uploaded. @@ -160,7 +160,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 --features local -- file download +cargo run --bin ant --features local -- file download ``` ### Registers diff --git a/autonomi-cli/Cargo.toml b/ant-cli/Cargo.toml similarity index 97% rename from autonomi-cli/Cargo.toml rename to ant-cli/Cargo.toml index 016a017e0c..7f1983fcfa 100644 --- a/autonomi-cli/Cargo.toml +++ b/ant-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] authors = ["MaidSafe Developers "] -name = "autonomi-cli" +name = "ant-cli" description = "CLI client for the Autonomi network" license = "GPL-3.0" version = "0.1.5" @@ -10,7 +10,7 @@ readme = "README.md" repository = "https://github.com/maidsafe/autonomi" [[bin]] -name = "autonomi" +name = "ant" path = "src/main.rs" [features] @@ -56,7 +56,7 @@ tokio = { version = "1.32.0", features = [ "sync", "time", "fs", -] } +]} tracing = { version = "~0.1.26" } walkdir = "2.5.0" @@ -64,7 +64,7 @@ walkdir = "2.5.0" autonomi = { path = "../autonomi", version = "0.2.4", features = [ "data", "fs", -] } +]} criterion = "0.5.1" eyre = "0.6.8" rand = { version = "~0.8.5", features = ["small_rng"] } diff --git a/autonomi-cli/README.md b/ant-cli/README.md similarity index 98% rename from autonomi-cli/README.md rename to ant-cli/README.md index 7e490029ac..1b8adc803e 100644 --- a/autonomi-cli/README.md +++ b/ant-cli/README.md @@ -1,7 +1,7 @@ # A CLI for the Autonomi Network ``` -Usage: autonomi [OPTIONS] +Usage: ant [OPTIONS] Commands: file Operations related to file handling diff --git a/autonomi-cli/benches/files.rs b/ant-cli/benches/files.rs similarity index 100% rename from autonomi-cli/benches/files.rs rename to ant-cli/benches/files.rs diff --git a/autonomi-cli/src/access/data_dir.rs b/ant-cli/src/access/data_dir.rs similarity index 100% rename from autonomi-cli/src/access/data_dir.rs rename to ant-cli/src/access/data_dir.rs diff --git a/autonomi-cli/src/access/keys.rs b/ant-cli/src/access/keys.rs similarity index 100% rename from autonomi-cli/src/access/keys.rs rename to ant-cli/src/access/keys.rs diff --git a/autonomi-cli/src/access/mod.rs b/ant-cli/src/access/mod.rs similarity index 100% rename from autonomi-cli/src/access/mod.rs rename to ant-cli/src/access/mod.rs diff --git a/autonomi-cli/src/access/network.rs b/ant-cli/src/access/network.rs similarity index 100% rename from autonomi-cli/src/access/network.rs rename to ant-cli/src/access/network.rs diff --git a/autonomi-cli/src/access/user_data.rs b/ant-cli/src/access/user_data.rs similarity index 100% rename from autonomi-cli/src/access/user_data.rs rename to ant-cli/src/access/user_data.rs diff --git a/autonomi-cli/src/actions/connect.rs b/ant-cli/src/actions/connect.rs similarity index 100% rename from autonomi-cli/src/actions/connect.rs rename to ant-cli/src/actions/connect.rs diff --git a/autonomi-cli/src/actions/download.rs b/ant-cli/src/actions/download.rs similarity index 100% rename from autonomi-cli/src/actions/download.rs rename to ant-cli/src/actions/download.rs diff --git a/autonomi-cli/src/actions/mod.rs b/ant-cli/src/actions/mod.rs similarity index 100% rename from autonomi-cli/src/actions/mod.rs rename to ant-cli/src/actions/mod.rs diff --git a/autonomi-cli/src/actions/progress_bar.rs b/ant-cli/src/actions/progress_bar.rs similarity index 100% rename from autonomi-cli/src/actions/progress_bar.rs rename to ant-cli/src/actions/progress_bar.rs diff --git a/autonomi-cli/src/commands.rs b/ant-cli/src/commands.rs similarity index 100% rename from autonomi-cli/src/commands.rs rename to ant-cli/src/commands.rs diff --git a/autonomi-cli/src/commands/file.rs b/ant-cli/src/commands/file.rs similarity index 100% rename from autonomi-cli/src/commands/file.rs rename to ant-cli/src/commands/file.rs diff --git a/autonomi-cli/src/commands/register.rs b/ant-cli/src/commands/register.rs similarity index 100% rename from autonomi-cli/src/commands/register.rs rename to ant-cli/src/commands/register.rs diff --git a/autonomi-cli/src/commands/vault.rs b/ant-cli/src/commands/vault.rs similarity index 100% rename from autonomi-cli/src/commands/vault.rs rename to ant-cli/src/commands/vault.rs diff --git a/autonomi-cli/src/commands/wallet.rs b/ant-cli/src/commands/wallet.rs similarity index 100% rename from autonomi-cli/src/commands/wallet.rs rename to ant-cli/src/commands/wallet.rs diff --git a/autonomi-cli/src/main.rs b/ant-cli/src/main.rs similarity index 100% rename from autonomi-cli/src/main.rs rename to ant-cli/src/main.rs diff --git a/autonomi-cli/src/opt.rs b/ant-cli/src/opt.rs similarity index 100% rename from autonomi-cli/src/opt.rs rename to ant-cli/src/opt.rs diff --git a/autonomi-cli/src/utils.rs b/ant-cli/src/utils.rs similarity index 100% rename from autonomi-cli/src/utils.rs rename to ant-cli/src/utils.rs diff --git a/autonomi-cli/src/wallet/encryption.rs b/ant-cli/src/wallet/encryption.rs similarity index 100% rename from autonomi-cli/src/wallet/encryption.rs rename to ant-cli/src/wallet/encryption.rs diff --git a/autonomi-cli/src/wallet/error.rs b/ant-cli/src/wallet/error.rs similarity index 100% rename from autonomi-cli/src/wallet/error.rs rename to ant-cli/src/wallet/error.rs diff --git a/autonomi-cli/src/wallet/fs.rs b/ant-cli/src/wallet/fs.rs similarity index 100% rename from autonomi-cli/src/wallet/fs.rs rename to ant-cli/src/wallet/fs.rs diff --git a/autonomi-cli/src/wallet/input.rs b/ant-cli/src/wallet/input.rs similarity index 100% rename from autonomi-cli/src/wallet/input.rs rename to ant-cli/src/wallet/input.rs diff --git a/autonomi-cli/src/wallet/mod.rs b/ant-cli/src/wallet/mod.rs similarity index 100% rename from autonomi-cli/src/wallet/mod.rs rename to ant-cli/src/wallet/mod.rs From 73e421f6a3110d7c0598d362b9d0111456a854c9 Mon Sep 17 00:00:00 2001 From: Chris O'Neil Date: Mon, 2 Dec 2024 15:24:56 +0000 Subject: [PATCH 2/2] chore: rename environment variables Use `ANT_LOG` and `ANT_PEERS` rather than `SN_LOG` and `SAFE_PEERS`. --- .github/workflows/benchmark-prs.yml | 8 +- .../workflows/generate-benchmark-charts.yml | 2 +- .github/workflows/memcheck.yml | 14 +- .github/workflows/merge.yml | 170 +++++++++--------- .github/workflows/merge_websocket.yml | 12 +- .github/workflows/nightly.yml | 40 ++--- .github/workflows/nightly_wan.yml | 28 +-- .github/workflows/nightly_wan_churn.yml | 8 +- .github/workflows/node_man_tests.yml | 16 +- ant-cli/README.md | 2 +- ant-cli/src/access/network.rs | 4 +- ant-logging/src/layers.rs | 20 +-- ant-logging/src/lib.rs | 10 +- ant-node-manager/src/add_services/tests.rs | 22 +-- ant-node-manager/src/bin/cli/main.rs | 14 +- ant-node-manager/src/cmd/node.rs | 2 +- ant-node-manager/tests/e2e.rs | 2 +- ant-node/tests/common/client.rs | 2 +- ant-peers-acquisition/README.md | 2 +- ant-peers-acquisition/src/lib.rs | 16 +- autonomi/README.md | 4 +- test-utils/src/lib.rs | 4 +- 22 files changed, 201 insertions(+), 201 deletions(-) diff --git a/.github/workflows/benchmark-prs.yml b/.github/workflows/benchmark-prs.yml index 94e503169d..25392240a3 100644 --- a/.github/workflows/benchmark-prs.yml +++ b/.github/workflows/benchmark-prs.yml @@ -49,7 +49,7 @@ jobs: - name: Start a local network uses: maidsafe/ant-local-testnet-action@main env: - SN_LOG: "all" + ANT_LOG: "all" with: action: start enable-evm-testnet: true @@ -57,9 +57,9 @@ jobs: platform: ubuntu-latest build: true - - name: Check SAFE_PEERS was set + - name: Check ANT_PEERS was set shell: bash - run: echo "The SAFE_PEERS variable has been set to $SAFE_PEERS" + run: echo "The ANT_PEERS variable has been set to $ANT_PEERS" - name: export default secret key run: echo "SECRET_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" >> $GITHUB_ENV @@ -73,7 +73,7 @@ jobs: shell: bash run: ./target/release/ant --log-output-dest=data-dir file upload "./the-test-data.zip" env: - SN_LOG: "all" + ANT_LOG: "all" timeout-minutes: 5 - name: Cleanup uploaded_files folder to avoid pollute download benchmark diff --git a/.github/workflows/generate-benchmark-charts.yml b/.github/workflows/generate-benchmark-charts.yml index 401275643a..5ec91d7641 100644 --- a/.github/workflows/generate-benchmark-charts.yml +++ b/.github/workflows/generate-benchmark-charts.yml @@ -102,7 +102,7 @@ jobs: shell: bash run: cargo run --bin ant --release -- --log-output-dest data-dir file upload the-test-data.zip env: - SN_LOG: "all" + ANT_LOG: "all" ######################### ### Stop Network ### diff --git a/.github/workflows/memcheck.yml b/.github/workflows/memcheck.yml index 89a3d517fa..3eca5f494d 100644 --- a/.github/workflows/memcheck.yml +++ b/.github/workflows/memcheck.yml @@ -48,9 +48,9 @@ jobs: platform: ubuntu-latest build: true - - name: Check SAFE_PEERS was set + - name: Check ANT_PEERS was set shell: bash - run: echo "The SAFE_PEERS variable has been set to $SAFE_PEERS" + run: echo "The ANT_PEERS variable has been set to $ANT_PEERS" - name: Start a node instance to be restarted run: | @@ -59,7 +59,7 @@ jobs: --root-dir $RESTART_TEST_NODE_DATA_PATH --log-output-dest $RESTART_TEST_NODE_DATA_PATH --local --rewards-address "0x03B770D9cD32077cC0bF330c13C114a87643B124" & sleep 10 env: - SN_LOG: "all" + ANT_LOG: "all" - name: Download 95mb file to be uploaded with the safe client shell: bash @@ -72,7 +72,7 @@ jobs: - name: File upload run: ./target/release/ant --log-output-dest=data-dir file upload --public "./the-test-data.zip" > ./upload_output 2>&1 env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 5 - name: showing the upload terminal output @@ -101,7 +101,7 @@ jobs: cp ./the-test-data.zip ./the-test-data_1.zip ./target/release/ant --log-output-dest data-dir file_TYPE upload "" > ./second_upload 2>&1 enrelease-candidatev: - SN_LOG: "all" + ANT_LOG: "all" timeout-minutes: 25 - name: showing the second upload terminal output @@ -121,7 +121,7 @@ jobs: --rewards-address "0x03B770D9cD32077cC0bF330c13C114a87643B124" & sleep 10 env: - SN_LOG: "all" + ANT_LOG: "all" # Records are encrypted, and seeds will change after restart # Currently, there will be `Existing record found`, but NO `Existing record loaded` @@ -154,7 +154,7 @@ jobs: ./target/release/ant --log-output-dest=data-dir file download ${{ env.UPLOAD_ADDRESS }} ./downloaded_resources env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 2 - name: Check nodes running diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index cb6d69baee..f306759803 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -202,17 +202,17 @@ jobs: platform: ${{ matrix.os }} build: true - - name: Check if SAFE_PEERS and EVM_NETWORK are set + - name: Check if ANT_PEERS and EVM_NETWORK are set shell: bash run: | - if [[ -z "$SAFE_PEERS" ]]; then - echo "The SAFE_PEERS variable has not been set" + if [[ -z "$ANT_PEERS" ]]; then + echo "The ANT_PEERS variable has not been set" exit 1 elif [[ -z "$EVM_NETWORK" ]]; then echo "The EVM_NETWORK variable has not been set" exit 1 else - echo "SAFE_PEERS has been set to $SAFE_PEERS" + echo "ANT_PEERS has been set to $ANT_PEERS" echo "EVM_NETWORK has been set to $EVM_NETWORK" fi @@ -220,7 +220,7 @@ jobs: - name: Run autonomi --tests run: cargo test --package autonomi --tests -- --nocapture env: - SN_LOG: "v" + ANT_LOG: "v" # only set the target dir for windows to bypass the linker issue. # happens if we build the node manager via testnet action CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }} @@ -239,13 +239,13 @@ jobs: - name: Get file cost run: ./target/release/ant --log-output-dest=data-dir file cost "./resources" env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 15 - name: File upload run: ./target/release/ant --log-output-dest=data-dir file upload "./resources" > ./upload_output 2>&1 env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 15 - name: parse address (unix) @@ -265,7 +265,7 @@ jobs: - name: File Download run: ./target/release/ant --log-output-dest=data-dir file download ${{ env.UPLOAD_ADDRESS }} ./downloaded_resources env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 5 - name: Generate register signing key @@ -274,7 +274,7 @@ jobs: - name: Create register (writeable by owner) run: ./target/release/ant --log-output-dest=data-dir register create baobao 123 > ./register_create_output 2>&1 env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 10 - name: parse register address (unix) @@ -294,25 +294,25 @@ jobs: - name: Get register run: ./target/release/ant --log-output-dest=data-dir register get ${{ env.REGISTER_ADDRESS }} env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 5 - name: Edit register run: ./target/release/ant --log-output-dest=data-dir register edit ${{ env.REGISTER_ADDRESS }} 456 env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 10 - name: Get register (after edit) run: ./target/release/ant --log-output-dest=data-dir register get ${{ env.REGISTER_ADDRESS }} env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 5 - name: Create Public Register (writeable by anyone) run: ./target/release/ant --log-output-dest=data-dir register create bao 111 --public > ./register_public_create_output 2>&1 env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 5 - name: parse public register address (unix) @@ -332,13 +332,13 @@ jobs: - name: Get Public Register (current key is the owner) run: ./target/release/ant --log-output-dest=data-dir register get ${{ env.PUBLIC_REGISTER_ADDRESS }} env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 5 - name: Edit Public Register (current key is the owner) run: ./target/release/ant --log-output-dest=data-dir register edit ${{ env.PUBLIC_REGISTER_ADDRESS }} 222 env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 10 - name: Delete current register signing key @@ -351,49 +351,49 @@ jobs: - name: Get Public Register (new signing key is not the owner) run: ./target/release/ant --log-output-dest data-dir register get ${{ env.PUBLIC_REGISTER_ADDRESS }} env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 2 - name: Edit Public Register (new signing key is not the owner) run: ./target/release/ant --log-output-dest data-dir register edit ${{ env.PUBLIC_REGISTER_ADDRESS }} 333 env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 10 - name: Get Public Register (new signing key is not the owner) run: ./target/release/ant --log-output-dest data-dir register get ${{ env.PUBLIC_REGISTER_ADDRESS }} env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 2 - name: create local user file run: echo random > random.txt env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 2 - name: file upload run: ./target/release/ant --log-output-dest data-dir file upload random.txt env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 2 - name: create a local register run: ./target/release/ant --log-output-dest data-dir register create sample_new_register 1234 env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 2 - name: Estimate cost to create a vault run: ./target/release/ant --log-output-dest data-dir vault cost env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 2 - name: create a vault with existing user data as above run: ./target/release/ant --log-output-dest data-dir vault create env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 2 - name: add more files - linux/macos @@ -407,7 +407,7 @@ jobs: ./target/release/ant --log-output-dest data-dir register create $i random_file_$i.bin done env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 25 - name: add more files - windows @@ -426,19 +426,19 @@ jobs: ./target/release/ant --log-output-dest data-dir register create $i "random_file_$i.bin" } env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 25 - name: sync the vault run: ./target/release/ant --log-output-dest data-dir vault sync env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 2 - name: load the vault from network run: ./target/release/ant --log-output-dest data-dir vault load env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 2 - name: vault sync validation @@ -480,7 +480,7 @@ jobs: python3 -c 'import sys; assert sys.argv[1] == sys.argv[2], f"Error: local data and vault in network dont match, Local registers: {sys.argv[1]} and vault registers: {sys.argv[2]} are Not Equal"' $NUM_OF_REGISTERS_first $NUM_OF_REGISTERS_IN_VAULT echo "vault synced successfully!" env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 15 - name: Set up variables - vault sync - windows @@ -492,7 +492,7 @@ jobs: ./target/release/ant register list > register_list.txt 2>&1 ./target/release/ant --log-output-dest data-dir vault load > vault_data.txt 2>&1 env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 15 - name: Vault sync validation @@ -538,13 +538,13 @@ jobs: assert NUM_OF_REGISTERS_FILES == NUM_OF_REGISTERS_IN_VAULT, f"Error: local data and vault in network dont match, Local registers: {NUM_OF_REGISTERS_FILES} and vault registers: {NUM_OF_REGISTERS_IN_VAULT} are Not Equal" print("Vault synced successfully!") env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 2 - name: load an existing vault from the network run: ./target/release/ant --log-output-dest=data-dir vault load env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 2 - name: Time profiling for Different files @@ -569,7 +569,7 @@ jobs: rm -rf random*.bin rm -rf ${{ matrix.ant_path }}/autonomi env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 15 - name: Stop the local network and upload logs @@ -613,27 +613,27 @@ jobs: # platform: ${{ matrix.os }} # build: true - # - name: Check SAFE_PEERS was set + # - name: Check ANT_PEERS was set # shell: bash # run: | - # if [[ -z "$SAFE_PEERS" ]]; then - # echo "The SAFE_PEERS variable has not been set" + # if [[ -z "$ANT_PEERS" ]]; then + # echo "The ANT_PEERS variable has not been set" # exit 1 # else - # echo "SAFE_PEERS has been set to $SAFE_PEERS" + # echo "ANT_PEERS has been set to $ANT_PEERS" # fi # - name: execute the sequential transfers tests # run: cargo test --release -p ant-node --features="local" --test sequential_transfers -- --nocapture --test-threads=1 # env: - # SN_LOG: "all" + # ANT_LOG: "all" # CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }} # timeout-minutes: 25 # - name: execute the storage payment tests # run: cargo test --release -p ant-node --features="local" --test storage_payments -- --nocapture --test-threads=1 # env: - # SN_LOG: "all" + # ANT_LOG: "all" # CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }} # timeout-minutes: 25 @@ -688,14 +688,14 @@ jobs: # platform: ${{ matrix.os }} # build: true - # - name: Check SAFE_PEERS was set + # - name: Check ANT_PEERS was set # shell: bash # run: | - # if [[ -z "$SAFE_PEERS" ]]; then - # echo "The SAFE_PEERS variable has not been set" + # if [[ -z "$ANT_PEERS" ]]; then + # echo "The ANT_PEERS variable has not been set" # exit 1 # else - # echo "SAFE_PEERS has been set to $SAFE_PEERS" + # echo "ANT_PEERS has been set to $ANT_PEERS" # fi # - name: execute the transaction simulation @@ -753,20 +753,20 @@ jobs: # platform: ${{ matrix.os }} # build: true - # - name: Check SAFE_PEERS was set + # - name: Check ANT_PEERS was set # shell: bash # run: | - # if [[ -z "$SAFE_PEERS" ]]; then - # echo "The SAFE_PEERS variable has not been set" + # if [[ -z "$ANT_PEERS" ]]; then + # echo "The ANT_PEERS variable has not been set" # exit 1 # else - # echo "SAFE_PEERS has been set to $SAFE_PEERS" + # echo "ANT_PEERS has been set to $ANT_PEERS" # fi # - name: execute token_distribution tests # run: cargo test --release --features=local,distribution token_distribution -- --nocapture --test-threads=1 # env: - # SN_LOG: "all" + # ANT_LOG: "all" # CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }} # timeout-minutes: 25 @@ -822,17 +822,17 @@ jobs: platform: ${{ matrix.os }} build: true - - name: Check if SAFE_PEERS and EVM_NETWORK are set + - name: Check if ANT_PEERS and EVM_NETWORK are set shell: bash run: | - if [[ -z "$SAFE_PEERS" ]]; then - echo "The SAFE_PEERS variable has not been set" + if [[ -z "$ANT_PEERS" ]]; then + echo "The ANT_PEERS variable has not been set" exit 1 elif [[ -z "$EVM_NETWORK" ]]; then echo "The EVM_NETWORK variable has not been set" exit 1 else - echo "SAFE_PEERS has been set to $SAFE_PEERS" + echo "ANT_PEERS has been set to $ANT_PEERS" echo "EVM_NETWORK has been set to $EVM_NETWORK" fi @@ -841,7 +841,7 @@ jobs: env: TEST_DURATION_MINS: 5 TEST_TOTAL_CHURN_CYCLES: 15 - SN_LOG: "all" + ANT_LOG: "all" CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }} timeout-minutes: 30 @@ -969,17 +969,17 @@ jobs: platform: ${{ matrix.os }} build: true - - name: Check if SAFE_PEERS and EVM_NETWORK are set + - name: Check if ANT_PEERS and EVM_NETWORK are set shell: bash run: | - if [[ -z "$SAFE_PEERS" ]]; then - echo "The SAFE_PEERS variable has not been set" + if [[ -z "$ANT_PEERS" ]]; then + echo "The ANT_PEERS variable has not been set" exit 1 elif [[ -z "$EVM_NETWORK" ]]; then echo "The EVM_NETWORK variable has not been set" exit 1 else - echo "SAFE_PEERS has been set to $SAFE_PEERS" + echo "ANT_PEERS has been set to $ANT_PEERS" echo "EVM_NETWORK has been set to $EVM_NETWORK" fi @@ -993,7 +993,7 @@ jobs: run: cargo test --release -p ant-node --features "local" --test verify_data_location -- --nocapture env: CHURN_COUNT: 6 - SN_LOG: "all" + ANT_LOG: "all" CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }} timeout-minutes: 25 @@ -1103,14 +1103,14 @@ jobs: # mv target/release/safe ~/safe # rm -rf target - # - name: Check SAFE_PEERS was set + # - name: Check ANT_PEERS was set # shell: bash # run: | - # if [[ -z "$SAFE_PEERS" ]]; then - # echo "The SAFE_PEERS variable has not been set" + # if [[ -z "$ANT_PEERS" ]]; then + # echo "The ANT_PEERS variable has not been set" # exit 1 # else - # echo "SAFE_PEERS has been set to $SAFE_PEERS" + # echo "ANT_PEERS has been set to $ANT_PEERS" # fi # - name: Create and fund a wallet first time @@ -1120,7 +1120,7 @@ jobs: # echo "----------" # cat first.txt # env: - # SN_LOG: "all" + # ANT_LOG: "all" # timeout-minutes: 5 # - name: Move faucet log to the working folder @@ -1133,7 +1133,7 @@ jobs: # ls -l $SAFE_DATA_PATH/test_faucet/logs # mv $SAFE_DATA_PATH/test_faucet/logs/faucet.log ./faucet_log.log # env: - # SN_LOG: "all" + # ANT_LOG: "all" # SAFE_DATA_PATH: /home/runner/.local/share/autonomi # continue-on-error: true # if: always() @@ -1155,25 +1155,25 @@ jobs: # rm -rf /home/runner/.local/share/autonomi/test_genesis # rm -rf /home/runner/.local/share/autonomi/autonomi # env: - # SN_LOG: "all" + # ANT_LOG: "all" # timeout-minutes: 5 # - name: Create a new wallet # run: ~/safe --log-output-dest=data-dir wallet create --no-password # env: - # SN_LOG: "all" + # ANT_LOG: "all" # timeout-minutes: 5 # - name: Attempt second faucet genesis disbursement # run: ~/faucet --log-output-dest=data-dir send 100000000 $(~/safe --log-output-dest=data-dir wallet address | tail -n 1) > second.txt 2>&1 || true # env: - # SN_LOG: "all" + # ANT_LOG: "all" # timeout-minutes: 5 # - name: cat second.txt # run: cat second.txt # env: - # SN_LOG: "all" + # ANT_LOG: "all" # timeout-minutes: 5 # - name: Verify a second disbursement is rejected @@ -1185,7 +1185,7 @@ jobs: # exit 1 # fi # env: - # SN_LOG: "all" + # ANT_LOG: "all" # timeout-minutes: 5 # - name: Create and fund a wallet with different keypair @@ -1203,7 +1203,7 @@ jobs: # echo "Faucet with different genesis key rejected" # fi # env: - # SN_LOG: "all" + # ANT_LOG: "all" # timeout-minutes: 5 # - name: Build faucet binary again without the gifting feature @@ -1220,7 +1220,7 @@ jobs: # target/release/faucet server & # sleep 60 # env: - # SN_LOG: "all" + # ANT_LOG: "all" # timeout-minutes: 5 # - name: check there is no upload happens @@ -1295,17 +1295,17 @@ jobs: platform: ubuntu-latest build: true - - name: Check if SAFE_PEERS and EVM_NETWORK are set + - name: Check if ANT_PEERS and EVM_NETWORK are set shell: bash run: | - if [[ -z "$SAFE_PEERS" ]]; then - echo "The SAFE_PEERS variable has not been set" + if [[ -z "$ANT_PEERS" ]]; then + echo "The ANT_PEERS variable has not been set" exit 1 elif [[ -z "$EVM_NETWORK" ]]; then echo "The EVM_NETWORK variable has not been set" exit 1 else - echo "SAFE_PEERS has been set to $SAFE_PEERS" + echo "ANT_PEERS has been set to $ANT_PEERS" echo "EVM_NETWORK has been set to $EVM_NETWORK" fi @@ -1328,7 +1328,7 @@ jobs: - name: File upload run: ./target/release/ant --log-output-dest data-dir file upload "./test_data_1.tar.gz" > ./upload_output 2>&1 env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 5 - name: showing the upload terminal output @@ -1345,7 +1345,7 @@ jobs: - name: File Download run: ./target/release/ant --log-output-dest data-dir file download ${{ env.UPLOAD_ADDRESS }} ./downloaded_resources > ./download_output 2>&1 env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 5 - name: showing the download terminal output @@ -1459,14 +1459,14 @@ jobs: # platform: ubuntu-latest # build: true - # - name: Check SAFE_PEERS was set + # - name: Check ANT_PEERS was set # shell: bash # run: | - # if [[ -z "$SAFE_PEERS" ]]; then - # echo "The SAFE_PEERS variable has not been set" + # if [[ -z "$ANT_PEERS" ]]; then + # echo "The ANT_PEERS variable has not been set" # exit 1 # else - # echo "SAFE_PEERS has been set to $SAFE_PEERS" + # echo "ANT_PEERS has been set to $ANT_PEERS" # fi # - name: Create and fund a wallet to pay for files storage @@ -1475,13 +1475,13 @@ jobs: # ./target/release/faucet --log-output-dest=data-dir send 100000000 $(./target/release/safe --log-output-dest=data-dir wallet address | tail -n 1) | tail -n 1 > transfer_hex # ./target/release/safe --log-output-dest=data-dir wallet receive --file transfer_hex # env: - # SN_LOG: "all" + # ANT_LOG: "all" # timeout-minutes: 5 # - name: Start a client to upload first file # run: ./target/release/safe --log-output-dest=data-dir files upload "./test_data_1.tar.gz" --retry-strategy quick # env: - # SN_LOG: "all" + # ANT_LOG: "all" # timeout-minutes: 5 # - name: Ensure no leftover transactions and payment files @@ -1515,7 +1515,7 @@ jobs: # - name: Use same client to upload second file # run: ./target/release/safe --log-output-dest=data-dir files upload "./test_data_2.tar.gz" --retry-strategy quick # env: - # SN_LOG: "all" + # ANT_LOG: "all" # timeout-minutes: 10 # - name: Ensure no leftover transactions and payment files @@ -1560,7 +1560,7 @@ jobs: # ./target/release/faucet --log-output-dest=data-dir send 100000000 $(./target/release/safe --log-output-dest=data-dir wallet address | tail -n 1) | tail -n 1 > transfer_hex # ./target/release/safe --log-output-dest=data-dir wallet receive --file transfer_hex # env: - # SN_LOG: "all" + # ANT_LOG: "all" # SAFE_DATA_PATH: /home/runner/.local/share/autonomi # CLIENT_DATA_PATH: /home/runner/.local/share/autonomi/client # timeout-minutes: 25 @@ -1568,7 +1568,7 @@ jobs: # - name: Use second client to upload third file # run: ./target/release/safe --log-output-dest=data-dir files upload "./test_data_3.tar.gz" --retry-strategy quick # env: - # SN_LOG: "all" + # ANT_LOG: "all" # timeout-minutes: 10 # - name: Ensure no leftover transactions and payment files diff --git a/.github/workflows/merge_websocket.yml b/.github/workflows/merge_websocket.yml index 2cb42ebfde..ca2c17c435 100644 --- a/.github/workflows/merge_websocket.yml +++ b/.github/workflows/merge_websocket.yml @@ -69,17 +69,17 @@ jobs: build: true sn-log: "" - - name: Check if SAFE_PEERS and EVM_NETWORK are set + - name: Check if ANT_PEERS and EVM_NETWORK are set shell: bash run: | - if [[ -z "$SAFE_PEERS" ]]; then - echo "The SAFE_PEERS variable has not been set" + if [[ -z "$ANT_PEERS" ]]; then + echo "The ANT_PEERS variable has not been set" exit 1 elif [[ -z "$EVM_NETWORK" ]]; then echo "The EVM_NETWORK variable has not been set" exit 1 else - echo "SAFE_PEERS has been set to $SAFE_PEERS" + echo "ANT_PEERS has been set to $ANT_PEERS" echo "EVM_NETWORK has been set to $EVM_NETWORK" fi @@ -102,7 +102,7 @@ jobs: - name: File upload run: ./target/release/ant --log-output-dest=data-dir file upload "./test_data_1.tar.gz" > ./upload_output 2>&1 env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 5 - name: showing the upload terminal output @@ -119,7 +119,7 @@ jobs: - name: File Download run: ./target/release/ant --log-output-dest=data-dir file download ${{ env.UPLOAD_ADDRESS }} ./downloaded_resources > ./download_output 2>&1 env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 5 - name: showing the download terminal output diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 23f24c63e3..32870fff79 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -44,17 +44,17 @@ jobs: platform: ${{ matrix.os }} build: true - - name: Check if SAFE_PEERS and EVM_NETWORK are set + - name: Check if ANT_PEERS and EVM_NETWORK are set shell: bash run: | - if [[ -z "$SAFE_PEERS" ]]; then - echo "The SAFE_PEERS variable has not been set" + if [[ -z "$ANT_PEERS" ]]; then + echo "The ANT_PEERS variable has not been set" exit 1 elif [[ -z "$EVM_NETWORK" ]]; then echo "The EVM_NETWORK variable has not been set" exit 1 else - echo "SAFE_PEERS has been set to $SAFE_PEERS" + echo "ANT_PEERS has been set to $ANT_PEERS" echo "EVM_NETWORK has been set to $EVM_NETWORK" fi @@ -62,7 +62,7 @@ jobs: - name: Run autonomi --tests run: cargo test --package autonomi --tests -- --nocapture env: - SN_LOG: "v" + ANT_LOG: "v" # only set the target dir for windows to bypass the linker issue. # happens if we build the node manager via testnet action CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }} @@ -82,13 +82,13 @@ jobs: - name: Get file cost run: ./target/release/ant --log-output-dest=data-dir file cost "./resources" env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 15 - name: File upload run: ./target/release/ant --log-output-dest=data-dir file upload "./resources" > ./upload_output 2>&1 env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 15 - name: parse address (unix) @@ -108,7 +108,7 @@ jobs: - name: File Download run: ./target/release/ant --log-output-dest=data-dir file download ${{ env.UPLOAD_ADDRESS }} ./downloaded_resources env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 5 - name: Generate register signing key @@ -117,7 +117,7 @@ jobs: - name: Create register (writeable by owner) run: ./target/release/ant --log-output-dest=data-dir register create baobao 123 > ./register_create_output 2>&1 env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 10 - name: parse register address (unix) @@ -137,25 +137,25 @@ jobs: - name: Get register run: ./target/release/ant --log-output-dest=data-dir register get ${{ env.REGISTER_ADDRESS }} env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 5 - name: Edit register run: ./target/release/ant --log-output-dest=data-dir register edit ${{ env.REGISTER_ADDRESS }} 456 env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 10 - name: Get register (after edit) run: ./target/release/ant --log-output-dest=data-dir register get ${{ env.REGISTER_ADDRESS }} env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 5 - name: Create Public Register (writeable by anyone) run: ./target/release/ant --log-output-dest=data-dir register create bao 111 --public > ./register_public_create_output 2>&1 env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 5 - name: parse public register address (unix) @@ -175,13 +175,13 @@ jobs: - name: Get Public Register (current key is the owner) run: ./target/release/ant --log-output-dest=data-dir register get ${{ env.PUBLIC_REGISTER_ADDRESS }} env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 5 - name: Edit Public Register (current key is the owner) run: ./target/release/ant --log-output-dest=data-dir register edit ${{ env.PUBLIC_REGISTER_ADDRESS }} 222 env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 10 - name: Delete current register signing key @@ -194,19 +194,19 @@ jobs: - name: Get Public Register (new signing key is not the owner) run: ./target/release/ant --log-output-dest=data-dir register get ${{ env.PUBLIC_REGISTER_ADDRESS }} env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 2 - name: Edit Public Register (new signing key is not the owner) run: ./target/release/ant --log-output-dest=data-dir register edit ${{ env.PUBLIC_REGISTER_ADDRESS }} 333 env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 10 - name: Get Public Register (new signing key is not the owner) run: ./target/release/ant --log-output-dest=data-dir register get ${{ env.PUBLIC_REGISTER_ADDRESS }} env: - SN_LOG: "v" + ANT_LOG: "v" timeout-minutes: 2 - name: Stop the local network and upload logs @@ -324,7 +324,7 @@ jobs: env: TEST_DURATION_MINS: 60 TEST_CHURN_CYCLES: 6 - SN_LOG: "all" + ANT_LOG: "all" CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }} timeout-minutes: 90 @@ -481,7 +481,7 @@ jobs: - name: Verify the location of the data on the network run: cargo test --release -p ant-node --features=local --test verify_data_location -- --nocapture env: - SN_LOG: "all" + ANT_LOG: "all" CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }} timeout-minutes: 90 diff --git a/.github/workflows/nightly_wan.yml b/.github/workflows/nightly_wan.yml index 5c9c0fc4c2..144fe88040 100644 --- a/.github/workflows/nightly_wan.yml +++ b/.github/workflows/nightly_wan.yml @@ -61,7 +61,7 @@ jobs: - name: Check env variables shell: bash run: | - echo "Peer is $SAFE_PEERS" + echo "Peer is $ANT_PEERS" echo "Deployment inventory is $SN_INVENTORY" - name: start faucet @@ -79,7 +79,7 @@ jobs: faucet_address=$(jq -r '.faucet_address' $inventory_path) cargo run --bin safe --release -- wallet get-faucet ${faucet_address} env: - SN_LOG: "all" + ANT_LOG: "all" timeout-minutes: 2 - name: Start a client to carry out chunk actions @@ -87,7 +87,7 @@ jobs: set -e cargo run --bin safe --release -- --log-output-dest=data-dir files upload "./resources" --retry-strategy quick env: - SN_LOG: "all" + ANT_LOG: "all" timeout-minutes: 2 - name: Start a client to create a register @@ -95,7 +95,7 @@ jobs: set -e cargo run --bin safe --release -- --log-output-dest=data-dir register create -n baobao env: - SN_LOG: "all" + ANT_LOG: "all" timeout-minutes: 2 - name: Start a client to get a register @@ -103,7 +103,7 @@ jobs: set -e cargo run --bin safe --release -- --log-output-dest=data-dir register get -n baobao env: - SN_LOG: "all" + ANT_LOG: "all" timeout-minutes: 2 - name: Start a client to edit a register @@ -111,7 +111,7 @@ jobs: set -e cargo run --bin safe --release -- --log-output-dest=data-dir register edit -n baobao wood env: - SN_LOG: "all" + ANT_LOG: "all" timeout-minutes: 2 # - name: Fetch network logs @@ -189,19 +189,19 @@ jobs: # - name: Check env variables # shell: bash # run: | - # echo "Peer is $SAFE_PEERS" + # echo "Peer is $ANT_PEERS" # echo "Deployment inventory is $SN_INVENTORY" # - name: execute the sequential transfers test # run: cargo test --release -p ant-node --test sequential_transfers -- --nocapture --test-threads=1 # env: - # SN_LOG: "all" + # ANT_LOG: "all" # timeout-minutes: 45 # - name: execute the storage payment tests # run: cargo test --release -p ant-node --test storage_payments -- --nocapture --test-threads=1 # env: - # SN_LOG: "all" + # ANT_LOG: "all" # timeout-minutes: 45 # - name: Small wait to allow reward receipt @@ -295,7 +295,7 @@ jobs: # - name: Check env variables # shell: bash # run: | - # echo "Peer is $SAFE_PEERS" + # echo "Peer is $ANT_PEERS" # echo "Deployment inventory is $SN_INVENTORY" # # - name: Chunks data integrity during nodes churn @@ -303,11 +303,11 @@ jobs: # env: # # TEST_DURATION_MINS: 60 # # TEST_CHURN_CYCLES: 6 - # # SN_LOG: "all" + # # ANT_LOG: "all" # # todo: lower time for testing # TEST_DURATION_MINS: 10 # TEST_CHURN_CYCLES: 2 - # SN_LOG: "all" + # ANT_LOG: "all" # timeout-minutes: 90 # # - name: Fetch network logs @@ -499,7 +499,7 @@ jobs: # - name: Check env variables # shell: bash # run: | - # echo "Peer is $SAFE_PEERS" + # echo "Peer is $ANT_PEERS" # echo "Deployment inventory is $SN_INVENTORY" # # - name: Verify the Routing table of the nodes @@ -509,7 +509,7 @@ jobs: # - name: Verify the location of the data on the network # run: cargo test --release -p ant-node --test verify_data_location -- --nocapture # env: - # SN_LOG: "all" + # ANT_LOG: "all" # timeout-minutes: 90 # # - name: Verify the routing tables of the nodes diff --git a/.github/workflows/nightly_wan_churn.yml b/.github/workflows/nightly_wan_churn.yml index e32cbb200b..a32ca930d2 100644 --- a/.github/workflows/nightly_wan_churn.yml +++ b/.github/workflows/nightly_wan_churn.yml @@ -59,7 +59,7 @@ jobs: - name: Check env variables shell: bash run: | - echo "Peer is $SAFE_PEERS" + echo "Peer is $ANT_PEERS" echo "Deployment inventory is $SN_INVENTORY" - name: Obtain the funds from the faucet @@ -74,13 +74,13 @@ jobs: cargo run --bin safe --release -- wallet get-faucet ${faucet_address} cargo run --bin safe --release -- wallet get-faucet ${faucet_address} env: - SN_LOG: "all" + ANT_LOG: "all" timeout-minutes: 2 - name: Start a client to upload run: cargo run --bin safe -- --log-output-dest=data-dir files upload "ubuntu-16.04.7-desktop-amd64.iso" --retry-strategy quick env: - SN_LOG: "all" + ANT_LOG: "all" timeout-minutes: 45 - name: Cause random churn @@ -96,7 +96,7 @@ jobs: - name: Start a client to download files run: cargo run --bin safe --release -- --log-output-dest=data-dir files download --retry-strategy quick env: - SN_LOG: "all" + ANT_LOG: "all" timeout-minutes: 30 - name: Fetch network logs diff --git a/.github/workflows/node_man_tests.yml b/.github/workflows/node_man_tests.yml index 2944456bf6..b3de7a8f7c 100644 --- a/.github/workflows/node_man_tests.yml +++ b/.github/workflows/node_man_tests.yml @@ -65,14 +65,14 @@ jobs: # platform: ${{ matrix.os }} # build: true - # - name: Check SAFE_PEERS was set + # - name: Check ANT_PEERS was set # shell: bash # run: | - # if [[ -z "$SAFE_PEERS" ]]; then - # echo "The SAFE_PEERS variable has not been set" + # if [[ -z "$ANT_PEERS" ]]; then + # echo "The ANT_PEERS variable has not been set" # exit 1 # else - # echo "SAFE_PEERS has been set to $SAFE_PEERS" + # echo "ANT_PEERS has been set to $ANT_PEERS" # fi # - shell: bash @@ -118,14 +118,14 @@ jobs: # platform: ${{ matrix.os }} # build: true - # - name: Check SAFE_PEERS was set + # - name: Check ANT_PEERS was set # shell: bash # run: | - # if [[ -z "$SAFE_PEERS" ]]; then - # echo "The SAFE_PEERS variable has not been set" + # if [[ -z "$ANT_PEERS" ]]; then + # echo "The ANT_PEERS variable has not been set" # exit 1 # else - # echo "SAFE_PEERS has been set to $SAFE_PEERS" + # echo "ANT_PEERS has been set to $ANT_PEERS" # fi # - shell: bash diff --git a/ant-cli/README.md b/ant-cli/README.md index 1b8adc803e..c8c57392ad 100644 --- a/ant-cli/README.md +++ b/ant-cli/README.md @@ -16,7 +16,7 @@ Options: --log-format Specify the logging format. --peer - Peer(s) to use for bootstrap, in a 'multiaddr' format containing the peer ID [env: SAFE_PEERS=] + Peer(s) to use for bootstrap, in a 'multiaddr' format containing the peer ID [env: ANT_PEERS=] --timeout The maximum duration to wait for a connection to the network before timing out -x, --no-verify diff --git a/ant-cli/src/access/network.rs b/ant-cli/src/access/network.rs index ee2722247a..fb7d5fe597 100644 --- a/ant-cli/src/access/network.rs +++ b/ant-cli/src/access/network.rs @@ -7,7 +7,7 @@ // permissions and limitations relating to use of the SAFE Network Software. use ant_peers_acquisition::PeersArgs; -use ant_peers_acquisition::SAFE_PEERS_ENV; +use ant_peers_acquisition::ANT_PEERS_ENV; use autonomi::Multiaddr; use color_eyre::eyre::Context; use color_eyre::Result; @@ -16,6 +16,6 @@ use color_eyre::Section; pub async fn get_peers(peers: PeersArgs) -> Result> { peers.get_peers().await .wrap_err("Please provide valid Network peers to connect to") - .with_suggestion(|| format!("make sure you've provided network peers using the --peers option or the {SAFE_PEERS_ENV} env var")) + .with_suggestion(|| format!("make sure you've provided network peers using the --peers option or the {ANT_PEERS_ENV} env var")) .with_suggestion(|| "a peer address looks like this: /ip4/42.42.42.42/udp/4242/quic-v1/p2p/B64nodePeerIDvdjb3FAJF4ks3moreBase64CharsHere") } diff --git a/ant-logging/src/layers.rs b/ant-logging/src/layers.rs index 3b994d3087..90bcd007c5 100644 --- a/ant-logging/src/layers.rs +++ b/ant-logging/src/layers.rs @@ -32,9 +32,9 @@ const MAX_LOG_SIZE: usize = 20 * 1024 * 1024; const MAX_UNCOMPRESSED_LOG_FILES: usize = 10; const MAX_LOG_FILES: usize = 1000; // Everything is logged by default -const ALL_SN_LOGS: &str = "all"; +const ALL_ANT_LOGS: &str = "all"; // Trace at nodes, clients, debug at networking layer -const VERBOSE_SN_LOGS: &str = "v"; +const VERBOSE_ANT_LOGS: &str = "v"; /// Handle that implements functions to change the log level on the fly. pub struct ReloadHandle(pub(crate) Handle + Send + Sync>, Registry>); @@ -163,10 +163,10 @@ impl TracingLayers { } } }; - let targets = match std::env::var("SN_LOG") { + let targets = match std::env::var("ANT_LOG") { Ok(sn_log_val) => { if print_updates_to_stdout { - println!("Using SN_LOG={sn_log_val}"); + println!("Using ANT_LOG={sn_log_val}"); } get_logging_targets(&sn_log_val)? } @@ -216,9 +216,9 @@ impl TracingLayers { ]))) .install_batch(opentelemetry::runtime::Tokio)?; - let targets = match std::env::var("SN_LOG_OTLP") { + let targets = match std::env::var("ANT_LOG_OTLP") { Ok(sn_log_val) => { - println!("Using SN_LOG_OTLP={sn_log_val}"); + println!("Using ANT_LOG_OTLP={sn_log_val}"); get_logging_targets(&sn_log_val)? } Err(_) => default_logging_targets, @@ -235,8 +235,8 @@ impl TracingLayers { } } -/// Parses the logging targets from the env variable (SN_LOG). The crates should be given as a CSV, for e.g., -/// `export SN_LOG = libp2p=DEBUG, tokio=INFO, all, sn_client=ERROR` +/// Parses the logging targets from the env variable (ANT_LOG). The crates should be given as a CSV, for e.g., +/// `export ANT_LOG = libp2p=DEBUG, tokio=INFO, all, sn_client=ERROR` /// Custom keywords will take less precedence if the same target has been manually specified in the CSV. /// `sn_client=ERROR` in the above example will be used instead of the TRACE level set by "all" keyword. fn get_logging_targets(logging_env_value: &str) -> Result> { @@ -247,10 +247,10 @@ fn get_logging_targets(logging_env_value: &str) -> Result> for crate_log_level in logging_env_value.split(',') { // TODO: are there other default short-circuits wanted? // Could we have a default set if NOT on a release commit? - if crate_log_level == ALL_SN_LOGS { + if crate_log_level == ALL_ANT_LOGS { contains_keyword_all_sn_logs = true; continue; - } else if crate_log_level == VERBOSE_SN_LOGS { + } else if crate_log_level == VERBOSE_ANT_LOGS { contains_keyword_verbose_sn_logs = true; continue; } diff --git a/ant-logging/src/lib.rs b/ant-logging/src/lib.rs index 9a8790a97f..394e7f1e5a 100644 --- a/ant-logging/src/lib.rs +++ b/ant-logging/src/lib.rs @@ -111,7 +111,7 @@ pub struct LogBuilder { impl LogBuilder { /// Create a new builder - /// Provide the default_logging_targets that are used if the `SN_LOG` env variable is not set. + /// Provide the default_logging_targets that are used if the `ANT_LOG` env variable is not set. /// /// By default, we use log to the StdOut with the default format. pub fn new(default_logging_targets: Vec<(String, Level)>) -> Self { @@ -229,16 +229,16 @@ impl LogBuilder { /// Initialize just the fmt_layer for testing purposes. /// - /// Also overwrites the SN_LOG variable to log everything including the test_file_name + /// Also overwrites the ANT_LOG variable to log everything including the test_file_name fn get_test_layers(test_file_name: &str, disable_networking_logs: bool) -> TracingLayers { - // overwrite SN_LOG + // overwrite ANT_LOG if disable_networking_logs { std::env::set_var( - "SN_LOG", + "ANT_LOG", format!("{test_file_name}=TRACE,all,ant_networking=WARN,all"), ); } else { - std::env::set_var("SN_LOG", format!("{test_file_name}=TRACE,all")); + std::env::set_var("ANT_LOG", format!("{test_file_name}=TRACE,all")); } let output_dest = match dirs_next::data_dir() { diff --git a/ant-node-manager/src/add_services/tests.rs b/ant-node-manager/src/add_services/tests.rs index 6d54770b79..bda83cd3fe 100644 --- a/ant-node-manager/src/add_services/tests.rs +++ b/ant-node-manager/src/add_services/tests.rs @@ -904,7 +904,7 @@ async fn add_node_should_update_the_environment_variables_inside_node_registry() let mut mock_service_control = MockServiceControl::new(); let env_variables = Some(vec![ - ("SN_LOG".to_owned(), "all".to_owned()), + ("ANT_LOG".to_owned(), "all".to_owned()), ("RUST_LOG".to_owned(), "libp2p=debug".to_owned()), ]); @@ -4138,7 +4138,7 @@ async fn add_auditor_should_add_an_auditor_service() -> Result<()> { ], autostart: true, contents: None, - environment: Some(vec![("SN_LOG".to_string(), "all".to_string())]), + environment: Some(vec![("ANT_LOG".to_string(), "all".to_string())]), label: "auditor".parse()?, program: auditor_install_path.to_path_buf(), username: Some(get_username()), @@ -4152,7 +4152,7 @@ async fn add_auditor_should_add_an_auditor_service() -> Result<()> { AddAuditorServiceOptions { bootstrap_peers: vec![], beta_encryption_key: None, - env_variables: Some(vec![("SN_LOG".to_string(), "all".to_string())]), + env_variables: Some(vec![("ANT_LOG".to_string(), "all".to_string())]), auditor_src_bin_path: auditor_download_path.to_path_buf(), auditor_install_bin_path: auditor_install_path.to_path_buf(), service_log_dir_path: auditor_logs_dir.to_path_buf(), @@ -4224,7 +4224,7 @@ async fn add_auditor_should_return_an_error_if_a_auditor_service_was_already_cre AddAuditorServiceOptions { bootstrap_peers: vec![], beta_encryption_key: None, - env_variables: Some(vec![("SN_LOG".to_string(), "all".to_string())]), + env_variables: Some(vec![("ANT_LOG".to_string(), "all".to_string())]), auditor_src_bin_path: auditor_download_path.to_path_buf(), auditor_install_bin_path: auditor_install_path.to_path_buf(), service_log_dir_path: auditor_logs_dir.to_path_buf(), @@ -4290,7 +4290,7 @@ async fn add_auditor_should_include_beta_encryption_key_if_specified() -> Result ], autostart: true, contents: None, - environment: Some(vec![("SN_LOG".to_string(), "all".to_string())]), + environment: Some(vec![("ANT_LOG".to_string(), "all".to_string())]), label: "auditor".parse()?, program: auditor_install_path.to_path_buf(), username: Some(get_username()), @@ -4304,7 +4304,7 @@ async fn add_auditor_should_include_beta_encryption_key_if_specified() -> Result AddAuditorServiceOptions { bootstrap_peers: vec![], beta_encryption_key: Some("test".to_string()), - env_variables: Some(vec![("SN_LOG".to_string(), "all".to_string())]), + env_variables: Some(vec![("ANT_LOG".to_string(), "all".to_string())]), auditor_src_bin_path: auditor_download_path.to_path_buf(), auditor_install_bin_path: auditor_install_path.to_path_buf(), service_log_dir_path: auditor_logs_dir.to_path_buf(), @@ -4379,7 +4379,7 @@ async fn add_faucet_should_add_a_faucet_service() -> Result<()> { ], autostart: true, contents: None, - environment: Some(vec![("SN_LOG".to_string(), "all".to_string())]), + environment: Some(vec![("ANT_LOG".to_string(), "all".to_string())]), label: "faucet".parse()?, program: faucet_install_path.to_path_buf(), username: Some(get_username()), @@ -4392,7 +4392,7 @@ async fn add_faucet_should_add_a_faucet_service() -> Result<()> { add_faucet( AddFaucetServiceOptions { bootstrap_peers: vec![], - env_variables: Some(vec![("SN_LOG".to_string(), "all".to_string())]), + env_variables: Some(vec![("ANT_LOG".to_string(), "all".to_string())]), faucet_src_bin_path: faucet_download_path.to_path_buf(), faucet_install_bin_path: faucet_install_path.to_path_buf(), local: false, @@ -4465,7 +4465,7 @@ async fn add_faucet_should_return_an_error_if_a_faucet_service_was_already_creat let result = add_faucet( AddFaucetServiceOptions { bootstrap_peers: vec![], - env_variables: Some(vec![("SN_LOG".to_string(), "all".to_string())]), + env_variables: Some(vec![("ANT_LOG".to_string(), "all".to_string())]), faucet_src_bin_path: faucet_download_path.to_path_buf(), faucet_install_bin_path: faucet_install_path.to_path_buf(), local: false, @@ -4531,7 +4531,7 @@ async fn add_daemon_should_add_a_daemon_service() -> Result<()> { ], autostart: true, contents: None, - environment: Some(vec![("SN_LOG".to_string(), "ALL".to_string())]), + environment: Some(vec![("ANT_LOG".to_string(), "ALL".to_string())]), label: "antctld".parse()?, program: daemon_install_path.to_path_buf(), username: Some(get_username()), @@ -4546,7 +4546,7 @@ async fn add_daemon_should_add_a_daemon_service() -> Result<()> { address: Ipv4Addr::new(127, 0, 0, 1), daemon_install_bin_path: daemon_install_path.to_path_buf(), daemon_src_bin_path: daemon_download_path.to_path_buf(), - env_variables: Some(vec![("SN_LOG".to_string(), "ALL".to_string())]), + env_variables: Some(vec![("ANT_LOG".to_string(), "ALL".to_string())]), port: 8080, user: get_username(), version: latest_version.to_string(), diff --git a/ant-node-manager/src/bin/cli/main.rs b/ant-node-manager/src/bin/cli/main.rs index 987fbbd007..449bcbd36c 100644 --- a/ant-node-manager/src/bin/cli/main.rs +++ b/ant-node-manager/src/bin/cli/main.rs @@ -120,7 +120,7 @@ pub enum SubCmd { /// /// Useful to set log levels. Variables should be comma separated without spaces. /// - /// Example: --env SN_LOG=all,RUST_LOG=libp2p=debug + /// Example: --env ANT_LOG=all,RUST_LOG=libp2p=debug #[clap(name = "env", long, use_value_delimiter = true, value_parser = parse_environment_variables)] env_variables: Option>, /// Specify what EVM network to use for payments. @@ -425,7 +425,7 @@ pub enum SubCmd { /// Useful to set antnode's log levels. Variables should be comma separated without /// spaces. /// - /// Example: --env SN_LOG=all,RUST_LOG=libp2p=debug + /// Example: --env ANT_LOG=all,RUST_LOG=libp2p=debug #[clap(name = "env", long, use_value_delimiter = true, value_parser = parse_environment_variables)] env_variables: Option>, /// Set this flag to force the upgrade command to replace binaries without comparing any @@ -487,7 +487,7 @@ pub enum AuditorSubCmd { /// /// Useful to set log levels. Variables should be comma separated without spaces. /// - /// Example: --env SN_LOG=all,RUST_LOG=libp2p=debug + /// Example: --env ANT_LOG=all,RUST_LOG=libp2p=debug #[clap(name = "env", long, use_value_delimiter = true, value_parser = parse_environment_variables)] env_variables: Option>, /// Provide the path for the log directory for the auditor. @@ -554,7 +554,7 @@ pub enum AuditorSubCmd { /// /// Useful to set log levels. Variables should be comma separated without spaces. /// - /// Example: --env SN_LOG=all,RUST_LOG=libp2p=debug + /// Example: --env ANT_LOG=all,RUST_LOG=libp2p=debug #[clap(name = "env", long, use_value_delimiter = true, value_parser = parse_environment_variables)] env_variables: Option>, /// Provide a binary to upgrade to using a URL. @@ -594,7 +594,7 @@ pub enum DaemonSubCmd { /// /// Useful to set log levels. Variables should be comma separated without spaces. /// - /// Example: --env SN_LOG=all,RUST_LOG=libp2p=debug + /// Example: --env ANT_LOG=all,RUST_LOG=libp2p=debug #[clap(name = "env", long, use_value_delimiter = true, value_parser = parse_environment_variables)] env_variables: Option>, /// Specify a port for the daemon to listen on. @@ -651,7 +651,7 @@ pub enum FaucetSubCmd { /// /// Useful to set log levels. Variables should be comma separated without spaces. /// - /// Example: --env SN_LOG=all,RUST_LOG=libp2p=debug + /// Example: --env ANT_LOG=all,RUST_LOG=libp2p=debug #[clap(name = "env", long, use_value_delimiter = true, value_parser = parse_environment_variables)] env_variables: Option>, /// Provide the path for the log directory for the faucet. @@ -718,7 +718,7 @@ pub enum FaucetSubCmd { /// /// Useful to set log levels. Variables should be comma separated without spaces. /// - /// Example: --env SN_LOG=all,RUST_LOG=libp2p=debug + /// Example: --env ANT_LOG=all,RUST_LOG=libp2p=debug #[clap(name = "env", long, use_value_delimiter = true, value_parser = parse_environment_variables)] env_variables: Option>, /// Provide a binary to upgrade to using a URL. diff --git a/ant-node-manager/src/cmd/node.rs b/ant-node-manager/src/cmd/node.rs index 8d6edf7e17..ee6284fb75 100644 --- a/ant-node-manager/src/cmd/node.rs +++ b/ant-node-manager/src/cmd/node.rs @@ -112,7 +112,7 @@ pub async fn add( // ant_peers_acquisition, we might end up getting having a huge peer list, and that's problematic for // service definition files. // Thus make use of get_peers_exclude_network_contacts() instead of get_peers() to make sure we only - // parse the --peers and SAFE_PEERS env var. + // parse the --peers and ANT_PEERS env var. // If the `antnode` binary we're using has `network-contacts` enabled (which is the case for released binaries), // it's fine if the service definition doesn't call `antnode` with a `--peer` argument. diff --git a/ant-node-manager/tests/e2e.rs b/ant-node-manager/tests/e2e.rs index 76e343060c..c1b04f4db6 100644 --- a/ant-node-manager/tests/e2e.rs +++ b/ant-node-manager/tests/e2e.rs @@ -17,7 +17,7 @@ use std::path::PathBuf; /// create real services and user accounts, and will not attempt to clean themselves up. /// /// They are assuming the existence of a `antnode` binary produced by the release process, and a -/// running local network, with SAFE_PEERS set to a local node. +/// running local network, with ANT_PEERS set to a local node. const CI_USER: &str = "runner"; #[cfg(unix)] const ANTNODE_BIN_NAME: &str = "antnode"; diff --git a/ant-node/tests/common/client.rs b/ant-node/tests/common/client.rs index df1193bbb0..c6e9296416 100644 --- a/ant-node/tests/common/client.rs +++ b/ant-node/tests/common/client.rs @@ -218,7 +218,7 @@ impl WanNetwork { // { // match parse_peer_addr(peer) { // Ok(peer) => bootstrap_peers.push(peer), - // Err(err) => error!("Can't parse SAFE_PEERS {peer:?} with error {err:?}"), + // Err(err) => error!("Can't parse ANT_PEERS {peer:?} with error {err:?}"), // } // } // if bootstrap_peers.is_empty() { diff --git a/ant-peers-acquisition/README.md b/ant-peers-acquisition/README.md index 50df8a8984..6c409a9103 100644 --- a/ant-peers-acquisition/README.md +++ b/ant-peers-acquisition/README.md @@ -2,4 +2,4 @@ Provides utilities for discovering bootstrap peers on a given system. -It handles `--peer` arguments across all bins, as well as `SAFE_PEERS` or indeed picking up an initial set of `network-conacts` from a provided, or hard-coded url. +It handles `--peer` arguments across all bins, as well as `ANT_PEERS` or indeed picking up an initial set of `network-conacts` from a provided, or hard-coded url. diff --git a/ant-peers-acquisition/src/lib.rs b/ant-peers-acquisition/src/lib.rs index 8c39764d96..da613e97ad 100644 --- a/ant-peers-acquisition/src/lib.rs +++ b/ant-peers-acquisition/src/lib.rs @@ -30,7 +30,7 @@ lazy_static! { const MAX_RETRIES_ON_GET_PEERS_FROM_URL: usize = 7; /// The name of the environment variable that can be used to pass peers to the node. -pub const SAFE_PEERS_ENV: &str = "SAFE_PEERS"; +pub const ANT_PEERS_ENV: &str = "ANT_PEERS"; #[derive(Args, Debug, Default, Clone)] pub struct PeersArgs { @@ -48,9 +48,9 @@ pub struct PeersArgs { /// /// This argument can be provided multiple times to connect to multiple peers. /// - /// Alternatively, the `SAFE_PEERS` environment variable can provide a comma-separated peer + /// Alternatively, the `ANT_PEERS` environment variable can provide a comma-separated peer /// list. - #[clap(long = "peer", env = "SAFE_PEERS", value_name = "multiaddr", value_delimiter = ',', value_parser = parse_peer_addr, conflicts_with = "first")] + #[clap(long = "peer", env = "ANT_PEERS", value_name = "multiaddr", value_delimiter = ',', value_parser = parse_peer_addr, conflicts_with = "first")] pub peers: Vec, /// Specify the URL to fetch the network contacts from. @@ -69,11 +69,11 @@ impl PeersArgs { /// /// Otherwise, peers are obtained in the following order of precedence: /// * The `--peer` argument. - /// * The `SAFE_PEERS` environment variable. + /// * The `ANT_PEERS` environment variable. /// * Using the `local` feature, which will return an empty peer list. /// * Using the `network-contacts` feature, which will download the peer list from a file on S3. /// - /// Note: the current behaviour is that `--peer` and `SAFE_PEERS` will be combined. Some tests + /// Note: the current behaviour is that `--peer` and `ANT_PEERS` will be combined. Some tests /// currently rely on this. We will change it soon. pub async fn get_peers(self) -> Result> { self.get_peers_inner(false).await @@ -85,13 +85,13 @@ impl PeersArgs { /// /// Otherwise, peers are obtained in the following order of precedence: /// * The `--peer` argument. - /// * The `SAFE_PEERS` environment variable. + /// * The `ANT_PEERS` environment variable. /// * Using the `local` feature, which will return an empty peer list. /// /// This will not fetch the peers from network-contacts even if the `network-contacts` feature is enabled. Use /// get_peers() instead. /// - /// Note: the current behaviour is that `--peer` and `SAFE_PEERS` will be combined. Some tests + /// Note: the current behaviour is that `--peer` and `ANT_PEERS` will be combined. Some tests /// currently rely on this. We will change it soon. pub async fn get_peers_exclude_network_contacts(self) -> Result> { self.get_peers_inner(true).await @@ -104,7 +104,7 @@ impl PeersArgs { } let mut peers = if !self.peers.is_empty() { - info!("Using peers supplied with the --peer argument(s) or SAFE_PEERS"); + info!("Using peers supplied with the --peer argument(s) or ANT_PEERS"); self.peers } else if cfg!(feature = "local") { info!("No peers given"); diff --git a/autonomi/README.md b/autonomi/README.md index 072fb0a732..10936d324b 100644 --- a/autonomi/README.md +++ b/autonomi/README.md @@ -67,7 +67,7 @@ To run a WASM test - Install `wasm-pack` - Make sure your Rust supports the `wasm32-unknown-unknown` target. (If you have `rustup`: `rustup target add wasm32-unknown-unknown`.) -- Pass a bootstrap peer via `SAFE_PEERS`. This *has* to be the websocket address, +- Pass a bootstrap peer via `ANT_PEERS`. This *has* to be the websocket address, e.g. `/ip4//tcp//ws/p2p/`. - As well as the other environment variables needed for EVM payments (e.g. `RPC_URL`). - Optionally specify the specific test, e.g. `-- put` to run `put()` in `wasm.rs` only. @@ -75,7 +75,7 @@ To run a WASM test Example: ```sh -SAFE_PEERS=/ip4//tcp//ws/p2p/ wasm-pack test --release --firefox autonomi --features=data,files --test wasm -- put +ANT_PEERS=/ip4//tcp//ws/p2p/ wasm-pack test --release --firefox autonomi --features=data,files --test wasm -- put ``` #### Test from JS in the browser diff --git a/test-utils/src/lib.rs b/test-utils/src/lib.rs index 7479693f6a..5d3c57960a 100644 --- a/test-utils/src/lib.rs +++ b/test-utils/src/lib.rs @@ -35,13 +35,13 @@ pub fn gen_random_data(len: usize) -> Bytes { Bytes::from(data) } -/// Parse the `SAFE_PEERS` env var into a list of Multiaddrs. +/// Parse the `ANT_PEERS` env var into a list of Multiaddrs. /// /// An empty `Vec` will be returned if the env var is not set or if local discovery is enabled. pub fn peers_from_env() -> Result> { let bootstrap_peers = if cfg!(feature = "local") { Ok(vec![]) - } else if let Some(peers_str) = env_from_runtime_or_compiletime!("SAFE_PEERS") { + } else if let Some(peers_str) = env_from_runtime_or_compiletime!("ANT_PEERS") { peers_str.split(',').map(parse_peer_addr).collect() } else { Ok(vec![])