Skip to content

[ANCHOR-1016]: Move testnet reset scripts into Anchor Platform repo - #1957

Merged
amandagonsalves merged 27 commits into
developfrom
chore/testnet-reset
Jul 1, 2026
Merged

amandagonsalves merged 27 commits into
developfrom
chore/testnet-reset

Conversation

@amandagonsalves

@amandagonsalves amandagonsalves commented Jun 19, 2026 •

Copy link
Copy Markdown
Collaborator

Description

update ci workflow for testnet reset script

Testing

test run: https://github.com/stellar/anchor-platform/actions/runs/27982913564/job/82817259384

philipliu and others added 23 commits June 18, 2025 11:37
* add new github actions workflow for manual testnet resets

* update workflow to install rust, stellar cli, and stellar sdk dependencies

* add environment variables for various testnet accounts and secrets
* add python3 and stellar-sdk prerequisites

* update .env loading to be optional, relying on environment variables if not present

* add public_key helper function to derive stellar public keys from secret keys

* refactor all script sections to use dynamically derived public keys from secret keys

* update usdc funding amount
…ntain permissions'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* delete `CLIENT_WALLET_PK_BYTES` environment variable

* add `pk_bytes` helper function to derive raw public key bytes

* update contract deployment to derive signer public key from a secret

* delete unused public keys from `.env.example`

* add `OTHER_SEP10_SIGNING_SECRET` for testing purposes

* update `TESTANCHOR_DISTRIBUTION_SECRET` to `TESTANCHOR_RECEIVE_SECRET`
* refactor secrets in ci workflow

* update rust wasm target

* refactor secret key handling in script

* update friendbot funding to handle errors

* refactor contract deployment for robustness
* update usdc funding logic

* update TESTANCHOR_DISTRIBUTION_SECRET usdc amount to 10000

* update other accounts usdc amount to 0.1
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* delete unused recipient variables from testnet funding list

* add specific funding amount (100 USDC) for TEST_CLIENT_WALLET_SECRET
…1757)

### Description

Updates `testnet_reset.sh`.

### Context

It previously only deployed the contracts.

### Testing

