Create NFT on Solana (Windows)
Table of Contents
Install Solana Command Line Tool
Generate a Solana Wallet
Generate Token
- Mint Fungible Token
- Mint Non-Fungible Token (NFT)
【Prerequisite】
- To create an NFT using command line tool for Windows system, it is suggested to use command prompt (cmd) opened as an Administer.
- explorer.solana.com as a web-based tool to interactively manage wallet and crypto assets.
【Install Solana Command Line Tool Suite】
First of all we need to install the Solana tool
suite. For Windows system, the command:
This downloads Solana installer of version 1.8.6 to directory C:\solana-install-tmp for Windows system. Now Solana installer got into that directory with file name solana-install-init.exe.
Check the version by
For Linux system we can reference official tutorial.
For my personal convenience I purely show the case of Windows system. Also see the
official tutorial for accessing the latest version of the installer (more than 1.8.6), and
yours will be newer than mine.
【Generate a Solana Wallet】
After getting Solana (command-line) tool installed, we are going to generate a wallet unique to you to store up cryptocurrencies and tokens.
We firstly make a preferred directory for the wallet (you can specify directory and folder name for sure)
Next on we generate a specific wallet.
We will then be asked to enter BIP39 passphrase
after running the command. Just hit enter to leave it blank at the moment.
In this step we can receive: (1) a public
key of the wallet to which everybody can access. it looks like 5ESD5g4fwWnvKWzVbSap23UTTX52SNXrxDHjKVCEW21C
The public key was also written into Json file my-keypair.json.
(2) seed phrase which is composed of a set of English words for log-in use. It must be kept in secret ourselves and hence must not expose it anywhere outside!
Thirdly go to explorer.solana.com on the browser and you will see a web-based interface like below. Make sure you are in Devnet (for development use) by clicking the cluster button on the right above.
Finally, to test the wallet, try airdrop 1 SOL to the wallet.
If done, one SOL can be seen in balance of
the wallet. This SOL can also be seen in the abovementioned web interface by
typing the public key of wallet in searching block. This airdropped SOL can
support you to mint Token on Devnet.
Paragraph Reference: https://docs.solana.com/wallet-guide/file-system-wallet
【Generate Token】
Before mining an NFT we need to generate
token at first.
change configuration
(not mainnet)
(the directory where the wallet key is saved)
Mint Fungible Token
We can now start to create token
And then create an account specifically for
the token we just created
Start to mint (fungible) token by
entering unique token account as well as number of tokens to mint (here got 10).
(Note: spl-token mint [token account] [number of token])
When checking the token, we found there are
indeed 10 tokens as supply currently. The mint authority below displayed our
wallet key.
You can further mint tokens by executing
the same command and specifying preferred amount of them (15 in this case).
Now there are 25 current supplies for the token.
Disable future minting – so that the
minting for the token account will be unavailable.
Create Non-fungible token (NFT)
Idea of creating NFT is like the way we
just created Fungible Token above. The difference is that the NFT cannot be
splitted and it is unique to individual address it has.
Again we created a token and this time specify decimals to be 0, because NFT is unique.
Then create a token account
Mint one token
We make it fixed in "1" so that it can be an NFT. Then disable its future mint for this token and make it one and only one token.
Check information for this one and only one
token, making sure it is unique to you as the only owner.
Paragraph reference: https://spl.solana.com/token
* I got so many hand-by-hand practical ideas from ZappyCode. Highly recommend his video clip tutorial on Youtube.
留言
張貼留言