diff --git a/.github/workflows/indexer-processor-testing.yaml b/.github/workflows/indexer-processor-testing.yaml index 091ef7982b017..de9656487c1fa 100644 --- a/.github/workflows/indexer-processor-testing.yaml +++ b/.github/workflows/indexer-processor-testing.yaml @@ -39,10 +39,31 @@ jobs: - name: Update Rust toolchain run: rustup update + - id: auth + uses: "google-github-actions/auth@v2" + with: + workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} + service_account: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }} + + - name: Prepare and Replace API Keys in Yaml + id: api_key_tokens + uses: 'google-github-actions/get-secretmanager-secrets@v2' + with: + secrets: |- + testnet_api_key:aptos-ci/TESTNET_INDEXER_API_KEY + mainnet_api_key:aptos-ci/MAINNET_INDEXER_API_KEY + - name: Run CLI to Generate JSON Files + id: api_key_update run: | cd ecosystem/indexer-grpc/indexer-transaction-generator - cargo run -- --testing-folder ./example_tests --output-folder ../indexer-test-transactions/new_json_transactions + ls -al ./imported_transactions + echo "Updating API keys in YAML files..." + sed -i "s/TESTNET_API_KEY/${{ steps.api_key_tokens.outputs.testnet_api_key }}/g" ./imported_transactions/imported_transactions.yaml + sed -i "s/MAINNET_API_KEY/${{ steps.api_key_tokens.outputs.mainnet_api_key }}/g" ./imported_transactions/imported_transactions.yaml + + cat ./imported_transactions/imported_transactions.yaml # Print the updated file for verification + cargo run -- --testing-folder ./imported_transactions --output-folder ../indexer-test-transactions/new_json_transactions - name: Install jq run: sudo apt-get install jq # Ensure jq is installed for JSON processing @@ -52,7 +73,8 @@ jobs: - name: Prepare and Clean JSON Files run: | cd ecosystem/indexer-grpc/indexer-test-transactions - + ls -al ./new_json_transactions/scripted_transactions + for folder in json_transactions/scripted_transactions new_json_transactions/scripted_transactions; do for file in $folder/*.json; do echo "Processing $file..." @@ -75,6 +97,7 @@ jobs: .user.request.sender, .user.request.expirationTimestampSecs.seconds, .user.request.signature.ed25519.publicKey, + .user.request.payload.scriptPayload.code.bytecode, .user.request.signature.ed25519.signature) | (.info.changes[].writeResource.data |= if type == "string" then @@ -110,13 +133,6 @@ jobs: exit 0 # Proceed successfully only if no new files or differences are found fi - - id: auth - if: steps.diff_check.outputs.diff_found == 'true' && steps.diff_check.outputs.new_file_found == 'false' - uses: "google-github-actions/auth@v2" - with: - workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} - service_account: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }} - - name: Log active service account email if: steps.diff_check.outputs.diff_found == 'true' && steps.diff_check.outputs.new_file_found == 'false' run: | diff --git a/.gitignore b/.gitignore index e12d93cd544c7..10096875d916a 100644 --- a/.gitignore +++ b/.gitignore @@ -130,7 +130,6 @@ run_* test_indexer_grpc_*.yaml test_indexer_grpc/* ecosystem/indexer-grpc/indexer-transaction-generator/*.yaml -ecosystem/indexer-grpc/indexer-transaction-generator/**/*.yaml # ignore compiler artifacts *.dot diff --git a/ecosystem/indexer-grpc/indexer-transaction-generator/README.md b/ecosystem/indexer-grpc/indexer-transaction-generator/README.md index f15ca877e7bac..d2988015abb0c 100644 --- a/ecosystem/indexer-grpc/indexer-transaction-generator/README.md +++ b/ecosystem/indexer-grpc/indexer-transaction-generator/README.md @@ -16,7 +16,7 @@ cargo run -p aptos-indexer-transaction-generator -- \ ```bash ./aptos-indexer-transaction-generator \ - --testing-folder /your/aptos-core/ecosystem/indexer-grpc/indexer-transaction-generator/example_tests \ + --testing-folder /your/aptos-core/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions \ --output-folder /tmp/ttt ``` @@ -58,7 +58,7 @@ cargo run -p aptos-indexer-transaction-generator -- \ ``` -You can check the example [here](example_tests). +You can check the example [here](imported_transactions). ### Account Management diff --git a/ecosystem/indexer-grpc/indexer-transaction-generator/example.yaml b/ecosystem/indexer-grpc/indexer-transaction-generator/example.yaml deleted file mode 100644 index dd84ad290fce0..0000000000000 --- a/ecosystem/indexer-grpc/indexer-transaction-generator/example.yaml +++ /dev/null @@ -1,10 +0,0 @@ -import_config: - testnet: - # Transaction Stream endpoint addresss. - transaction_stream_endpoint: https://grpc.testnet.aptoslabs.com:443 - # (Optional) The key to use with developers.aptoslabs.com - api_key: YOUR_KEY_HERE - # A map from versions to dump and their output names. - versions_to_import: - 1: v1_genesis - 278556781: coin_register_fa_metadata_278556781 \ No newline at end of file diff --git a/ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/move_fixtures/simple_user_script/script.mv b/ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/move_fixtures/simple_user_script/script.mv deleted file mode 100644 index 6e2db2756ea36..0000000000000 Binary files a/ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/move_fixtures/simple_user_script/script.mv and /dev/null differ diff --git a/ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/move_fixtures/simple_user_script2/script.mv b/ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/move_fixtures/simple_user_script2/script.mv deleted file mode 100644 index 6e2db2756ea36..0000000000000 Binary files a/ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/move_fixtures/simple_user_script2/script.mv and /dev/null differ diff --git a/ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/README.md b/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/README.md similarity index 100% rename from ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/README.md rename to ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/README.md diff --git a/ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/imported_transactions.yaml b/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/imported_transactions.yaml similarity index 90% rename from ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/imported_transactions.yaml rename to ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/imported_transactions.yaml index c6946a177bbb0..989b7ba7e3fec 100644 --- a/ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/imported_transactions.yaml +++ b/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/imported_transactions.yaml @@ -2,7 +2,7 @@ testnet: # Transaction Stream endpoint addresss. transaction_stream_endpoint: https://grpc.testnet.aptoslabs.com:443 # (Optional) The key to use with developers.aptoslabs.com - api_key: YOUR_KEY_HERE + api_key: TESTNET_API_KEY # A map from versions to dump and their output names. versions_to_import: # naming: @@ -17,6 +17,6 @@ testnet: mainnet: transaction_stream_endpoint: https://grpc.mainnet.aptoslabs.com:443 - api_key: YOUR_KEY_HERE # update with oncall key + api_key: MAINNET_API_KEY versions_to_import: 308783012: 308783012_fa_transfer diff --git a/ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/move_fixtures/README.md b/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/move_fixtures/README.md similarity index 100% rename from ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/move_fixtures/README.md rename to ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/move_fixtures/README.md diff --git a/ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/move_fixtures/simple_user_script.yaml b/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/move_fixtures/simple_user_script.yaml similarity index 100% rename from ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/move_fixtures/simple_user_script.yaml rename to ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/move_fixtures/simple_user_script.yaml diff --git a/ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/move_fixtures/simple_user_script/Move.toml b/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/move_fixtures/simple_user_script/Move.toml similarity index 100% rename from ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/move_fixtures/simple_user_script/Move.toml rename to ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/move_fixtures/simple_user_script/Move.toml diff --git a/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/move_fixtures/simple_user_script/script.mv b/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/move_fixtures/simple_user_script/script.mv new file mode 100644 index 0000000000000..fcc6c86488245 Binary files /dev/null and b/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/move_fixtures/simple_user_script/script.mv differ diff --git a/ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/move_fixtures/simple_user_script/sources/main.move b/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/move_fixtures/simple_user_script/sources/main.move similarity index 100% rename from ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/move_fixtures/simple_user_script/sources/main.move rename to ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/move_fixtures/simple_user_script/sources/main.move diff --git a/ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/move_fixtures/simple_user_script2.yaml b/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/move_fixtures/simple_user_script2.yaml similarity index 100% rename from ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/move_fixtures/simple_user_script2.yaml rename to ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/move_fixtures/simple_user_script2.yaml diff --git a/ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/move_fixtures/simple_user_script2/Move.toml b/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/move_fixtures/simple_user_script2/Move.toml similarity index 100% rename from ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/move_fixtures/simple_user_script2/Move.toml rename to ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/move_fixtures/simple_user_script2/Move.toml diff --git a/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/move_fixtures/simple_user_script2/script.mv b/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/move_fixtures/simple_user_script2/script.mv new file mode 100644 index 0000000000000..fcc6c86488245 Binary files /dev/null and b/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/move_fixtures/simple_user_script2/script.mv differ diff --git a/ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/move_fixtures/simple_user_script2/sources/main.move b/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/move_fixtures/simple_user_script2/sources/main.move similarity index 100% rename from ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/move_fixtures/simple_user_script2/sources/main.move rename to ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/move_fixtures/simple_user_script2/sources/main.move diff --git a/ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/testing_accounts.yaml b/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/testing_accounts.yaml similarity index 100% rename from ecosystem/indexer-grpc/indexer-transaction-generator/example_tests/testing_accounts.yaml rename to ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions/testing_accounts.yaml diff --git a/ecosystem/indexer-grpc/indexer-transaction-generator/template_config.yaml b/ecosystem/indexer-grpc/indexer-transaction-generator/template_config.yaml index a0193e836045a..2c9a7efcb76b6 100644 --- a/ecosystem/indexer-grpc/indexer-transaction-generator/template_config.yaml +++ b/ecosystem/indexer-grpc/indexer-transaction-generator/template_config.yaml @@ -9,17 +9,9 @@ mainnet: # example: # 123: "example_transaction" } + # testnet: # transaction_stream_endpoint: https://grpc.testnet.aptoslabs.com:443 # api_key: YOUR_KEY_HERE # versions_to_import: { # } -# devnet: -# transaction_stream_endpoint: https://grpc.devnet.aptoslabs.com:443 -# api_key: YOUR_KEY_HERE -# versions_to_import: { -# } -# custom: -# transaction_stream_endpoint: https://CUSTOM_ENDPOINT:443 -# versions_to_import: { -# } \ No newline at end of file