Introduction
Tokens are units of value that are built and maintained on blockchain networks, they are essentially digital assets that are usually fungible or nonfungible.
The Solana blockchain has its associated framework for building and deploying tokens similar to the ERC-20 tokens on the Ethereum network.
In this tutorial, we will create our own token and deploy it to the Solana blockchain.
The Solana token program is written in Rust programming language and basic knowledge of the language is recommended. We are going to create our token using the spl command-line interface.
After successful installation of rust on your computer, run the following command to install the spl-token-cli
on your computer:
cargo install spl-token-cli
to know more about the spl-token-cli
commands, check the help command for some tips with this command, spl-token --help
. That's great, let's move ahead to create our token in the following steps. But before we go further, we need to have a Solana wallet to be able to create our token.
Install the Solana tool suite on your computer by following these three steps.
- Open the command prompt as a system administrator, and paste the following command to Download the Solana installer into a temporary directory.
curl https://release.solana.com/v1.10.29/solana-install-init-x86_64-pc-windows-msvc.exe --output C:\solana-install-tmp\solana-install-init.exe --create-dirs
- Copy and paste the following command to update to the latest version of the Solana suite.
C:\solana-install-tmp\solana-install-init.exe v1.10.29
you can also update Solana anytime using solana-install update
.
Send a few Sols
to the wallet you are using to create a token as you will have to use a small price to create a new token.
create the token with the following command.
- Restart your terminal to get the installations updated. Great, we're almost there. The next step is to create our token.
Initialize the token creation with the following command and that's all with token creation on Solana network.
spl-token create-token
A unique token identifier will be given for your token.
Once you are able to create your token successfully, you also need to create an account for your new token and you can do this by using this command.
spl-token create-account <unique token identifier>
Mint some tokens into the account you created for your new token with the following command.
spl-token mint <unique token identifier> 50
The token supply and balance can now be viewed from your account:
spl-token balance <unique token identifier>
spl-token supply <unique token identifier>
Always refer to spl-token --help
for further actions on your token.
Top comments (2)
Hello,
Thank you for this tutorial.
For those who struggle with coding, some tools allow to create, customize and deploy a SPL-token in few clicks from a website UI and no coding knowledge.
Skunka Tools - Create your custom SPL Token
Thanks for this comment too