docs(amm-ui): clarify test wallet password (throwaway setup vs restore-keys)

This commit is contained in:
Andrea Franz
2026-08-05 17:19:38 +02:00
parent 0576b10dcb
commit c5b9508e4d
2 changed files with 18 additions and 10 deletions
+9 -3
View File
@@ -52,9 +52,15 @@ nix build .#integration-test -L
## Notes
- **Wallet password.** The isolated wallet is restored with password `test`
(`TEST_WALLET_PASSWORD`). If the UI shows the **Connect** modal instead of
auto-opening, unlock with `test`.
- **Wallet password.** The wallet's key storage is encrypted with a password,
which you enter to **unlock** the wallet so the app can sign transactions (the
UI's **Connect** modal). During first-time setup you're prompted once for a
password (read from the terminal — it can't be scripted), but **that wallet is
a throwaway**: `restore-keys` then rebuilds it from the test mnemonic and sets
the **real** password to `TEST_WALLET_PASSWORD` (default `test`). So type
anything at the setup prompt; **unlock the UI with `test`** — not whatever you
typed there. Prefer no password? Run with `TEST_WALLET_PASSWORD=""` and unlock
with an empty password everywhere.
- **Re-bootstrap.** `FORCE_BOOTSTRAP=1 apps/amm/tests/testnet/setup-amm-testnet.sh`
re-restores the isolated `.wallet` (rewrites only that directory).
- **Overrides.** `TEST_WALLET_HOME`, `TEST_MNEMONIC`, `TEST_WALLET_PASSWORD`,
+9 -7
View File
@@ -182,16 +182,18 @@ bootstrap_test_wallet() {
if [ -n "$TEST_SEQUENCER_ADDR" ]; then
log "${DIM}\$ wallet config set sequencer_addr $TEST_SEQUENCER_ADDR${RST}"
# On a fresh home this triggers first-time wallet setup, which prompts for a
# password (and generates a throwaway random seed). Feed the password via
# stdin so the bootstrap stays non-interactive; restore-keys below then
# replaces those keys with the deterministic test mnemonic.
printf '%s\n' "$TEST_WALLET_PASSWORD" \
| wallet config set sequencer_addr "$TEST_SEQUENCER_ADDR" \
# NOTE: on a fresh home this triggers first-time wallet setup, which
# generates a THROWAWAY random-seed wallet and prompts once for a password
# (read from the terminal, so it can't be piped — just type anything, even
# empty). That wallet is immediately discarded: restore-keys below rebuilds
# the wallet from the test mnemonic and sets the REAL password to
# $TEST_WALLET_PASSWORD, which is what unlocks the wallet afterward.
wallet config set sequencer_addr "$TEST_SEQUENCER_ADDR" \
|| log "${YEL}⚠ 'wallet config set sequencer_addr' failed — configure the wallet manually.${RST}"
fi
# restore-keys reads the mnemonic then the password from stdin.
# restore-keys reads the mnemonic then the password from stdin (non-interactive)
# and REWRITES storage — so the wallet's password becomes $TEST_WALLET_PASSWORD.
log "${DIM}\$ printf '<mnemonic>\\n<password>\\n' | wallet restore-keys --depth $TEST_WALLET_DEPTH${RST}"
printf '%s\n%s\n' "$TEST_MNEMONIC" "$TEST_WALLET_PASSWORD" \
| wallet restore-keys --depth "$TEST_WALLET_DEPTH" \