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![])