Skip to content

hedera-dev/five-minute-token-launch-challenge

Repository files navigation

5 minute HTS token launch challenge

Intended to be used as a common starting point for demo repos for tutorials.

Features

Tutorial

Video demo

5 minute HTS token launch challenge (watch on YouTube)

Steps

  1. Click on the "open in Gitpod" button to launch Gitpod
    1. 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.
  2. Wait for Gitpod to spin up a new instance (takes under 10 seconds)
  3. In the terminal, a script will prompt you to answer a few questions
    1. The newly generated accounts are derived from a seed phrase: Leave blank to generate a random one
    2. Number of accounts are derived from a seed phrase: Leave blank to accept the default
    3. RPC URL: Leave blank to accept the default
    4. 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.
    5. Copy the address of the newly generated account to your clipboard
  4. Visit faucet.hedera.com in a new browser tab/window
    1. Note that if you have previously funded this particular account, you may skip the following steps
    2. Paste the address of your newly generated account from your clipboard
    3. Press the "receive" button
    4. Clear the captcha challenge
    5. Press the "confirm" button
    6. You should see a new account ID - this means that your account has been funded
  5. Switch back to your Gitpod instance, and in the terminal continue answering the questions prompted by the script
    1. Simply hit the "enter" key, now that you have funded this account
    2. The script will automatically work out the account ID for you (no need to copy paste it)
  6. In the file navigation pane, open the .env file to inspect the output of the script
  7. In the file navigation pane, open the src/script-five-min-token-launch.js file to edit its contents
  8. 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).
  9. Modify the values in the next 3 lines as follows:
    1. Under it, change the value of name to the name that you wish to give your fungible token
    2. 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)
    3. Finally, change the value of initialSupply to some large number, as this will be the total circulating supply of your token upon creation
  10. In the terminal, enter the command cd src
  11. In the terminal, run the following script: ./script-five-min-token-launch.js
    1. Shortcut: type ./script, then hit the [tab] key to auto-complete
  12. This script sends a TokenCreateTransaction to the network, with the options that you provided when editing it, to create your token
  13. Copy the 2 Hashscan URLs from the terminal output, and open them in new browser tabs/windows
    1. For the transaction page, check that the transaction sent the tokens (the entire initial supply) to your account
    2. For the token page, check that its name, symbol, and initial supply match the values that you have configured

You're done - congratulations! 🎉

Author

Brendan Graetz

Licence

MIT