Retrieving Account Information
This tutorial walks you through how to retrieve account-related data on the VSL network using the vsl-cli
tool.
Whether you're working with multiple accounts or debugging a transaction, understanding how to inspect account details is essential.
Step 1: Enter REPL Mode
Launch the interactive CLI shell in temporary configuration mode:
vsl-cli repl --tmp-config
Step 2: Connect to a Network
You can connect to a local or remote VSL node.
Option A: Local Node
vsl> server:launch --db tmp --genesis-file "genesis.json"
Make sure the accounts you're inspecting exist in the genesis.json
file if using a local setup.
Option B: Remote Devnet
vsl> network:add remote --url https://rpc.vsl.pi2.network
vsl> network:use remote
Check the connection:
vsl> health:check
Step 3: List Existing Accounts
To view all accounts you've created in the current configuration:
vsl> account:list
This will show a list of account aliases and their associated addresses.
Step 4: Check Active Account
To see which account is currently active:
vsl> account:current
If needed, switch accounts:
vsl> account:use alice
Step 5: Get Account Details
To fetch full details for a specific account (by alias or address):
vsl> account:get alice
Or by address:
vsl> account:get 0x0101010101010101010101010101010101010101
This includes public address, type, and metadata if available.
Step 6: Check Account Balances
To get the native token balance:
vsl> account:balance
To view asset balances for the current account:
vsl> asset:balances
For a specific asset:
vsl> asset:balance DEMO
Step 7: Get or Set Account State
Every account has an optional state
field, represented as a fixed-size hash. You can use it to store application-specific metadata.
To read it from the network:
vsl> account:state-get <address>
To update it (only if you know the format your application expects):
vsl> account:state-set '{"my":"state"}'
Optional: Use JSON Output
For structured scripting or debugging, append --json
to any command:
vsl> account:list --json
vsl> account:get alice --json
Cleanup (Optional)
If you're using a temporary setup:
vsl> account:remove alice
vsl> network:remove remote
vsl> server:stop
Next Steps
You now know how to inspect accounts and their balances on the VSL network. This is helpful for:
Verifying transaction results
Auditing token holdings
Debugging application logic
You can now move on to tutorials like submitting a claim or retrieving settled claims.
Last updated
Was this helpful?