Intended to be used as a common starting point for demo repos for tutorials.
- Script that makes it easy to launch your own fungible token on Hedera Token Service (HTS)
- ... Plus all of the features in the Hedera Tutorial Demo Base Template, which this extends from.
5 minute HTS token launch challenge (watch on YouTube)
- Click on the "open in Gitpod" button to launch Gitpod
- If this is your first time using Gitpod, you'll need to create an account. It does not take long - it is as simple as signing in with Github, then authorising the Gitpod app.
- Wait for Gitpod to spin up a new instance (takes under 10 seconds)
- In the terminal, a script will prompt you to answer a few questions
- The newly generated accounts are derived from a seed phrase: Leave blank to generate a random one
- Number of accounts are derived from a seed phrase: Leave blank to accept the default
- RPC URL: Leave blank to accept the default
- Private key:
Leave blank to accept the default, which is to use the first account generated earlier
- Note that you may alternatively use the "HEX Encoded Private Key" of the "ECDSA Account"
from
portal.hedera.com
. This option requires a few extra minutes.
- Note that you may alternatively use the "HEX Encoded Private Key" of the "ECDSA Account"
from
- Copy the address of the newly generated account to your clipboard
- Visit
faucet.hedera.com
in a new browser tab/window- Note that if you have previously funded this particular account, you may skip the following steps
- Paste the address of your newly generated account from your clipboard
- Press the "receive" button
- Clear the captcha challenge
- Press the "confirm" button
- You should see a new account ID - this means that your account has been funded
- Switch back to your Gitpod instance, and in the terminal continue answering the questions prompted by the script
- Simply hit the "enter" key, now that you have funded this account
- The script will automatically work out the account ID for you (no need to copy paste it)
- In the file navigation pane, open the
.env
file to inspect the output of the script - In the file navigation pane, open the
src/script-five-min-token-launch.js
file to edit its contents - Find the section
Configuring the new HTS token
. The should be a comment which reads:// Set the token name, token symbol, and its initial supply (total number of tokens).
- Modify the values in the next 3 lines as follows:
- Under it, change the value of
name
to the name that you wish to give your fungible token - Change the value of
symbol
to the symbol that you wish to give your fungible token (this is typically an acronym or contraction of the name, and in all-caps, but that is up to you) - Finally, change the value of
initialSupply
to some large number, as this will be the total circulating supply of your token upon creation
- Under it, change the value of
- In the terminal, enter the command
cd src
- In the terminal, run the following script:
./script-five-min-token-launch.js
- Shortcut: type
./script
, then hit the[tab]
key to auto-complete
- Shortcut: type
- This script sends a
TokenCreateTransaction
to the network, with the options that you provided when editing it, to create your token - Copy the 2 Hashscan URLs from the terminal output, and open them in new browser tabs/windows
- For the transaction page, check that the transaction sent the tokens (the entire initial supply) to your account
- For the token page, check that its name, symbol, and initial supply match the values that you have configured
You're done - congratulations! 🎉
MIT