- Testing the script locally
```
[INFO] Starting testnet reset...
[INFO] Checking prerequisites...
[SUCCESS] Prerequisites check passed
[INFO] Loading environment...
[SUCCESS] Environment loaded
[INFO] Funding test accounts...
[INFO] Funding: GDAHPZ2NSYIIHZXM56Y36SBVTV5QKFIZGYMMBHOU53ETUSWTP62B63EQ
[INFO] Funding: GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG
[INFO] Funding: GC6X2ANA2OS3O2ESHUV6X44NH6J46EP2EO2JB7563Y7DYOIXFKHMHJ5O
[INFO] Funding: GATEYCIMJZ2F6Y437QSYH4XFQ6HLD5YP4MBJZFFPZVEQDJOY4QTCB7BB
[INFO] Funding: GDC2U5GRKUSPGV5XENLBWKQZH2C4PG7ZEVMQOUA2QZKIRXE5FYYEMEF7
[INFO] Funding: GASI56WX7UKIDFPZRCQEI4OQE3V3QBGXEOB4ZY6ZMU5MZXPHQHIDA7JU
[INFO] Funding: GD4C2QRT7YL4WJFJPYQCYRXEDBB7ERHC3XZGWR6KXKRHPEFXXNXIVNFY
[INFO] Funding: GC56VTOVOJDRQAJRYLZW6DLQGVTQSYDTZU7ISNIZ2VJIE3FYWI2HMD5G
[INFO] Funding: GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B
[INFO] Funding: GABCKCYPAGDDQMSCTMSBO7C2L34NU3XXCW7LR4VVSWCCXMAJY3B4YCZP
[INFO] Ensuring signers are present with 1/1/1 thresholds...
[SUCCESS] Signers configured with 1/1/1 thresholds
[INFO] Setting up trustlines...
ℹ️ Signing transaction: 0e1dc31de70a5f9862d5de2368875a8257a66eb098f22bc936daf15f14ca5e27
[SUCCESS] Anchor USDC trustline created for TEST_CLIENT_WALLET_SECRET
ℹ️ Signing transaction: be5ed1e7ecd3bf2fc02685b080513ff8bee8402c56039d89238290b0b6ac4c8a
[SUCCESS] Circle USDC trustline created for TEST_CLIENT_WALLET_SECRET
ℹ️ Signing transaction: e0652c0f8fa4945d2b9ed427366f3584595577f4a9a01df88a3a7c8f2ee0f41d
[SUCCESS] Anchor USDC trustline created for TEST_WITHDRAW_FUND_CLIENT_SECRET_1
ℹ️ Signing transaction: b3dfa7fd5be1a3ff9fa1ca8da035e518d7024a00638ff8784344f9077efb78ee
[SUCCESS] Circle USDC trustline created for TEST_WITHDRAW_FUND_CLIENT_SECRET_1
ℹ️ Signing transaction: b49e9eca4e316420e58ff06a691460b56667caeea809b3bbba239c5ff5b393c4
[SUCCESS] Anchor USDC trustline created for TEST_WITHDRAW_FUND_CLIENT_SECRET_2
ℹ️ Signing transaction: e9198dea0e49b3aa380d49672304aa9c36291fe6f02ec2a3a2ac531cd6bf5909
[SUCCESS] Circle USDC trustline created for TEST_WITHDRAW_FUND_CLIENT_SECRET_2
ℹ️ Signing transaction: 6c7314f40975a7c22c341ec1a8f742b8cea644ad9264ca93b634b80e3d59e653
[SUCCESS] Anchor USDC trustline created for TEST_DEPOSIT_FUND_CLIENT_SECRET_1
ℹ️ Signing transaction: b2ceb0c32e3fb16f8f69d4040a5de9660efca2cb57a05327c5be57bb907f5b39
[SUCCESS] Circle USDC trustline created for TEST_DEPOSIT_FUND_CLIENT_SECRET_1
ℹ️ Signing transaction: ff676d254b2bd9ef2a52cf3e99c2a4a6c91a6f9ec375e6c63d02aae37f8d64f6
[SUCCESS] Anchor USDC trustline created for TEST_DEPOSIT_FUND_CLIENT_SECRET_2
ℹ️ Signing transaction: 7760582d6c371067b0aa23745b6b0945ab3c6b6377ebd0444746be40ce1bb5bb
[SUCCESS] Circle USDC trustline created for TEST_DEPOSIT_FUND_CLIENT_SECRET_2
ℹ️ Signing transaction: e39f57886861fb44e5cab67f1770532de18d3dcdc5d15eb729058aa097b06660
[SUCCESS] Anchor USDC trustline created for TESTANCHOR_DISTRIBUTION_SECRET
ℹ️ Signing transaction: 7166c3faa7717323b0b4b77c9d79e18d64ada72784a543817550b7042d7143c8
[SUCCESS] Circle USDC trustline created for TESTANCHOR_DISTRIBUTION_SECRET
ℹ️ Signing transaction: f715b70a711cff87ac7ead4180ea4d94248c23fb64c480e30e7977cacd31f247
[SUCCESS] SRT trustline created for TESTANCHOR_DISTRIBUTION_SECRET
[INFO] Issuing USDC and funding accounts...
[INFO] Funding: GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP
[INFO] Sending 1000 USDC to TEST_CLIENT_WALLET_SECRET (GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG)...
ℹ️ Signing transaction: a076c49830e9ebdad6a0c34f764fd7c55ccd91c965d1752c62bc83293b9b0c9d
[SUCCESS] Sent 1000 USDC to TEST_CLIENT_WALLET_SECRET
[INFO] Sending 1000 USDC to TEST_WITHDRAW_FUND_CLIENT_SECRET_1 (GDC2U5GRKUSPGV5XENLBWKQZH2C4PG7ZEVMQOUA2QZKIRXE5FYYEMEF7)...
ℹ️ Signing transaction: 3d8a3286fbee7e7b743e47bcd1b7bf7cf10b1718cfabb184c4aebde06b81a662
[SUCCESS] Sent 1000 USDC to TEST_WITHDRAW_FUND_CLIENT_SECRET_1
[INFO] Sending 1000 USDC to TEST_WITHDRAW_FUND_CLIENT_SECRET_2 (GASI56WX7UKIDFPZRCQEI4OQE3V3QBGXEOB4ZY6ZMU5MZXPHQHIDA7JU)...
ℹ️ Signing transaction: 7c1b487fa7caece602bed65058930ebd3b4d3065d2c1308c5db18460d31f8efa
[SUCCESS] Sent 1000 USDC to TEST_WITHDRAW_FUND_CLIENT_SECRET_2
[INFO] Sending 1000 USDC to TEST_DEPOSIT_FUND_CLIENT_SECRET_1 (GD4C2QRT7YL4WJFJPYQCYRXEDBB7ERHC3XZGWR6KXKRHPEFXXNXIVNFY)...
ℹ️ Signing transaction: 62dd6cfe9d48cc0045135a78700fafddf4d6a0792b94110d6b95369c2a479165
[SUCCESS] Sent 1000 USDC to TEST_DEPOSIT_FUND_CLIENT_SECRET_1
[INFO] Sending 1000 USDC to TEST_DEPOSIT_FUND_CLIENT_SECRET_2 (GC56VTOVOJDRQAJRYLZW6DLQGVTQSYDTZU7ISNIZ2VJIE3FYWI2HMD5G)...
ℹ️ Signing transaction: 250728ac22edf919a647b1306f05461751f01a991176b2022791ce5b4979def7
[SUCCESS] Sent 1000 USDC to TEST_DEPOSIT_FUND_CLIENT_SECRET_2
[INFO] Issuing SRT and funding test anchor distribution account...
[INFO] Funding: GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B
[INFO] Sending 1000000 SRT to test anchor distribution account...
ℹ️ Signing transaction: e94cdf15a9f2e81ac9805facd7ada1af2e97b581994622479813f8eb7404462e
[SUCCESS] Sent 1000000 SRT to test anchor distribution account
[INFO] Deploying contracts...
[INFO] Using GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG as contract deployer
ℹ️ CARGO_BUILD_RUSTFLAGS=--remap-path-prefix=/Users/philipliu/.cargo/registry/src= cargo rustc --manifest-path=contracts/account/Cargo.toml --crate-type=cdylib --target=wasm32-unknown-unknown --release
    Finished `release` profile [optimized] target(s) in 0.04s
ℹ️ Build Summary:
  Wasm File: target/wasm32-unknown-unknown/release/account.wasm
  Wasm Hash: ae95eb9d4bab6a01022af3bda941cf7603809adb173f82d46f70bd22b005c068
  Exported Functions: 4 found
    • _
    • __check_auth
    • __constructor
    • upgrade
✅ Build Complete
ℹ️ CARGO_BUILD_RUSTFLAGS=--remap-path-prefix=/Users/philipliu/.cargo/registry/src= cargo rustc --manifest-path=contracts/web-auth/Cargo.toml --crate-type=cdylib --target=wasm32-unknown-unknown --release
    Finished `release` profile [optimized] target(s) in 0.04s
ℹ️ Build Summary:
  Wasm File: target/wasm32-unknown-unknown/release/web_auth.wasm
  Wasm Hash: 32a79785d469f8c5e04ab11d1b8f680b511575c995419b0806a16278cbd5240c
  Exported Functions: 4 found
    • _
    • __constructor
    • upgrade
    • web_auth_verify
✅ Build Complete
[INFO] Deploying account contract...
[SUCCESS] Account contract deployed:    0: [Diagnostic Event] topics:[error, Error(Storage, ExistingValue)], data:["contract already exists", Bytes(317c7a069bdc2cfbfe62cd3ea4a49562e4f9c92feb6dad7764c5a8c1199bfa9c)]
[INFO] Deploying web auth contract...
[SUCCESS] Web auth contract deployed:    0: [Diagnostic Event] topics:[error, Error(Storage, ExistingValue)], data:["contract already exists", Bytes(f6b07a2a2f47a2b751d2fbf65aeb0c644b588d27f98090b9948cd4c526408a68)]
[INFO] Deploying USDC asset contract...
[WARNING] USDC asset contract deployment skipped (already exists)
[SUCCESS] Contracts deployed
[SUCCESS] ✨ Testnet setup completed!
```

