Skip to main content

Test Accounts

Localnet provides pre-funded test accounts for immediate use.

Available Accounts

These accounts are automatically available when localnet is running.

Using Test Accounts

Check Balance

Output:

Send Tokens

Deploy Contracts

Execute Contracts

Account Details

Alice

Primary test account, typically used for deployments.

Bob

Secondary test account, useful for testing transfers.

Mnemonics

Test accounts use deterministic mnemonics for reproducibility. Query the actual mnemonics from your localnet keyring:
These mnemonics are public and for testing only. NEVER use them for real funds.

Creating Additional Accounts

Generate New Account

Fund from Alice

Import Existing

Multi-Account Workflows

Token Transfer

Contract Ownership Transfer

Checking Balances

Single Account

All Test Accounts

JSON Output

Reset Account Balances

To restore accounts to initial state:
Accounts return to their initial balances (alice: 1,000,000 XYZ, bob: 500,000 XYZ).

Scripting with Test Accounts

Bash Script

Test Script

Troubleshooting

Test accounts are only available when localnet is running:
Account may have spent its balance. Reset localnet:
Localnet uses the test keyring backend:

Best Practices

  1. Use alice for deployments - Keep bob for testing interactions
  2. Reset often - Start fresh to avoid state confusion
  3. Script everything - Make tests reproducible
  4. Check balances - Verify before complex operations
  5. Use JSON output - Easier parsing in scripts