Skip to content

Conversation

@philipliu
Copy link
Contributor

@philipliu philipliu commented Jun 16, 2025

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

@philipliu philipliu force-pushed the philip/testnet-reset branch from 422f479 to 4b125da Compare June 18, 2025 15:37
@philipliu philipliu marked this pull request as ready for review June 18, 2025 15:52
log_warning "Failed to create Anchor USDC trustline for $account_var"
fi

if stellar tx new change-trust \
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious. Do all these test accounts need a trustline to Circle USDC? I thought only the distribution account would need it, like we do for SRT.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, you're right. Fixed.

Copy link
Contributor

@JiahuiWho JiahuiWho left a comment

Choose a reason for hiding this comment

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

LGTM

@lijamie98
Copy link
Contributor

The PR looks fine to me overall.

I don't see the script where we check the circle USDC balance though. (here) Is it no longer needed in our tests?

@lijamie98
Copy link
Contributor

Can we add a GH action to run the testnet reset?


# USDC issuer
USDC_ISSUER_SECRET=
USDC_ISSUER_PUBLIC=
Copy link
Contributor

Choose a reason for hiding this comment

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

The .env should not have PUBLIC keys. They can be generated from the secret.

@lijamie98 lijamie98 changed the title Update testnet reset script 【DRAFT] Update testnet reset script Aug 27, 2025
@lijamie98 lijamie98 marked this pull request as draft August 27, 2025 23:54
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