### Documentation

N/A

### Known limitations

N/A
* update stellar-cli installation command

* delete  flag from stellar-cli install
* update friendbot funding call to use only silent () flag

* delete the fail-on-http-errors () flag

* delete the show-error () flag
* refactor ci rust setup for improved caching and reliability

* add dedicated cache steps for cargo bin, rustup, and rust dependencies

* update stellar cli installation to use a github action
@amandagonsalves amandagonsalves self-assigned this Jun 19, 2026
Copilot AI review requested due to automatic review settings June 19, 2026 16:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@amandagonsalves
amandagonsalves marked this pull request as draft June 22, 2026 16:49
@amandagonsalves amandagonsalves changed the title chore(ci): update ci rust setup and stellar cli [ANCHOR-1016]: Move testnet reset scripts into Anchor Platform repo Jun 22, 2026
@amandagonsalves
amandagonsalves marked this pull request as ready for review June 22, 2026 20:54
@amandagonsalves
amandagonsalves merged commit c8c6885 into develop Jul 1, 2026
17 of 21 checks passed
@amandagonsalves
amandagonsalves deleted the chore/testnet-reset branch July 1, 2026 14:02
amandagonsalves added a commit that referenced this pull request Jul 1, 2026
### Description

Merges release/4.5.0 into main for the 4.5.0 release.

### Context

#1957
#1962
#1960
#1954
#1953
#1955

### Testing

- `./gradlew test`

### Documentation
N/A

### Known limitations
N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants