Creating Accounts

This tutorial walks you through how to create and manage accounts on the VSL network using the vsl-cli tool.

We assume you already have the CLI installed and are familiar with basic terminal usage. If you need to install it, follow the instructions in the Run Commands with the CLI guide.

Step 1: Enter REPL Mode

We recommend using REPL mode for tutorials and experimentation. It gives you a shell-like interface to run multiple commands:

vsl-cli repl --tmp-config

This will start the interactive CLI in temporary configuration mode.

Step 2: Connect to a Network

You can either launch a local development node or connect to a remote one.

Option A: Launch a Local Node

vsl> server:launch --db tmp --genesis-file "genesis.json"

The genesis.json file defines the initial state of your local VSL network, including pre-funded accounts and optional custom tokens.

Option B: Use Remote Devnet

vsl> network:add remote --url https://rpc.vsl.pi2.network
vsl> network:use remote

You can also check network health:

vsl> health:check

Step 3: Create Accounts

You can create an account using the commands below. In this case, create two accounts named alice and bob:

vsl> account:create alice
vsl> account:create bob

You can list all created accounts with:

vsl> account:list

Step 4: Fund Accounts

Use the master account to transfer native tokens:

vsl> account:use master
vsl> pay --to alice --amount 0x1000
vsl> pay --to bob --amount 0x500

Switch to Alice and check her balance:

vsl> account:use alice
vsl> account:balance

Repeat for Bob:

vsl> account:use bob
vsl> account:balance

Step 5: Use the Accounts

Set a default account for future commands:

vsl> account:use alice

You can check which account is currently active:

vsl> account:current

To get more details:

vsl> account:get alice

Step 6: Save or Export Accounts (Optional)

Export Alice’s private key to a file:

vsl> account:export alice -f alice.key

Later, you can re-import:

vsl> account:load alice -p <private_key>

Cleanup (Optional)

If using a local setup and want to remove everything:

vsl> account:remove alice
vsl> account:remove bob
vsl> network:remove remote
vsl> server:stop

Next Steps

You’ve just created and funded accounts on the VSL network. From here, you can start creating custom assets.

Need help? Join the community on Discord

Last updated

Was this helpful?