From c027d0f06ed14e96bbedc5cee6af0da0aad2054c Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 10:42:53 -0500 Subject: [PATCH 001/146] add deployment script + adjust some values in utils.js to enable it to work with httpcalls --- .github/workflows/test-stellar.yaml | 215 ++++++++++++++++++++++++++++ stellar/generate-bindings.js | 2 +- stellar/utils.js | 10 +- 3 files changed, 222 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/test-stellar.yaml diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml new file mode 100644 index 000000000..c2ba14688 --- /dev/null +++ b/.github/workflows/test-stellar.yaml @@ -0,0 +1,215 @@ +name: Test Stellar + +on: pull_request + +jobs: + check-relevant-changes: + name: Check for Relevant Changes + runs-on: blacksmith-2vcpu-ubuntu-2204 + outputs: + run_tests: ${{ steps.filter.outputs.sui == 'true' || steps.filter.outputs.common == 'true' || steps.filter.outputs.github == 'true' }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + sui: + - 'stellar/**' + common: + - 'common/**' + github: + # - '.github/actions/setup-stellar/**' + - '.github/workflows/test-stellar.yaml' + - name: Summarize Changes + run: | + echo "Changes in stellar: ${{ steps.filter.outputs.sui }}" + echo "Changes in common: ${{ steps.filter.outputs.common }}" + echo "Changes in github: ${{ steps.filter.outputs.github }}" + + test-stellar: + name: Test Stellar + needs: check-relevant-changes + if: ${{ needs.check-relevant-changes.outputs.run_tests == 'true' }} + runs-on: blacksmith-2vcpu-ubuntu-2204 + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' # Hardcoded to ensure consistency. + cache: 'npm' + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + shell: bash + run: npm ci + + - name: Install stable toolchain + uses: dtolnay/rust-toolchain + with: + toolchain: 1.81.0 + + - name: Install Stellar CLI + shell: bash + run: | + cargo install --locked stellar-cli --features opt --version ~21 + + - name: Pull stellar/quickstart docker image + run: | + docker pull stellar/quickstart + + - name: Setup Stellar standalone network + run: | + docker run -d --rm -it \ + -p 8000:8000 \ + --name stellar \ + stellar/quickstart:testing \ + --local \ + --enable-soroban-rpc \ + --protocol-version 21 + + RPC_URL="http://localhost:8000" + NETWORK_PASSPHRASE="Standalone Network ; February 2017" + + - name: Add as configured network + run: | + stellar network add standalone \ + --rpc-url $RPC_URL \ + --network-passphrase $NETWORK_PASSPHRASE + + - name: Setup Stellar wallet + run: | + stellar keys generate test \ + --rpc-url $RPC_URL \ + --network-passphrase $NETWORK_PASSPHRASE + STELLAR_PRIVATE_KEY=$(stellar keys show test) + STELLAR_ADDRESS=$(stellar keys address test) + echo "STELLAR_PRIVATE_KEY=${STELLAR_PRIVATE_KEY}" >> $GITHUB_ENV + echo "STELLAR_ADDRESS=${STELLAR_ADDRESS}" >> $GITHUB_ENV + + - name: Prepare local.json + run: | + echo '{ + "chains": { + "stellar": { + "name": "Stellar", + "axelarId": "stellar", + "networkType": "localnet", + "chainType": "stellar", + "tokenSymbol": "XLM", + "rpc": "http://127.0.0.1:8000", + "horizonRpc": "http://127.0.0.1:8000", + "contracts": { + "AxelarGateway": {} + } + } + } + }' > ./axelar-chains-config/info/local.json + + - name: Start Stellar network + run: | + stellar network container start local + + - name: Wait for Stellar network + uses: nev7n/wait_for_response@v1 + with: + url: 'http://localhost:8000' + responseCode: 200 + timeout: 60000 + interval: 1000 + + # Create .env file with default hardhat private key that's prefunded + - name: Prepare .env + run: | + echo "PRIVATE_KEY=STELLAR_PRIVATE_KEY" >> .env + echo 'ENV=local' >> .env + # echo 'SKIP_EXISTING = true' >> .env + + - name: Display local.json + run: cat ./axelar-chains-config/info/local.json + + # - name: Request SUI from faucet + # run: node stellar/faucet.js + + ###### Compile Wasm Contracts ###### + + - name: Checkout axelar-cgp-soroban repo + uses: actions/checkout@v4 + with: + repository: axelarnetwork/axelar-cgp-soroban + + - name: Compile WASM contracts + run: | + stellar contract build --manifest-path=axelar-cgp-soroban/Cargo.toml + cd axelar-cgp-soroban + ./optmize.sh + cd .. + WASM_DIR=axelar-cgp-soroban/target/wasm32-unknown-unknown/release + echo "WASM_DIR=${WASM_DIR}" >> $GITHUB_ENV + + ###### Command: Deploy Contract ###### + + - name: Deploy axelar_gateway + run: | + CONTRACT=axelar_gateway + node stellar/deploy-contract deploy $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm --initialize + + - name: Deploy axelar_operators + run: | + CONTRACT=axelar_operators + node stellar/deploy-contract deploy $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm --initialize + + ###### Command: Gateway ###### + # - name: Gateway Approve + # run: | + # node stellar/gateway approve avalanche 0x32034b47cb29d162d9d803cc405356f4ac0ec07fe847ace431385fe8acf3e6e5-2 0x4F4495243837681061C4743b74B3eEdf548D56A5 wallet 0x1234 + + + - name: Gateway Call Contract + run: node stellar/gateway.js call-contract avalanche 0x4F4495243837681061C4743b74B3eEdf548D56A5 0x1234 + + - name: Gateway Rotate Signers + run: | + node stellar/gateway rotate --new-nonce test --signers wallet + node stellar/gateway rotate --new-nonce test2 --current-nonce test --signers wallet + + - name: Upgrade gateway contract + run: | + CONTRACT=axelar_gateway + node stellar/deploy-contract.js upgrade $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm + + ###### Command: Operators ###### + + - name: Store Capability Object in Operators + run: node sui/operators.js storeCap + + - name: Add Operator + run: node sui/operators.js add $SUI_ADDRESS + + - name: Collect Gas with Operator + run: node sui/operators.js collectGas --amount 1 + + - name: Refund Gas with Operator + run: node sui/operators.js refund 0x32034b47cb29d162d9d803cc405356f4ac0ec07fe847ace431385fe8acf3e6e5-2 --amount 1 + + - name: Remove Operator + run: node sui/operators.js remove $SUI_ADDRESS + + ###### Command: Generate Keypair ###### + - name: Generate Keypair + run: node sui/generate-keypair.js + + + ###### Command: Generate Bindings ##### + - name: generate operators bindings + run: | + CONTRACT=axelar_operators + node stellar/generate-bindings.js --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm --contract-id $(jq .chains.stellar.contracts.$CONTRACT.address axelar-chains-config/info/local.json) --output-dir ./stellar/bindings/$CONTRACT + + - name: generate gateway bindings + run: | + CONTRACT=axelar_gateway + node stellar/generate-bindings.js --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm --contract-id $(jq .chains.stellar.contracts.$CONTRACT.address axelar-chains-config/info/local.json) --output-dir ./stellar/bindings/$CONTRACT diff --git a/stellar/generate-bindings.js b/stellar/generate-bindings.js index aa17f6e43..6708b5a21 100644 --- a/stellar/generate-bindings.js +++ b/stellar/generate-bindings.js @@ -37,7 +37,7 @@ function main() { program.action((options) => { const config = loadConfig(options.env); - processCommand(options, config, config.stellar); + processCommand(options, config, config.chains.stellar); }); program.parse(); diff --git a/stellar/utils.js b/stellar/utils.js index b664365ba..3a5f30625 100644 --- a/stellar/utils.js +++ b/stellar/utils.js @@ -24,7 +24,7 @@ const stellarCmd = 'stellar'; function getNetworkPassphrase(networkType) { switch (networkType) { case 'local': - return Networks.SANDBOX; + return Networks.STANDALONE; case 'futurenet': return Networks.FUTURENET; case 'testnet': @@ -147,7 +147,7 @@ async function sendTransaction(tx, server, action, options = {}) { } async function broadcast(operation, wallet, chain, action, options = {}) { - const server = new SorobanRpc.Server(chain.rpc); + const server = new SorobanRpc.Server(chain.rpc, { allowHttp: true }); if (options.estimateCost) { const tx = await buildTransaction(operation, server, wallet, chain.networkType, options); @@ -167,8 +167,10 @@ function getAssetCode(balance, chain) { async function getWallet(chain, options) { const keypair = Keypair.fromSecret(options.privateKey); const address = keypair.publicKey(); - const provider = new SorobanRpc.Server(chain.rpc); - const horizonServer = new Horizon.Server(chain.horizonRpc); + const provider = new SorobanRpc.Server(chain.rpc, { + allowHttp: true, + }); + const horizonServer = new Horizon.Server(chain.horizonRpc, { allowHttp: true }); printInfo('Wallet address', address); const account = await provider.getAccount(address); From 1e7b9558854a78a7b318880ad6b97e01be5f9f84 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 10:50:37 -0500 Subject: [PATCH 002/146] remove unneeded contracts field --- .github/workflows/test-stellar.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index c2ba14688..b4bb80411 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -102,9 +102,7 @@ jobs: "tokenSymbol": "XLM", "rpc": "http://127.0.0.1:8000", "horizonRpc": "http://127.0.0.1:8000", - "contracts": { - "AxelarGateway": {} - } + "contracts": {} } } }' > ./axelar-chains-config/info/local.json From 3994fe1e90d2bc43f42f9cb25e47306318d4ab0e Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 10:51:54 -0500 Subject: [PATCH 003/146] remove unused comment --- .github/workflows/test-stellar.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index b4bb80411..df5c62cc3 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -129,9 +129,6 @@ jobs: - name: Display local.json run: cat ./axelar-chains-config/info/local.json - # - name: Request SUI from faucet - # run: node stellar/faucet.js - ###### Compile Wasm Contracts ###### - name: Checkout axelar-cgp-soroban repo From 807da9c2b599cab5ec24c43ffce22929f2ca3de6 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 11:00:45 -0500 Subject: [PATCH 004/146] add operator contract actions --- .github/workflows/test-stellar.yaml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index df5c62cc3..01ad7f29a 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -158,6 +158,7 @@ jobs: node stellar/deploy-contract deploy $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm --initialize ###### Command: Gateway ###### + # FIXME: # - name: Gateway Approve # run: | # node stellar/gateway approve avalanche 0x32034b47cb29d162d9d803cc405356f4ac0ec07fe847ace431385fe8acf3e6e5-2 0x4F4495243837681061C4743b74B3eEdf548D56A5 wallet 0x1234 @@ -178,20 +179,24 @@ jobs: ###### Command: Operators ###### - - name: Store Capability Object in Operators - run: node sui/operators.js storeCap + - name: Execute is_operator action + run: node stellar/operators.js --action is_operator --args $STELLAR_ADDRESS - - name: Add Operator - run: node sui/operators.js add $SUI_ADDRESS + - name: Execute add_operator action + run: node stellar/operators.js --action add_operator --args $STELLAR_ADDRESS - - name: Collect Gas with Operator - run: node sui/operators.js collectGas --amount 1 + - name: Execute remove_operator action + run: node stellar/operators.js --action remove_operator --args $STELLAR_ADDRESS - - name: Refund Gas with Operator - run: node sui/operators.js refund 0x32034b47cb29d162d9d803cc405356f4ac0ec07fe847ace431385fe8acf3e6e5-2 --amount 1 + - name: Execute refund action + run: node stellar/operators.js --action refund - - name: Remove Operator - run: node sui/operators.js remove $SUI_ADDRESS + - name: Execute execute action + run: node stellar/operators.js --action execute + + # TODO: currently fails + # - name: is_operator with estimate_cost + # run: node stellar/operators.js --action is_operator --args $STELLAR_ADDRESS --estimate-cost ###### Command: Generate Keypair ###### - name: Generate Keypair From 2a8987e227400d112ce4e04688b48d4fd67d5e53 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 11:07:13 -0500 Subject: [PATCH 005/146] remove commented out item --- .github/workflows/test-stellar.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 01ad7f29a..db9d13248 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -19,7 +19,6 @@ jobs: common: - 'common/**' github: - # - '.github/actions/setup-stellar/**' - '.github/workflows/test-stellar.yaml' - name: Summarize Changes run: | From d2bed2b20c248a320063993449bff908dd2a5fd0 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 11:11:53 -0500 Subject: [PATCH 006/146] replace all instances of sui with stellar --- .github/workflows/test-stellar.yaml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index db9d13248..d196cf9ef 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -7,14 +7,14 @@ jobs: name: Check for Relevant Changes runs-on: blacksmith-2vcpu-ubuntu-2204 outputs: - run_tests: ${{ steps.filter.outputs.sui == 'true' || steps.filter.outputs.common == 'true' || steps.filter.outputs.github == 'true' }} + run_tests: ${{ steps.filter.outputs.stellar == 'true' || steps.filter.outputs.common == 'true' || steps.filter.outputs.github == 'true' }} steps: - uses: actions/checkout@v4 - uses: dorny/paths-filter@v3 id: filter with: filters: | - sui: + stellar: - 'stellar/**' common: - 'common/**' @@ -22,7 +22,7 @@ jobs: - '.github/workflows/test-stellar.yaml' - name: Summarize Changes run: | - echo "Changes in stellar: ${{ steps.filter.outputs.sui }}" + echo "Changes in stellar: ${{ steps.filter.outputs.stellar }}" echo "Changes in common: ${{ steps.filter.outputs.common }}" echo "Changes in github: ${{ steps.filter.outputs.github }}" @@ -197,10 +197,6 @@ jobs: # - name: is_operator with estimate_cost # run: node stellar/operators.js --action is_operator --args $STELLAR_ADDRESS --estimate-cost - ###### Command: Generate Keypair ###### - - name: Generate Keypair - run: node sui/generate-keypair.js - ###### Command: Generate Bindings ##### - name: generate operators bindings From a5d4a25148bc5988c5b2232d0b602ff30b102ed2 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 11:15:00 -0500 Subject: [PATCH 007/146] fix linting complaints --- .github/workflows/test-stellar.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index d196cf9ef..444a29364 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -162,7 +162,6 @@ jobs: # run: | # node stellar/gateway approve avalanche 0x32034b47cb29d162d9d803cc405356f4ac0ec07fe847ace431385fe8acf3e6e5-2 0x4F4495243837681061C4743b74B3eEdf548D56A5 wallet 0x1234 - - name: Gateway Call Contract run: node stellar/gateway.js call-contract avalanche 0x4F4495243837681061C4743b74B3eEdf548D56A5 0x1234 @@ -197,7 +196,6 @@ jobs: # - name: is_operator with estimate_cost # run: node stellar/operators.js --action is_operator --args $STELLAR_ADDRESS --estimate-cost - ###### Command: Generate Bindings ##### - name: generate operators bindings run: | From 931d7701b48109521e5a3eb1500b6a279b4c4749 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 11:19:37 -0500 Subject: [PATCH 008/146] modify uses statement .yaml --- .github/workflows/test-stellar.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 444a29364..dc7f0d287 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -47,7 +47,7 @@ jobs: run: npm ci - name: Install stable toolchain - uses: dtolnay/rust-toolchain + uses: dtolnay/rust-toolchain@stable with: toolchain: 1.81.0 From 10f26a0658aab6267a7d3b7754f8f2e690c7f7e6 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 11:31:19 -0500 Subject: [PATCH 009/146] make env vars persistent --- .github/workflows/test-stellar.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index dc7f0d287..ce9bb5bdd 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -72,6 +72,8 @@ jobs: RPC_URL="http://localhost:8000" NETWORK_PASSPHRASE="Standalone Network ; February 2017" + echo "RPC_URL=${RPC_URL}" >> $GITHUB_ENV + echo "NETWORK_PASSPHRASE=${NETWORK_PASSPHRASE}" >> $GITHUB_ENV - name: Add as configured network run: | From 16f147e761805c96f60b2356c50c7183ff255b21 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 11:47:35 -0500 Subject: [PATCH 010/146] cleanup errors in various commands --- .github/workflows/test-stellar.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index ce9bb5bdd..389364795 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -78,14 +78,15 @@ jobs: - name: Add as configured network run: | stellar network add standalone \ - --rpc-url $RPC_URL \ - --network-passphrase $NETWORK_PASSPHRASE + --rpc-url "$RPC_URL" \ + --network-passphrase "$NETWORK_PASSPHRASE" - name: Setup Stellar wallet run: | stellar keys generate test \ - --rpc-url $RPC_URL \ - --network-passphrase $NETWORK_PASSPHRASE + --rpc-url "$RPC_URL" \ + --network-passphrase "$NETWORK_PASSPHRASE" + STELLAR_PRIVATE_KEY=$(stellar keys show test) STELLAR_ADDRESS=$(stellar keys address test) echo "STELLAR_PRIVATE_KEY=${STELLAR_PRIVATE_KEY}" >> $GITHUB_ENV @@ -98,10 +99,10 @@ jobs: "stellar": { "name": "Stellar", "axelarId": "stellar", - "networkType": "localnet", + "networkType": "local", "chainType": "stellar", "tokenSymbol": "XLM", - "rpc": "http://127.0.0.1:8000", + "rpc": "http://127.0.0.1:8000/soroban/rpc", "horizonRpc": "http://127.0.0.1:8000", "contracts": {} } @@ -123,9 +124,8 @@ jobs: # Create .env file with default hardhat private key that's prefunded - name: Prepare .env run: | - echo "PRIVATE_KEY=STELLAR_PRIVATE_KEY" >> .env + echo "PRIVATE_KEY=$STELLAR_PRIVATE_KEY" >> .env echo 'ENV=local' >> .env - # echo 'SKIP_EXISTING = true' >> .env - name: Display local.json run: cat ./axelar-chains-config/info/local.json From 9a692fa1080f41fdb59155ea0a101af09f3fe2cf Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 12:52:55 -0500 Subject: [PATCH 011/146] rename vars + don't double start network the docker container seems to already start the network (port 8000 is taken), so remove that step from the pipeline --- .github/workflows/test-stellar.yaml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 389364795..16521f00f 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -70,14 +70,14 @@ jobs: --enable-soroban-rpc \ --protocol-version 21 - RPC_URL="http://localhost:8000" + RPC_URL="http://localhost:8000/soroban/rpc" NETWORK_PASSPHRASE="Standalone Network ; February 2017" echo "RPC_URL=${RPC_URL}" >> $GITHUB_ENV echo "NETWORK_PASSPHRASE=${NETWORK_PASSPHRASE}" >> $GITHUB_ENV - name: Add as configured network run: | - stellar network add standalone \ + stellar network add local \ --rpc-url "$RPC_URL" \ --network-passphrase "$NETWORK_PASSPHRASE" @@ -109,10 +109,6 @@ jobs: } }' > ./axelar-chains-config/info/local.json - - name: Start Stellar network - run: | - stellar network container start local - - name: Wait for Stellar network uses: nev7n/wait_for_response@v1 with: @@ -121,7 +117,6 @@ jobs: timeout: 60000 interval: 1000 - # Create .env file with default hardhat private key that's prefunded - name: Prepare .env run: | echo "PRIVATE_KEY=$STELLAR_PRIVATE_KEY" >> .env @@ -141,7 +136,7 @@ jobs: run: | stellar contract build --manifest-path=axelar-cgp-soroban/Cargo.toml cd axelar-cgp-soroban - ./optmize.sh + ./optimize.sh cd .. WASM_DIR=axelar-cgp-soroban/target/wasm32-unknown-unknown/release echo "WASM_DIR=${WASM_DIR}" >> $GITHUB_ENV From afdf8588fb07c6ba2a8f2db8b24784c07a8a2f07 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 13:12:21 -0500 Subject: [PATCH 012/146] do not wait for network it makes a head request which doesn't work (for some reason). curl -i works, curl -I does not --- .github/workflows/test-stellar.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 16521f00f..148374165 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -109,14 +109,6 @@ jobs: } }' > ./axelar-chains-config/info/local.json - - name: Wait for Stellar network - uses: nev7n/wait_for_response@v1 - with: - url: 'http://localhost:8000' - responseCode: 200 - timeout: 60000 - interval: 1000 - - name: Prepare .env run: | echo "PRIVATE_KEY=$STELLAR_PRIVATE_KEY" >> .env From 6ea5983ebd44cb887c1c924e4436ce58974a30ff Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 13:46:56 -0500 Subject: [PATCH 013/146] use binary install to save compilation time --- .github/workflows/test-stellar.yaml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 148374165..f35ddd213 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -34,6 +34,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + path: "." - name: Setup Node.js uses: actions/setup-node@v4 @@ -51,17 +53,24 @@ jobs: with: toolchain: 1.81.0 + # install binary to save lengthy compilation time - name: Install Stellar CLI shell: bash run: | - cargo install --locked stellar-cli --features opt --version ~21 - - - name: Pull stellar/quickstart docker image + # query release page to find URL of the latest release of the soroban-cli tool + URL=$(curl -s https://api.github.com/repos/stellar/stellar-cli/releases/latest | jq -r .assets[].browser_download_url | grep 'soroban.*x86_64-unknown-linux') + wget $URL + tar -xzf $(basename $URL) + mkdir bin + mv soroban bin/ + + # the cargo install defines these as aliases, so mimic that behaviour + ln -s bin/soroban bin/stellar + PATH=$PATH:bin/ + + - name: Setup Stellar local network run: | docker pull stellar/quickstart - - - name: Setup Stellar standalone network - run: | docker run -d --rm -it \ -p 8000:8000 \ --name stellar \ From cca6b78b6a4060a846bf27c5f4223411e00d3555 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 13:56:49 -0500 Subject: [PATCH 014/146] properly set path in gh action --- .github/workflows/test-stellar.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index f35ddd213..958fdb6b4 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -53,20 +53,21 @@ jobs: with: toolchain: 1.81.0 - # install binary to save lengthy compilation time + # install binary to avoid lengthy compilation process - name: Install Stellar CLI shell: bash run: | + cargo binstall stellar-cli # query release page to find URL of the latest release of the soroban-cli tool URL=$(curl -s https://api.github.com/repos/stellar/stellar-cli/releases/latest | jq -r .assets[].browser_download_url | grep 'soroban.*x86_64-unknown-linux') - wget $URL + wget -q $URL tar -xzf $(basename $URL) mkdir bin mv soroban bin/ # the cargo install defines these as aliases, so mimic that behaviour ln -s bin/soroban bin/stellar - PATH=$PATH:bin/ + echo "bin" >> $GITHUB_PATH - name: Setup Stellar local network run: | From d31b558fcde72312dce6b225228052f5a9de7f47 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 14:00:00 -0500 Subject: [PATCH 015/146] fix linting error --- .github/workflows/test-stellar.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 958fdb6b4..8e9d7ee55 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -35,7 +35,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - path: "." + path: '.' - name: Setup Node.js uses: actions/setup-node@v4 @@ -57,7 +57,6 @@ jobs: - name: Install Stellar CLI shell: bash run: | - cargo binstall stellar-cli # query release page to find URL of the latest release of the soroban-cli tool URL=$(curl -s https://api.github.com/repos/stellar/stellar-cli/releases/latest | jq -r .assets[].browser_download_url | grep 'soroban.*x86_64-unknown-linux') wget -q $URL From 1b864ca0440b299a774a62a6166351a554d1f0e9 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 14:07:40 -0500 Subject: [PATCH 016/146] absolute path for adding to path --- .github/workflows/test-stellar.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 8e9d7ee55..07c354cf4 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -66,7 +66,7 @@ jobs: # the cargo install defines these as aliases, so mimic that behaviour ln -s bin/soroban bin/stellar - echo "bin" >> $GITHUB_PATH + echo $(readlink -f bin) >> "$GITHUB_PATH" - name: Setup Stellar local network run: | From e621a91cdce62c6712323ccaafdfd26b44ca7798 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 14:16:03 -0500 Subject: [PATCH 017/146] use pwd instead --- .github/workflows/test-stellar.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 07c354cf4..531078fe9 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -66,7 +66,7 @@ jobs: # the cargo install defines these as aliases, so mimic that behaviour ln -s bin/soroban bin/stellar - echo $(readlink -f bin) >> "$GITHUB_PATH" + echo "$PWD/bin" >> "$GITHUB_PATH" - name: Setup Stellar local network run: | From 72e084997429945a5287d9410904beab14672d82 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 14:21:57 -0500 Subject: [PATCH 018/146] cleanup docs + try vague change to make paths work --- .github/workflows/test-stellar.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 531078fe9..75eae5f7b 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -57,16 +57,21 @@ jobs: - name: Install Stellar CLI shell: bash run: | - # query release page to find URL of the latest release of the soroban-cli tool + # Query latest release from official Stellar repo URL=$(curl -s https://api.github.com/repos/stellar/stellar-cli/releases/latest | jq -r .assets[].browser_download_url | grep 'soroban.*x86_64-unknown-linux') + + # download + extract binary wget -q $URL tar -xzf $(basename $URL) + + # setup bin/ directory mkdir bin mv soroban bin/ # the cargo install defines these as aliases, so mimic that behaviour ln -s bin/soroban bin/stellar - echo "$PWD/bin" >> "$GITHUB_PATH" + + echo "${PWD}/bin" >> "${GITHUB_PATH}" - name: Setup Stellar local network run: | From aa323442d40041d9ac9ce8a3281a883f96b33e2c Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 14:23:49 -0500 Subject: [PATCH 019/146] use github workspace instead --- .github/workflows/test-stellar.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 75eae5f7b..bf4ba87fa 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -71,7 +71,7 @@ jobs: # the cargo install defines these as aliases, so mimic that behaviour ln -s bin/soroban bin/stellar - echo "${PWD}/bin" >> "${GITHUB_PATH}" + echo "$GITHUB_WORKSPACE/bin" >> "${GITHUB_PATH}" - name: Setup Stellar local network run: | From 1d2b132c52ecdadc6e23f3d85ed24582c8dd85f7 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 14:31:19 -0500 Subject: [PATCH 020/146] debugging --- .github/workflows/test-stellar.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index bf4ba87fa..0c388063a 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -91,6 +91,9 @@ jobs: - name: Add as configured network run: | + ls + echo $GITHUB_PATH + echo $PATH stellar network add local \ --rpc-url "$RPC_URL" \ --network-passphrase "$NETWORK_PASSPHRASE" From 187b2898b67e7796ed808b8e61d213d8f455ca61 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 14:35:10 -0500 Subject: [PATCH 021/146] more debugging --- .github/workflows/test-stellar.yaml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 0c388063a..c6d7a3ac2 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -73,6 +73,22 @@ jobs: echo "$GITHUB_WORKSPACE/bin" >> "${GITHUB_PATH}" + # test if it works + + stellar --version + + - name: Add as configured network + run: | + ls + ls bin/ + echo $GITHUB_PATH + echo $PATH + echo $PWD + echo $GITHUB_WORKSPACE + stellar network add local \ + --rpc-url "$RPC_URL" \ + --network-passphrase "$NETWORK_PASSPHRASE" + - name: Setup Stellar local network run: | docker pull stellar/quickstart @@ -89,14 +105,6 @@ jobs: echo "RPC_URL=${RPC_URL}" >> $GITHUB_ENV echo "NETWORK_PASSPHRASE=${NETWORK_PASSPHRASE}" >> $GITHUB_ENV - - name: Add as configured network - run: | - ls - echo $GITHUB_PATH - echo $PATH - stellar network add local \ - --rpc-url "$RPC_URL" \ - --network-passphrase "$NETWORK_PASSPHRASE" - name: Setup Stellar wallet run: | From 519380ff33d795c6484e63729d94c8dafdac9fa2 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 14:36:51 -0500 Subject: [PATCH 022/146] remove failing comp --- .github/workflows/test-stellar.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index c6d7a3ac2..9f887516b 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -73,10 +73,6 @@ jobs: echo "$GITHUB_WORKSPACE/bin" >> "${GITHUB_PATH}" - # test if it works - - stellar --version - - name: Add as configured network run: | ls From 06bf4a766a59cbeef77b5f44d6813750270a99d4 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 14:47:38 -0500 Subject: [PATCH 023/146] just trying anything --- .github/workflows/test-stellar.yaml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 9f887516b..a7d1b4c08 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -37,6 +37,11 @@ jobs: with: path: '.' + - name: Checkout axelar-cgp-soroban repo + uses: actions/checkout@v4 + with: + repository: axelarnetwork/axelar-cgp-soroban + - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -71,9 +76,12 @@ jobs: # the cargo install defines these as aliases, so mimic that behaviour ln -s bin/soroban bin/stellar - echo "$GITHUB_WORKSPACE/bin" >> "${GITHUB_PATH}" + echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH + echo "$GITHUB_WORKSPACE/bin/stellar" >> $GITHUB_PATH + echo "$GITHUB_WORKSPACE/bin/soroban" >> $GITHUB_PATH - name: Add as configured network + shell: bash run: | ls ls bin/ @@ -140,11 +148,6 @@ jobs: ###### Compile Wasm Contracts ###### - - name: Checkout axelar-cgp-soroban repo - uses: actions/checkout@v4 - with: - repository: axelarnetwork/axelar-cgp-soroban - - name: Compile WASM contracts run: | stellar contract build --manifest-path=axelar-cgp-soroban/Cargo.toml From ccd3cba9a28ffd138dab438a9c168985e886f0ec Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 15:01:08 -0500 Subject: [PATCH 024/146] setup nested repo --- .github/workflows/test-stellar.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index a7d1b4c08..906c596de 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -34,13 +34,12 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - with: - path: '.' - name: Checkout axelar-cgp-soroban repo uses: actions/checkout@v4 with: repository: axelarnetwork/axelar-cgp-soroban + path: axelar-cgp-soroban - name: Setup Node.js uses: actions/setup-node@v4 @@ -109,7 +108,6 @@ jobs: echo "RPC_URL=${RPC_URL}" >> $GITHUB_ENV echo "NETWORK_PASSPHRASE=${NETWORK_PASSPHRASE}" >> $GITHUB_ENV - - name: Setup Stellar wallet run: | stellar keys generate test \ From b73971b36b393a841111afa2a9d5b835e28e2bf8 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 15:04:51 -0500 Subject: [PATCH 025/146] give up on it --- .github/workflows/test-stellar.yaml | 31 ++++++++++++++++------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 906c596de..1facd5608 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -79,19 +79,6 @@ jobs: echo "$GITHUB_WORKSPACE/bin/stellar" >> $GITHUB_PATH echo "$GITHUB_WORKSPACE/bin/soroban" >> $GITHUB_PATH - - name: Add as configured network - shell: bash - run: | - ls - ls bin/ - echo $GITHUB_PATH - echo $PATH - echo $PWD - echo $GITHUB_WORKSPACE - stellar network add local \ - --rpc-url "$RPC_URL" \ - --network-passphrase "$NETWORK_PASSPHRASE" - - name: Setup Stellar local network run: | docker pull stellar/quickstart @@ -108,8 +95,17 @@ jobs: echo "RPC_URL=${RPC_URL}" >> $GITHUB_ENV echo "NETWORK_PASSPHRASE=${NETWORK_PASSPHRASE}" >> $GITHUB_ENV + - name: Add as configured network + shell: bash + run: | + PATH=$PATH:$PWD/bin/ + stellar network add local \ + --rpc-url "$RPC_URL" \ + --network-passphrase "$NETWORK_PASSPHRASE" + - name: Setup Stellar wallet run: | + PATH=$PATH:$PWD/bin/ stellar keys generate test \ --rpc-url "$RPC_URL" \ --network-passphrase "$NETWORK_PASSPHRASE" @@ -148,6 +144,7 @@ jobs: - name: Compile WASM contracts run: | + PATH=$PATH:$PWD/bin/ stellar contract build --manifest-path=axelar-cgp-soroban/Cargo.toml cd axelar-cgp-soroban ./optimize.sh @@ -159,11 +156,13 @@ jobs: - name: Deploy axelar_gateway run: | + PATH=$PATH:$PWD/bin/ CONTRACT=axelar_gateway node stellar/deploy-contract deploy $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm --initialize - name: Deploy axelar_operators run: | + PATH=$PATH:$PWD/bin/ CONTRACT=axelar_operators node stellar/deploy-contract deploy $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm --initialize @@ -174,15 +173,19 @@ jobs: # node stellar/gateway approve avalanche 0x32034b47cb29d162d9d803cc405356f4ac0ec07fe847ace431385fe8acf3e6e5-2 0x4F4495243837681061C4743b74B3eEdf548D56A5 wallet 0x1234 - name: Gateway Call Contract - run: node stellar/gateway.js call-contract avalanche 0x4F4495243837681061C4743b74B3eEdf548D56A5 0x1234 + run: | + PATH=$PATH:$PWD/bin/ + node stellar/gateway.js call-contract avalanche 0x4F4495243837681061C4743b74B3eEdf548D56A5 0x1234 - name: Gateway Rotate Signers run: | + PATH=$PATH:$PWD/bin/ node stellar/gateway rotate --new-nonce test --signers wallet node stellar/gateway rotate --new-nonce test2 --current-nonce test --signers wallet - name: Upgrade gateway contract run: | + PATH=$PATH:$PWD/bin/ CONTRACT=axelar_gateway node stellar/deploy-contract.js upgrade $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm From e44d82cb7ef054f9de7881a86322ee360735d10d Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 15:18:46 -0500 Subject: [PATCH 026/146] don't use relative path for symlink --- .github/workflows/test-stellar.yaml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 1facd5608..09d3b97ca 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -73,11 +73,9 @@ jobs: mv soroban bin/ # the cargo install defines these as aliases, so mimic that behaviour - ln -s bin/soroban bin/stellar + ln -s $PWD/bin/soroban bin/stellar echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH - echo "$GITHUB_WORKSPACE/bin/stellar" >> $GITHUB_PATH - echo "$GITHUB_WORKSPACE/bin/soroban" >> $GITHUB_PATH - name: Setup Stellar local network run: | @@ -98,14 +96,12 @@ jobs: - name: Add as configured network shell: bash run: | - PATH=$PATH:$PWD/bin/ stellar network add local \ --rpc-url "$RPC_URL" \ --network-passphrase "$NETWORK_PASSPHRASE" - name: Setup Stellar wallet run: | - PATH=$PATH:$PWD/bin/ stellar keys generate test \ --rpc-url "$RPC_URL" \ --network-passphrase "$NETWORK_PASSPHRASE" @@ -144,7 +140,6 @@ jobs: - name: Compile WASM contracts run: | - PATH=$PATH:$PWD/bin/ stellar contract build --manifest-path=axelar-cgp-soroban/Cargo.toml cd axelar-cgp-soroban ./optimize.sh @@ -156,13 +151,11 @@ jobs: - name: Deploy axelar_gateway run: | - PATH=$PATH:$PWD/bin/ CONTRACT=axelar_gateway node stellar/deploy-contract deploy $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm --initialize - name: Deploy axelar_operators run: | - PATH=$PATH:$PWD/bin/ CONTRACT=axelar_operators node stellar/deploy-contract deploy $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm --initialize @@ -173,19 +166,15 @@ jobs: # node stellar/gateway approve avalanche 0x32034b47cb29d162d9d803cc405356f4ac0ec07fe847ace431385fe8acf3e6e5-2 0x4F4495243837681061C4743b74B3eEdf548D56A5 wallet 0x1234 - name: Gateway Call Contract - run: | - PATH=$PATH:$PWD/bin/ - node stellar/gateway.js call-contract avalanche 0x4F4495243837681061C4743b74B3eEdf548D56A5 0x1234 + run: node stellar/gateway.js call-contract avalanche 0x4F4495243837681061C4743b74B3eEdf548D56A5 0x1234 - name: Gateway Rotate Signers run: | - PATH=$PATH:$PWD/bin/ node stellar/gateway rotate --new-nonce test --signers wallet node stellar/gateway rotate --new-nonce test2 --current-nonce test --signers wallet - name: Upgrade gateway contract run: | - PATH=$PATH:$PWD/bin/ CONTRACT=axelar_gateway node stellar/deploy-contract.js upgrade $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm From bc86cd1f078d25f5942ddea9977e9725adc4d0d9 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 15:22:00 -0500 Subject: [PATCH 027/146] add missing target for rust + docs --- .github/workflows/test-stellar.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 09d3b97ca..10866c0be 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -32,6 +32,12 @@ jobs: if: ${{ needs.check-relevant-changes.outputs.run_tests == 'true' }} runs-on: blacksmith-2vcpu-ubuntu-2204 steps: + + # this sets up nested repos: https://github.com/actions/checkout?tab=readme-ov-file#checkout-multiple-repos-nested + # axelar-contract-deployments + # - axelar-cgp-soroban + # + # future steps depend on this directory structure - name: Checkout code uses: actions/checkout@v4 @@ -56,6 +62,7 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.81.0 + targets: wasm32-unknown-unknown # install binary to avoid lengthy compilation process - name: Install Stellar CLI From 84ff7635ead259d8d8368d42ed4680cd1d591060 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 15:31:33 -0500 Subject: [PATCH 028/146] inspect .env --- .github/workflows/test-stellar.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 10866c0be..2b0a62220 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -32,7 +32,6 @@ jobs: if: ${{ needs.check-relevant-changes.outputs.run_tests == 'true' }} runs-on: blacksmith-2vcpu-ubuntu-2204 steps: - # this sets up nested repos: https://github.com/actions/checkout?tab=readme-ov-file#checkout-multiple-repos-nested # axelar-contract-deployments # - axelar-cgp-soroban @@ -153,6 +152,7 @@ jobs: cd .. WASM_DIR=axelar-cgp-soroban/target/wasm32-unknown-unknown/release echo "WASM_DIR=${WASM_DIR}" >> $GITHUB_ENV + cat .env ###### Command: Deploy Contract ###### From 3b65c214d9f3ca899f6ceb493fd625f1c5f7db04 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 16:18:10 -0500 Subject: [PATCH 029/146] switch order around --- .github/workflows/test-stellar.yaml | 34 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 2b0a62220..2d06aaf80 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -106,17 +106,6 @@ jobs: --rpc-url "$RPC_URL" \ --network-passphrase "$NETWORK_PASSPHRASE" - - name: Setup Stellar wallet - run: | - stellar keys generate test \ - --rpc-url "$RPC_URL" \ - --network-passphrase "$NETWORK_PASSPHRASE" - - STELLAR_PRIVATE_KEY=$(stellar keys show test) - STELLAR_ADDRESS=$(stellar keys address test) - echo "STELLAR_PRIVATE_KEY=${STELLAR_PRIVATE_KEY}" >> $GITHUB_ENV - echo "STELLAR_ADDRESS=${STELLAR_ADDRESS}" >> $GITHUB_ENV - - name: Prepare local.json run: | echo '{ @@ -134,11 +123,6 @@ jobs: } }' > ./axelar-chains-config/info/local.json - - name: Prepare .env - run: | - echo "PRIVATE_KEY=$STELLAR_PRIVATE_KEY" >> .env - echo 'ENV=local' >> .env - - name: Display local.json run: cat ./axelar-chains-config/info/local.json @@ -152,10 +136,24 @@ jobs: cd .. WASM_DIR=axelar-cgp-soroban/target/wasm32-unknown-unknown/release echo "WASM_DIR=${WASM_DIR}" >> $GITHUB_ENV - cat .env - ###### Command: Deploy Contract ###### + - name: Setup Stellar wallet + run: | + stellar keys generate test \ + --rpc-url "$RPC_URL" \ + --network-passphrase "$NETWORK_PASSPHRASE" + + STELLAR_PRIVATE_KEY=$(stellar keys show test) + STELLAR_ADDRESS=$(stellar keys address test) + echo "STELLAR_PRIVATE_KEY=${STELLAR_PRIVATE_KEY}" >> $GITHUB_ENV + echo "STELLAR_ADDRESS=${STELLAR_ADDRESS}" >> $GITHUB_ENV + - name: Prepare .env + run: | + echo "PRIVATE_KEY = '$STELLAR_PRIVATE_KEY'" >> .env + echo "ENV = 'local'" >> .env + + ###### Command: Deploy Contract ###### - name: Deploy axelar_gateway run: | CONTRACT=axelar_gateway From 7df3f61ecad1b00f8f35df9c4b03eef087dce844 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 16:50:28 -0500 Subject: [PATCH 030/146] yes env to skip confirmation --- .github/workflows/test-stellar.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 2d06aaf80..8e10d4392 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -152,6 +152,7 @@ jobs: run: | echo "PRIVATE_KEY = '$STELLAR_PRIVATE_KEY'" >> .env echo "ENV = 'local'" >> .env + echo "YES = 'true'" ###### Command: Deploy Contract ###### - name: Deploy axelar_gateway From 76e910c31ed1d846cf236a9816976872c6fe1474 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 16:56:07 -0500 Subject: [PATCH 031/146] put it in the env --- .github/workflows/test-stellar.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 8e10d4392..9f0920741 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -152,7 +152,7 @@ jobs: run: | echo "PRIVATE_KEY = '$STELLAR_PRIVATE_KEY'" >> .env echo "ENV = 'local'" >> .env - echo "YES = 'true'" + echo "YES = 'true'" >> .env ###### Command: Deploy Contract ###### - name: Deploy axelar_gateway From 56bbf73502e674e460abe274d5429fd89526c008 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 7 Nov 2024 17:16:33 -0500 Subject: [PATCH 032/146] comment out misbehaving lines --- .github/workflows/test-stellar.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 9f0920741..f05438dc5 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -195,11 +195,13 @@ jobs: - name: Execute remove_operator action run: node stellar/operators.js --action remove_operator --args $STELLAR_ADDRESS - - name: Execute refund action - run: node stellar/operators.js --action refund + # TODO: needs gas-service contract + # - name: Execute refund action + # run: node stellar/operators.js --action refund - - name: Execute execute action - run: node stellar/operators.js --action execute + # FIXME: find proper way to execute this + # - name: Execute execute action + # run: node stellar/operators.js --action execute --target $STELLAR_ADDRESS --method "is_operator" # TODO: currently fails # - name: is_operator with estimate_cost From 09dcf8ab13d7b48b53644e731447f5fd5cabd8c4 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Mon, 25 Nov 2024 11:22:51 -0500 Subject: [PATCH 033/146] update protocol version --- .github/workflows/test-stellar.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index f05438dc5..c9735bc21 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -33,6 +33,7 @@ jobs: runs-on: blacksmith-2vcpu-ubuntu-2204 steps: # this sets up nested repos: https://github.com/actions/checkout?tab=readme-ov-file#checkout-multiple-repos-nested + # # axelar-contract-deployments # - axelar-cgp-soroban # @@ -92,7 +93,7 @@ jobs: stellar/quickstart:testing \ --local \ --enable-soroban-rpc \ - --protocol-version 21 + --protocol-version 22 RPC_URL="http://localhost:8000/soroban/rpc" NETWORK_PASSPHRASE="Standalone Network ; February 2017" From b92c7ae6133e32c08110b42bd30f2285e8ff3c0b Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Mon, 25 Nov 2024 11:46:47 -0500 Subject: [PATCH 034/146] add explicit funding for stellar wallet eventually `generate` will not fund by default, so do it manually + depend on the faucet to do so --- .github/workflows/test-stellar.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index c9735bc21..b82dac1bb 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -132,9 +132,11 @@ jobs: - name: Compile WASM contracts run: | stellar contract build --manifest-path=axelar-cgp-soroban/Cargo.toml + cd axelar-cgp-soroban ./optimize.sh cd .. + WASM_DIR=axelar-cgp-soroban/target/wasm32-unknown-unknown/release echo "WASM_DIR=${WASM_DIR}" >> $GITHUB_ENV @@ -149,6 +151,9 @@ jobs: echo "STELLAR_PRIVATE_KEY=${STELLAR_PRIVATE_KEY}" >> $GITHUB_ENV echo "STELLAR_ADDRESS=${STELLAR_ADDRESS}" >> $GITHUB_ENV + - name: Fund Stellar wallet + run: node stellar/faucet --recipient $STELLAR_ADDRESS + - name: Prepare .env run: | echo "PRIVATE_KEY = '$STELLAR_PRIVATE_KEY'" >> .env From 38227fa5a23974bdb9e76d30d702ca274486def6 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Mon, 25 Nov 2024 14:51:56 -0500 Subject: [PATCH 035/146] pull stellar not soroban --- .github/workflows/test-stellar.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index b82dac1bb..1f283fd0f 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -69,7 +69,7 @@ jobs: shell: bash run: | # Query latest release from official Stellar repo - URL=$(curl -s https://api.github.com/repos/stellar/stellar-cli/releases/latest | jq -r .assets[].browser_download_url | grep 'soroban.*x86_64-unknown-linux') + URL=$(curl -s https://api.github.com/repos/stellar/stellar-cli/releases/latest | jq -r .assets[].browser_download_url | grep 'stellar.*x86_64-unknown-linux') # download + extract binary wget -q $URL From 4f3d91096f8c87a05be93d6e342685fe6540ccdd Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Tue, 26 Nov 2024 10:08:18 -0500 Subject: [PATCH 036/146] install sellar cli properly --- .github/workflows/test-stellar.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 1f283fd0f..e0ea6027d 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -68,6 +68,10 @@ jobs: - name: Install Stellar CLI shell: bash run: | + # setup bin/ directory + mkdir bin + cd bin + # Query latest release from official Stellar repo URL=$(curl -s https://api.github.com/repos/stellar/stellar-cli/releases/latest | jq -r .assets[].browser_download_url | grep 'stellar.*x86_64-unknown-linux') @@ -75,13 +79,6 @@ jobs: wget -q $URL tar -xzf $(basename $URL) - # setup bin/ directory - mkdir bin - mv soroban bin/ - - # the cargo install defines these as aliases, so mimic that behaviour - ln -s $PWD/bin/soroban bin/stellar - echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH - name: Setup Stellar local network From 59462c48cb1c64f8d46e3f1e56b29994a1719eb2 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Wed, 11 Dec 2024 11:07:14 -0500 Subject: [PATCH 037/146] accomodate pulling from CF --- .github/workflows/test-stellar.yaml | 30 +++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index e0ea6027d..8fb830a6f 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -124,17 +124,31 @@ jobs: - name: Display local.json run: cat ./axelar-chains-config/info/local.json - ###### Compile Wasm Contracts ###### - - - name: Compile WASM contracts + ###### Acquire WASM Contracts ###### + - name: Configure CF credentials + run: | + cd $HOME; mkdir ~/.aws; touch ~/.aws/credentials; touch ~/.aws/config + echo "[default] + aws_access_key_id = ${{ secrets.cf-bucket-access-key-id }} + aws_secret_access_key = ${{ secrets.cf-bucket-secret-access-key }}" > ~/.aws/credentials + echo "[default] + region=auto + output=json" > ~/.aws/config + + - name: Fetch WASM contracts from CF + env: + S3_BUCKET_NAME: ${{ vars.CF_BUCKET_NAME }} + ENDPOINT_URL: ${{ secrets.cf-endpoint-url }} + CF_BUCKET_ROOT_KEY: ${{ vars.CF_BUCKET_ROOT_KEY }} run: | - stellar contract build --manifest-path=axelar-cgp-soroban/Cargo.toml + export CF_WASM_BUCKET_ROOT_KEY="${CF_BUCKET_ROOT_KEY}/${{ env.PACKAGE_NAME }}/${{ env.PACKAGE_VERSION }}/wasm" + for name in axelar_gateway axelar_operators axelar_gas_service; do + aws s3api get-object --bucket $S3_BUCKET_NAME --key "$CF_WASM_BUCKET_ROOT_KEY/$FILE_KEY" --body "$name.optimized.wasm" --acl public-read --endpoint-url $ENDPOINT_URL + done - cd axelar-cgp-soroban - ./optimize.sh - cd .. + ls - WASM_DIR=axelar-cgp-soroban/target/wasm32-unknown-unknown/release + WASM_DIR=./ echo "WASM_DIR=${WASM_DIR}" >> $GITHUB_ENV - name: Setup Stellar wallet From e06b235e979b5abe792a594f1390e8c745f51be7 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Fri, 13 Dec 2024 11:04:08 -0500 Subject: [PATCH 038/146] add version file + update for changes --- .github/workflows/test-stellar.yaml | 6 ++++-- stellar/version | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 stellar/version diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 8fb830a6f..65c6760dc 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -141,9 +141,11 @@ jobs: ENDPOINT_URL: ${{ secrets.cf-endpoint-url }} CF_BUCKET_ROOT_KEY: ${{ vars.CF_BUCKET_ROOT_KEY }} run: | - export CF_WASM_BUCKET_ROOT_KEY="${CF_BUCKET_ROOT_KEY}/${{ env.PACKAGE_NAME }}/${{ env.PACKAGE_VERSION }}/wasm" + PACKAGE_VERSION=${cat stellar/version} for name in axelar_gateway axelar_operators axelar_gas_service; do - aws s3api get-object --bucket $S3_BUCKET_NAME --key "$CF_WASM_BUCKET_ROOT_KEY/$FILE_KEY" --body "$name.optimized.wasm" --acl public-read --endpoint-url $ENDPOINT_URL + CF_WASM_BUCKET_ROOT_KEY="${CF_BUCKET_ROOT_KEY}/$name/$PACKAGE_VERSION/wasm" + FILE_KEY=axelar-cgp-soroban-wasm-$name-$PACKAGE_VERSION + aws s3api get-object --bucket $S3_BUCKET_NAME --key "$CF_WASM_BUCKET_ROOT_KEY/$FILE_KEY" --acl public-read --endpoint-url $ENDPOINT_URL done ls diff --git a/stellar/version b/stellar/version new file mode 100644 index 000000000..7da0a9528 --- /dev/null +++ b/stellar/version @@ -0,0 +1 @@ +a90ac0b9d2d66533f32df8a9e5e15e483ec59c5d From e6533e20514a498d8e0bd86c27af1bd3f92be590 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Fri, 13 Dec 2024 11:08:12 -0500 Subject: [PATCH 039/146] remove --initialize --- .github/workflows/test-stellar.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 65c6760dc..d698a9262 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -177,12 +177,12 @@ jobs: - name: Deploy axelar_gateway run: | CONTRACT=axelar_gateway - node stellar/deploy-contract deploy $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm --initialize + node stellar/deploy-contract deploy $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm - name: Deploy axelar_operators run: | CONTRACT=axelar_operators - node stellar/deploy-contract deploy $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm --initialize + node stellar/deploy-contract deploy $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm ###### Command: Gateway ###### # FIXME: From 66db0f755d2766f3374a3606c50f3a0f8410cc2b Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Fri, 13 Dec 2024 11:08:59 -0500 Subject: [PATCH 040/146] add more contract names --- .github/workflows/test-stellar.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index d698a9262..7a3cc4725 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -142,7 +142,7 @@ jobs: CF_BUCKET_ROOT_KEY: ${{ vars.CF_BUCKET_ROOT_KEY }} run: | PACKAGE_VERSION=${cat stellar/version} - for name in axelar_gateway axelar_operators axelar_gas_service; do + for name in axelar_gateway axelar_operators axelar_gas_service interchain_token interchain_token_service example; do CF_WASM_BUCKET_ROOT_KEY="${CF_BUCKET_ROOT_KEY}/$name/$PACKAGE_VERSION/wasm" FILE_KEY=axelar-cgp-soroban-wasm-$name-$PACKAGE_VERSION aws s3api get-object --bucket $S3_BUCKET_NAME --key "$CF_WASM_BUCKET_ROOT_KEY/$FILE_KEY" --acl public-read --endpoint-url $ENDPOINT_URL From dcd889e22c58f167f3347ba571a53a9391310a50 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 19 Dec 2024 11:42:48 -0500 Subject: [PATCH 041/146] named variable + use () for cat --- .github/workflows/test-stellar.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 7a3cc4725..7e3bb85df 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -141,8 +141,9 @@ jobs: ENDPOINT_URL: ${{ secrets.cf-endpoint-url }} CF_BUCKET_ROOT_KEY: ${{ vars.CF_BUCKET_ROOT_KEY }} run: | - PACKAGE_VERSION=${cat stellar/version} - for name in axelar_gateway axelar_operators axelar_gas_service interchain_token interchain_token_service example; do + PACKAGE_VERSION=$(cat stellar/version) + CONTRACTS=("axelar_gateway" "axelar_operators" "axelar_gas_service" "interchain_token" "interchain_token_service" "example") + for name in CONTRACTS; do CF_WASM_BUCKET_ROOT_KEY="${CF_BUCKET_ROOT_KEY}/$name/$PACKAGE_VERSION/wasm" FILE_KEY=axelar-cgp-soroban-wasm-$name-$PACKAGE_VERSION aws s3api get-object --bucket $S3_BUCKET_NAME --key "$CF_WASM_BUCKET_ROOT_KEY/$FILE_KEY" --acl public-read --endpoint-url $ENDPOINT_URL From abd26c1858ce9559aca390f87af1e949abe43eb7 Mon Sep 17 00:00:00 2001 From: Laith Bahodi Date: Thu, 19 Dec 2024 11:46:34 -0500 Subject: [PATCH 042/146] same variable formatting --- .github/workflows/test-stellar.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 7e3bb85df..e8f044348 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -138,7 +138,7 @@ jobs: - name: Fetch WASM contracts from CF env: S3_BUCKET_NAME: ${{ vars.CF_BUCKET_NAME }} - ENDPOINT_URL: ${{ secrets.cf-endpoint-url }} + ENDPOINT_URL: ${{ secrets.CF-ENDPOINT-URL }} CF_BUCKET_ROOT_KEY: ${{ vars.CF_BUCKET_ROOT_KEY }} run: | PACKAGE_VERSION=$(cat stellar/version) From 627f75ce61158bffdfdf2ecba45cca68d4770990 Mon Sep 17 00:00:00 2001 From: ahramy Date: Mon, 31 Mar 2025 21:52:48 -0700 Subject: [PATCH 043/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 53 ++++++++++++----------------- 1 file changed, 21 insertions(+), 32 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index e8f044348..889e2d358 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -35,17 +35,17 @@ jobs: # this sets up nested repos: https://github.com/actions/checkout?tab=readme-ov-file#checkout-multiple-repos-nested # # axelar-contract-deployments - # - axelar-cgp-soroban + # - axelar-amplifier-stellar # # future steps depend on this directory structure - name: Checkout code uses: actions/checkout@v4 - - name: Checkout axelar-cgp-soroban repo + - name: Checkout axelar-amplifier-stellar repo uses: actions/checkout@v4 with: - repository: axelarnetwork/axelar-cgp-soroban - path: axelar-cgp-soroban + repository: axelarnetwork/axelar-amplifier-stellar + path: axelar-amplifier-stellar - name: Setup Node.js uses: actions/setup-node@v4 @@ -142,10 +142,10 @@ jobs: CF_BUCKET_ROOT_KEY: ${{ vars.CF_BUCKET_ROOT_KEY }} run: | PACKAGE_VERSION=$(cat stellar/version) - CONTRACTS=("axelar_gateway" "axelar_operators" "axelar_gas_service" "interchain_token" "interchain_token_service" "example") + CONTRACTS=("AxelarExample" "AxelarGasService" "AxelarGateway" "AxelarOperators" "InterchainToken "InterchainTokenService" "TokenManager" "Upgrader") for name in CONTRACTS; do CF_WASM_BUCKET_ROOT_KEY="${CF_BUCKET_ROOT_KEY}/$name/$PACKAGE_VERSION/wasm" - FILE_KEY=axelar-cgp-soroban-wasm-$name-$PACKAGE_VERSION + FILE_KEY=axelar-amplifier-stellar-wasm-$name-$PACKAGE_VERSION aws s3api get-object --bucket $S3_BUCKET_NAME --key "$CF_WASM_BUCKET_ROOT_KEY/$FILE_KEY" --acl public-read --endpoint-url $ENDPOINT_URL done @@ -175,14 +175,19 @@ jobs: echo "YES = 'true'" >> .env ###### Command: Deploy Contract ###### - - name: Deploy axelar_gateway + - name: Deploy AxelarOperators run: | - CONTRACT=axelar_gateway + CONTRACT=AxelarOperators node stellar/deploy-contract deploy $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm - - name: Deploy axelar_operators + - name: Deploy AxelarGasService run: | - CONTRACT=axelar_operators + CONTRACT=AxelarGasService + node stellar/deploy-contract deploy $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm + + - name: Deploy AxelarGateway + run: | + CONTRACT=AxelarGateway node stellar/deploy-contract deploy $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm ###### Command: Gateway ###### @@ -199,21 +204,16 @@ jobs: node stellar/gateway rotate --new-nonce test --signers wallet node stellar/gateway rotate --new-nonce test2 --current-nonce test --signers wallet - - name: Upgrade gateway contract - run: | - CONTRACT=axelar_gateway - node stellar/deploy-contract.js upgrade $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm - ###### Command: Operators ###### - - name: Execute is_operator action - run: node stellar/operators.js --action is_operator --args $STELLAR_ADDRESS + - name: Execute is operator + run: node stellar/operators.js is-operator $STELLAR_ADDRESS - - name: Execute add_operator action - run: node stellar/operators.js --action add_operator --args $STELLAR_ADDRESS + - name: Execute add operator + run: node stellar/operators.js add-operator $STELLAR_ADDRESS - - name: Execute remove_operator action - run: node stellar/operators.js --action remove_operator --args $STELLAR_ADDRESS + - name: Execute remove operator + run: node stellar/operators.js remove-operator $STELLAR_ADDRESS # TODO: needs gas-service contract # - name: Execute refund action @@ -226,14 +226,3 @@ jobs: # TODO: currently fails # - name: is_operator with estimate_cost # run: node stellar/operators.js --action is_operator --args $STELLAR_ADDRESS --estimate-cost - - ###### Command: Generate Bindings ##### - - name: generate operators bindings - run: | - CONTRACT=axelar_operators - node stellar/generate-bindings.js --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm --contract-id $(jq .chains.stellar.contracts.$CONTRACT.address axelar-chains-config/info/local.json) --output-dir ./stellar/bindings/$CONTRACT - - - name: generate gateway bindings - run: | - CONTRACT=axelar_gateway - node stellar/generate-bindings.js --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm --contract-id $(jq .chains.stellar.contracts.$CONTRACT.address axelar-chains-config/info/local.json) --output-dir ./stellar/bindings/$CONTRACT From 822e6ec351297f2b353c20f74031a40bf862e906 Mon Sep 17 00:00:00 2001 From: ahramy Date: Mon, 31 Mar 2025 22:09:31 -0700 Subject: [PATCH 044/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 60 +++++++++++++---------------- 1 file changed, 27 insertions(+), 33 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 889e2d358..f89ce3d6c 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -114,6 +114,7 @@ jobs: "networkType": "local", "chainType": "stellar", "tokenSymbol": "XLM", + "tokenAddress": "CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC", "rpc": "http://127.0.0.1:8000/soroban/rpc", "horizonRpc": "http://127.0.0.1:8000", "contracts": {} @@ -124,34 +125,9 @@ jobs: - name: Display local.json run: cat ./axelar-chains-config/info/local.json - ###### Acquire WASM Contracts ###### - - name: Configure CF credentials + - name: Setup Wasm Directory run: | - cd $HOME; mkdir ~/.aws; touch ~/.aws/credentials; touch ~/.aws/config - echo "[default] - aws_access_key_id = ${{ secrets.cf-bucket-access-key-id }} - aws_secret_access_key = ${{ secrets.cf-bucket-secret-access-key }}" > ~/.aws/credentials - echo "[default] - region=auto - output=json" > ~/.aws/config - - - name: Fetch WASM contracts from CF - env: - S3_BUCKET_NAME: ${{ vars.CF_BUCKET_NAME }} - ENDPOINT_URL: ${{ secrets.CF-ENDPOINT-URL }} - CF_BUCKET_ROOT_KEY: ${{ vars.CF_BUCKET_ROOT_KEY }} - run: | - PACKAGE_VERSION=$(cat stellar/version) - CONTRACTS=("AxelarExample" "AxelarGasService" "AxelarGateway" "AxelarOperators" "InterchainToken "InterchainTokenService" "TokenManager" "Upgrader") - for name in CONTRACTS; do - CF_WASM_BUCKET_ROOT_KEY="${CF_BUCKET_ROOT_KEY}/$name/$PACKAGE_VERSION/wasm" - FILE_KEY=axelar-amplifier-stellar-wasm-$name-$PACKAGE_VERSION - aws s3api get-object --bucket $S3_BUCKET_NAME --key "$CF_WASM_BUCKET_ROOT_KEY/$FILE_KEY" --acl public-read --endpoint-url $ENDPOINT_URL - done - - ls - - WASM_DIR=./ + WASM_DIR=target/wasm32-unknown-unknown/release echo "WASM_DIR=${WASM_DIR}" >> $GITHUB_ENV - name: Setup Stellar wallet @@ -174,6 +150,24 @@ jobs: echo "ENV = 'local'" >> .env echo "YES = 'true'" >> .env + - name: Build all contracts + run: | + # Install Stellar CLI compatible with the soroban-sdk version in Cargo.toml + cargo install --locked stellar-cli --version 22.2.0 --features opt + + # Build all contracts + stellar contract build + ./optimize.sh + + # Process in the release directory + cd target/wasm32-unknown-unknown/release + + # Remove unoptimized files and rename optimized ones + # This ensures we only keep the optimized versions + find . -type f -name "*.wasm" ! -name "*.optimized.wasm" -maxdepth 1 -delete + find . -name "*.optimized.wasm" -maxdepth 1 -exec sh -c 'mv "$0" "${0%.optimized.wasm}.wasm"' {} \; + find . -type f ! -name "*.wasm" -delete + ###### Command: Deploy Contract ###### - name: Deploy AxelarOperators run: | @@ -196,13 +190,13 @@ jobs: # run: | # node stellar/gateway approve avalanche 0x32034b47cb29d162d9d803cc405356f4ac0ec07fe847ace431385fe8acf3e6e5-2 0x4F4495243837681061C4743b74B3eEdf548D56A5 wallet 0x1234 - - name: Gateway Call Contract - run: node stellar/gateway.js call-contract avalanche 0x4F4495243837681061C4743b74B3eEdf548D56A5 0x1234 + # - name: Gateway Call Contract + # run: node stellar/gateway.js call-contract avalanche 0x4F4495243837681061C4743b74B3eEdf548D56A5 0x1234 - - name: Gateway Rotate Signers - run: | - node stellar/gateway rotate --new-nonce test --signers wallet - node stellar/gateway rotate --new-nonce test2 --current-nonce test --signers wallet + # - name: Gateway Rotate Signers + # run: | + # node stellar/gateway rotate --new-nonce test --signers wallet + # node stellar/gateway rotate --new-nonce test2 --current-nonce test --signers wallet ###### Command: Operators ###### From b7112472ed811d2162e9f76e82959dbf229dcc44 Mon Sep 17 00:00:00 2001 From: ahramy Date: Mon, 31 Mar 2025 22:13:06 -0700 Subject: [PATCH 045/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index f89ce3d6c..3b2aaa240 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -133,6 +133,7 @@ jobs: - name: Setup Stellar wallet run: | stellar keys generate test \ + --fund --rpc-url "$RPC_URL" \ --network-passphrase "$NETWORK_PASSPHRASE" @@ -141,9 +142,6 @@ jobs: echo "STELLAR_PRIVATE_KEY=${STELLAR_PRIVATE_KEY}" >> $GITHUB_ENV echo "STELLAR_ADDRESS=${STELLAR_ADDRESS}" >> $GITHUB_ENV - - name: Fund Stellar wallet - run: node stellar/faucet --recipient $STELLAR_ADDRESS - - name: Prepare .env run: | echo "PRIVATE_KEY = '$STELLAR_PRIVATE_KEY'" >> .env From e1c77676a0b14854e2e43b36d4fdb4ec2421fd0f Mon Sep 17 00:00:00 2001 From: ahramy Date: Mon, 31 Mar 2025 22:15:33 -0700 Subject: [PATCH 046/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 3b2aaa240..d801f91ce 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -133,9 +133,9 @@ jobs: - name: Setup Stellar wallet run: | stellar keys generate test \ - --fund --rpc-url "$RPC_URL" \ - --network-passphrase "$NETWORK_PASSPHRASE" + --network-passphrase "$NETWORK_PASSPHRASE" \ + --fund STELLAR_PRIVATE_KEY=$(stellar keys show test) STELLAR_ADDRESS=$(stellar keys address test) From 6d552cf5366420258d1128c87d87045b519b5282 Mon Sep 17 00:00:00 2001 From: ahramy Date: Mon, 31 Mar 2025 22:36:19 -0700 Subject: [PATCH 047/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 61 ++++++++++++----------------- 1 file changed, 25 insertions(+), 36 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index d801f91ce..052e2698d 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -45,7 +45,7 @@ jobs: uses: actions/checkout@v4 with: repository: axelarnetwork/axelar-amplifier-stellar - path: axelar-amplifier-stellar + path: ./stellar/axelar-amplifier-stellar - name: Setup Node.js uses: actions/setup-node@v4 @@ -64,22 +64,34 @@ jobs: toolchain: 1.81.0 targets: wasm32-unknown-unknown - # install binary to avoid lengthy compilation process - - name: Install Stellar CLI - shell: bash + - name: Build all contracts run: | - # setup bin/ directory - mkdir bin - cd bin + # Install Stellar CLI compatible with the soroban-sdk version in Cargo.toml + cargo install --locked stellar-cli --version 22.2.0 --features opt + + # Build all contracts + stellar contract build + ./optimize.sh + + # Process in the release directory + cd target/wasm32-unknown-unknown/release - # Query latest release from official Stellar repo - URL=$(curl -s https://api.github.com/repos/stellar/stellar-cli/releases/latest | jq -r .assets[].browser_download_url | grep 'stellar.*x86_64-unknown-linux') + # Remove unoptimized files and rename optimized ones + # This ensures we only keep the optimized versions + find . -type f -name "*.wasm" ! -name "*.optimized.wasm" -maxdepth 1 -delete + find . -name "*.optimized.wasm" -maxdepth 1 -exec sh -c 'mv "$0" "${0%.optimized.wasm}.wasm"' {} \; + find . -type f ! -name "*.wasm" -delete - # download + extract binary - wget -q $URL - tar -xzf $(basename $URL) + - name: Checkout axelar-contract-deployments repo + uses: actions/checkout@v4 + with: + repository: axelarnetwork/axelar-contract-deployments + path: ./stellar/axelar-contract-deployments - echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH + - name: Setup Wasm Directory + run: | + WASM_DIR=../axelar-amplifier-stellar/target/wasm32-unknown-unknown/release + echo "WASM_DIR=${WASM_DIR}" >> $GITHUB_ENV - name: Setup Stellar local network run: | @@ -125,11 +137,6 @@ jobs: - name: Display local.json run: cat ./axelar-chains-config/info/local.json - - name: Setup Wasm Directory - run: | - WASM_DIR=target/wasm32-unknown-unknown/release - echo "WASM_DIR=${WASM_DIR}" >> $GITHUB_ENV - - name: Setup Stellar wallet run: | stellar keys generate test \ @@ -148,24 +155,6 @@ jobs: echo "ENV = 'local'" >> .env echo "YES = 'true'" >> .env - - name: Build all contracts - run: | - # Install Stellar CLI compatible with the soroban-sdk version in Cargo.toml - cargo install --locked stellar-cli --version 22.2.0 --features opt - - # Build all contracts - stellar contract build - ./optimize.sh - - # Process in the release directory - cd target/wasm32-unknown-unknown/release - - # Remove unoptimized files and rename optimized ones - # This ensures we only keep the optimized versions - find . -type f -name "*.wasm" ! -name "*.optimized.wasm" -maxdepth 1 -delete - find . -name "*.optimized.wasm" -maxdepth 1 -exec sh -c 'mv "$0" "${0%.optimized.wasm}.wasm"' {} \; - find . -type f ! -name "*.wasm" -delete - ###### Command: Deploy Contract ###### - name: Deploy AxelarOperators run: | From bd5c92af3798f890782f3846bdcc6f7d527716f1 Mon Sep 17 00:00:00 2001 From: ahramy Date: Mon, 31 Mar 2025 22:52:22 -0700 Subject: [PATCH 048/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 50 ++++------------------------- 1 file changed, 6 insertions(+), 44 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 052e2698d..270a4ed20 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -45,7 +45,7 @@ jobs: uses: actions/checkout@v4 with: repository: axelarnetwork/axelar-amplifier-stellar - path: ./stellar/axelar-amplifier-stellar + path: axelar-amplifier-stellar - name: Setup Node.js uses: actions/setup-node@v4 @@ -66,6 +66,8 @@ jobs: - name: Build all contracts run: | + cd axelar-amplifier-stellar; + # Install Stellar CLI compatible with the soroban-sdk version in Cargo.toml cargo install --locked stellar-cli --version 22.2.0 --features opt @@ -82,15 +84,12 @@ jobs: find . -name "*.optimized.wasm" -maxdepth 1 -exec sh -c 'mv "$0" "${0%.optimized.wasm}.wasm"' {} \; find . -type f ! -name "*.wasm" -delete - - name: Checkout axelar-contract-deployments repo - uses: actions/checkout@v4 - with: - repository: axelarnetwork/axelar-contract-deployments - path: ./stellar/axelar-contract-deployments + # Change directory to the top level + cd ../../../../ - name: Setup Wasm Directory run: | - WASM_DIR=../axelar-amplifier-stellar/target/wasm32-unknown-unknown/release + WASM_DIR=./axelar-amplifier-stellar/target/wasm32-unknown-unknown/release echo "WASM_DIR=${WASM_DIR}" >> $GITHUB_ENV - name: Setup Stellar local network @@ -170,40 +169,3 @@ jobs: run: | CONTRACT=AxelarGateway node stellar/deploy-contract deploy $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm - - ###### Command: Gateway ###### - # FIXME: - # - name: Gateway Approve - # run: | - # node stellar/gateway approve avalanche 0x32034b47cb29d162d9d803cc405356f4ac0ec07fe847ace431385fe8acf3e6e5-2 0x4F4495243837681061C4743b74B3eEdf548D56A5 wallet 0x1234 - - # - name: Gateway Call Contract - # run: node stellar/gateway.js call-contract avalanche 0x4F4495243837681061C4743b74B3eEdf548D56A5 0x1234 - - # - name: Gateway Rotate Signers - # run: | - # node stellar/gateway rotate --new-nonce test --signers wallet - # node stellar/gateway rotate --new-nonce test2 --current-nonce test --signers wallet - - ###### Command: Operators ###### - - - name: Execute is operator - run: node stellar/operators.js is-operator $STELLAR_ADDRESS - - - name: Execute add operator - run: node stellar/operators.js add-operator $STELLAR_ADDRESS - - - name: Execute remove operator - run: node stellar/operators.js remove-operator $STELLAR_ADDRESS - - # TODO: needs gas-service contract - # - name: Execute refund action - # run: node stellar/operators.js --action refund - - # FIXME: find proper way to execute this - # - name: Execute execute action - # run: node stellar/operators.js --action execute --target $STELLAR_ADDRESS --method "is_operator" - - # TODO: currently fails - # - name: is_operator with estimate_cost - # run: node stellar/operators.js --action is_operator --args $STELLAR_ADDRESS --estimate-cost From a830e518689a735fd147fc1a43fafa0f54b2cf6b Mon Sep 17 00:00:00 2001 From: ahramy Date: Mon, 31 Mar 2025 23:08:41 -0700 Subject: [PATCH 049/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 270a4ed20..60b4766eb 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -158,14 +158,24 @@ jobs: - name: Deploy AxelarOperators run: | CONTRACT=AxelarOperators - node stellar/deploy-contract deploy $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm + node stellar/deploy-contract deploy $CONTRACT --artifact-path $WASM_DIR/$CONTRACT.optimized.wasm - name: Deploy AxelarGasService run: | CONTRACT=AxelarGasService - node stellar/deploy-contract deploy $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm + node stellar/deploy-contract deploy $CONTRACT --artifact-path $WASM_DIR/$CONTRACT.optimized.wasm - name: Deploy AxelarGateway run: | CONTRACT=AxelarGateway - node stellar/deploy-contract deploy $CONTRACT --wasm-path $WASM_DIR/$CONTRACT.optimized.wasm + node stellar/deploy-contract deploy $CONTRACT --artifact-path $WASM_DIR/$CONTRACT.optimized.wasm + + ###### Command: Operators ###### + - name: Execute is operator + run: node stellar/operators.js is-operator $STELLAR_ADDRESS + + - name: Execute add operator + run: node stellar/operators.js add-operator $STELLAR_ADDRESS + + - name: Execute remove operator + run: node stellar/operators.js remove-operator $STELLAR_ADDRESS From ed142fdf4111e3d5d4e08b89c59d8ce3b48f3c39 Mon Sep 17 00:00:00 2001 From: ahramy Date: Mon, 31 Mar 2025 23:19:48 -0700 Subject: [PATCH 050/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 60b4766eb..1be5cd3a9 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -75,18 +75,6 @@ jobs: stellar contract build ./optimize.sh - # Process in the release directory - cd target/wasm32-unknown-unknown/release - - # Remove unoptimized files and rename optimized ones - # This ensures we only keep the optimized versions - find . -type f -name "*.wasm" ! -name "*.optimized.wasm" -maxdepth 1 -delete - find . -name "*.optimized.wasm" -maxdepth 1 -exec sh -c 'mv "$0" "${0%.optimized.wasm}.wasm"' {} \; - find . -type f ! -name "*.wasm" -delete - - # Change directory to the top level - cd ../../../../ - - name: Setup Wasm Directory run: | WASM_DIR=./axelar-amplifier-stellar/target/wasm32-unknown-unknown/release @@ -157,18 +145,15 @@ jobs: ###### Command: Deploy Contract ###### - name: Deploy AxelarOperators run: | - CONTRACT=AxelarOperators - node stellar/deploy-contract deploy $CONTRACT --artifact-path $WASM_DIR/$CONTRACT.optimized.wasm + node stellar/deploy-contract deploy AxelarOperators --artifact-path $WASM_DIR/stellar_axelar_operators.optimized.wasm - name: Deploy AxelarGasService run: | - CONTRACT=AxelarGasService - node stellar/deploy-contract deploy $CONTRACT --artifact-path $WASM_DIR/$CONTRACT.optimized.wasm + node stellar/deploy-contract deploy AxelarGasService --artifact-path $WASM_DIR/stellar_axelar_gas_service.optimized.wasm - name: Deploy AxelarGateway run: | - CONTRACT=AxelarGateway - node stellar/deploy-contract deploy $CONTRACT --artifact-path $WASM_DIR/$CONTRACT.optimized.wasm + node stellar/deploy-contract deploy AxelarGateway --artifact-path $WASM_DIR/stellar_axelar_gateway.optimized.wasm ###### Command: Operators ###### - name: Execute is operator From bd97a7508ce9f9296c863104112d73204009bce6 Mon Sep 17 00:00:00 2001 From: ahramy Date: Mon, 31 Mar 2025 23:45:35 -0700 Subject: [PATCH 051/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 1be5cd3a9..d2fd0f5ef 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -140,11 +140,14 @@ jobs: run: | echo "PRIVATE_KEY = '$STELLAR_PRIVATE_KEY'" >> .env echo "ENV = 'local'" >> .env + echo "CHAIN = 'stellar'" >> .env echo "YES = 'true'" >> .env ###### Command: Deploy Contract ###### - name: Deploy AxelarOperators run: | + echo $WASM_DIR; + ls -al $WASM_DIR/stellar_axelar_operators.optimized.wasm; node stellar/deploy-contract deploy AxelarOperators --artifact-path $WASM_DIR/stellar_axelar_operators.optimized.wasm - name: Deploy AxelarGasService From 4a2136ddbe10e009a97e537020954eb1fd91fc59 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 1 Apr 2025 00:00:38 -0700 Subject: [PATCH 052/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index d2fd0f5ef..01b19e3a3 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -64,16 +64,16 @@ jobs: toolchain: 1.81.0 targets: wasm32-unknown-unknown - - name: Build all contracts - run: | - cd axelar-amplifier-stellar; - - # Install Stellar CLI compatible with the soroban-sdk version in Cargo.toml - cargo install --locked stellar-cli --version 22.2.0 --features opt - - # Build all contracts - stellar contract build - ./optimize.sh + # - name: Build all contracts + # run: | + # cd axelar-amplifier-stellar; + # + # # Install Stellar CLI compatible with the soroban-sdk version in Cargo.toml + # cargo install --locked stellar-cli --version 22.2.0 --features opt + # + # # Build all contracts + # stellar contract build + # ./optimize.sh - name: Setup Wasm Directory run: | @@ -127,8 +127,8 @@ jobs: - name: Setup Stellar wallet run: | stellar keys generate test \ - --rpc-url "$RPC_URL" \ - --network-passphrase "$NETWORK_PASSPHRASE" \ + --rpc-url "${RPC_URL}" \ + --network-passphrase "${NETWORK_PASSPHRASE}" \ --fund STELLAR_PRIVATE_KEY=$(stellar keys show test) @@ -148,6 +148,7 @@ jobs: run: | echo $WASM_DIR; ls -al $WASM_DIR/stellar_axelar_operators.optimized.wasm; + stellar contract invoke --id CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC --network-passphrase "${NETWORK_PASSPHRASE}" --rpc-url "${RPC_URL}" -- help node stellar/deploy-contract deploy AxelarOperators --artifact-path $WASM_DIR/stellar_axelar_operators.optimized.wasm - name: Deploy AxelarGasService From eb2c1b2f4432875767a8b68b83d804b436d0ef2a Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 1 Apr 2025 00:02:33 -0700 Subject: [PATCH 053/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 01b19e3a3..006bc3e42 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -77,6 +77,7 @@ jobs: - name: Setup Wasm Directory run: | + cargo install --locked stellar-cli --version 22.2.0 --features opt WASM_DIR=./axelar-amplifier-stellar/target/wasm32-unknown-unknown/release echo "WASM_DIR=${WASM_DIR}" >> $GITHUB_ENV From f89399298b0ae950c08c85cfd6ac293e083ab6a0 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 1 Apr 2025 15:06:40 -0700 Subject: [PATCH 054/146] update --- .github/workflows/test-stellar.yaml | 49 +++++++++++++++----------- axelar-chains-config/info/local.json-e | 15 ++++++++ 2 files changed, 43 insertions(+), 21 deletions(-) create mode 100644 axelar-chains-config/info/local.json-e diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 006bc3e42..0f69b2e80 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -64,20 +64,19 @@ jobs: toolchain: 1.81.0 targets: wasm32-unknown-unknown - # - name: Build all contracts - # run: | - # cd axelar-amplifier-stellar; - # - # # Install Stellar CLI compatible with the soroban-sdk version in Cargo.toml - # cargo install --locked stellar-cli --version 22.2.0 --features opt - # - # # Build all contracts - # stellar contract build - # ./optimize.sh + - name: Build all contracts + run: | + cd axelar-amplifier-stellar; + + # Install Stellar CLI compatible with the soroban-sdk version in Cargo.toml + cargo install --locked stellar-cli --version 22.2.0 --features opt + + # Build all contracts + stellar contract build + ./optimize.sh - name: Setup Wasm Directory run: | - cargo install --locked stellar-cli --version 22.2.0 --features opt WASM_DIR=./axelar-amplifier-stellar/target/wasm32-unknown-unknown/release echo "WASM_DIR=${WASM_DIR}" >> $GITHUB_ENV @@ -114,7 +113,7 @@ jobs: "networkType": "local", "chainType": "stellar", "tokenSymbol": "XLM", - "tokenAddress": "CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC", + "tokenAddress": "TOKEN_ADDRESS", "rpc": "http://127.0.0.1:8000/soroban/rpc", "horizonRpc": "http://127.0.0.1:8000", "contracts": {} @@ -122,9 +121,6 @@ jobs: } }' > ./axelar-chains-config/info/local.json - - name: Display local.json - run: cat ./axelar-chains-config/info/local.json - - name: Setup Stellar wallet run: | stellar keys generate test \ @@ -139,17 +135,25 @@ jobs: - name: Prepare .env run: | - echo "PRIVATE_KEY = '$STELLAR_PRIVATE_KEY'" >> .env - echo "ENV = 'local'" >> .env - echo "CHAIN = 'stellar'" >> .env - echo "YES = 'true'" >> .env + echo "PRIVATE_KEY=${STELLAR_PRIVATE_KEY}" >> .env + echo "ENV=local" >> .env + echo "CHAIN=stellar" >> .env + echo "YES=true" >> .env + + - name: Deploy Native Asset (XLM) and replace tokenAddress with XLM_ADDRESS + run: | + stellar contract asset deploy --source-account test --network local --asset native + XLM_ADDRESS=$(stellar contract id asset --asset native --network local) + sed -i'' -e "s/TOKEN_ADDRESS/${XLM_ADDRESS}/g" ./axelar-chains-config/info/local.json + echo "XLM_ADDRESS=${XLM_ADDRESS}" >> $GITHUB_ENV + + - name: Display local.json + run: cat ./axelar-chains-config/info/local.json - ###### Command: Deploy Contract ###### - name: Deploy AxelarOperators run: | echo $WASM_DIR; ls -al $WASM_DIR/stellar_axelar_operators.optimized.wasm; - stellar contract invoke --id CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC --network-passphrase "${NETWORK_PASSPHRASE}" --rpc-url "${RPC_URL}" -- help node stellar/deploy-contract deploy AxelarOperators --artifact-path $WASM_DIR/stellar_axelar_operators.optimized.wasm - name: Deploy AxelarGasService @@ -169,3 +173,6 @@ jobs: - name: Execute remove operator run: node stellar/operators.js remove-operator $STELLAR_ADDRESS + + - name: Display local.json + run: cat ./axelar-chains-config/info/local.json diff --git a/axelar-chains-config/info/local.json-e b/axelar-chains-config/info/local.json-e new file mode 100644 index 000000000..d634dcd84 --- /dev/null +++ b/axelar-chains-config/info/local.json-e @@ -0,0 +1,15 @@ +{ + "chains": { + "stellar": { + "name": "Stellar", + "axelarId": "stellar", + "networkType": "local", + "chainType": "stellar", + "tokenSymbol": "XLM", + "tokenAddress": "TOKEN_ADDRESS", + "rpc": "http://127.0.0.1:8000/soroban/rpc", + "horizonRpc": "http://127.0.0.1:8000", + "contracts": {} + } + } + } From 7eae0589998d702a338e9742198603158627453a Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 1 Apr 2025 16:29:16 -0700 Subject: [PATCH 055/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 0f69b2e80..48cb3eba1 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -69,7 +69,7 @@ jobs: cd axelar-amplifier-stellar; # Install Stellar CLI compatible with the soroban-sdk version in Cargo.toml - cargo install --locked stellar-cli --version 22.2.0 --features opt + cargo install --locked stellar-cli --version 22.6.0 --features opt # Build all contracts stellar contract build @@ -84,14 +84,14 @@ jobs: run: | docker pull stellar/quickstart docker run -d --rm -it \ - -p 8000:8000 \ + -p "8000:8000" \ --name stellar \ stellar/quickstart:testing \ --local \ --enable-soroban-rpc \ --protocol-version 22 - RPC_URL="http://localhost:8000/soroban/rpc" + RPC_URL="http://127.0.0.1:8000/soroban/rpc" NETWORK_PASSPHRASE="Standalone Network ; February 2017" echo "RPC_URL=${RPC_URL}" >> $GITHUB_ENV echo "NETWORK_PASSPHRASE=${NETWORK_PASSPHRASE}" >> $GITHUB_ENV From 68a33ff3df631524b36a38d42d67623b085ccd36 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 1 Apr 2025 16:38:08 -0700 Subject: [PATCH 056/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 48cb3eba1..8e69ea050 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -5,7 +5,7 @@ on: pull_request jobs: check-relevant-changes: name: Check for Relevant Changes - runs-on: blacksmith-2vcpu-ubuntu-2204 + runs-on: blacksmith-8vcpu-ubuntu-2204 outputs: run_tests: ${{ steps.filter.outputs.stellar == 'true' || steps.filter.outputs.common == 'true' || steps.filter.outputs.github == 'true' }} steps: @@ -69,7 +69,7 @@ jobs: cd axelar-amplifier-stellar; # Install Stellar CLI compatible with the soroban-sdk version in Cargo.toml - cargo install --locked stellar-cli --version 22.6.0 --features opt + cargo install --locked stellar-cli --version 22.2.0 --features opt # Build all contracts stellar contract build From 06ca2491a9779318fbc1bd0a6e29df2a8475a167 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 1 Apr 2025 16:48:59 -0700 Subject: [PATCH 057/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 8e69ea050..9f9e2e37d 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -30,7 +30,7 @@ jobs: name: Test Stellar needs: check-relevant-changes if: ${{ needs.check-relevant-changes.outputs.run_tests == 'true' }} - runs-on: blacksmith-2vcpu-ubuntu-2204 + runs-on: blacksmith-8vcpu-ubuntu-2204 steps: # this sets up nested repos: https://github.com/actions/checkout?tab=readme-ov-file#checkout-multiple-repos-nested # @@ -84,7 +84,7 @@ jobs: run: | docker pull stellar/quickstart docker run -d --rm -it \ - -p "8000:8000" \ + -p 8000:8000 \ --name stellar \ stellar/quickstart:testing \ --local \ @@ -140,9 +140,14 @@ jobs: echo "CHAIN=stellar" >> .env echo "YES=true" >> .env + - name: Display local.json + run: | + cat ./axelar-chains-config/info/local.json + cat .env + - name: Deploy Native Asset (XLM) and replace tokenAddress with XLM_ADDRESS run: | - stellar contract asset deploy --source-account test --network local --asset native + ## stellar contract asset deploy --source-account test --network local --asset native XLM_ADDRESS=$(stellar contract id asset --asset native --network local) sed -i'' -e "s/TOKEN_ADDRESS/${XLM_ADDRESS}/g" ./axelar-chains-config/info/local.json echo "XLM_ADDRESS=${XLM_ADDRESS}" >> $GITHUB_ENV From 37ee616f00b750e7debffdc3fcd08e0185daaea3 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 1 Apr 2025 17:02:41 -0700 Subject: [PATCH 058/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 9f9e2e37d..87f1c8b74 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -91,7 +91,7 @@ jobs: --enable-soroban-rpc \ --protocol-version 22 - RPC_URL="http://127.0.0.1:8000/soroban/rpc" + RPC_URL="http://127.0.0.1:8000/rpc" NETWORK_PASSPHRASE="Standalone Network ; February 2017" echo "RPC_URL=${RPC_URL}" >> $GITHUB_ENV echo "NETWORK_PASSPHRASE=${NETWORK_PASSPHRASE}" >> $GITHUB_ENV @@ -114,7 +114,7 @@ jobs: "chainType": "stellar", "tokenSymbol": "XLM", "tokenAddress": "TOKEN_ADDRESS", - "rpc": "http://127.0.0.1:8000/soroban/rpc", + "rpc": "http://127.0.0.1:8000/rpc", "horizonRpc": "http://127.0.0.1:8000", "contracts": {} } @@ -147,7 +147,6 @@ jobs: - name: Deploy Native Asset (XLM) and replace tokenAddress with XLM_ADDRESS run: | - ## stellar contract asset deploy --source-account test --network local --asset native XLM_ADDRESS=$(stellar contract id asset --asset native --network local) sed -i'' -e "s/TOKEN_ADDRESS/${XLM_ADDRESS}/g" ./axelar-chains-config/info/local.json echo "XLM_ADDRESS=${XLM_ADDRESS}" >> $GITHUB_ENV From 833de5f7c71ace3c9ac16da3fc4d206931e54012 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 1 Apr 2025 17:10:36 -0700 Subject: [PATCH 059/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 87f1c8b74..2518703a6 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -91,7 +91,7 @@ jobs: --enable-soroban-rpc \ --protocol-version 22 - RPC_URL="http://127.0.0.1:8000/rpc" + RPC_URL="http://localhost:8000/rpc" NETWORK_PASSPHRASE="Standalone Network ; February 2017" echo "RPC_URL=${RPC_URL}" >> $GITHUB_ENV echo "NETWORK_PASSPHRASE=${NETWORK_PASSPHRASE}" >> $GITHUB_ENV @@ -114,8 +114,8 @@ jobs: "chainType": "stellar", "tokenSymbol": "XLM", "tokenAddress": "TOKEN_ADDRESS", - "rpc": "http://127.0.0.1:8000/rpc", - "horizonRpc": "http://127.0.0.1:8000", + "rpc": "http://localhost:8000/rpc", + "horizonRpc": "http://localhost:8000", "contracts": {} } } From 2f053db7a782a876fb18fed5a037f7dc247e6b6b Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 1 Apr 2025 17:17:34 -0700 Subject: [PATCH 060/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 2518703a6..1487c4b00 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -91,7 +91,7 @@ jobs: --enable-soroban-rpc \ --protocol-version 22 - RPC_URL="http://localhost:8000/rpc" + RPC_URL="http://localhost:8000" NETWORK_PASSPHRASE="Standalone Network ; February 2017" echo "RPC_URL=${RPC_URL}" >> $GITHUB_ENV echo "NETWORK_PASSPHRASE=${NETWORK_PASSPHRASE}" >> $GITHUB_ENV @@ -114,13 +114,25 @@ jobs: "chainType": "stellar", "tokenSymbol": "XLM", "tokenAddress": "TOKEN_ADDRESS", - "rpc": "http://localhost:8000/rpc", + "rpc": "http://localhost:8000", "horizonRpc": "http://localhost:8000", "contracts": {} } } }' > ./axelar-chains-config/info/local.json + - name: Start Stellar network + run: | + stellar network container start local + + - name: Wait for Stellar network + uses: nev7n/wait_for_response@v1 + with: + url: 'http://localhost:8000' + responseCode: 200 + timeout: 60000 + interval: 1000 + - name: Setup Stellar wallet run: | stellar keys generate test \ From f692412c8da8f342d3ce228d836c40919344c66a Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 1 Apr 2025 17:26:44 -0700 Subject: [PATCH 061/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 32 +++++++++-------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 1487c4b00..42815f564 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -80,22 +80,22 @@ jobs: WASM_DIR=./axelar-amplifier-stellar/target/wasm32-unknown-unknown/release echo "WASM_DIR=${WASM_DIR}" >> $GITHUB_ENV - - name: Setup Stellar local network + - name: Start Stellar network run: | - docker pull stellar/quickstart - docker run -d --rm -it \ - -p 8000:8000 \ - --name stellar \ - stellar/quickstart:testing \ - --local \ - --enable-soroban-rpc \ - --protocol-version 22 - + stellar network container start local RPC_URL="http://localhost:8000" NETWORK_PASSPHRASE="Standalone Network ; February 2017" echo "RPC_URL=${RPC_URL}" >> $GITHUB_ENV echo "NETWORK_PASSPHRASE=${NETWORK_PASSPHRASE}" >> $GITHUB_ENV + - name: Wait for Stellar network + uses: nev7n/wait_for_response@v1 + with: + url: 'http://localhost:8000' + responseCode: 200 + timeout: 60000 + interval: 1000 + - name: Add as configured network shell: bash run: | @@ -121,18 +121,6 @@ jobs: } }' > ./axelar-chains-config/info/local.json - - name: Start Stellar network - run: | - stellar network container start local - - - name: Wait for Stellar network - uses: nev7n/wait_for_response@v1 - with: - url: 'http://localhost:8000' - responseCode: 200 - timeout: 60000 - interval: 1000 - - name: Setup Stellar wallet run: | stellar keys generate test \ From a7468b762fe5fed01660934d95a284a73d87ccb8 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 1 Apr 2025 17:38:14 -0700 Subject: [PATCH 062/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 42815f564..c3ad22b47 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -80,10 +80,18 @@ jobs: WASM_DIR=./axelar-amplifier-stellar/target/wasm32-unknown-unknown/release echo "WASM_DIR=${WASM_DIR}" >> $GITHUB_ENV - - name: Start Stellar network + - name: Setup Stellar local network run: | - stellar network container start local - RPC_URL="http://localhost:8000" + docker pull stellar/quickstart + docker run -d --rm -it \ + -p 8000:8000 \ + --name stellar \ + stellar/quickstart:testing \ + --local \ + --enable-soroban-rpc \ + --protocol-version 22 + + RPC_URL="http://localhost:8000/rpc" NETWORK_PASSPHRASE="Standalone Network ; February 2017" echo "RPC_URL=${RPC_URL}" >> $GITHUB_ENV echo "NETWORK_PASSPHRASE=${NETWORK_PASSPHRASE}" >> $GITHUB_ENV @@ -93,7 +101,7 @@ jobs: with: url: 'http://localhost:8000' responseCode: 200 - timeout: 60000 + timeout: 120000 interval: 1000 - name: Add as configured network @@ -114,7 +122,7 @@ jobs: "chainType": "stellar", "tokenSymbol": "XLM", "tokenAddress": "TOKEN_ADDRESS", - "rpc": "http://localhost:8000", + "rpc": "http://localhost:8000/rpc", "horizonRpc": "http://localhost:8000", "contracts": {} } From b3664028a6140f97e2eff337dfb30c693b1a650c Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 1 Apr 2025 17:49:14 -0700 Subject: [PATCH 063/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index c3ad22b47..56328c9aa 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -84,14 +84,14 @@ jobs: run: | docker pull stellar/quickstart docker run -d --rm -it \ - -p 8000:8000 \ + -p 8001:8000 \ --name stellar \ stellar/quickstart:testing \ --local \ --enable-soroban-rpc \ --protocol-version 22 - RPC_URL="http://localhost:8000/rpc" + RPC_URL="http://localhost:8001/rpc" NETWORK_PASSPHRASE="Standalone Network ; February 2017" echo "RPC_URL=${RPC_URL}" >> $GITHUB_ENV echo "NETWORK_PASSPHRASE=${NETWORK_PASSPHRASE}" >> $GITHUB_ENV @@ -99,7 +99,7 @@ jobs: - name: Wait for Stellar network uses: nev7n/wait_for_response@v1 with: - url: 'http://localhost:8000' + url: 'http://localhost:8001' responseCode: 200 timeout: 120000 interval: 1000 @@ -122,8 +122,8 @@ jobs: "chainType": "stellar", "tokenSymbol": "XLM", "tokenAddress": "TOKEN_ADDRESS", - "rpc": "http://localhost:8000/rpc", - "horizonRpc": "http://localhost:8000", + "rpc": "http://localhost:8001/rpc", + "horizonRpc": "http://localhost:8001", "contracts": {} } } From 5d275ef847e276ec33afebb2d66d40d03212568d Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 1 Apr 2025 17:59:52 -0700 Subject: [PATCH 064/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 31 ++++++++--------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 56328c9aa..0cc334f88 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -80,30 +80,14 @@ jobs: WASM_DIR=./axelar-amplifier-stellar/target/wasm32-unknown-unknown/release echo "WASM_DIR=${WASM_DIR}" >> $GITHUB_ENV - - name: Setup Stellar local network + - name: Start Stellar network run: | - docker pull stellar/quickstart - docker run -d --rm -it \ - -p 8001:8000 \ - --name stellar \ - stellar/quickstart:testing \ - --local \ - --enable-soroban-rpc \ - --protocol-version 22 - - RPC_URL="http://localhost:8001/rpc" + stellar network container start local; + RPC_URL="http://localhost:8000/soroban/rpc" NETWORK_PASSPHRASE="Standalone Network ; February 2017" echo "RPC_URL=${RPC_URL}" >> $GITHUB_ENV echo "NETWORK_PASSPHRASE=${NETWORK_PASSPHRASE}" >> $GITHUB_ENV - - name: Wait for Stellar network - uses: nev7n/wait_for_response@v1 - with: - url: 'http://localhost:8001' - responseCode: 200 - timeout: 120000 - interval: 1000 - - name: Add as configured network shell: bash run: | @@ -122,8 +106,8 @@ jobs: "chainType": "stellar", "tokenSymbol": "XLM", "tokenAddress": "TOKEN_ADDRESS", - "rpc": "http://localhost:8001/rpc", - "horizonRpc": "http://localhost:8001", + "rpc": "http://localhost:8000/soroban/rpc", + "horizonRpc": "http://localhost:8000", "contracts": {} } } @@ -133,14 +117,15 @@ jobs: run: | stellar keys generate test \ --rpc-url "${RPC_URL}" \ - --network-passphrase "${NETWORK_PASSPHRASE}" \ - --fund + --network-passphrase "${NETWORK_PASSPHRASE}" STELLAR_PRIVATE_KEY=$(stellar keys show test) STELLAR_ADDRESS=$(stellar keys address test) echo "STELLAR_PRIVATE_KEY=${STELLAR_PRIVATE_KEY}" >> $GITHUB_ENV echo "STELLAR_ADDRESS=${STELLAR_ADDRESS}" >> $GITHUB_ENV + curl http://localhost:8000/friendbot\?addr=${STELLAR_ADDRESS} + - name: Prepare .env run: | echo "PRIVATE_KEY=${STELLAR_PRIVATE_KEY}" >> .env From 182ef40f8922973ea396557e4f9ae01872144bd6 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 1 Apr 2025 18:15:20 -0700 Subject: [PATCH 065/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 94 +++++++++++------------------ 1 file changed, 34 insertions(+), 60 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 0cc334f88..03424a382 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -25,7 +25,6 @@ jobs: echo "Changes in stellar: ${{ steps.filter.outputs.stellar }}" echo "Changes in common: ${{ steps.filter.outputs.common }}" echo "Changes in github: ${{ steps.filter.outputs.github }}" - test-stellar: name: Test Stellar needs: check-relevant-changes @@ -33,7 +32,6 @@ jobs: runs-on: blacksmith-8vcpu-ubuntu-2204 steps: # this sets up nested repos: https://github.com/actions/checkout?tab=readme-ov-file#checkout-multiple-repos-nested - # # axelar-contract-deployments # - axelar-amplifier-stellar # @@ -64,25 +62,23 @@ jobs: toolchain: 1.81.0 targets: wasm32-unknown-unknown - - name: Build all contracts + # install binary to avoid lengthy compilation process + - name: Install Stellar CLI + shell: bash run: | - cd axelar-amplifier-stellar; - # Install Stellar CLI compatible with the soroban-sdk version in Cargo.toml cargo install --locked stellar-cli --version 22.2.0 --features opt - # Build all contracts - stellar contract build - ./optimize.sh - - - name: Setup Wasm Directory - run: | - WASM_DIR=./axelar-amplifier-stellar/target/wasm32-unknown-unknown/release - echo "WASM_DIR=${WASM_DIR}" >> $GITHUB_ENV - - - name: Start Stellar network + - name: Setup Stellar local network run: | - stellar network container start local; + docker pull stellar/quickstart + docker run -d --rm -it \ + -p 8000:8000 \ + --name stellar \ + stellar/quickstart:testing \ + --local \ + --enable-soroban-rpc \ + --protocol-version 22 RPC_URL="http://localhost:8000/soroban/rpc" NETWORK_PASSPHRASE="Standalone Network ; February 2017" echo "RPC_URL=${RPC_URL}" >> $GITHUB_ENV @@ -105,26 +101,38 @@ jobs: "networkType": "local", "chainType": "stellar", "tokenSymbol": "XLM", - "tokenAddress": "TOKEN_ADDRESS", - "rpc": "http://localhost:8000/soroban/rpc", - "horizonRpc": "http://localhost:8000", + "rpc": "http://127.0.0.1:8000/soroban/rpc", + "horizonRpc": "http://127.0.0.1:8000", "contracts": {} } } }' > ./axelar-chains-config/info/local.json + - name: Display local.json + run: cat ./axelar-chains-config/info/local.json + + ###### Compile Wasm Contracts ###### + + - name: Compile WASM contracts + run: | + cd axelar-amplifier-stellar + stellar contract build + ./optimize.sh + cd .. + WASM_DIR=axelar-amplifier-stellar/target/wasm32-unknown-unknown/release + echo "WASM_DIR=${WASM_DIR}" >> $GITHUB_ENV + - name: Setup Stellar wallet run: | stellar keys generate test \ - --rpc-url "${RPC_URL}" \ - --network-passphrase "${NETWORK_PASSPHRASE}" - + --rpc-url "$RPC_URL" \ + --network-passphrase "$NETWORK_PASSPHRASE" STELLAR_PRIVATE_KEY=$(stellar keys show test) STELLAR_ADDRESS=$(stellar keys address test) echo "STELLAR_PRIVATE_KEY=${STELLAR_PRIVATE_KEY}" >> $GITHUB_ENV echo "STELLAR_ADDRESS=${STELLAR_ADDRESS}" >> $GITHUB_ENV - - curl http://localhost:8000/friendbot\?addr=${STELLAR_ADDRESS} + XLM_ADDRESS=$(stellar contract id asset --asset native --network local) + echo "XLM_ADDRESS=${XLM_ADDRESS}" >> $GITHUB_ENV - name: Prepare .env run: | @@ -133,43 +141,9 @@ jobs: echo "CHAIN=stellar" >> .env echo "YES=true" >> .env - - name: Display local.json - run: | - cat ./axelar-chains-config/info/local.json - cat .env - - - name: Deploy Native Asset (XLM) and replace tokenAddress with XLM_ADDRESS - run: | - XLM_ADDRESS=$(stellar contract id asset --asset native --network local) - sed -i'' -e "s/TOKEN_ADDRESS/${XLM_ADDRESS}/g" ./axelar-chains-config/info/local.json - echo "XLM_ADDRESS=${XLM_ADDRESS}" >> $GITHUB_ENV - - - name: Display local.json - run: cat ./axelar-chains-config/info/local.json - - - name: Deploy AxelarOperators + ###### Command: Deploy Contract ###### + - name: Deploy axelar_gateway run: | echo $WASM_DIR; ls -al $WASM_DIR/stellar_axelar_operators.optimized.wasm; node stellar/deploy-contract deploy AxelarOperators --artifact-path $WASM_DIR/stellar_axelar_operators.optimized.wasm - - - name: Deploy AxelarGasService - run: | - node stellar/deploy-contract deploy AxelarGasService --artifact-path $WASM_DIR/stellar_axelar_gas_service.optimized.wasm - - - name: Deploy AxelarGateway - run: | - node stellar/deploy-contract deploy AxelarGateway --artifact-path $WASM_DIR/stellar_axelar_gateway.optimized.wasm - - ###### Command: Operators ###### - - name: Execute is operator - run: node stellar/operators.js is-operator $STELLAR_ADDRESS - - - name: Execute add operator - run: node stellar/operators.js add-operator $STELLAR_ADDRESS - - - name: Execute remove operator - run: node stellar/operators.js remove-operator $STELLAR_ADDRESS - - - name: Display local.json - run: cat ./axelar-chains-config/info/local.json From 84f332da15b463ab0442de72448906d3941c6a52 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 1 Apr 2025 18:25:54 -0700 Subject: [PATCH 066/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 03424a382..8cc2e822d 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -101,6 +101,7 @@ jobs: "networkType": "local", "chainType": "stellar", "tokenSymbol": "XLM", + "tokenAddress": "NATIVE_TOKEN_ADDRESS", "rpc": "http://127.0.0.1:8000/soroban/rpc", "horizonRpc": "http://127.0.0.1:8000", "contracts": {} @@ -126,14 +127,23 @@ jobs: run: | stellar keys generate test \ --rpc-url "$RPC_URL" \ - --network-passphrase "$NETWORK_PASSPHRASE" + --network-passphrase "$NETWORK_PASSPHRASE" \ + --fund + STELLAR_PRIVATE_KEY=$(stellar keys show test) STELLAR_ADDRESS=$(stellar keys address test) echo "STELLAR_PRIVATE_KEY=${STELLAR_PRIVATE_KEY}" >> $GITHUB_ENV echo "STELLAR_ADDRESS=${STELLAR_ADDRESS}" >> $GITHUB_ENV + + - name: Retrieve native token (XLM) address and replace in the config + run: | XLM_ADDRESS=$(stellar contract id asset --asset native --network local) + sed -i'' -e "s/NATIVE_TOKEN_ADDRESS/${XLM_ADDRESS}/g" ./axelar-chains-config/info/local.json echo "XLM_ADDRESS=${XLM_ADDRESS}" >> $GITHUB_ENV + - name: Display local.json + run: cat ./axelar-chains-config/info/local.json + - name: Prepare .env run: | echo "PRIVATE_KEY=${STELLAR_PRIVATE_KEY}" >> .env @@ -147,3 +157,13 @@ jobs: echo $WASM_DIR; ls -al $WASM_DIR/stellar_axelar_operators.optimized.wasm; node stellar/deploy-contract deploy AxelarOperators --artifact-path $WASM_DIR/stellar_axelar_operators.optimized.wasm + + ###### Command: Operators ###### + - name: Execute is operator + run: node stellar/operators.js is-operator $STELLAR_ADDRESS + + - name: Execute add operator + run: node stellar/operators.js add-operator $STELLAR_ADDRESS + + - name: Execute remove operator + run: node stellar/operators.js remove-operator $STELLAR_ADDRESS From 85368d01533cff8d7b2f90ad95fbd02e76a2ff69 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 1 Apr 2025 18:28:04 -0700 Subject: [PATCH 067/146] Delete local.json-e --- axelar-chains-config/info/local.json-e | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 axelar-chains-config/info/local.json-e diff --git a/axelar-chains-config/info/local.json-e b/axelar-chains-config/info/local.json-e deleted file mode 100644 index d634dcd84..000000000 --- a/axelar-chains-config/info/local.json-e +++ /dev/null @@ -1,15 +0,0 @@ -{ - "chains": { - "stellar": { - "name": "Stellar", - "axelarId": "stellar", - "networkType": "local", - "chainType": "stellar", - "tokenSymbol": "XLM", - "tokenAddress": "TOKEN_ADDRESS", - "rpc": "http://127.0.0.1:8000/soroban/rpc", - "horizonRpc": "http://127.0.0.1:8000", - "contracts": {} - } - } - } From 445a3f351f19c8013155590cf8695c0641119099 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 1 Apr 2025 18:32:52 -0700 Subject: [PATCH 068/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 8cc2e822d..fd8026386 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -79,6 +79,7 @@ jobs: --local \ --enable-soroban-rpc \ --protocol-version 22 + RPC_URL="http://localhost:8000/soroban/rpc" NETWORK_PASSPHRASE="Standalone Network ; February 2017" echo "RPC_URL=${RPC_URL}" >> $GITHUB_ENV @@ -109,11 +110,6 @@ jobs: } }' > ./axelar-chains-config/info/local.json - - name: Display local.json - run: cat ./axelar-chains-config/info/local.json - - ###### Compile Wasm Contracts ###### - - name: Compile WASM contracts run: | cd axelar-amplifier-stellar @@ -154,8 +150,6 @@ jobs: ###### Command: Deploy Contract ###### - name: Deploy axelar_gateway run: | - echo $WASM_DIR; - ls -al $WASM_DIR/stellar_axelar_operators.optimized.wasm; node stellar/deploy-contract deploy AxelarOperators --artifact-path $WASM_DIR/stellar_axelar_operators.optimized.wasm ###### Command: Operators ###### From 2bb30f70948684115ad8314899c8569ddfe878e1 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 1 Apr 2025 18:34:17 -0700 Subject: [PATCH 069/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index fd8026386..6a1766e36 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -5,7 +5,7 @@ on: pull_request jobs: check-relevant-changes: name: Check for Relevant Changes - runs-on: blacksmith-8vcpu-ubuntu-2204 + runs-on: blacksmith-2vcpu-ubuntu-2204 outputs: run_tests: ${{ steps.filter.outputs.stellar == 'true' || steps.filter.outputs.common == 'true' || steps.filter.outputs.github == 'true' }} steps: @@ -25,6 +25,7 @@ jobs: echo "Changes in stellar: ${{ steps.filter.outputs.stellar }}" echo "Changes in common: ${{ steps.filter.outputs.common }}" echo "Changes in github: ${{ steps.filter.outputs.github }}" + test-stellar: name: Test Stellar needs: check-relevant-changes @@ -131,7 +132,7 @@ jobs: echo "STELLAR_PRIVATE_KEY=${STELLAR_PRIVATE_KEY}" >> $GITHUB_ENV echo "STELLAR_ADDRESS=${STELLAR_ADDRESS}" >> $GITHUB_ENV - - name: Retrieve native token (XLM) address and replace in the config + - name: Retrieve native token address and replace in the config run: | XLM_ADDRESS=$(stellar contract id asset --asset native --network local) sed -i'' -e "s/NATIVE_TOKEN_ADDRESS/${XLM_ADDRESS}/g" ./axelar-chains-config/info/local.json From 4426d6e173dbcf1b0bd1c156b96a935647c46827 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 1 Apr 2025 18:35:44 -0700 Subject: [PATCH 070/146] Delete version --- stellar/version | 1 - 1 file changed, 1 deletion(-) delete mode 100644 stellar/version diff --git a/stellar/version b/stellar/version deleted file mode 100644 index 7da0a9528..000000000 --- a/stellar/version +++ /dev/null @@ -1 +0,0 @@ -a90ac0b9d2d66533f32df8a9e5e15e483ec59c5d From 7bf6683bf383cd4c46988a7a76db2f145d0db197 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 14:16:29 -0700 Subject: [PATCH 071/146] update --- .github/workflows/test-stellar.yaml | 69 ++++++++++++----------------- stellar/utils.js | 4 +- 2 files changed, 31 insertions(+), 42 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 6a1766e36..f8487db5b 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -30,7 +30,7 @@ jobs: name: Test Stellar needs: check-relevant-changes if: ${{ needs.check-relevant-changes.outputs.run_tests == 'true' }} - runs-on: blacksmith-8vcpu-ubuntu-2204 + runs-on: blacksmith-4vcpu-ubuntu-2204 steps: # this sets up nested repos: https://github.com/actions/checkout?tab=readme-ov-file#checkout-multiple-repos-nested # axelar-contract-deployments @@ -54,23 +54,19 @@ jobs: registry-url: 'https://registry.npmjs.org' - name: Install dependencies - shell: bash run: npm ci - - name: Install stable toolchain + - name: Install stable Rust toolchain uses: dtolnay/rust-toolchain@stable with: toolchain: 1.81.0 targets: wasm32-unknown-unknown - # install binary to avoid lengthy compilation process - name: Install Stellar CLI - shell: bash - run: | - # Install Stellar CLI compatible with the soroban-sdk version in Cargo.toml - cargo install --locked stellar-cli --version 22.2.0 --features opt + run: cargo install --locked stellar-cli --version 22.2.0 --features opt - name: Setup Stellar local network + id: setup_network run: | docker pull stellar/quickstart docker run -d --rm -it \ @@ -80,18 +76,19 @@ jobs: --local \ --enable-soroban-rpc \ --protocol-version 22 - - RPC_URL="http://localhost:8000/soroban/rpc" - NETWORK_PASSPHRASE="Standalone Network ; February 2017" - echo "RPC_URL=${RPC_URL}" >> $GITHUB_ENV - echo "NETWORK_PASSPHRASE=${NETWORK_PASSPHRASE}" >> $GITHUB_ENV + echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_OUTPUT + echo "network_passphrase='Standalone Network ; February 2017'" >> $GITHUB_OUTPUT - name: Add as configured network - shell: bash run: | stellar network add local \ - --rpc-url "$RPC_URL" \ - --network-passphrase "$NETWORK_PASSPHRASE" + --rpc-url "${{ steps.setup_network.outputs.rpc_url }}" \ + --network-passphrase "${{ steps.setup_network.outputs.network_passphrase }}" + + - name: Retrieve native token address + id: get_xlm_address + run: | + echo "xlm_address=$(stellar contract id asset --asset native --network local)" >> $GITHUB_OUTPUT - name: Prepare local.json run: | @@ -103,7 +100,7 @@ jobs: "networkType": "local", "chainType": "stellar", "tokenSymbol": "XLM", - "tokenAddress": "NATIVE_TOKEN_ADDRESS", + "tokenAddress": "${{ steps.get_xlm_address.outputs.xlm_address }}", "rpc": "http://127.0.0.1:8000/soroban/rpc", "horizonRpc": "http://127.0.0.1:8000", "contracts": {} @@ -111,39 +108,31 @@ jobs: } }' > ./axelar-chains-config/info/local.json + - name: Display local.json + run: cat ./axelar-chains-config/info/local.json + - name: Compile WASM contracts + id: compile_wasm run: | cd axelar-amplifier-stellar stellar contract build ./optimize.sh cd .. - WASM_DIR=axelar-amplifier-stellar/target/wasm32-unknown-unknown/release - echo "WASM_DIR=${WASM_DIR}" >> $GITHUB_ENV + echo "wasm_dir=axelar-amplifier-stellar/target/wasm32-unknown-unknown/release" >> $GITHUB_OUTPUT - name: Setup Stellar wallet + id: setup_wallet run: | stellar keys generate test \ - --rpc-url "$RPC_URL" \ - --network-passphrase "$NETWORK_PASSPHRASE" \ + --rpc-url "${{ steps.setup_network.outputs.rpc_url }}" \ + --network-passphrase "${{ steps.setup_network.outputs.network_passphrase }}" \ --fund - - STELLAR_PRIVATE_KEY=$(stellar keys show test) - STELLAR_ADDRESS=$(stellar keys address test) - echo "STELLAR_PRIVATE_KEY=${STELLAR_PRIVATE_KEY}" >> $GITHUB_ENV - echo "STELLAR_ADDRESS=${STELLAR_ADDRESS}" >> $GITHUB_ENV - - - name: Retrieve native token address and replace in the config - run: | - XLM_ADDRESS=$(stellar contract id asset --asset native --network local) - sed -i'' -e "s/NATIVE_TOKEN_ADDRESS/${XLM_ADDRESS}/g" ./axelar-chains-config/info/local.json - echo "XLM_ADDRESS=${XLM_ADDRESS}" >> $GITHUB_ENV - - - name: Display local.json - run: cat ./axelar-chains-config/info/local.json + echo "private_key=$(stellar keys show test)" >> $GITHUB_OUTPUT + echo "stellar_address=$(stellar keys address test)" >> $GITHUB_OUTPUT - name: Prepare .env run: | - echo "PRIVATE_KEY=${STELLAR_PRIVATE_KEY}" >> .env + echo "PRIVATE_KEY=${{ steps.setup_wallet.outputs.private_key }}" >> .env echo "ENV=local" >> .env echo "CHAIN=stellar" >> .env echo "YES=true" >> .env @@ -151,14 +140,14 @@ jobs: ###### Command: Deploy Contract ###### - name: Deploy axelar_gateway run: | - node stellar/deploy-contract deploy AxelarOperators --artifact-path $WASM_DIR/stellar_axelar_operators.optimized.wasm + node stellar/deploy-contract deploy AxelarOperators --artifact-path ${{ steps.compile_wasm.outputs.wasm_dir }}/stellar_axelar_operators.optimized.wasm ###### Command: Operators ###### - name: Execute is operator - run: node stellar/operators.js is-operator $STELLAR_ADDRESS + run: node stellar/operators.js is-operator ${{ steps.setup_wallet.outputs.stellar_address }} - name: Execute add operator - run: node stellar/operators.js add-operator $STELLAR_ADDRESS + run: node stellar/operators.js add-operator ${{ steps.setup_wallet.outputs.stellar_address }} - name: Execute remove operator - run: node stellar/operators.js remove-operator $STELLAR_ADDRESS + run: node stellar/operators.js remove-operator ${{ steps.setup_wallet.outputs.stellar_address }} diff --git a/stellar/utils.js b/stellar/utils.js index 744d601a8..de3ab1d8c 100644 --- a/stellar/utils.js +++ b/stellar/utils.js @@ -164,7 +164,7 @@ async function sendTransaction(tx, server, action, options = {}) { } async function broadcast(operation, wallet, chain, action, options = {}, simulateTransaction = false) { - const server = new rpc.Server(chain.rpc, { allowHttp: true }); + const server = new rpc.Server(chain.rpc, { allowHttp: chain.networkType === 'local' }); if (options.estimateCost) { const tx = await buildTransaction(operation, server, wallet, chain.networkType, options); @@ -197,7 +197,7 @@ async function getWallet(chain, options) { const keypair = Keypair.fromSecret(options.privateKey); const address = keypair.publicKey(); const provider = new rpc.Server(chain.rpc, { - allowHttp: true, + allowHttp: chain.networkType === 'local', }); const horizonServer = new Horizon.Server(chain.horizonRpc, { allowHttp: true }); const balances = await getBalances(horizonServer, address); From f9807a9b2776e872842a9500890ea84b0f5db0e1 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 14:29:26 -0700 Subject: [PATCH 072/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index f8487db5b..15b17bf1a 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -68,16 +68,9 @@ jobs: - name: Setup Stellar local network id: setup_network run: | - docker pull stellar/quickstart - docker run -d --rm -it \ - -p 8000:8000 \ - --name stellar \ - stellar/quickstart:testing \ - --local \ - --enable-soroban-rpc \ - --protocol-version 22 + stellar container start --protocol-version 22 echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_OUTPUT - echo "network_passphrase='Standalone Network ; February 2017'" >> $GITHUB_OUTPUT + echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_OUTPUT - name: Add as configured network run: | From 7cfee97614d5569f92decaad19b5c385da22a9a9 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 14:38:42 -0700 Subject: [PATCH 073/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 15b17bf1a..1a8b593a6 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -68,7 +68,8 @@ jobs: - name: Setup Stellar local network id: setup_network run: | - stellar container start --protocol-version 22 + # stellar container start --protocol-version + stellar container start --protocol-version 22 local echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_OUTPUT echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_OUTPUT From 27c7c11f7b3e0aaf50d610f8379101f971ca85cb Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 15:02:22 -0700 Subject: [PATCH 074/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 1a8b593a6..41b3960f0 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -105,14 +105,17 @@ jobs: - name: Display local.json run: cat ./axelar-chains-config/info/local.json - - name: Compile WASM contracts - id: compile_wasm + - name: Get Latest Short Commit Hash + id: get_commit_hash run: | - cd axelar-amplifier-stellar - stellar contract build - ./optimize.sh - cd .. - echo "wasm_dir=axelar-amplifier-stellar/target/wasm32-unknown-unknown/release" >> $GITHUB_OUTPUT + COMMIT_HASH=$(git rev-parse --short origin/main) + echo "commit_hash=${COMMIT_HASH}" >> $GITHUB_OUTPUT + + - name: Set Artifact URL Base + id: set_artifact_base_url + run: | + ARTIFACT_BASE_URL="https://static.axelar.network/releases/stellar/" + echo "artifact_base_url=${ARTIFACT_BASE_URL}" >> $GITHUB_OUTPUT - name: Setup Stellar wallet id: setup_wallet @@ -134,7 +137,10 @@ jobs: ###### Command: Deploy Contract ###### - name: Deploy axelar_gateway run: | - node stellar/deploy-contract deploy AxelarOperators --artifact-path ${{ steps.compile_wasm.outputs.wasm_dir }}/stellar_axelar_operators.optimized.wasm + CONTRACT_NAME=stellar_axelar_operators + ARTIFACT_PATH="${{ steps.set_artifact_url.outputs.artifact_url }}/${CONTRACT_NAME}/${{ steps.get_commit_hash.outputs.commit_hash }}/wasm/${CONTRACT_NAME}.wasm" + echo $ARTIFACT_PATH; + node stellar/deploy-contract deploy AxelarOperators --artifact-path $ARTIFACT_PATH ###### Command: Operators ###### - name: Execute is operator From 8398e8fa24d07b80131de75794ecd266f53aa970 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 15:14:43 -0700 Subject: [PATCH 075/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 41b3960f0..5bfd4b4f7 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -46,6 +46,15 @@ jobs: repository: axelarnetwork/axelar-amplifier-stellar path: axelar-amplifier-stellar + # Get the short commit hash from axelar-amplifier-stellar repo + - name: Get Latest Short Commit Hash from axelar-amplifier-stellar + id: get_short_commit_hash + run: | + cd axelar-amplifier-stellar + git fetch --all + COMMIT_HASH=$(git rev-parse --short HEAD) + echo "hash=${COMMIT_HASH}" >> $GITHUB_OUTPUT + - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -105,17 +114,11 @@ jobs: - name: Display local.json run: cat ./axelar-chains-config/info/local.json - - name: Get Latest Short Commit Hash - id: get_commit_hash - run: | - COMMIT_HASH=$(git rev-parse --short origin/main) - echo "commit_hash=${COMMIT_HASH}" >> $GITHUB_OUTPUT - - - name: Set Artifact URL Base + - name: Set Artifact Base URL id: set_artifact_base_url run: | ARTIFACT_BASE_URL="https://static.axelar.network/releases/stellar/" - echo "artifact_base_url=${ARTIFACT_BASE_URL}" >> $GITHUB_OUTPUT + echo "url=${ARTIFACT_BASE_URL}" >> $GITHUB_OUTPUT - name: Setup Stellar wallet id: setup_wallet @@ -138,7 +141,7 @@ jobs: - name: Deploy axelar_gateway run: | CONTRACT_NAME=stellar_axelar_operators - ARTIFACT_PATH="${{ steps.set_artifact_url.outputs.artifact_url }}/${CONTRACT_NAME}/${{ steps.get_commit_hash.outputs.commit_hash }}/wasm/${CONTRACT_NAME}.wasm" + ARTIFACT_PATH="${{ steps.set_artifact_base_url.outputs.url }}/${CONTRACT_NAME}/${{ steps.get_short_commit_hash.outputs.hash }}/wasm/${CONTRACT_NAME}.wasm" echo $ARTIFACT_PATH; node stellar/deploy-contract deploy AxelarOperators --artifact-path $ARTIFACT_PATH From 040c5bb34aafd3999f1bd0ee149b40f72f159e8b Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 15:42:14 -0700 Subject: [PATCH 076/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 5bfd4b4f7..0f0a0e3cb 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -137,13 +137,30 @@ jobs: echo "CHAIN=stellar" >> .env echo "YES=true" >> .env - ###### Command: Deploy Contract ###### - - name: Deploy axelar_gateway + ###### Command: Deploy Contracts ###### + - name: Deploy Contracts run: | - CONTRACT_NAME=stellar_axelar_operators - ARTIFACT_PATH="${{ steps.set_artifact_base_url.outputs.url }}/${CONTRACT_NAME}/${{ steps.get_short_commit_hash.outputs.hash }}/wasm/${CONTRACT_NAME}.wasm" - echo $ARTIFACT_PATH; - node stellar/deploy-contract deploy AxelarOperators --artifact-path $ARTIFACT_PATH + # List of contracts to deploy + CONTRACTS=("AxelarOperators" "AxelarGasService" "AxelarExample") + + for CONTRACT in "${CONTRACTS[@]}"; do + # Derive CONTRACT_DIR by: + # - Converting the CONTRACT name to lowercase. + # - Replacing any non-alphanumeric characters with a hyphen (-). + # - Prefixing with "stellar-". + CONTRACT_DIR="stellar-$(echo $CONTRACT | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g')" + + # Derive CONTRACT_NAME by: + # - Replacing hyphens in the CONTRACT_DIR with underscores (_). + CONTRACT_NAME=$(echo "${CONTRACT_DIR}" | sed 's/-/_/g') + + # Define ARTIFACT_PATH using the contract-specific details + ARTIFACT_PATH="${{ steps.set_artifact_base_url.outputs.url }}/${CONTRACT_DIR}/${{ steps.get_short_commit_hash.outputs.hash }}/wasm/${CONTRACT_NAME}.wasm" + echo "Deploying $CONTRACT from $ARTIFACT_PATH" + + # Deploy the contract + node stellar/deploy-contract deploy $CONTRACT --artifact-path $ARTIFACT_PATH + done ###### Command: Operators ###### - name: Execute is operator From 59bae2463ced97b29898c75493f32b72253c9cdd Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 18:37:15 -0700 Subject: [PATCH 077/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 0f0a0e3cb..87bf1f6a0 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -117,7 +117,7 @@ jobs: - name: Set Artifact Base URL id: set_artifact_base_url run: | - ARTIFACT_BASE_URL="https://static.axelar.network/releases/stellar/" + ARTIFACT_BASE_URL="https://static.axelar.network/releases/stellar" echo "url=${ARTIFACT_BASE_URL}" >> $GITHUB_OUTPUT - name: Setup Stellar wallet @@ -148,7 +148,7 @@ jobs: # - Converting the CONTRACT name to lowercase. # - Replacing any non-alphanumeric characters with a hyphen (-). # - Prefixing with "stellar-". - CONTRACT_DIR="stellar-$(echo $CONTRACT | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g')" + CONTRACT_DIR="stellar-$(echo $CONTRACT | sed 's/\([^A-Z]\)\([A-Z]\)/\1-\2/g' | tr '[:upper:]' '[:lower:]')" # Derive CONTRACT_NAME by: # - Replacing hyphens in the CONTRACT_DIR with underscores (_). From f8f611788672b166e1a36d29257c4c640cf79091 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 19:06:48 -0700 Subject: [PATCH 078/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 87bf1f6a0..fa79422dc 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -154,11 +154,14 @@ jobs: # - Replacing hyphens in the CONTRACT_DIR with underscores (_). CONTRACT_NAME=$(echo "${CONTRACT_DIR}" | sed 's/-/_/g') - # Define ARTIFACT_PATH using the contract-specific details ARTIFACT_PATH="${{ steps.set_artifact_base_url.outputs.url }}/${CONTRACT_DIR}/${{ steps.get_short_commit_hash.outputs.hash }}/wasm/${CONTRACT_NAME}.wasm" - echo "Deploying $CONTRACT from $ARTIFACT_PATH" + LOCAL_PATH="./artifacts/${CONTRACT_NAME}.wasm" + + mkdir -p ./artifacts + echo "Downloading $CONTRACT from $ARTIFACT_URL" + curl -sSfL "$ARTIFACT_URL" -o "$LOCAL_PATH" - # Deploy the contract + echo "Deploying $CONTRACT from $ARTIFACT_PATH" node stellar/deploy-contract deploy $CONTRACT --artifact-path $ARTIFACT_PATH done From 2d3a1061491ae58d93802f003e7e41e84eb15508 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 19:17:28 -0700 Subject: [PATCH 079/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index fa79422dc..debdce670 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -154,7 +154,7 @@ jobs: # - Replacing hyphens in the CONTRACT_DIR with underscores (_). CONTRACT_NAME=$(echo "${CONTRACT_DIR}" | sed 's/-/_/g') - ARTIFACT_PATH="${{ steps.set_artifact_base_url.outputs.url }}/${CONTRACT_DIR}/${{ steps.get_short_commit_hash.outputs.hash }}/wasm/${CONTRACT_NAME}.wasm" + ARTIFACT_URL="${{ steps.set_artifact_base_url.outputs.url }}/${CONTRACT_DIR}/${{ steps.get_short_commit_hash.outputs.hash }}/wasm/${CONTRACT_NAME}.wasm" LOCAL_PATH="./artifacts/${CONTRACT_NAME}.wasm" mkdir -p ./artifacts From bc87ef67d3914602773f1936e660584da7886825 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 19:27:07 -0700 Subject: [PATCH 080/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index debdce670..f334c5ea3 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -161,8 +161,8 @@ jobs: echo "Downloading $CONTRACT from $ARTIFACT_URL" curl -sSfL "$ARTIFACT_URL" -o "$LOCAL_PATH" - echo "Deploying $CONTRACT from $ARTIFACT_PATH" - node stellar/deploy-contract deploy $CONTRACT --artifact-path $ARTIFACT_PATH + echo "Deploying $CONTRACT from $LOCAL_PATH" + node stellar/deploy-contract deploy "$CONTRACT" --artifact-path "$LOCAL_PATH" done ###### Command: Operators ###### From 5fa6035984c25841eeca27ee4a0f99eba3feddd8 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 20:06:27 -0700 Subject: [PATCH 081/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index f334c5ea3..e5e7c012a 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -77,8 +77,7 @@ jobs: - name: Setup Stellar local network id: setup_network run: | - # stellar container start --protocol-version - stellar container start --protocol-version 22 local + stellar container start local -v --name stellar --protocol-version 22 echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_OUTPUT echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_OUTPUT @@ -161,8 +160,10 @@ jobs: echo "Downloading $CONTRACT from $ARTIFACT_URL" curl -sSfL "$ARTIFACT_URL" -o "$LOCAL_PATH" + ls -al "$LOCAL_PATH"; + echo "Deploying $CONTRACT from $LOCAL_PATH" - node stellar/deploy-contract deploy "$CONTRACT" --artifact-path "$LOCAL_PATH" + node stellar/deploy-contract.js deploy "$CONTRACT" --artifact-path "$LOCAL_PATH" done ###### Command: Operators ###### From d9196cbdff6c982648c202a2fd7e95316e93eabe Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 20:31:30 -0700 Subject: [PATCH 082/146] update --- .github/workflows/test-stellar.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index e5e7c012a..2790aea3d 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -77,7 +77,15 @@ jobs: - name: Setup Stellar local network id: setup_network run: | - stellar container start local -v --name stellar --protocol-version 22 + #stellar container start --protocol-version 22 local + docker pull stellar/quickstart + docker run -d --rm -it \ + -p 8000:8000 \ + --name stellar \ + stellar/quickstart:testing \ + --local \ + --enable-soroban-rpc \ + --protocol-version 22 echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_OUTPUT echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_OUTPUT From 4a89f4887c4fa53c3939011cde36e546097f45e6 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 20:38:27 -0700 Subject: [PATCH 083/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 72 +++++------------------------ 1 file changed, 12 insertions(+), 60 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 2790aea3d..63f4b822a 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -46,15 +46,6 @@ jobs: repository: axelarnetwork/axelar-amplifier-stellar path: axelar-amplifier-stellar - # Get the short commit hash from axelar-amplifier-stellar repo - - name: Get Latest Short Commit Hash from axelar-amplifier-stellar - id: get_short_commit_hash - run: | - cd axelar-amplifier-stellar - git fetch --all - COMMIT_HASH=$(git rev-parse --short HEAD) - echo "hash=${COMMIT_HASH}" >> $GITHUB_OUTPUT - - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -77,15 +68,8 @@ jobs: - name: Setup Stellar local network id: setup_network run: | - #stellar container start --protocol-version 22 local - docker pull stellar/quickstart - docker run -d --rm -it \ - -p 8000:8000 \ - --name stellar \ - stellar/quickstart:testing \ - --local \ - --enable-soroban-rpc \ - --protocol-version 22 + # stellar container start --protocol-version + stellar container start --protocol-version 22 local echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_OUTPUT echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_OUTPUT @@ -121,11 +105,14 @@ jobs: - name: Display local.json run: cat ./axelar-chains-config/info/local.json - - name: Set Artifact Base URL - id: set_artifact_base_url + - name: Compile WASM contracts + id: compile_wasm run: | - ARTIFACT_BASE_URL="https://static.axelar.network/releases/stellar" - echo "url=${ARTIFACT_BASE_URL}" >> $GITHUB_OUTPUT + cd axelar-amplifier-stellar + stellar contract build + ./optimize.sh + cd .. + echo "wasm_dir=axelar-amplifier-stellar/target/wasm32-unknown-unknown/release" >> $GITHUB_OUTPUT - name: Setup Stellar wallet id: setup_wallet @@ -144,42 +131,7 @@ jobs: echo "CHAIN=stellar" >> .env echo "YES=true" >> .env - ###### Command: Deploy Contracts ###### - - name: Deploy Contracts + ###### Command: Deploy Contract ###### + - name: Deploy axelar_gateway run: | - # List of contracts to deploy - CONTRACTS=("AxelarOperators" "AxelarGasService" "AxelarExample") - - for CONTRACT in "${CONTRACTS[@]}"; do - # Derive CONTRACT_DIR by: - # - Converting the CONTRACT name to lowercase. - # - Replacing any non-alphanumeric characters with a hyphen (-). - # - Prefixing with "stellar-". - CONTRACT_DIR="stellar-$(echo $CONTRACT | sed 's/\([^A-Z]\)\([A-Z]\)/\1-\2/g' | tr '[:upper:]' '[:lower:]')" - - # Derive CONTRACT_NAME by: - # - Replacing hyphens in the CONTRACT_DIR with underscores (_). - CONTRACT_NAME=$(echo "${CONTRACT_DIR}" | sed 's/-/_/g') - - ARTIFACT_URL="${{ steps.set_artifact_base_url.outputs.url }}/${CONTRACT_DIR}/${{ steps.get_short_commit_hash.outputs.hash }}/wasm/${CONTRACT_NAME}.wasm" - LOCAL_PATH="./artifacts/${CONTRACT_NAME}.wasm" - - mkdir -p ./artifacts - echo "Downloading $CONTRACT from $ARTIFACT_URL" - curl -sSfL "$ARTIFACT_URL" -o "$LOCAL_PATH" - - ls -al "$LOCAL_PATH"; - - echo "Deploying $CONTRACT from $LOCAL_PATH" - node stellar/deploy-contract.js deploy "$CONTRACT" --artifact-path "$LOCAL_PATH" - done - - ###### Command: Operators ###### - - name: Execute is operator - run: node stellar/operators.js is-operator ${{ steps.setup_wallet.outputs.stellar_address }} - - - name: Execute add operator - run: node stellar/operators.js add-operator ${{ steps.setup_wallet.outputs.stellar_address }} - - - name: Execute remove operator - run: node stellar/operators.js remove-operator ${{ steps.setup_wallet.outputs.stellar_address }} + node stellar/deploy-contract deploy AxelarOperators --artifact-path ${{ steps.compile_wasm.outputs.wasm_dir }}/stellar_axelar_operators.optimized.wasm From 22469a329199a60ea680f720af2496425ab02222 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 21:07:42 -0700 Subject: [PATCH 084/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 58 ++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 63f4b822a..32c91adda 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -46,6 +46,14 @@ jobs: repository: axelarnetwork/axelar-amplifier-stellar path: axelar-amplifier-stellar + - name: Get Latest Short Commit Hash from axelar-amplifier-stellar + id: get_short_commit_hash + run: | + cd axelar-amplifier-stellar + git fetch --all + COMMIT_HASH=$(git rev-parse --short HEAD) + echo "hash=${COMMIT_HASH}" >> $GITHUB_OUTPUT + - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -68,8 +76,7 @@ jobs: - name: Setup Stellar local network id: setup_network run: | - # stellar container start --protocol-version - stellar container start --protocol-version 22 local + stellar container start local --protocol-version 22 echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_OUTPUT echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_OUTPUT @@ -105,15 +112,6 @@ jobs: - name: Display local.json run: cat ./axelar-chains-config/info/local.json - - name: Compile WASM contracts - id: compile_wasm - run: | - cd axelar-amplifier-stellar - stellar contract build - ./optimize.sh - cd .. - echo "wasm_dir=axelar-amplifier-stellar/target/wasm32-unknown-unknown/release" >> $GITHUB_OUTPUT - - name: Setup Stellar wallet id: setup_wallet run: | @@ -132,6 +130,40 @@ jobs: echo "YES=true" >> .env ###### Command: Deploy Contract ###### - - name: Deploy axelar_gateway + #- name: Deploy axelar_gateway + # run: | + # node stellar/deploy-contract deploy AxelarOperators --artifact-path ${{ steps.compile_wasm.outputs.wasm_dir }}/stellar_axelar_operators.optimized.wasm + + ###### Command: Deploy Contracts ###### + - name: Deploy Contracts run: | - node stellar/deploy-contract deploy AxelarOperators --artifact-path ${{ steps.compile_wasm.outputs.wasm_dir }}/stellar_axelar_operators.optimized.wasm + # List of contracts to deploy + CONTRACTS=("AxelarOperators" "AxelarGasService" "AxelarExample") + + for CONTRACT in "${CONTRACTS[@]}"; do + # Derive CONTRACT_DIR by: + # - Converting the CONTRACT name to lowercase. + # - Replacing any non-alphanumeric characters with a hyphen (-). + # - Prefixing with "stellar-". + CONTRACT_DIR="stellar-$(echo $CONTRACT | sed 's/\([^A-Z]\)\([A-Z]\)/\1-\2/g' | tr '[:upper:]' '[:lower:]')" + + # Derive CONTRACT_NAME by: + # - Replacing hyphens in the CONTRACT_DIR with underscores (_). + CONTRACT_NAME=$(echo "${CONTRACT_DIR}" | sed 's/-/_/g') + + ARTIFACT_URL="${{ steps.set_artifact_base_url.outputs.url }}/${CONTRACT_DIR}/${{ steps.get_short_commit_hash.outputs.hash }}/wasm/${CONTRACT_NAME}.wasm" + LOCAL_PATH="./artifacts/${CONTRACT_NAME}.wasm" + + mkdir -p ./artifacts + echo "Downloading $CONTRACT from $ARTIFACT_URL" + curl -sSfL "$ARTIFACT_URL" -o "$LOCAL_PATH" + + ls -al "$LOCAL_PATH"; + + echo "Deploying $CONTRACT from $LOCAL_PATH" + echo "$CONTRACT_DIR" + echo "$CONTRACT_NAME" + echo "$CONTRACT" + echo "$LOCAL_PATH" + node stellar/deploy-contract deploy "$CONTRACT" --artifact-path "$LOCAL_PATH" + done From 079de5a7574243d8fced2727a9b0760554ea1afc Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 21:14:01 -0700 Subject: [PATCH 085/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 32c91adda..a496f4132 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -112,6 +112,12 @@ jobs: - name: Display local.json run: cat ./axelar-chains-config/info/local.json + - name: Set Artifact Base URL + id: set_artifact_base_url + run: | + ARTIFACT_BASE_URL="https://static.axelar.network/releases/stellar" + echo "url=${ARTIFACT_BASE_URL}" >> $GITHUB_OUTPUT + - name: Setup Stellar wallet id: setup_wallet run: | From 743b5438e783bb20f9004cc208deac7252a905cd Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 21:25:08 -0700 Subject: [PATCH 086/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index a496f4132..c7fcebf3b 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -135,10 +135,19 @@ jobs: echo "CHAIN=stellar" >> .env echo "YES=true" >> .env + - name: Compile WASM contracts + id: compile_wasm + run: | + cd axelar-amplifier-stellar + stellar contract build + ./optimize.sh + cd .. + echo "wasm_dir=axelar-amplifier-stellar/target/wasm32-unknown-unknown/release" >> $GITHUB_OUTPUT + ###### Command: Deploy Contract ###### - #- name: Deploy axelar_gateway - # run: | - # node stellar/deploy-contract deploy AxelarOperators --artifact-path ${{ steps.compile_wasm.outputs.wasm_dir }}/stellar_axelar_operators.optimized.wasm + - name: Deploy axelar_gateway + run: | + node stellar/deploy-contract deploy AxelarOperators --artifact-path ${{ steps.compile_wasm.outputs.wasm_dir }}/stellar_axelar_operators.optimized.wasm ###### Command: Deploy Contracts ###### - name: Deploy Contracts From c57caf05cb4d12e57f177db5926e99c9bfc26355 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 21:34:53 -0700 Subject: [PATCH 087/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index c7fcebf3b..f149e0d5f 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -86,6 +86,15 @@ jobs: --rpc-url "${{ steps.setup_network.outputs.rpc_url }}" \ --network-passphrase "${{ steps.setup_network.outputs.network_passphrase }}" + - name: Compile WASM contracts + id: compile_wasm + run: | + cd axelar-amplifier-stellar + stellar contract build + ./optimize.sh + cd .. + echo "wasm_dir=axelar-amplifier-stellar/target/wasm32-unknown-unknown/release" >> $GITHUB_OUTPUT + - name: Retrieve native token address id: get_xlm_address run: | @@ -135,15 +144,6 @@ jobs: echo "CHAIN=stellar" >> .env echo "YES=true" >> .env - - name: Compile WASM contracts - id: compile_wasm - run: | - cd axelar-amplifier-stellar - stellar contract build - ./optimize.sh - cd .. - echo "wasm_dir=axelar-amplifier-stellar/target/wasm32-unknown-unknown/release" >> $GITHUB_OUTPUT - ###### Command: Deploy Contract ###### - name: Deploy axelar_gateway run: | From 0cb1168bf3257c4aa0780e0f6e63fd9e5873cacf Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 21:45:43 -0700 Subject: [PATCH 088/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 30 +++++++++-------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index f149e0d5f..4dc92a296 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -80,21 +80,20 @@ jobs: echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_OUTPUT echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_OUTPUT + - name: Wait for Stellar network + uses: nev7n/wait_for_response@v1 + with: + url: 'http://localhost:8000' + responseCode: 200 + timeout: 300000 + interval: 2000 + - name: Add as configured network run: | stellar network add local \ --rpc-url "${{ steps.setup_network.outputs.rpc_url }}" \ --network-passphrase "${{ steps.setup_network.outputs.network_passphrase }}" - - name: Compile WASM contracts - id: compile_wasm - run: | - cd axelar-amplifier-stellar - stellar contract build - ./optimize.sh - cd .. - echo "wasm_dir=axelar-amplifier-stellar/target/wasm32-unknown-unknown/release" >> $GITHUB_OUTPUT - - name: Retrieve native token address id: get_xlm_address run: | @@ -144,16 +143,11 @@ jobs: echo "CHAIN=stellar" >> .env echo "YES=true" >> .env - ###### Command: Deploy Contract ###### - - name: Deploy axelar_gateway - run: | - node stellar/deploy-contract deploy AxelarOperators --artifact-path ${{ steps.compile_wasm.outputs.wasm_dir }}/stellar_axelar_operators.optimized.wasm - ###### Command: Deploy Contracts ###### - name: Deploy Contracts run: | # List of contracts to deploy - CONTRACTS=("AxelarOperators" "AxelarGasService" "AxelarExample") + CONTRACTS=("AxelarOperators" "AxelarGasService") for CONTRACT in "${CONTRACTS[@]}"; do # Derive CONTRACT_DIR by: @@ -173,12 +167,6 @@ jobs: echo "Downloading $CONTRACT from $ARTIFACT_URL" curl -sSfL "$ARTIFACT_URL" -o "$LOCAL_PATH" - ls -al "$LOCAL_PATH"; - echo "Deploying $CONTRACT from $LOCAL_PATH" - echo "$CONTRACT_DIR" - echo "$CONTRACT_NAME" - echo "$CONTRACT" - echo "$LOCAL_PATH" node stellar/deploy-contract deploy "$CONTRACT" --artifact-path "$LOCAL_PATH" done From e22cd25497fa1609d9c1c1e4ca1704790514a53d Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 22:03:48 -0700 Subject: [PATCH 089/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 4dc92a296..083aec7c0 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -85,8 +85,8 @@ jobs: with: url: 'http://localhost:8000' responseCode: 200 - timeout: 300000 - interval: 2000 + timeout: 500000 + interval: 1000 - name: Add as configured network run: | From 938d56ad3ee6ebdcf04ee31bbd3180435b1e7375 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 22:13:40 -0700 Subject: [PATCH 090/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 083aec7c0..b214eb88b 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -81,12 +81,7 @@ jobs: echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_OUTPUT - name: Wait for Stellar network - uses: nev7n/wait_for_response@v1 - with: - url: 'http://localhost:8000' - responseCode: 200 - timeout: 500000 - interval: 1000 + run: sleep 60 - name: Add as configured network run: | From 635b2fca224e899f5aab410e1de9243301fd97c2 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 3 Apr 2025 22:20:12 -0700 Subject: [PATCH 091/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index b214eb88b..b655035dd 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -105,8 +105,8 @@ jobs: "chainType": "stellar", "tokenSymbol": "XLM", "tokenAddress": "${{ steps.get_xlm_address.outputs.xlm_address }}", - "rpc": "http://127.0.0.1:8000/soroban/rpc", - "horizonRpc": "http://127.0.0.1:8000", + "rpc": "http://localhost:8000/soroban/rpc", + "horizonRpc": "http://localhost:8000", "contracts": {} } } From 80874a0d87fce0601e3233dfcef30bb3b15b693d Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 8 Apr 2025 12:49:15 -0700 Subject: [PATCH 092/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index b655035dd..c5bac1cad 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -7,23 +7,23 @@ jobs: name: Check for Relevant Changes runs-on: blacksmith-2vcpu-ubuntu-2204 outputs: - run_tests: ${{ steps.filter.outputs.stellar == 'true' || steps.filter.outputs.common == 'true' || steps.filter.outputs.github == 'true' }} + run_tests: ${{ steps.filter.outputs.contracts == 'true' || steps.filter.outputs.packages == 'true' || steps.filter.outputs.github == 'true' }} steps: - uses: actions/checkout@v4 - uses: dorny/paths-filter@v3 id: filter with: filters: | - stellar: - - 'stellar/**' - common: - - 'common/**' + contracts: + - 'contracts/**' + packages: + - 'packages/**' github: - '.github/workflows/test-stellar.yaml' - name: Summarize Changes run: | - echo "Changes in stellar: ${{ steps.filter.outputs.stellar }}" - echo "Changes in common: ${{ steps.filter.outputs.common }}" + echo "Changes in contracts: ${{ steps.filter.outputs.contracts }}" + echo "Changes in packages: ${{ steps.filter.outputs.packages }}" echo "Changes in github: ${{ steps.filter.outputs.github }}" test-stellar: @@ -81,7 +81,18 @@ jobs: echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_OUTPUT - name: Wait for Stellar network - run: sleep 60 + run: | + echo "Waiting for Stellar network (checking current_protocol_version)..." + for i in {1..30}; do + if curl -s http://localhost:8000/ | grep -q '"current_protocol_version"'; then + echo "Stellar network is ready." + exit 0 + fi + echo "Attempt $i: Stellar network not ready yet, retrying in 2 seconds..." + sleep 2 + done + echo "Stellar network did not become ready in time." + exit 1 - name: Add as configured network run: | From 181824922409eedd26714c122e9b3db4e99f3bbe Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 8 Apr 2025 13:14:11 -0700 Subject: [PATCH 093/146] update --- .../reusable-setup-stellar-cli-network.yaml | 72 +++++++++++++++++++ .github/workflows/test-stellar.yaml | 46 ++---------- 2 files changed, 76 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/reusable-setup-stellar-cli-network.yaml diff --git a/.github/workflows/reusable-setup-stellar-cli-network.yaml b/.github/workflows/reusable-setup-stellar-cli-network.yaml new file mode 100644 index 000000000..5098f8352 --- /dev/null +++ b/.github/workflows/reusable-setup-stellar-cli-network.yaml @@ -0,0 +1,72 @@ +name: Setup Stellar Network + +on: + workflow_call: + outputs: + rpc_url: + description: 'Stellar RPC URL' + value: ${{ jobs.setup.outputs.rpc_url }} + network_passphrase: + description: 'Stellar Network Passphrase' + value: ${{ jobs.setup.outputs.network_passphrase }} + xlm_address: + description: 'XLM Native Token Address' + value: ${{ jobs.setup.outputs.xlm_address }} + +jobs: + setup: + runs-on: blacksmith-4vcpu-ubuntu-2204 + outputs: + rpc_url: ${{ steps.setup_network.outputs.rpc_url }} + network_passphrase: ${{ steps.setup_network.outputs.network_passphrase }} + xlm_address: ${{ steps.get_xlm_address.outputs.xlm_address }} + steps: + - uses: actions/checkout@v4 + + - name: Install stable Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.81.0 + targets: wasm32-unknown-unknown + + - name: Install Stellar CLI + run: cargo install --locked stellar-cli --version 22.2.0 --features opt + + - name: Setup Stellar local network + id: setup_network + run: | + stellar container start local --protocol-version 22 + echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_OUTPUT + echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_OUTPUT + + - name: Wait for Stellar network (RPC + friendbot reachable) + run: | + echo "Waiting for Stellar network to be reachable (rpc + friendbot)..." + for i in {1..60}; do + echo "Attempt $i: checking..." + if ! curl -s http://localhost:8000/ | grep -q '"current_protocol_version"'; then + echo " - RPC not ready yet" + sleep 2 + continue + fi + if curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/friendbot | grep -q '^[0-9][0-9][0-9]$'; then + echo "✅ Stellar network is ready" + exit 0 + else + echo " - Friendbot not responding (curl failure)" + fi + sleep 2 + done + echo "❌ Stellar network did not become ready in 120 seconds." + exit 1 + + - name: Add as configured network + run: | + stellar network add local \ + --rpc-url "${{ steps.setup_network.outputs.rpc_url }}" \ + --network-passphrase "${{ steps.setup_network.outputs.network_passphrase }}" + + - name: Retrieve native token address + id: get_xlm_address + run: | + echo "xlm_address=$(stellar contract id asset --asset native --network local)" >> $GITHUB_OUTPUT diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index c5bac1cad..bdccc4a32 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -64,46 +64,8 @@ jobs: - name: Install dependencies run: npm ci - - name: Install stable Rust toolchain - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.81.0 - targets: wasm32-unknown-unknown - - - name: Install Stellar CLI - run: cargo install --locked stellar-cli --version 22.2.0 --features opt - - - name: Setup Stellar local network - id: setup_network - run: | - stellar container start local --protocol-version 22 - echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_OUTPUT - echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_OUTPUT - - - name: Wait for Stellar network - run: | - echo "Waiting for Stellar network (checking current_protocol_version)..." - for i in {1..30}; do - if curl -s http://localhost:8000/ | grep -q '"current_protocol_version"'; then - echo "Stellar network is ready." - exit 0 - fi - echo "Attempt $i: Stellar network not ready yet, retrying in 2 seconds..." - sleep 2 - done - echo "Stellar network did not become ready in time." - exit 1 - - - name: Add as configured network - run: | - stellar network add local \ - --rpc-url "${{ steps.setup_network.outputs.rpc_url }}" \ - --network-passphrase "${{ steps.setup_network.outputs.network_passphrase }}" - - - name: Retrieve native token address - id: get_xlm_address - run: | - echo "xlm_address=$(stellar contract id asset --asset native --network local)" >> $GITHUB_OUTPUT + - name: Setup Stellar CLI & network + uses: ./.github/actions/reusable-setup-stellar-cli-network.yaml - name: Prepare local.json run: | @@ -115,8 +77,8 @@ jobs: "networkType": "local", "chainType": "stellar", "tokenSymbol": "XLM", - "tokenAddress": "${{ steps.get_xlm_address.outputs.xlm_address }}", - "rpc": "http://localhost:8000/soroban/rpc", + "tokenAddress": "'"$xlm_address"'", + "rpc": "'"$rpc_url"'", "horizonRpc": "http://localhost:8000", "contracts": {} } From 6d54f805e137ca63746ca3575602eb50ea41d876 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 8 Apr 2025 13:57:24 -0700 Subject: [PATCH 094/146] update --- .../setup-stellar/action.yaml} | 2 +- .github/workflows/test-stellar.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename .github/{workflows/reusable-setup-stellar-cli-network.yaml => actions/setup-stellar/action.yaml} (98%) diff --git a/.github/workflows/reusable-setup-stellar-cli-network.yaml b/.github/actions/setup-stellar/action.yaml similarity index 98% rename from .github/workflows/reusable-setup-stellar-cli-network.yaml rename to .github/actions/setup-stellar/action.yaml index 5098f8352..2090621cb 100644 --- a/.github/workflows/reusable-setup-stellar-cli-network.yaml +++ b/.github/actions/setup-stellar/action.yaml @@ -1,4 +1,4 @@ -name: Setup Stellar Network +name: Setup Stellar CLI and Local Network on: workflow_call: diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index bdccc4a32..0ee25bd80 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -65,7 +65,7 @@ jobs: run: npm ci - name: Setup Stellar CLI & network - uses: ./.github/actions/reusable-setup-stellar-cli-network.yaml + uses: ./.github/actions/setup-stellar/action.yaml - name: Prepare local.json run: | From 26da74b798042a8e60c9e98af8607e0ad5cd4a8c Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 8 Apr 2025 14:00:11 -0700 Subject: [PATCH 095/146] update --- .github/actions/setup-stellar/{action.yaml => action.yml} | 0 .github/workflows/test-stellar.yaml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/actions/setup-stellar/{action.yaml => action.yml} (100%) diff --git a/.github/actions/setup-stellar/action.yaml b/.github/actions/setup-stellar/action.yml similarity index 100% rename from .github/actions/setup-stellar/action.yaml rename to .github/actions/setup-stellar/action.yml diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 0ee25bd80..4904a2762 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -65,7 +65,7 @@ jobs: run: npm ci - name: Setup Stellar CLI & network - uses: ./.github/actions/setup-stellar/action.yaml + uses: ./.github/actions/setup-stellar - name: Prepare local.json run: | From 63605257b99eb6611fafbaffc1e83c5647face31 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 8 Apr 2025 14:04:56 -0700 Subject: [PATCH 096/146] update --- .github/actions/setup-stellar/action.yml | 113 +++++++++-------------- .github/workflows/test-stellar.yaml | 8 +- 2 files changed, 50 insertions(+), 71 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 2090621cb..d1c53666c 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -1,72 +1,45 @@ -name: Setup Stellar CLI and Local Network +name: Setup Stellar CLI & Network +description: Install Stellar CLI and starts local Stellar network -on: - workflow_call: - outputs: - rpc_url: - description: 'Stellar RPC URL' - value: ${{ jobs.setup.outputs.rpc_url }} - network_passphrase: - description: 'Stellar Network Passphrase' - value: ${{ jobs.setup.outputs.network_passphrase }} - xlm_address: - description: 'XLM Native Token Address' - value: ${{ jobs.setup.outputs.xlm_address }} - -jobs: - setup: - runs-on: blacksmith-4vcpu-ubuntu-2204 - outputs: - rpc_url: ${{ steps.setup_network.outputs.rpc_url }} - network_passphrase: ${{ steps.setup_network.outputs.network_passphrase }} - xlm_address: ${{ steps.get_xlm_address.outputs.xlm_address }} +runs: + using: 'composite' steps: - - uses: actions/checkout@v4 - - - name: Install stable Rust toolchain - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.81.0 - targets: wasm32-unknown-unknown - - - name: Install Stellar CLI - run: cargo install --locked stellar-cli --version 22.2.0 --features opt - - - name: Setup Stellar local network - id: setup_network - run: | - stellar container start local --protocol-version 22 - echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_OUTPUT - echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_OUTPUT - - - name: Wait for Stellar network (RPC + friendbot reachable) - run: | - echo "Waiting for Stellar network to be reachable (rpc + friendbot)..." - for i in {1..60}; do - echo "Attempt $i: checking..." - if ! curl -s http://localhost:8000/ | grep -q '"current_protocol_version"'; then - echo " - RPC not ready yet" - sleep 2 - continue - fi - if curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/friendbot | grep -q '^[0-9][0-9][0-9]$'; then - echo "✅ Stellar network is ready" - exit 0 - else - echo " - Friendbot not responding (curl failure)" - fi - sleep 2 - done - echo "❌ Stellar network did not become ready in 120 seconds." - exit 1 - - - name: Add as configured network - run: | - stellar network add local \ - --rpc-url "${{ steps.setup_network.outputs.rpc_url }}" \ - --network-passphrase "${{ steps.setup_network.outputs.network_passphrase }}" - - - name: Retrieve native token address - id: get_xlm_address - run: | - echo "xlm_address=$(stellar contract id asset --asset native --network local)" >> $GITHUB_OUTPUT + - name: Install Stellar CLI + run: cargo install --locked stellar-cli --version 22.2.0 --features opt + + - name: Start Stellar local network + run: | + stellar container start local --protocol-version 22 + echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_ENV + echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_ENV + + - name: Wait for Stellar network + run: | + echo "Waiting for Stellar network to be reachable (rpc + friendbot)..." + for i in {1..60}; do + echo "Attempt $i: checking..." + if ! curl -s http://localhost:8000/ | grep -q '"current_protocol_version"'; then + echo " - RPC not ready yet" + sleep 2 + continue + fi + if curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/friendbot | grep -q '^[0-9][0-9][0-9]$'; then + echo "✅ Stellar network is ready" + exit 0 + else + echo " - Friendbot not responding (curl failure)" + fi + sleep 2 + done + echo "❌ Stellar network did not become ready in 120 seconds." + exit 1 + + - name: Add as configured network + run: | + stellar network add local \ + --rpc-url "$rpc_url" \ + --network-passphrase "$network_passphrase" + + - name: Retrieve native token address + run: | + echo "xlm_address=$(stellar contract id asset --asset native --network local)" >> $GITHUB_ENV diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 4904a2762..6bab2df9e 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -64,9 +64,15 @@ jobs: - name: Install dependencies run: npm ci - - name: Setup Stellar CLI & network + - name: Setup Stellar network uses: ./.github/actions/setup-stellar + - name: Use the environment variables + run: | + echo "RPC URL: $rpc_url" + echo "Network passphrase: $network_passphrase" + echo "XLM address: $xlm_address" + - name: Prepare local.json run: | echo '{ From e8c51741e954ed327a4ba8289644fa104b9dbae7 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 8 Apr 2025 14:07:12 -0700 Subject: [PATCH 097/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index d1c53666c..c8f49bb7f 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -5,15 +5,18 @@ runs: using: 'composite' steps: - name: Install Stellar CLI + shell: bash run: cargo install --locked stellar-cli --version 22.2.0 --features opt - name: Start Stellar local network + shell: bash run: | stellar container start local --protocol-version 22 echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_ENV echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_ENV - name: Wait for Stellar network + shell: bash run: | echo "Waiting for Stellar network to be reachable (rpc + friendbot)..." for i in {1..60}; do @@ -35,11 +38,13 @@ runs: exit 1 - name: Add as configured network + shell: bash run: | stellar network add local \ --rpc-url "$rpc_url" \ --network-passphrase "$network_passphrase" - name: Retrieve native token address + shell: bash run: | echo "xlm_address=$(stellar contract id asset --asset native --network local)" >> $GITHUB_ENV From 16d44dd3104989090f3c022fcbb953a8430328e3 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 8 Apr 2025 14:10:44 -0700 Subject: [PATCH 098/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index c8f49bb7f..e2d8dd712 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -4,6 +4,12 @@ description: Install Stellar CLI and starts local Stellar network runs: using: 'composite' steps: + - name: Install stable Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.81.0 + targets: wasm32-unknown-unknown + - name: Install Stellar CLI shell: bash run: cargo install --locked stellar-cli --version 22.2.0 --features opt From ac61909a6927eaaefb19e081a8fdcdb2845a0448 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 8 Apr 2025 14:22:12 -0700 Subject: [PATCH 099/146] update --- .github/actions/setup-stellar/action.yml | 16 +++++----------- .github/workflows/test-stellar.yaml | 24 ++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index e2d8dd712..aa023a4d2 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -24,23 +24,17 @@ runs: - name: Wait for Stellar network shell: bash run: | - echo "Waiting for Stellar network to be reachable (rpc + friendbot)..." + echo "Waiting for Stellar network RPC to become ready..." for i in {1..60}; do echo "Attempt $i: checking..." - if ! curl -s http://localhost:8000/ | grep -q '"current_protocol_version"'; then - echo " - RPC not ready yet" - sleep 2 - continue - fi - if curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/friendbot | grep -q '^[0-9][0-9][0-9]$'; then - echo "✅ Stellar network is ready" + if curl -s http://localhost:8000/ | grep -q '"current_protocol_version"'; then + echo "✅ Stellar RPC is ready" exit 0 - else - echo " - Friendbot not responding (curl failure)" fi + echo " - RPC not ready yet" sleep 2 done - echo "❌ Stellar network did not become ready in 120 seconds." + echo "❌ Stellar RPC did not become ready in 120 seconds." exit 1 - name: Add as configured network diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 6bab2df9e..57a60a038 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -105,11 +105,31 @@ jobs: run: | stellar keys generate test \ --rpc-url "${{ steps.setup_network.outputs.rpc_url }}" \ - --network-passphrase "${{ steps.setup_network.outputs.network_passphrase }}" \ - --fund + --network-passphrase "${{ steps.setup_network.outputs.network_passphrase }}" echo "private_key=$(stellar keys show test)" >> $GITHUB_OUTPUT echo "stellar_address=$(stellar keys address test)" >> $GITHUB_OUTPUT + - name: Wait for friendbot to successfully fund address + run: | + echo "Waiting for friendbot to successfully fund the address..." + + for i in {1..60}; do + echo "Attempt $i: calling friendbot..." + + RESPONSE=$(curl -s "http://localhost:8000/friendbot?addr=GBWLFYBZH6AHLFG6VMU2VLY4SC47HE3KYCZKDGPHEVPAPRWOXPC3DWP7") + + if echo "$RESPONSE" | grep -q '"successful": *true'; then + echo "✅ Friendbot successfully funded the address." + exit 0 + fi + + echo " - Not yet successful. Retrying in 2 seconds..." + sleep 2 + done + + echo "❌ Friendbot did not successfully fund the address in time." + exit 1 + - name: Prepare .env run: | echo "PRIVATE_KEY=${{ steps.setup_wallet.outputs.private_key }}" >> .env From 5010daa85f9dc44c46e0f0e92583ead110c5f20d Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 8 Apr 2025 14:23:49 -0700 Subject: [PATCH 100/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 57a60a038..680227756 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -111,12 +111,13 @@ jobs: - name: Wait for friendbot to successfully fund address run: | - echo "Waiting for friendbot to successfully fund the address..." + addr="${{ steps.setup_wallet.outputs.stellar_address }}" + echo "Waiting for friendbot to successfully fund address: $addr" for i in {1..60}; do echo "Attempt $i: calling friendbot..." - RESPONSE=$(curl -s "http://localhost:8000/friendbot?addr=GBWLFYBZH6AHLFG6VMU2VLY4SC47HE3KYCZKDGPHEVPAPRWOXPC3DWP7") + RESPONSE=$(curl -s "http://localhost:8000/friendbot?addr=$addr") if echo "$RESPONSE" | grep -q '"successful": *true'; then echo "✅ Friendbot successfully funded the address." From e28c7dd4e25fffd8e35c7f34474e92cc989af064 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 8 Apr 2025 14:32:57 -0700 Subject: [PATCH 101/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index aa023a4d2..150310b71 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -21,21 +21,12 @@ runs: echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_ENV echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_ENV - - name: Wait for Stellar network - shell: bash - run: | - echo "Waiting for Stellar network RPC to become ready..." - for i in {1..60}; do - echo "Attempt $i: checking..." - if curl -s http://localhost:8000/ | grep -q '"current_protocol_version"'; then - echo "✅ Stellar RPC is ready" - exit 0 - fi - echo " - RPC not ready yet" - sleep 2 - done - echo "❌ Stellar RPC did not become ready in 120 seconds." - exit 1 + - name: Wait for Stellar RPC + uses: nick-fields/assert-url@v1 + with: + url: http://localhost:8000/ + expected-status: 200 + timeout: 60 - name: Add as configured network shell: bash From 0b9f0a07d2364b9a731f743499522b0f6678a09c Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 8 Apr 2025 14:38:21 -0700 Subject: [PATCH 102/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 150310b71..279f8f0c8 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -22,11 +22,12 @@ runs: echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_ENV - name: Wait for Stellar RPC - uses: nick-fields/assert-url@v1 + uses: nev7n/wait_for_response@v1 with: - url: http://localhost:8000/ - expected-status: 200 - timeout: 60 + url: 'http://localhost:8000/' + responseCode: 200 + timeout: 60000 + interval: 1000 - name: Add as configured network shell: bash From 3fd068e0664bc5f3a1346f957db4bd8641152b17 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 8 Apr 2025 14:47:19 -0700 Subject: [PATCH 103/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 279f8f0c8..37e32fb56 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -21,14 +21,6 @@ runs: echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_ENV echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_ENV - - name: Wait for Stellar RPC - uses: nev7n/wait_for_response@v1 - with: - url: 'http://localhost:8000/' - responseCode: 200 - timeout: 60000 - interval: 1000 - - name: Add as configured network shell: bash run: | From 8f070e89e57591d79f19be03d4273bda0c38cacc Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 8 Apr 2025 14:55:31 -0700 Subject: [PATCH 104/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 37e32fb56..aa023a4d2 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -21,6 +21,22 @@ runs: echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_ENV echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_ENV + - name: Wait for Stellar network + shell: bash + run: | + echo "Waiting for Stellar network RPC to become ready..." + for i in {1..60}; do + echo "Attempt $i: checking..." + if curl -s http://localhost:8000/ | grep -q '"current_protocol_version"'; then + echo "✅ Stellar RPC is ready" + exit 0 + fi + echo " - RPC not ready yet" + sleep 2 + done + echo "❌ Stellar RPC did not become ready in 120 seconds." + exit 1 + - name: Add as configured network shell: bash run: | From 446e1797d634ebdcd69847441c5c49afe2b22a35 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 8 Apr 2025 15:03:38 -0700 Subject: [PATCH 105/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 680227756..b219bfb77 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -30,7 +30,7 @@ jobs: name: Test Stellar needs: check-relevant-changes if: ${{ needs.check-relevant-changes.outputs.run_tests == 'true' }} - runs-on: blacksmith-4vcpu-ubuntu-2204 + runs-on: blacksmith-8vcpu-ubuntu-2204 steps: # this sets up nested repos: https://github.com/actions/checkout?tab=readme-ov-file#checkout-multiple-repos-nested # axelar-contract-deployments @@ -128,7 +128,7 @@ jobs: sleep 2 done - echo "❌ Friendbot did not successfully fund the address in time." + echo "Friendbot did not successfully fund the address in time." exit 1 - name: Prepare .env From 82688a7231ba1759a4c2c071e995b0bb53788840 Mon Sep 17 00:00:00 2001 From: ahramy Date: Tue, 8 Apr 2025 15:12:31 -0700 Subject: [PATCH 106/146] update --- .github/actions/setup-stellar/action.yml | 4 ++-- .github/workflows/test-stellar.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index aa023a4d2..29716d7d2 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -25,7 +25,7 @@ runs: shell: bash run: | echo "Waiting for Stellar network RPC to become ready..." - for i in {1..60}; do + for i in {1..30}; do echo "Attempt $i: checking..." if curl -s http://localhost:8000/ | grep -q '"current_protocol_version"'; then echo "✅ Stellar RPC is ready" @@ -34,7 +34,7 @@ runs: echo " - RPC not ready yet" sleep 2 done - echo "❌ Stellar RPC did not become ready in 120 seconds." + echo "Stellar RPC did not become ready in 60 seconds." exit 1 - name: Add as configured network diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index b219bfb77..264866d95 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -114,7 +114,7 @@ jobs: addr="${{ steps.setup_wallet.outputs.stellar_address }}" echo "Waiting for friendbot to successfully fund address: $addr" - for i in {1..60}; do + for i in {1..30}; do echo "Attempt $i: calling friendbot..." RESPONSE=$(curl -s "http://localhost:8000/friendbot?addr=$addr") @@ -128,7 +128,7 @@ jobs: sleep 2 done - echo "Friendbot did not successfully fund the address in time." + echo "Friendbot did not successfully fund the address in 60 seconds." exit 1 - name: Prepare .env From 691d15abbc4f13c8ee2c47ede85bc15877855aca Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 11:43:35 -0700 Subject: [PATCH 107/146] update --- .github/actions/setup-stellar/action.yml | 28 +++++++++++------------- .github/workflows/test-stellar.yaml | 14 ++++++------ 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 29716d7d2..33314e325 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -1,50 +1,48 @@ name: Setup Stellar CLI & Network -description: Install Stellar CLI and starts local Stellar network +description: Install Stellar CLI and start a local Stellar network runs: using: 'composite' steps: - name: Install stable Rust toolchain uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.81.0 - targets: wasm32-unknown-unknown - name: Install Stellar CLI shell: bash - run: cargo install --locked stellar-cli --version 22.2.0 --features opt + run: cargo install --locked stellar-cli --version 22 --features opt - name: Start Stellar local network shell: bash run: | stellar container start local --protocol-version 22 - echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_ENV - echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_ENV + RPC_HOST="http://localhost:8000" + RPC_URL="${RPC_HOST}/soroban/rpc" + echo "rpc_url=${RPC_URL}" >> $GITHUB_OUTPUT + echo "network_passphrase='Standalone Network ; February 2017'" >> $GITHUB_OUTPUT - name: Wait for Stellar network shell: bash + timeout-minutes: 2 run: | echo "Waiting for Stellar network RPC to become ready..." - for i in {1..30}; do - echo "Attempt $i: checking..." - if curl -s http://localhost:8000/ | grep -q '"current_protocol_version"'; then + while true; do + echo "Checking..." + if curl -s "${RPC_HOST}/" | grep -q '"current_protocol_version"'; then echo "✅ Stellar RPC is ready" exit 0 fi echo " - RPC not ready yet" sleep 2 done - echo "Stellar RPC did not become ready in 60 seconds." - exit 1 - name: Add as configured network shell: bash run: | stellar network add local \ - --rpc-url "$rpc_url" \ - --network-passphrase "$network_passphrase" + --rpc-url "${{ steps.start_stellar_local_network.outputs.rpc_url }}" \ + --network-passphrase "${{ steps.start_stellar_local_network.outputs.network_passphrase }}" - name: Retrieve native token address shell: bash run: | - echo "xlm_address=$(stellar contract id asset --asset native --network local)" >> $GITHUB_ENV + echo "xlm_address=$(stellar contract id asset --asset native --network local)" >> $GITHUB_OUTPUT diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 264866d95..e93599cd7 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -69,9 +69,9 @@ jobs: - name: Use the environment variables run: | - echo "RPC URL: $rpc_url" - echo "Network passphrase: $network_passphrase" - echo "XLM address: $xlm_address" + echo "RPC URL: ${{ steps.setup_network.outputs.rpc_url }}" + echo "Network passphrase: ${{ steps.setup_network.outputs.network_passphrase }}" + echo "XLM address: ${{ steps.setup_network.outputs.xlm_address }}" - name: Prepare local.json run: | @@ -83,8 +83,8 @@ jobs: "networkType": "local", "chainType": "stellar", "tokenSymbol": "XLM", - "tokenAddress": "'"$xlm_address"'", - "rpc": "'"$rpc_url"'", + "tokenAddress": "'"${{ steps.setup_network.outputs.xlm_address }}"'", + "rpc": "'"${{ steps.setup_network.outputs.rpc_url }}"'", "horizonRpc": "http://localhost:8000", "contracts": {} } @@ -104,8 +104,8 @@ jobs: id: setup_wallet run: | stellar keys generate test \ - --rpc-url "${{ steps.setup_network.outputs.rpc_url }}" \ - --network-passphrase "${{ steps.setup_network.outputs.network_passphrase }}" + --rpc-url "http://localhost:8000/soroban/rpc" \ + --network-passphrase "Standalone Network ; February 2017" echo "private_key=$(stellar keys show test)" >> $GITHUB_OUTPUT echo "stellar_address=$(stellar keys address test)" >> $GITHUB_OUTPUT From 17fe6ac26c69f2bba2e4782bbc6ca9c4766fec73 Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 11:51:51 -0700 Subject: [PATCH 108/146] update --- .github/actions/setup-stellar/action.yml | 1 - .github/workflows/test-stellar.yaml | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 33314e325..5413966b3 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -22,7 +22,6 @@ runs: - name: Wait for Stellar network shell: bash - timeout-minutes: 2 run: | echo "Waiting for Stellar network RPC to become ready..." while true; do diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index e93599cd7..4fb38a74f 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -65,6 +65,7 @@ jobs: run: npm ci - name: Setup Stellar network + timeout-minutes: 4 uses: ./.github/actions/setup-stellar - name: Use the environment variables From b711c1e1ef309aa47ce4b81d764c1050235a09a2 Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 11:54:13 -0700 Subject: [PATCH 109/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 5413966b3..6814b433b 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -9,7 +9,7 @@ runs: - name: Install Stellar CLI shell: bash - run: cargo install --locked stellar-cli --version 22 --features opt + run: cargo install --locked stellar-cli --version ^22 --features opt - name: Start Stellar local network shell: bash From a871a3807f80584dc1cdc9f25f05129bc2104c66 Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 12:10:00 -0700 Subject: [PATCH 110/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 6814b433b..596807ce4 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -9,7 +9,7 @@ runs: - name: Install Stellar CLI shell: bash - run: cargo install --locked stellar-cli --version ^22 --features opt + run: cargo install --locked stellar-cli --version 22.2.0 --features opt - name: Start Stellar local network shell: bash From 7760ab2e58de347e0d7fe425c79de9b968cb8836 Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 12:25:11 -0700 Subject: [PATCH 111/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 28 ++++++++++++++++++------ 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 596807ce4..fbc350f34 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -1,8 +1,22 @@ name: Setup Stellar CLI & Network description: Install Stellar CLI and start a local Stellar network +outputs: + rpc_url: + description: 'RPC URL of the local Stellar network' + value: ${{ steps.start.outputs.rpc_url }} + network_passphrase: + description: 'Network passphrase' + value: ${{ steps.start.outputs.network_passphrase }} + xlm_address: + description: 'Native XLM asset address' + value: ${{ steps.native_token.outputs.xlm_address }} + runs: using: 'composite' + env: + RPC_HOST: http://localhost:8000 + RPC_URL: http://localhost:8000/soroban/rpc steps: - name: Install stable Rust toolchain uses: dtolnay/rust-toolchain@stable @@ -12,13 +26,12 @@ runs: run: cargo install --locked stellar-cli --version 22.2.0 --features opt - name: Start Stellar local network + id: start shell: bash run: | stellar container start local --protocol-version 22 - RPC_HOST="http://localhost:8000" - RPC_URL="${RPC_HOST}/soroban/rpc" - echo "rpc_url=${RPC_URL}" >> $GITHUB_OUTPUT - echo "network_passphrase='Standalone Network ; February 2017'" >> $GITHUB_OUTPUT + echo "rpc_url=${RPC_URL}" >> "$GITHUB_OUTPUT" + echo "network_passphrase=Standalone Network ; February 2017" >> "$GITHUB_OUTPUT" - name: Wait for Stellar network shell: bash @@ -38,10 +51,11 @@ runs: shell: bash run: | stellar network add local \ - --rpc-url "${{ steps.start_stellar_local_network.outputs.rpc_url }}" \ - --network-passphrase "${{ steps.start_stellar_local_network.outputs.network_passphrase }}" + --rpc-url "${{ steps.start.outputs.rpc_url }}" \ + --network-passphrase "${{ steps.start.outputs.network_passphrase }}" - name: Retrieve native token address + id: native_token shell: bash run: | - echo "xlm_address=$(stellar contract id asset --asset native --network local)" >> $GITHUB_OUTPUT + echo "xlm_address=$(stellar contract id asset --asset native --network local)" >> "$GITHUB_OUTPUT" From 6b02e9ac46825c64f0e94c1c9e5bc0b8a30e6c44 Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 12:39:50 -0700 Subject: [PATCH 112/146] update --- .github/actions/setup-stellar/action.yml | 25 +++++++------------- .github/workflows/test-stellar.yaml | 30 ++++++++++-------------- 2 files changed, 20 insertions(+), 35 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index fbc350f34..b36d51509 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -1,22 +1,12 @@ name: Setup Stellar CLI & Network description: Install Stellar CLI and start a local Stellar network -outputs: - rpc_url: - description: 'RPC URL of the local Stellar network' - value: ${{ steps.start.outputs.rpc_url }} - network_passphrase: - description: 'Network passphrase' - value: ${{ steps.start.outputs.network_passphrase }} - xlm_address: - description: 'Native XLM asset address' - value: ${{ steps.native_token.outputs.xlm_address }} - runs: using: 'composite' env: - RPC_HOST: http://localhost:8000 - RPC_URL: http://localhost:8000/soroban/rpc + HORIZON_RPC: 'http://localhost:8000' + RPC_URL: 'http://localhost:8000/soroban/rpc' + NETWORK_PASSPHRASE: 'Standalone Network ; February 2017' steps: - name: Install stable Rust toolchain uses: dtolnay/rust-toolchain@stable @@ -30,8 +20,9 @@ runs: shell: bash run: | stellar container start local --protocol-version 22 + echo "horizon_rpc=${HORIZON_RPC}" >> "$GITHUB_OUTPUT" echo "rpc_url=${RPC_URL}" >> "$GITHUB_OUTPUT" - echo "network_passphrase=Standalone Network ; February 2017" >> "$GITHUB_OUTPUT" + echo "network_passphrase=${NETWORK_PASSPHRASE}" >> "$GITHUB_OUTPUT" - name: Wait for Stellar network shell: bash @@ -39,7 +30,7 @@ runs: echo "Waiting for Stellar network RPC to become ready..." while true; do echo "Checking..." - if curl -s "${RPC_HOST}/" | grep -q '"current_protocol_version"'; then + if curl -s "${HORIZON_RPC}/" | grep -q '"current_protocol_version"'; then echo "✅ Stellar RPC is ready" exit 0 fi @@ -51,8 +42,8 @@ runs: shell: bash run: | stellar network add local \ - --rpc-url "${{ steps.start.outputs.rpc_url }}" \ - --network-passphrase "${{ steps.start.outputs.network_passphrase }}" + --rpc-url "${RPC_URL}" \ + --network-passphrase "${NETWORK_PASSPHRASE}" - name: Retrieve native token address id: native_token diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 4fb38a74f..ec0389ea4 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -7,23 +7,23 @@ jobs: name: Check for Relevant Changes runs-on: blacksmith-2vcpu-ubuntu-2204 outputs: - run_tests: ${{ steps.filter.outputs.contracts == 'true' || steps.filter.outputs.packages == 'true' || steps.filter.outputs.github == 'true' }} + run_tests: ${{ steps.filter.outputs.stellar == 'true' || steps.filter.outputs.common == 'true' || steps.filter.outputs.github == 'true' }} steps: - uses: actions/checkout@v4 - uses: dorny/paths-filter@v3 id: filter with: filters: | - contracts: - - 'contracts/**' - packages: - - 'packages/**' + stellar: + - 'stellar/**' + common: + - 'common/**' github: - '.github/workflows/test-stellar.yaml' - name: Summarize Changes run: | - echo "Changes in contracts: ${{ steps.filter.outputs.contracts }}" - echo "Changes in packages: ${{ steps.filter.outputs.packages }}" + echo "Changes in stellar: ${{ steps.filter.outputs.stellar }}" + echo "Changes in common: ${{ steps.filter.outputs.common }}" echo "Changes in github: ${{ steps.filter.outputs.github }}" test-stellar: @@ -68,12 +68,6 @@ jobs: timeout-minutes: 4 uses: ./.github/actions/setup-stellar - - name: Use the environment variables - run: | - echo "RPC URL: ${{ steps.setup_network.outputs.rpc_url }}" - echo "Network passphrase: ${{ steps.setup_network.outputs.network_passphrase }}" - echo "XLM address: ${{ steps.setup_network.outputs.xlm_address }}" - - name: Prepare local.json run: | echo '{ @@ -84,9 +78,9 @@ jobs: "networkType": "local", "chainType": "stellar", "tokenSymbol": "XLM", - "tokenAddress": "'"${{ steps.setup_network.outputs.xlm_address }}"'", - "rpc": "'"${{ steps.setup_network.outputs.rpc_url }}"'", - "horizonRpc": "http://localhost:8000", + "tokenAddress": "${{ steps.setup_network.outputs.xlm_address }}", + "rpc": "${{ steps.setup_network.outputs.rpc_url }}", + "horizonRpc": "${{ steps.setup_network.outputs.horizon_rpc }}", "contracts": {} } } @@ -105,8 +99,8 @@ jobs: id: setup_wallet run: | stellar keys generate test \ - --rpc-url "http://localhost:8000/soroban/rpc" \ - --network-passphrase "Standalone Network ; February 2017" + --rpc-url "${{ steps.setup_network.outputs.rpc_url }}" \ + --network-passphrase "${{ steps.setup_network.outputs.network_passphrase }}" echo "private_key=$(stellar keys show test)" >> $GITHUB_OUTPUT echo "stellar_address=$(stellar keys address test)" >> $GITHUB_OUTPUT From 97f4e24bc8f2680933c1ab7670ff4fae9ff62c50 Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 12:44:59 -0700 Subject: [PATCH 113/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index b36d51509..bed76ced3 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -1,7 +1,7 @@ name: Setup Stellar CLI & Network description: Install Stellar CLI and start a local Stellar network -runs: +runs: using: 'composite' env: HORIZON_RPC: 'http://localhost:8000' From 2f428dc64476774a2e2dcdb00f029c80263240ad Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 12:57:16 -0700 Subject: [PATCH 114/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 32 ++++++++++++++++-------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index bed76ced3..859ad9ad0 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -1,12 +1,22 @@ name: Setup Stellar CLI & Network description: Install Stellar CLI and start a local Stellar network -runs: +outputs: + rpc_url: + description: 'RPC URL of the local Stellar network' + value: ${{ steps.start.outputs.rpc_url }} + network_passphrase: + description: 'Network passphrase of the local Stellar network' + value: ${{ steps.start.outputs.network_passphrase }} + horizon_rpc: + description: 'Horizon RPC URL' + value: ${{ steps.start.outputs.horizon_rpc }} + xlm_address: + description: 'Native XLM asset address' + value: ${{ steps.native_token.outputs.xlm_address }} + +runs: using: 'composite' - env: - HORIZON_RPC: 'http://localhost:8000' - RPC_URL: 'http://localhost:8000/soroban/rpc' - NETWORK_PASSPHRASE: 'Standalone Network ; February 2017' steps: - name: Install stable Rust toolchain uses: dtolnay/rust-toolchain@stable @@ -20,9 +30,9 @@ runs: shell: bash run: | stellar container start local --protocol-version 22 - echo "horizon_rpc=${HORIZON_RPC}" >> "$GITHUB_OUTPUT" - echo "rpc_url=${RPC_URL}" >> "$GITHUB_OUTPUT" - echo "network_passphrase=${NETWORK_PASSPHRASE}" >> "$GITHUB_OUTPUT" + echo "horizon_rpc=http://localhost:8000" >> $GITHUB_OUTPUT + echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_OUTPUT + echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_OUTPUT - name: Wait for Stellar network shell: bash @@ -30,7 +40,7 @@ runs: echo "Waiting for Stellar network RPC to become ready..." while true; do echo "Checking..." - if curl -s "${HORIZON_RPC}/" | grep -q '"current_protocol_version"'; then + if curl -s "${{ steps.start.outputs.horizon_rpc }}" | grep -q '"current_protocol_version"'; then echo "✅ Stellar RPC is ready" exit 0 fi @@ -42,8 +52,8 @@ runs: shell: bash run: | stellar network add local \ - --rpc-url "${RPC_URL}" \ - --network-passphrase "${NETWORK_PASSPHRASE}" + --rpc-url "${{ steps.start.outputs.rpc_url }}" \ + --network-passphrase "${{ steps.start.outputs.network_passphrase }}" - name: Retrieve native token address id: native_token From 300e62145d09df73b0721b06983fb4ee6f163936 Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 13:20:18 -0700 Subject: [PATCH 115/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 859ad9ad0..2fbc58acc 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -2,15 +2,15 @@ name: Setup Stellar CLI & Network description: Install Stellar CLI and start a local Stellar network outputs: - rpc_url: - description: 'RPC URL of the local Stellar network' - value: ${{ steps.start.outputs.rpc_url }} network_passphrase: description: 'Network passphrase of the local Stellar network' value: ${{ steps.start.outputs.network_passphrase }} horizon_rpc: description: 'Horizon RPC URL' value: ${{ steps.start.outputs.horizon_rpc }} + rpc_url: + description: 'RPC URL of the local Stellar network' + value: ${{ steps.start.outputs.rpc_url }} xlm_address: description: 'Native XLM asset address' value: ${{ steps.native_token.outputs.xlm_address }} @@ -30,9 +30,9 @@ runs: shell: bash run: | stellar container start local --protocol-version 22 + echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_OUTPUT echo "horizon_rpc=http://localhost:8000" >> $GITHUB_OUTPUT echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_OUTPUT - echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_OUTPUT - name: Wait for Stellar network shell: bash From d8e107dc8f4827770569415f549138c43746ce1b Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 13:22:17 -0700 Subject: [PATCH 116/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index ec0389ea4..d92261be8 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -65,6 +65,7 @@ jobs: run: npm ci - name: Setup Stellar network + id: setup_network timeout-minutes: 4 uses: ./.github/actions/setup-stellar From 349a340615a8dc621fc582e27329c73daf20a67e Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 13:33:01 -0700 Subject: [PATCH 117/146] update --- .github/actions/setup-stellar/action.yml | 2 +- .github/workflows/test-stellar.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 2fbc58acc..1dab6a585 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -30,7 +30,7 @@ runs: shell: bash run: | stellar container start local --protocol-version 22 - echo "network_passphrase=Standalone Network ; February 2017" >> $GITHUB_OUTPUT + echo "network_passphrase='Standalone Network ; February 2017'" >> $GITHUB_OUTPUT echo "horizon_rpc=http://localhost:8000" >> $GITHUB_OUTPUT echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_OUTPUT diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index d92261be8..a7f50aded 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -30,7 +30,7 @@ jobs: name: Test Stellar needs: check-relevant-changes if: ${{ needs.check-relevant-changes.outputs.run_tests == 'true' }} - runs-on: blacksmith-8vcpu-ubuntu-2204 + runs-on: blacksmith-16vcpu-ubuntu-2204 steps: # this sets up nested repos: https://github.com/actions/checkout?tab=readme-ov-file#checkout-multiple-repos-nested # axelar-contract-deployments From 434f8ce306e0d541a7b88d0efdd4d7d27db7823c Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 13:39:12 -0700 Subject: [PATCH 118/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index a7f50aded..e67957464 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -30,7 +30,7 @@ jobs: name: Test Stellar needs: check-relevant-changes if: ${{ needs.check-relevant-changes.outputs.run_tests == 'true' }} - runs-on: blacksmith-16vcpu-ubuntu-2204 + runs-on: blacksmith-16vcpu-ubuntu-2204 steps: # this sets up nested repos: https://github.com/actions/checkout?tab=readme-ov-file#checkout-multiple-repos-nested # axelar-contract-deployments From 56f48ab9a4e52a6e4d1238e0a36c5204addc97b0 Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 14:17:21 -0700 Subject: [PATCH 119/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index e67957464..d92261be8 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -30,7 +30,7 @@ jobs: name: Test Stellar needs: check-relevant-changes if: ${{ needs.check-relevant-changes.outputs.run_tests == 'true' }} - runs-on: blacksmith-16vcpu-ubuntu-2204 + runs-on: blacksmith-8vcpu-ubuntu-2204 steps: # this sets up nested repos: https://github.com/actions/checkout?tab=readme-ov-file#checkout-multiple-repos-nested # axelar-contract-deployments From 7fc09a211eff836ffd60330061a8991ee2849a3f Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 21:08:46 -0700 Subject: [PATCH 120/146] update --- .github/actions/setup-stellar/action.yml | 41 +++++++++++----- .github/workflows/test-stellar.yaml | 62 +----------------------- 2 files changed, 31 insertions(+), 72 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 1dab6a585..99c2135aa 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -11,9 +11,6 @@ outputs: rpc_url: description: 'RPC URL of the local Stellar network' value: ${{ steps.start.outputs.rpc_url }} - xlm_address: - description: 'Native XLM asset address' - value: ${{ steps.native_token.outputs.xlm_address }} runs: using: 'composite' @@ -26,7 +23,7 @@ runs: run: cargo install --locked stellar-cli --version 22.2.0 --features opt - name: Start Stellar local network - id: start + id: setup_network shell: bash run: | stellar container start local --protocol-version 22 @@ -40,7 +37,7 @@ runs: echo "Waiting for Stellar network RPC to become ready..." while true; do echo "Checking..." - if curl -s "${{ steps.start.outputs.horizon_rpc }}" | grep -q '"current_protocol_version"'; then + if curl -s "${{ steps.setup_network.outputs.horizon_rpc }}" | grep -q '"current_protocol_version"'; then echo "✅ Stellar RPC is ready" exit 0 fi @@ -52,11 +49,33 @@ runs: shell: bash run: | stellar network add local \ - --rpc-url "${{ steps.start.outputs.rpc_url }}" \ - --network-passphrase "${{ steps.start.outputs.network_passphrase }}" + --rpc-url "${{ steps.setup_network.outputs.rpc_url }}" \ + --network-passphrase "${{ steps.setup_network.outputs.network_passphrase }}" - - name: Retrieve native token address - id: native_token - shell: bash + - name: Prepare local.json + run: | + echo '{ + "chains": { + "stellar": { + "name": "Stellar", + "axelarId": "stellar", + "networkType": "local", + "chainType": "stellar", + "tokenSymbol": "XLM", + "tokenAddress": "CDMLFMKMMD7MWZP3FKUBZPVHTUEDLSX4BYGYKH4GCESXYHS3IHQ4EIG4", + "rpc": "${{ steps.setup_network.outputs.rpc_url }}", + "horizonRpc": "${{ steps.setup_network.outputs.horizon_rpc }}", + "contracts": {} + } + } + }' > ./axelar-chains-config/info/local.json + + - name: Display local.json + run: cat ./axelar-chains-config/info/local.json + + - name: Prepare .env run: | - echo "xlm_address=$(stellar contract id asset --asset native --network local)" >> "$GITHUB_OUTPUT" + echo "PRIVATE_KEY=SC5O7VZUXDJ6JBDSZ74DSERXL7W3Y5LTOAMRF7RQRL3TAGAPS7LUVG3L" >> .env + echo "ENV=local" >> .env + echo "CHAIN=stellar" >> .env + echo "YES=true" >> .env diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index d92261be8..c8c7d9956 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -65,75 +65,15 @@ jobs: run: npm ci - name: Setup Stellar network - id: setup_network - timeout-minutes: 4 + timeout-minutes: 5 uses: ./.github/actions/setup-stellar - - name: Prepare local.json - run: | - echo '{ - "chains": { - "stellar": { - "name": "Stellar", - "axelarId": "stellar", - "networkType": "local", - "chainType": "stellar", - "tokenSymbol": "XLM", - "tokenAddress": "${{ steps.setup_network.outputs.xlm_address }}", - "rpc": "${{ steps.setup_network.outputs.rpc_url }}", - "horizonRpc": "${{ steps.setup_network.outputs.horizon_rpc }}", - "contracts": {} - } - } - }' > ./axelar-chains-config/info/local.json - - - name: Display local.json - run: cat ./axelar-chains-config/info/local.json - - name: Set Artifact Base URL id: set_artifact_base_url run: | ARTIFACT_BASE_URL="https://static.axelar.network/releases/stellar" echo "url=${ARTIFACT_BASE_URL}" >> $GITHUB_OUTPUT - - name: Setup Stellar wallet - id: setup_wallet - run: | - stellar keys generate test \ - --rpc-url "${{ steps.setup_network.outputs.rpc_url }}" \ - --network-passphrase "${{ steps.setup_network.outputs.network_passphrase }}" - echo "private_key=$(stellar keys show test)" >> $GITHUB_OUTPUT - echo "stellar_address=$(stellar keys address test)" >> $GITHUB_OUTPUT - - - name: Wait for friendbot to successfully fund address - run: | - addr="${{ steps.setup_wallet.outputs.stellar_address }}" - echo "Waiting for friendbot to successfully fund address: $addr" - - for i in {1..30}; do - echo "Attempt $i: calling friendbot..." - - RESPONSE=$(curl -s "http://localhost:8000/friendbot?addr=$addr") - - if echo "$RESPONSE" | grep -q '"successful": *true'; then - echo "✅ Friendbot successfully funded the address." - exit 0 - fi - - echo " - Not yet successful. Retrying in 2 seconds..." - sleep 2 - done - - echo "Friendbot did not successfully fund the address in 60 seconds." - exit 1 - - - name: Prepare .env - run: | - echo "PRIVATE_KEY=${{ steps.setup_wallet.outputs.private_key }}" >> .env - echo "ENV=local" >> .env - echo "CHAIN=stellar" >> .env - echo "YES=true" >> .env - ###### Command: Deploy Contracts ###### - name: Deploy Contracts run: | From d85b4c5a342aadbac295cc070ca6842f1de10d5e Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 21:10:41 -0700 Subject: [PATCH 121/146] update --- .github/actions/setup-stellar/action.yml | 3 +++ .github/workflows/test-stellar.yaml | 9 ++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 99c2135aa..10718f07c 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -53,6 +53,7 @@ runs: --network-passphrase "${{ steps.setup_network.outputs.network_passphrase }}" - name: Prepare local.json + shell: bash run: | echo '{ "chains": { @@ -71,9 +72,11 @@ runs: }' > ./axelar-chains-config/info/local.json - name: Display local.json + shell: bash run: cat ./axelar-chains-config/info/local.json - name: Prepare .env + shell: bash run: | echo "PRIVATE_KEY=SC5O7VZUXDJ6JBDSZ74DSERXL7W3Y5LTOAMRF7RQRL3TAGAPS7LUVG3L" >> .env echo "ENV=local" >> .env diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index c8c7d9956..1a4681f85 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -64,17 +64,16 @@ jobs: - name: Install dependencies run: npm ci - - name: Setup Stellar network - timeout-minutes: 5 - uses: ./.github/actions/setup-stellar - - name: Set Artifact Base URL id: set_artifact_base_url run: | ARTIFACT_BASE_URL="https://static.axelar.network/releases/stellar" echo "url=${ARTIFACT_BASE_URL}" >> $GITHUB_OUTPUT - ###### Command: Deploy Contracts ###### + - name: Setup Stellar network + timeout-minutes: 5 + uses: ./.github/actions/setup-stellar + - name: Deploy Contracts run: | # List of contracts to deploy From 9db07345415d00d001a26686c10c97a642a3bae9 Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 21:26:10 -0700 Subject: [PATCH 122/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 1a4681f85..0a4a11a96 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -74,6 +74,9 @@ jobs: timeout-minutes: 5 uses: ./.github/actions/setup-stellar + - name: Wait for 60 seconds + run: sleep 60 + - name: Deploy Contracts run: | # List of contracts to deploy From af326bc50683a83512baeeae3c04001ade65981d Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 21:34:34 -0700 Subject: [PATCH 123/146] update --- .github/actions/setup-stellar/action.yml | 20 +++++++++++++++++--- .github/workflows/test-stellar.yaml | 3 --- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 10718f07c..c7d1ce09d 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -35,13 +35,27 @@ runs: shell: bash run: | echo "Waiting for Stellar network RPC to become ready..." + echo " Horizon RPC: ${{ steps.setup_network.outputs.horizon_rpc }}" + echo " Soroban RPC: ${{ steps.setup_network.outputs.rpc_url }}" + while true; do - echo "Checking..." + echo "Checking Horizon RPC..." if curl -s "${{ steps.setup_network.outputs.horizon_rpc }}" | grep -q '"current_protocol_version"'; then - echo "✅ Stellar RPC is ready" + echo "✅ Horizon RPC is ready" + else + echo " - Horizon RPC not ready yet" + sleep 2 + continue + fi + + echo "Checking Soroban RPC..." + if curl -s "${{ steps.setup_network.outputs.rpc_url }}/status" | grep -q '"status":"healty"'; then + echo "✅ Soroban RPC is ready" exit 0 + else + echo " - Soroban RPC not ready yet" fi - echo " - RPC not ready yet" + sleep 2 done diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 0a4a11a96..1a4681f85 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -74,9 +74,6 @@ jobs: timeout-minutes: 5 uses: ./.github/actions/setup-stellar - - name: Wait for 60 seconds - run: sleep 60 - - name: Deploy Contracts run: | # List of contracts to deploy From 644d4659c0aafbb8f0b8d965c82574905c361cd9 Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 21:48:50 -0700 Subject: [PATCH 124/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index c7d1ce09d..9e624bb33 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -49,7 +49,12 @@ runs: fi echo "Checking Soroban RPC..." - if curl -s "${{ steps.setup_network.outputs.rpc_url }}/status" | grep -q '"status":"healty"'; then + SOROBAN_STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" \ + -X POST "$SOROBAN_RPC" \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","id":0,"method":"getNetwork"}') + + if [ "$SOROBAN_STATUS_CODE" -eq 200 ]; then echo "✅ Soroban RPC is ready" exit 0 else From 904bbd31241c9e7dbe1176f95f73108abe1a479f Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 21:54:34 -0700 Subject: [PATCH 125/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 9e624bb33..f8bcbfe08 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -50,7 +50,7 @@ runs: echo "Checking Soroban RPC..." SOROBAN_STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" \ - -X POST "$SOROBAN_RPC" \ + -X POST "${{ steps.setup_network.outputs.rpc_url }}" \ -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","id":0,"method":"getNetwork"}') From 8e591aa968d6a535d6efec3128ba2945b4ec1432 Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 22:10:16 -0700 Subject: [PATCH 126/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 32 +++++++----------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index f8bcbfe08..d41311465 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -11,7 +11,9 @@ outputs: rpc_url: description: 'RPC URL of the local Stellar network' value: ${{ steps.start.outputs.rpc_url }} - + friendbot: + description: 'Friendbot of the local Stellar network' + value: ${{ steps.start.outputs.friendbot }} runs: using: 'composite' steps: @@ -30,37 +32,21 @@ runs: echo "network_passphrase='Standalone Network ; February 2017'" >> $GITHUB_OUTPUT echo "horizon_rpc=http://localhost:8000" >> $GITHUB_OUTPUT echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_OUTPUT + echo "friendbot=http://localhost:8000/friendbot" >> $GITHUB_OUTPUT - name: Wait for Stellar network shell: bash run: | - echo "Waiting for Stellar network RPC to become ready..." - echo " Horizon RPC: ${{ steps.setup_network.outputs.horizon_rpc }}" - echo " Soroban RPC: ${{ steps.setup_network.outputs.rpc_url }}" + echo "Waiting for Stellar network to become ready..." while true; do - echo "Checking Horizon RPC..." - if curl -s "${{ steps.setup_network.outputs.horizon_rpc }}" | grep -q '"current_protocol_version"'; then - echo "✅ Horizon RPC is ready" - else - echo " - Horizon RPC not ready yet" - sleep 2 - continue - fi - - echo "Checking Soroban RPC..." - SOROBAN_STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" \ - -X POST "${{ steps.setup_network.outputs.rpc_url }}" \ - -H 'Content-Type: application/json' \ - -d '{"jsonrpc":"2.0","id":0,"method":"getNetwork"}') - - if [ "$SOROBAN_STATUS_CODE" -eq 200 ]; then - echo "✅ Soroban RPC is ready" + echo "Checking Friendbot: ${{ steps.setup_network.outputs.friendbot }} ..." + if curl -s "${{ steps.setup_network.outputs.friendbot }}" | grep -q '"status"'; then + echo "✅ Stellar Network is ready" exit 0 - else - echo " - Soroban RPC not ready yet" fi + echo " - Stellar Network not ready yet" sleep 2 done From a0497d6a21446367cf01e6d528fbccbf3695ea28 Mon Sep 17 00:00:00 2001 From: ahramy Date: Wed, 9 Apr 2025 23:08:30 -0700 Subject: [PATCH 127/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index d41311465..c2e545469 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -83,6 +83,7 @@ runs: - name: Prepare .env shell: bash run: | + # The root account is derived from the network ID/passphrase echo "PRIVATE_KEY=SC5O7VZUXDJ6JBDSZ74DSERXL7W3Y5LTOAMRF7RQRL3TAGAPS7LUVG3L" >> .env echo "ENV=local" >> .env echo "CHAIN=stellar" >> .env From 4ad70dc4588e043f161e8185f965bfa6220920b1 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 10 Apr 2025 11:49:15 -0700 Subject: [PATCH 128/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 46 ++++++++---------------- 1 file changed, 14 insertions(+), 32 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index c2e545469..1dbb4b454 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -1,19 +1,6 @@ name: Setup Stellar CLI & Network description: Install Stellar CLI and start a local Stellar network -outputs: - network_passphrase: - description: 'Network passphrase of the local Stellar network' - value: ${{ steps.start.outputs.network_passphrase }} - horizon_rpc: - description: 'Horizon RPC URL' - value: ${{ steps.start.outputs.horizon_rpc }} - rpc_url: - description: 'RPC URL of the local Stellar network' - value: ${{ steps.start.outputs.rpc_url }} - friendbot: - description: 'Friendbot of the local Stellar network' - value: ${{ steps.start.outputs.friendbot }} runs: using: 'composite' steps: @@ -24,38 +11,33 @@ runs: shell: bash run: cargo install --locked stellar-cli --version 22.2.0 --features opt + - name: Set environment variables + shell: bash + run: | + echo "LOCALHOST=http://localhost:8000" >> $GITHUB_ENV + echo "NETWORK_PASSPHRASE='Standalone Network ; February 2017'" >> $GITHUB_ENV + - name: Start Stellar local network - id: setup_network shell: bash run: | stellar container start local --protocol-version 22 - echo "network_passphrase='Standalone Network ; February 2017'" >> $GITHUB_OUTPUT - echo "horizon_rpc=http://localhost:8000" >> $GITHUB_OUTPUT - echo "rpc_url=http://localhost:8000/soroban/rpc" >> $GITHUB_OUTPUT - echo "friendbot=http://localhost:8000/friendbot" >> $GITHUB_OUTPUT - name: Wait for Stellar network shell: bash run: | echo "Waiting for Stellar network to become ready..." - - while true; do - echo "Checking Friendbot: ${{ steps.setup_network.outputs.friendbot }} ..." - if curl -s "${{ steps.setup_network.outputs.friendbot }}" | grep -q '"status"'; then - echo "✅ Stellar Network is ready" - exit 0 - fi - + until curl -s "$LOCALHOST/friendbot" | grep -q '"status"'; do echo " - Stellar Network not ready yet" sleep 2 done + echo "✅ Stellar Network is ready" - name: Add as configured network shell: bash run: | stellar network add local \ - --rpc-url "${{ steps.setup_network.outputs.rpc_url }}" \ - --network-passphrase "${{ steps.setup_network.outputs.network_passphrase }}" + --rpc-url "$LOCALHOST/soroban/rpc" \ + --network-passphrase "$NETWORK_PASSPHRASE" - name: Prepare local.json shell: bash @@ -69,8 +51,8 @@ runs: "chainType": "stellar", "tokenSymbol": "XLM", "tokenAddress": "CDMLFMKMMD7MWZP3FKUBZPVHTUEDLSX4BYGYKH4GCESXYHS3IHQ4EIG4", - "rpc": "${{ steps.setup_network.outputs.rpc_url }}", - "horizonRpc": "${{ steps.setup_network.outputs.horizon_rpc }}", + "rpc": "$LOCALHOST/soroban/rpc", + "horizonRpc": "$LOCALHOST", "contracts": {} } } @@ -83,8 +65,8 @@ runs: - name: Prepare .env shell: bash run: | - # The root account is derived from the network ID/passphrase - echo "PRIVATE_KEY=SC5O7VZUXDJ6JBDSZ74DSERXL7W3Y5LTOAMRF7RQRL3TAGAPS7LUVG3L" >> .env + ROOT_SECRET=$(stellar container logs | grep 'network root secret key:' | cut -d ':' -f2 | xargs) + echo "PRIVATE_KEY=$ROOT_SECRET" >> .env echo "ENV=local" >> .env echo "CHAIN=stellar" >> .env echo "YES=true" >> .env From d881e2e98fe6d58d55beaa8d39a0e8c4dd8cba6f Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 10 Apr 2025 11:58:26 -0700 Subject: [PATCH 129/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 1dbb4b454..166bd25d2 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -14,8 +14,11 @@ runs: - name: Set environment variables shell: bash run: | - echo "LOCALHOST=http://localhost:8000" >> $GITHUB_ENV echo "NETWORK_PASSPHRASE='Standalone Network ; February 2017'" >> $GITHUB_ENV + echo "LOCALHOST=http://localhost:8000" >> $GITHUB_ENV + echo "HORIZON_RPC=$LOCALHOST" >> $GITHUB_ENV + echo "SOROBAN_RPC=$LOCALHOST/soroban/rpc" >> $GITHUB_ENV + echo "FRIENDBOT=$LOCALHOST/friendbot" >> $GITHUB_ENV - name: Start Stellar local network shell: bash @@ -26,7 +29,7 @@ runs: shell: bash run: | echo "Waiting for Stellar network to become ready..." - until curl -s "$LOCALHOST/friendbot" | grep -q '"status"'; do + until curl -s "$FRIENDBOT" | grep -q '"status"'; do echo " - Stellar Network not ready yet" sleep 2 done @@ -36,7 +39,7 @@ runs: shell: bash run: | stellar network add local \ - --rpc-url "$LOCALHOST/soroban/rpc" \ + --rpc-url "$SOROBAN_RPC" \ --network-passphrase "$NETWORK_PASSPHRASE" - name: Prepare local.json @@ -51,8 +54,8 @@ runs: "chainType": "stellar", "tokenSymbol": "XLM", "tokenAddress": "CDMLFMKMMD7MWZP3FKUBZPVHTUEDLSX4BYGYKH4GCESXYHS3IHQ4EIG4", - "rpc": "$LOCALHOST/soroban/rpc", - "horizonRpc": "$LOCALHOST", + "rpc": "$SOROBAN_RPC", + "horizonRpc": "$HORIZON_RPC", "contracts": {} } } @@ -65,7 +68,7 @@ runs: - name: Prepare .env shell: bash run: | - ROOT_SECRET=$(stellar container logs | grep 'network root secret key:' | cut -d ':' -f2 | xargs) + ROOT_SECRET=$(stellar container logs local | grep 'network root secret key:' | cut -d ':' -f2 | xargs) echo "PRIVATE_KEY=$ROOT_SECRET" >> .env echo "ENV=local" >> .env echo "CHAIN=stellar" >> .env From 270a02a7769ae00d08c33862727cdc8c4f2bdaff Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 10 Apr 2025 13:51:25 -0700 Subject: [PATCH 130/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 166bd25d2..1d1c582aa 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -28,11 +28,20 @@ runs: - name: Wait for Stellar network shell: bash run: | + MAX_WAIT=60 + ELAPSED=0 + echo "Waiting for Stellar network to become ready..." until curl -s "$FRIENDBOT" | grep -q '"status"'; do echo " - Stellar Network not ready yet" sleep 2 + ELAPSED=$((ELAPSED + 2)) + if [ "$ELAPSED" -ge "$MAX_WAIT" ]; then + echo "Timed out after $MAX_WAIT seconds waiting for Stellar network." + exit 1 + fi done + echo "✅ Stellar Network is ready" - name: Add as configured network From 27bf70147c5a2a07296519ce152371e09c763c72 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 10 Apr 2025 15:27:24 -0700 Subject: [PATCH 131/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 1d1c582aa..ca230bc22 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -16,7 +16,7 @@ runs: run: | echo "NETWORK_PASSPHRASE='Standalone Network ; February 2017'" >> $GITHUB_ENV echo "LOCALHOST=http://localhost:8000" >> $GITHUB_ENV - echo "HORIZON_RPC=$LOCALHOST" >> $GITHUB_ENV + echo "HORIZON_RPC=$LOCALHOST/" >> $GITHUB_ENV echo "SOROBAN_RPC=$LOCALHOST/soroban/rpc" >> $GITHUB_ENV echo "FRIENDBOT=$LOCALHOST/friendbot" >> $GITHUB_ENV @@ -28,7 +28,7 @@ runs: - name: Wait for Stellar network shell: bash run: | - MAX_WAIT=60 + MAX_WAIT=120 ELAPSED=0 echo "Waiting for Stellar network to become ready..." From 42f55d2ef937d2f87a77a95fc5cd4f64cd292220 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 10 Apr 2025 15:37:35 -0700 Subject: [PATCH 132/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index ca230bc22..fcdc9e762 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -32,17 +32,24 @@ runs: ELAPSED=0 echo "Waiting for Stellar network to become ready..." - until curl -s "$FRIENDBOT" | grep -q '"status"'; do - echo " - Stellar Network not ready yet" + while true; do + echo "Checking Friendbot... ($FRIENDBOT)" + if curl -s "$FRIENDBOT" | grep -q '"status"'; then + echo "✅ Stellar Network is ready" + exit 0 + fi + sleep 2 ELAPSED=$((ELAPSED + 2)) + if [ "$ELAPSED" -ge "$MAX_WAIT" ]; then echo "Timed out after $MAX_WAIT seconds waiting for Stellar network." exit 1 fi - done - echo "✅ Stellar Network is ready" + echo " - Stellar Network not ready yet" + + done - name: Add as configured network shell: bash From e4b1fa5b89a527a416669fce3aaf171188b3eea3 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 10 Apr 2025 15:49:54 -0700 Subject: [PATCH 133/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index fcdc9e762..d7e72428b 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -14,11 +14,11 @@ runs: - name: Set environment variables shell: bash run: | - echo "NETWORK_PASSPHRASE='Standalone Network ; February 2017'" >> $GITHUB_ENV - echo "LOCALHOST=http://localhost:8000" >> $GITHUB_ENV + LOCALHOST=http://localhost:8000 echo "HORIZON_RPC=$LOCALHOST/" >> $GITHUB_ENV echo "SOROBAN_RPC=$LOCALHOST/soroban/rpc" >> $GITHUB_ENV echo "FRIENDBOT=$LOCALHOST/friendbot" >> $GITHUB_ENV + echo "NETWORK_PASSPHRASE='Standalone Network ; February 2017'" >> $GITHUB_ENV - name: Start Stellar local network shell: bash From 6fa0c8c4bb56e0dc8426cbb5674da895ae455831 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 10 Apr 2025 16:02:45 -0700 Subject: [PATCH 134/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index d7e72428b..b001624e7 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -33,8 +33,8 @@ runs: echo "Waiting for Stellar network to become ready..." while true; do - echo "Checking Friendbot... ($FRIENDBOT)" - if curl -s "$FRIENDBOT" | grep -q '"status"'; then + echo "Checking Friendbot: ${FRIENDBOT} ..." + if curl -s "${FRIENDBOT}" | grep -q '"status"'; then echo "✅ Stellar Network is ready" exit 0 fi @@ -55,8 +55,8 @@ runs: shell: bash run: | stellar network add local \ - --rpc-url "$SOROBAN_RPC" \ - --network-passphrase "$NETWORK_PASSPHRASE" + --rpc-url "${SOROBAN_RPC}" \ + --network-passphrase "${NETWORK_PASSPHRASE}" - name: Prepare local.json shell: bash @@ -70,8 +70,8 @@ runs: "chainType": "stellar", "tokenSymbol": "XLM", "tokenAddress": "CDMLFMKMMD7MWZP3FKUBZPVHTUEDLSX4BYGYKH4GCESXYHS3IHQ4EIG4", - "rpc": "$SOROBAN_RPC", - "horizonRpc": "$HORIZON_RPC", + "rpc": "${SOROBAN_RPC}", + "horizonRpc": "${HORIZON_RPC}", "contracts": {} } } @@ -85,7 +85,8 @@ runs: shell: bash run: | ROOT_SECRET=$(stellar container logs local | grep 'network root secret key:' | cut -d ':' -f2 | xargs) - echo "PRIVATE_KEY=$ROOT_SECRET" >> .env + echo "PRIVATE_KEY=${ROOT_SECRET}" >> .env echo "ENV=local" >> .env echo "CHAIN=stellar" >> .env echo "YES=true" >> .env + cat .env From e9d6f14624c9e7b5bcf2449431b9630023ed8f63 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 10 Apr 2025 21:48:37 -0700 Subject: [PATCH 135/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index b001624e7..53f980bb3 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -12,13 +12,14 @@ runs: run: cargo install --locked stellar-cli --version 22.2.0 --features opt - name: Set environment variables + id: env shell: bash run: | LOCALHOST=http://localhost:8000 - echo "HORIZON_RPC=$LOCALHOST/" >> $GITHUB_ENV - echo "SOROBAN_RPC=$LOCALHOST/soroban/rpc" >> $GITHUB_ENV - echo "FRIENDBOT=$LOCALHOST/friendbot" >> $GITHUB_ENV - echo "NETWORK_PASSPHRASE='Standalone Network ; February 2017'" >> $GITHUB_ENV + echo "horizon_rpc=$LOCALHOST/" >> $GITHUB_OUTPUT + echo "soroban_rpc=$LOCALHOST/soroban/rpc" >> $GITHUB_OUTPUT + echo "friendbot=$LOCALHOST/friendbot" >> $GITHUB_OUTPUT + echo "network_passphrase='Standalone Network ; February 2017'" >> $GITHUB_OUTPUT - name: Start Stellar local network shell: bash @@ -33,8 +34,8 @@ runs: echo "Waiting for Stellar network to become ready..." while true; do - echo "Checking Friendbot: ${FRIENDBOT} ..." - if curl -s "${FRIENDBOT}" | grep -q '"status"'; then + echo "Checking Friendbot: ${{ steps.env.outputs.friendbot }} ..." + if curl -s "${{ steps.env.outputs.friendbot }}" | grep -q '"status"'; then echo "✅ Stellar Network is ready" exit 0 fi @@ -55,8 +56,8 @@ runs: shell: bash run: | stellar network add local \ - --rpc-url "${SOROBAN_RPC}" \ - --network-passphrase "${NETWORK_PASSPHRASE}" + --rpc-url "${{ steps.env.outputs.soroban_rpc }}" \ + --network-passphrase "${{ steps.env.outputs.network_passphrase }}" - name: Prepare local.json shell: bash @@ -70,8 +71,8 @@ runs: "chainType": "stellar", "tokenSymbol": "XLM", "tokenAddress": "CDMLFMKMMD7MWZP3FKUBZPVHTUEDLSX4BYGYKH4GCESXYHS3IHQ4EIG4", - "rpc": "${SOROBAN_RPC}", - "horizonRpc": "${HORIZON_RPC}", + "rpc": "${{ steps.env.outputs.soroban_rpc }}", + "horizonRpc": "${{ steps.env.outputs.horizon_rpc }}", "contracts": {} } } From b9eadf4200e6e7f4145935fbbf1a6bd501bcff12 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 10 Apr 2025 22:01:23 -0700 Subject: [PATCH 136/146] update --- .github/workflows/test-stellar.yaml | 1 - axelar-chains-config/info/devnet-amplifier.json | 6 +++--- stellar/generate-bindings.js | 8 +++++--- stellar/utils.js | 12 ++++++++---- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 1a4681f85..1659d8ca6 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -71,7 +71,6 @@ jobs: echo "url=${ARTIFACT_BASE_URL}" >> $GITHUB_OUTPUT - name: Setup Stellar network - timeout-minutes: 5 uses: ./.github/actions/setup-stellar - name: Deploy Contracts diff --git a/axelar-chains-config/info/devnet-amplifier.json b/axelar-chains-config/info/devnet-amplifier.json index b9a59f313..e89960599 100644 --- a/axelar-chains-config/info/devnet-amplifier.json +++ b/axelar-chains-config/info/devnet-amplifier.json @@ -667,11 +667,11 @@ "connectionType": "amplifier" }, "AxelarOperators": { - "address": "CDOWLXRHI3JVLTDXUZK4AA5RYT4MO53KGGHWRVTMLI6C74HJPAG5W7WO", - "deployer": "GCRN3JXRVXHQTFQFM7NR4TTTORGZDCJWPIOLPQQHL6WMAQGVMWSXJL3Q", + "address": "CAAKMUFUR3CVWFTTT4ROHRPBH6Q4RSUWQX7O7BRTR4TMDQLETMKO4NMK", + "deployer": "GBL3CICTZNEQIVUEKP74PGSSU275KAMNQABOEQENHFUXB5P5FGBXETET", "wasmHash": "82acfafba05ef400104d172664e8d30dbadca6e21e97fa9ae2e1c06c9148be1d", "initializeArgs": { - "owner": "GCRN3JXRVXHQTFQFM7NR4TTTORGZDCJWPIOLPQQHL6WMAQGVMWSXJL3Q" + "owner": "GBL3CICTZNEQIVUEKP74PGSSU275KAMNQABOEQENHFUXB5P5FGBXETET" } }, "AxelarGasService": { diff --git a/stellar/generate-bindings.js b/stellar/generate-bindings.js index dfdccbb4e..c46ec646f 100644 --- a/stellar/generate-bindings.js +++ b/stellar/generate-bindings.js @@ -5,13 +5,15 @@ const { execSync } = require('child_process'); const { loadConfig } = require('../evm/utils'); const path = require('path'); const { stellarCmd, getNetworkPassphrase } = require('./utils'); -const { addEnvOption } = require('../common'); +const { addEnvOption, getChainConfig } = require('../common'); const { validateParameters } = require('../common/utils'); require('./cli-utils'); -function processCommand(options, _, chain) { +function processCommand(options, config) { const { artifactPath, contractId, outputDir } = options; + const chain = getChainConfig(config, options.chainName); + validateParameters({ isValidStellarAddress: { contractId }, }); @@ -43,7 +45,7 @@ function main() { program.action((options) => { const config = loadConfig(options.env); - processCommand(options, config, config.chains.stellar); + processCommand(options, config); }); program.parse(); diff --git a/stellar/utils.js b/stellar/utils.js index e06d22172..7d94445c0 100644 --- a/stellar/utils.js +++ b/stellar/utils.js @@ -202,13 +202,17 @@ function getAssetCode(balance, chain) { return balance.asset_type === 'native' ? chain.tokenSymbol : balance.asset_code; } +function getRpcOptions(chain) { + return { + allowHttp: chain.networkType === 'local', + }; +} + async function getWallet(chain, options) { const keypair = Keypair.fromSecret(options.privateKey); const address = keypair.publicKey(); - const provider = new rpc.Server(chain.rpc, { - allowHttp: chain.networkType === 'local', - }); - const horizonServer = new Horizon.Server(chain.horizonRpc, { allowHttp: true }); + const provider = new rpc.Server(chain.rpc, getRpcOptions(chain)); + const horizonServer = new Horizon.Server(chain.horizonRpc, getRpcOptions(chain)); const balances = await getBalances(horizonServer, address); printInfo('Wallet address', address); From 225aa827fb98036df835d12d64f2a71f39a7ad69 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 10 Apr 2025 22:05:09 -0700 Subject: [PATCH 137/146] update --- .github/workflows/test-stellar.yaml | 27 ++----------------- .../info/devnet-amplifier.json | 4 +-- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 1659d8ca6..95f800f89 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -64,12 +64,6 @@ jobs: - name: Install dependencies run: npm ci - - name: Set Artifact Base URL - id: set_artifact_base_url - run: | - ARTIFACT_BASE_URL="https://static.axelar.network/releases/stellar" - echo "url=${ARTIFACT_BASE_URL}" >> $GITHUB_OUTPUT - - name: Setup Stellar network uses: ./.github/actions/setup-stellar @@ -79,23 +73,6 @@ jobs: CONTRACTS=("AxelarOperators" "AxelarGasService") for CONTRACT in "${CONTRACTS[@]}"; do - # Derive CONTRACT_DIR by: - # - Converting the CONTRACT name to lowercase. - # - Replacing any non-alphanumeric characters with a hyphen (-). - # - Prefixing with "stellar-". - CONTRACT_DIR="stellar-$(echo $CONTRACT | sed 's/\([^A-Z]\)\([A-Z]\)/\1-\2/g' | tr '[:upper:]' '[:lower:]')" - - # Derive CONTRACT_NAME by: - # - Replacing hyphens in the CONTRACT_DIR with underscores (_). - CONTRACT_NAME=$(echo "${CONTRACT_DIR}" | sed 's/-/_/g') - - ARTIFACT_URL="${{ steps.set_artifact_base_url.outputs.url }}/${CONTRACT_DIR}/${{ steps.get_short_commit_hash.outputs.hash }}/wasm/${CONTRACT_NAME}.wasm" - LOCAL_PATH="./artifacts/${CONTRACT_NAME}.wasm" - - mkdir -p ./artifacts - echo "Downloading $CONTRACT from $ARTIFACT_URL" - curl -sSfL "$ARTIFACT_URL" -o "$LOCAL_PATH" - - echo "Deploying $CONTRACT from $LOCAL_PATH" - node stellar/deploy-contract deploy "$CONTRACT" --artifact-path "$LOCAL_PATH" + echo "Deploying $CONTRACT with short hash version: ${{ steps.get_short_commit_hash.outputs.hash }}" + node stellar/deploy-contract deploy "$CONTRACT" --version ${{ steps.get_short_commit_hash.outputs.hash }} done diff --git a/axelar-chains-config/info/devnet-amplifier.json b/axelar-chains-config/info/devnet-amplifier.json index e89960599..4acaf2a98 100644 --- a/axelar-chains-config/info/devnet-amplifier.json +++ b/axelar-chains-config/info/devnet-amplifier.json @@ -667,9 +667,9 @@ "connectionType": "amplifier" }, "AxelarOperators": { - "address": "CAAKMUFUR3CVWFTTT4ROHRPBH6Q4RSUWQX7O7BRTR4TMDQLETMKO4NMK", + "address": "CDJQ52UPLRQDFPWH72XSCZ7BPJ2OSAV47ZNL2QSYJD3FVNM35MMO6WMV", "deployer": "GBL3CICTZNEQIVUEKP74PGSSU275KAMNQABOEQENHFUXB5P5FGBXETET", - "wasmHash": "82acfafba05ef400104d172664e8d30dbadca6e21e97fa9ae2e1c06c9148be1d", + "wasmHash": "8e0d3c6ace7b80c80d945eaca495ff2cea7de12e9cf736dcf1fb9aaee07b4dd2", "initializeArgs": { "owner": "GBL3CICTZNEQIVUEKP74PGSSU275KAMNQABOEQENHFUXB5P5FGBXETET" } From 2e903e0142bec2fd4ebfdd2d76fe91e0524aaded Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 10 Apr 2025 22:16:57 -0700 Subject: [PATCH 138/146] update --- .github/actions/setup-stellar/action.yml | 3 ++- .github/workflows/test-stellar.yaml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 53f980bb3..81e9935d1 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -85,7 +85,8 @@ runs: - name: Prepare .env shell: bash run: | - ROOT_SECRET=$(stellar container logs local | grep 'network root secret key:' | cut -d ':' -f2 | xargs) + stellar container logs local + ROOT_SECRET=$(stellar container logs local | grep 'root secret key' | cut -d ':' -f2 | xargs) echo "PRIVATE_KEY=${ROOT_SECRET}" >> .env echo "ENV=local" >> .env echo "CHAIN=stellar" >> .env diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 95f800f89..c15aeca05 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -70,7 +70,7 @@ jobs: - name: Deploy Contracts run: | # List of contracts to deploy - CONTRACTS=("AxelarOperators" "AxelarGasService") + CONTRACTS=("AxelarOperators" "AxelarGasService" "AxelarGateway" "InterchainToken" "TokenManager" "InterchainTokenService" "Upgrader" "AxelarExample" "Multicall") for CONTRACT in "${CONTRACTS[@]}"; do echo "Deploying $CONTRACT with short hash version: ${{ steps.get_short_commit_hash.outputs.hash }}" From 1a04786ffd09a913f4127e68b50536978be8d623 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 10 Apr 2025 22:25:17 -0700 Subject: [PATCH 139/146] Update action.yml --- .github/actions/setup-stellar/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 81e9935d1..2b71c20c6 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -85,8 +85,8 @@ runs: - name: Prepare .env shell: bash run: | - stellar container logs local - ROOT_SECRET=$(stellar container logs local | grep 'root secret key' | cut -d ':' -f2 | xargs) + timeout 2 stellar container logs local + ROOT_SECRET=$(timeout 2 stellar container logs local | grep 'network root secret key:' | cut -d ':' -f2 | xargs) echo "PRIVATE_KEY=${ROOT_SECRET}" >> .env echo "ENV=local" >> .env echo "CHAIN=stellar" >> .env From 40f7b65cd7b63ac6695dddabac280421ae1dca65 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 10 Apr 2025 22:38:35 -0700 Subject: [PATCH 140/146] update --- .github/actions/setup-stellar/action.yml | 6 +++--- .github/workflows/test-stellar.yaml | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 2b71c20c6..87bb15498 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -85,9 +85,9 @@ runs: - name: Prepare .env shell: bash run: | - timeout 2 stellar container logs local - ROOT_SECRET=$(timeout 2 stellar container logs local | grep 'network root secret key:' | cut -d ':' -f2 | xargs) - echo "PRIVATE_KEY=${ROOT_SECRET}" >> .env + timeout 1 stellar container logs local > log + echo "PRIVATE_KEY=$(cat log | grep 'network root secret key:' | cut -d ':' -f2 | xargs)}" >> .env + echo "ACCOUNT_ID=$(cat log | grep 'network root account id:' | cut -d ':' -f2 | xargs)" >> .env echo "ENV=local" >> .env echo "CHAIN=stellar" >> .env echo "YES=true" >> .env diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index c15aeca05..7eca5c5f9 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -69,6 +69,9 @@ jobs: - name: Deploy Contracts run: | + PRIVATE_KEY=$(grep '^PRIVATE_KEY=' .env | cut -d '=' -f2- | xargs) + ACCOUNT_ID=$(grep '^ACCOUNT_ID=' .env | cut -d '=' -f2- | xargs) + # List of contracts to deploy CONTRACTS=("AxelarOperators" "AxelarGasService" "AxelarGateway" "InterchainToken" "TokenManager" "InterchainTokenService" "Upgrader" "AxelarExample" "Multicall") @@ -76,3 +79,5 @@ jobs: echo "Deploying $CONTRACT with short hash version: ${{ steps.get_short_commit_hash.outputs.hash }}" node stellar/deploy-contract deploy "$CONTRACT" --version ${{ steps.get_short_commit_hash.outputs.hash }} done + + node stellar/operators.js is-operator $ACCOUNT_ID From 37b0403c7dbb868ce5f465718aec57274b662803 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 10 Apr 2025 22:55:52 -0700 Subject: [PATCH 141/146] update --- .github/actions/setup-stellar/action.yml | 7 ++-- .github/workflows/test-stellar.yaml | 32 ++++++++++++++++++- .../info/devnet-amplifier.json | 8 ++--- 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 87bb15498..916892490 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -85,10 +85,9 @@ runs: - name: Prepare .env shell: bash run: | - timeout 1 stellar container logs local > log - echo "PRIVATE_KEY=$(cat log | grep 'network root secret key:' | cut -d ':' -f2 | xargs)}" >> .env - echo "ACCOUNT_ID=$(cat log | grep 'network root account id:' | cut -d ':' -f2 | xargs)" >> .env + # Since the root account is derived from the network passphrase, it can be safely considered static. + echo "PRIVATE_KEY=SC5O7VZUXDJ6JBDSZ74DSERXL7W3Y5LTOAMRF7RQRL3TAGAPS7LUVG3L" >> .env + echo "ACCOUNT_ID=GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI" >> .env echo "ENV=local" >> .env echo "CHAIN=stellar" >> .env echo "YES=true" >> .env - cat .env diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 7eca5c5f9..22fe77b27 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -72,6 +72,13 @@ jobs: PRIVATE_KEY=$(grep '^PRIVATE_KEY=' .env | cut -d '=' -f2- | xargs) ACCOUNT_ID=$(grep '^ACCOUNT_ID=' .env | cut -d '=' -f2- | xargs) + stellar keys generate wallet --fund --network local + NEW_ACCOUNT_ID=$(stellar keys address wallet) + + ############################ + ### Contract Deployments ### + ############################ + # List of contracts to deploy CONTRACTS=("AxelarOperators" "AxelarGasService" "AxelarGateway" "InterchainToken" "TokenManager" "InterchainTokenService" "Upgrader" "AxelarExample" "Multicall") @@ -80,4 +87,27 @@ jobs: node stellar/deploy-contract deploy "$CONTRACT" --version ${{ steps.get_short_commit_hash.outputs.hash }} done - node stellar/operators.js is-operator $ACCOUNT_ID + ##################################### + ### Test AxelarOperators Contract ### + ##################################### + + node stellar/operators.js add-operator $ACCOUNT_ID + + OUTPUT=$(node stellar/operators.js is-operator $ACCOUNT_ID) + if ! echo "$OUTPUT" | grep -q 'is an operator'; then + exit 1 + fi + + node stellar/operators.js add-operator $ACCOUNT_ID + + OUTPUT=$(node stellar/operators.js is-operator $ACCOUNT_ID) + if ! echo "$OUTPUT" | grep -q 'is an operator'; then + exit 1 + fi + + node stellar/operators.js remove-operator $ACCOUNT_ID + + OUTPUT=$(node stellar/operators.js is-operator $ACCOUNT_ID) + if ! echo "$OUTPUT" | grep -q 'is not an operator'; then + exit 1 + fi diff --git a/axelar-chains-config/info/devnet-amplifier.json b/axelar-chains-config/info/devnet-amplifier.json index 4acaf2a98..b9a59f313 100644 --- a/axelar-chains-config/info/devnet-amplifier.json +++ b/axelar-chains-config/info/devnet-amplifier.json @@ -667,11 +667,11 @@ "connectionType": "amplifier" }, "AxelarOperators": { - "address": "CDJQ52UPLRQDFPWH72XSCZ7BPJ2OSAV47ZNL2QSYJD3FVNM35MMO6WMV", - "deployer": "GBL3CICTZNEQIVUEKP74PGSSU275KAMNQABOEQENHFUXB5P5FGBXETET", - "wasmHash": "8e0d3c6ace7b80c80d945eaca495ff2cea7de12e9cf736dcf1fb9aaee07b4dd2", + "address": "CDOWLXRHI3JVLTDXUZK4AA5RYT4MO53KGGHWRVTMLI6C74HJPAG5W7WO", + "deployer": "GCRN3JXRVXHQTFQFM7NR4TTTORGZDCJWPIOLPQQHL6WMAQGVMWSXJL3Q", + "wasmHash": "82acfafba05ef400104d172664e8d30dbadca6e21e97fa9ae2e1c06c9148be1d", "initializeArgs": { - "owner": "GBL3CICTZNEQIVUEKP74PGSSU275KAMNQABOEQENHFUXB5P5FGBXETET" + "owner": "GCRN3JXRVXHQTFQFM7NR4TTTORGZDCJWPIOLPQQHL6WMAQGVMWSXJL3Q" } }, "AxelarGasService": { From 1d6055b5bfd3fbd1d10fbd94f8e483baebcd6844 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 10 Apr 2025 23:01:18 -0700 Subject: [PATCH 142/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 22fe77b27..f1248f210 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -79,8 +79,7 @@ jobs: ### Contract Deployments ### ############################ - # List of contracts to deploy - CONTRACTS=("AxelarOperators" "AxelarGasService" "AxelarGateway" "InterchainToken" "TokenManager" "InterchainTokenService" "Upgrader" "AxelarExample" "Multicall") + CONTRACTS=("AxelarOperators" "AxelarGasService" "AxelarGateway" "InterchainTokenService" "Upgrader" "AxelarExample" "Multicall") for CONTRACT in "${CONTRACTS[@]}"; do echo "Deploying $CONTRACT with short hash version: ${{ steps.get_short_commit_hash.outputs.hash }}" @@ -98,13 +97,6 @@ jobs: exit 1 fi - node stellar/operators.js add-operator $ACCOUNT_ID - - OUTPUT=$(node stellar/operators.js is-operator $ACCOUNT_ID) - if ! echo "$OUTPUT" | grep -q 'is an operator'; then - exit 1 - fi - node stellar/operators.js remove-operator $ACCOUNT_ID OUTPUT=$(node stellar/operators.js is-operator $ACCOUNT_ID) From 97e69803db62086638fa3f7f209bdf2cf5aac7fa Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 10 Apr 2025 23:12:35 -0700 Subject: [PATCH 143/146] update --- .github/workflows/test-stellar.yaml | 9 ++++++++- stellar/deploy-contract/processors.js | 6 +++++- stellar/utils.js | 3 +++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index f1248f210..e14aab148 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -82,7 +82,6 @@ jobs: CONTRACTS=("AxelarOperators" "AxelarGasService" "AxelarGateway" "InterchainTokenService" "Upgrader" "AxelarExample" "Multicall") for CONTRACT in "${CONTRACTS[@]}"; do - echo "Deploying $CONTRACT with short hash version: ${{ steps.get_short_commit_hash.outputs.hash }}" node stellar/deploy-contract deploy "$CONTRACT" --version ${{ steps.get_short_commit_hash.outputs.hash }} done @@ -103,3 +102,11 @@ jobs: if ! echo "$OUTPUT" | grep -q 'is not an operator'; then exit 1 fi + + ########################## + ### Test Pause/Unpause ### + ########################## + + ############################################## + ### Test Transfer Ownership / Operatorship ### + ############################################## diff --git a/stellar/deploy-contract/processors.js b/stellar/deploy-contract/processors.js index 2e8614136..29b2fb28d 100644 --- a/stellar/deploy-contract/processors.js +++ b/stellar/deploy-contract/processors.js @@ -143,7 +143,7 @@ const getInitializeArgs = async (config, chain, contractName, wallet, options) = const interchainTokenWasmHash = BytesToScVal(await uploadContract('InterchainToken', options, wallet, chain)); const tokenManagerWasmHash = BytesToScVal(await uploadContract('TokenManager', options, wallet, chain)); - return { + const result = { owner, operator, gatewayAddress, @@ -154,6 +154,10 @@ const getInitializeArgs = async (config, chain, contractName, wallet, options) = interchainTokenWasmHash, tokenManagerWasmHash, }; + console.log('ahram test'); + console.log('InterchainTokenService'); + console.log(result); + return result; } case 'AxelarOperators': diff --git a/stellar/utils.js b/stellar/utils.js index 7d94445c0..b2d16f323 100644 --- a/stellar/utils.js +++ b/stellar/utils.js @@ -422,6 +422,9 @@ function getContractArtifactPath(artifactPath, contractName) { } const getContractCodePath = async (options, contractName) => { + console.log('ahram getContractCodePath'); + console.log(options); + if (options.artifactPath) { if (contractName === 'InterchainToken' || contractName === 'TokenManager') { return getContractArtifactPath(options.artifactPath, contractName); From eda58e347f6de9626e618e71603e21bfcf3587a6 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 10 Apr 2025 23:22:16 -0700 Subject: [PATCH 144/146] Update test-stellar.yaml --- .github/workflows/test-stellar.yaml | 47 +++++------------------------ 1 file changed, 7 insertions(+), 40 deletions(-) diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index e14aab148..86451cd89 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -67,46 +67,13 @@ jobs: - name: Setup Stellar network uses: ./.github/actions/setup-stellar - - name: Deploy Contracts - run: | - PRIVATE_KEY=$(grep '^PRIVATE_KEY=' .env | cut -d '=' -f2- | xargs) - ACCOUNT_ID=$(grep '^ACCOUNT_ID=' .env | cut -d '=' -f2- | xargs) - - stellar keys generate wallet --fund --network local - NEW_ACCOUNT_ID=$(stellar keys address wallet) - - ############################ - ### Contract Deployments ### - ############################ - - CONTRACTS=("AxelarOperators" "AxelarGasService" "AxelarGateway" "InterchainTokenService" "Upgrader" "AxelarExample" "Multicall") - - for CONTRACT in "${CONTRACTS[@]}"; do - node stellar/deploy-contract deploy "$CONTRACT" --version ${{ steps.get_short_commit_hash.outputs.hash }} - done - - ##################################### - ### Test AxelarOperators Contract ### - ##################################### - - node stellar/operators.js add-operator $ACCOUNT_ID - - OUTPUT=$(node stellar/operators.js is-operator $ACCOUNT_ID) - if ! echo "$OUTPUT" | grep -q 'is an operator'; then - exit 1 - fi - - node stellar/operators.js remove-operator $ACCOUNT_ID + ###### Command: Deploy Contract ###### - OUTPUT=$(node stellar/operators.js is-operator $ACCOUNT_ID) - if ! echo "$OUTPUT" | grep -q 'is not an operator'; then - exit 1 - fi + - name: Deploy AxelarOperators + run: node stellar/deploy-contract deploy AxelarOperators --version ${{ steps.get_short_commit_hash.outputs.hash }} - ########################## - ### Test Pause/Unpause ### - ########################## + - name: Deploy AxelarGasService + run: node stellar/deploy-contract deploy AxelarGasService --version ${{ steps.get_short_commit_hash.outputs.hash }} - ############################################## - ### Test Transfer Ownership / Operatorship ### - ############################################## + - name: Deploy AxelarGateway + run: node stellar/deploy-contract deploy AxelarGateway --version ${{ steps.get_short_commit_hash.outputs.hash }} From db62bbc5dad2db9cb38458d104fee3d1d81f1e29 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 10 Apr 2025 23:27:25 -0700 Subject: [PATCH 145/146] update --- stellar/deploy-contract/processors.js | 6 +----- stellar/utils.js | 3 --- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/stellar/deploy-contract/processors.js b/stellar/deploy-contract/processors.js index 29b2fb28d..2e8614136 100644 --- a/stellar/deploy-contract/processors.js +++ b/stellar/deploy-contract/processors.js @@ -143,7 +143,7 @@ const getInitializeArgs = async (config, chain, contractName, wallet, options) = const interchainTokenWasmHash = BytesToScVal(await uploadContract('InterchainToken', options, wallet, chain)); const tokenManagerWasmHash = BytesToScVal(await uploadContract('TokenManager', options, wallet, chain)); - const result = { + return { owner, operator, gatewayAddress, @@ -154,10 +154,6 @@ const getInitializeArgs = async (config, chain, contractName, wallet, options) = interchainTokenWasmHash, tokenManagerWasmHash, }; - console.log('ahram test'); - console.log('InterchainTokenService'); - console.log(result); - return result; } case 'AxelarOperators': diff --git a/stellar/utils.js b/stellar/utils.js index b2d16f323..7d94445c0 100644 --- a/stellar/utils.js +++ b/stellar/utils.js @@ -422,9 +422,6 @@ function getContractArtifactPath(artifactPath, contractName) { } const getContractCodePath = async (options, contractName) => { - console.log('ahram getContractCodePath'); - console.log(options); - if (options.artifactPath) { if (contractName === 'InterchainToken' || contractName === 'TokenManager') { return getContractArtifactPath(options.artifactPath, contractName); From a0f77bba601d9d040bc2b925e64d59eeae815719 Mon Sep 17 00:00:00 2001 From: ahramy Date: Mon, 14 Apr 2025 21:33:50 -0700 Subject: [PATCH 146/146] update --- .github/actions/setup-stellar/action.yml | 8 ++++---- .github/workflows/test-stellar.yaml | 22 ++++++++-------------- stellar/utils.js | 4 ++++ 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/actions/setup-stellar/action.yml b/.github/actions/setup-stellar/action.yml index 916892490..cb04ee560 100644 --- a/.github/actions/setup-stellar/action.yml +++ b/.github/actions/setup-stellar/action.yml @@ -15,10 +15,10 @@ runs: id: env shell: bash run: | - LOCALHOST=http://localhost:8000 - echo "horizon_rpc=$LOCALHOST/" >> $GITHUB_OUTPUT - echo "soroban_rpc=$LOCALHOST/soroban/rpc" >> $GITHUB_OUTPUT - echo "friendbot=$LOCALHOST/friendbot" >> $GITHUB_OUTPUT + RPC=http://localhost:8000 + echo "horizon_rpc=$RPC/" >> $GITHUB_OUTPUT + echo "soroban_rpc=$RPC/soroban/rpc" >> $GITHUB_OUTPUT + echo "friendbot=$RPC/friendbot" >> $GITHUB_OUTPUT echo "network_passphrase='Standalone Network ; February 2017'" >> $GITHUB_OUTPUT - name: Start Stellar local network diff --git a/.github/workflows/test-stellar.yaml b/.github/workflows/test-stellar.yaml index 86451cd89..31bd4f114 100644 --- a/.github/workflows/test-stellar.yaml +++ b/.github/workflows/test-stellar.yaml @@ -32,11 +32,6 @@ jobs: if: ${{ needs.check-relevant-changes.outputs.run_tests == 'true' }} runs-on: blacksmith-8vcpu-ubuntu-2204 steps: - # this sets up nested repos: https://github.com/actions/checkout?tab=readme-ov-file#checkout-multiple-repos-nested - # axelar-contract-deployments - # - axelar-amplifier-stellar - # - # future steps depend on this directory structure - name: Checkout code uses: actions/checkout@v4 @@ -46,20 +41,19 @@ jobs: repository: axelarnetwork/axelar-amplifier-stellar path: axelar-amplifier-stellar - - name: Get Latest Short Commit Hash from axelar-amplifier-stellar - id: get_short_commit_hash + - name: Get latest short commit for axelar-amplifier-stellar + id: commit_hash run: | cd axelar-amplifier-stellar git fetch --all COMMIT_HASH=$(git rev-parse --short HEAD) echo "hash=${COMMIT_HASH}" >> $GITHUB_OUTPUT - - name: Setup Node.js - uses: actions/setup-node@v4 + - name: Install Node.js + uses: useblacksmith/setup-node@v5 with: - node-version: '18' # Hardcoded to ensure consistency. + node-version: 18.x cache: 'npm' - registry-url: 'https://registry.npmjs.org' - name: Install dependencies run: npm ci @@ -70,10 +64,10 @@ jobs: ###### Command: Deploy Contract ###### - name: Deploy AxelarOperators - run: node stellar/deploy-contract deploy AxelarOperators --version ${{ steps.get_short_commit_hash.outputs.hash }} + run: node stellar/deploy-contract deploy AxelarOperators --version ${{ steps.commit_hash.outputs.hash }} - name: Deploy AxelarGasService - run: node stellar/deploy-contract deploy AxelarGasService --version ${{ steps.get_short_commit_hash.outputs.hash }} + run: node stellar/deploy-contract deploy AxelarGasService --version ${{ steps.commit_hash.outputs.hash }} - name: Deploy AxelarGateway - run: node stellar/deploy-contract deploy AxelarGateway --version ${{ steps.get_short_commit_hash.outputs.hash }} + run: node stellar/deploy-contract deploy AxelarGateway --version ${{ steps.commit_hash.outputs.hash }} diff --git a/stellar/utils.js b/stellar/utils.js index ff292f213..52a170387 100644 --- a/stellar/utils.js +++ b/stellar/utils.js @@ -202,6 +202,10 @@ function getAssetCode(balance, chain) { return balance.asset_type === 'native' ? chain.tokenSymbol : balance.asset_code; } +/* + * To enable connecting to the local network, allowHttp needs to be set to true. + * This is necessary because the local network does not accept HTTPS requests. + */ function getRpcOptions(chain) { return { allowHttp: chain.networkType === 'local',