Creating Custom Assets
This tutorial walks you through how to create and manage custom assets on the VSL network using the vsl-cli
tool.
We assume you already have the CLI installed and have created at least one account. If not, check out our Creating Accounts tutorial first.
Step 1: Enter REPL Mode
We recommend starting in REPL mode. This gives you an interactive shell-like environment for chaining commands:
vsl-cli repl --tmp-config
Step 2: Connect to a Network
You can either run a local VSL node or connect to the remote devnet.
Option A: Launch a Local Node
vsl> server:launch --db tmp --genesis-file "genesis.json"
Your genesis.json
file should contain the initial account(s) that will be authorized to create the asset.
Option B: Use Remote Devnet
vsl> network:add remote --url https://rpc.vsl.pi2.network
vsl> network:use remote
Check that you're connected:
vsl> health:check
Step 3: Select the Account to Use
Make sure you're using the account that will own and mint the new asset:
vsl> account:use alice
You can verify the active account:
vsl> account:current
Step 4: Create a Custom Asset
Now you can create a new token. You’ll need to specify the token symbol and the total supply.
vsl> asset:create --symbol DEMO --supply 0x1000
This creates an asset named DEMO
with a supply of 0x1000
(4096 in decimal) owned by the currently active account.
To confirm it was created:
vsl> asset:get DEMO
Step 5: Check Asset Balances
To check how much of a given asset the current account owns:
vsl> asset:balance DEMO
Or check balances for all assets:
vsl> asset:balances
Step 6: Transfer Assets
To transfer some amount of your custom asset to another account (e.g. bob
):
vsl> asset:transfer --asset DEMO --to bob --amount 0x64
To verify the recipient received the asset:
vsl> account:use bob
vsl> asset:balance DEMO
Cleanup (Optional)
To clean up your local environment:
vsl> account:remove alice
vsl> account:remove bob
vsl> network:remove remote
vsl> server:stop
Next Steps
You’ve successfully created and transferred a custom asset on the VSL network. From here, you can explore submitting and settling claims.
Don’t forget that you can join our Discord community to ask questions or get support.
Last updated
Was this helpful?