How to Create and Transfer Your TRC-20 Token in 5 Minutes

·

TrustNote is a DAG-based distributed ledger platform designed for the tokenized economy. It enables developers to create, issue, and manage tokens or digital assets quickly and efficiently.

With the release of TrustNote’s TRC-20 token specification, we’ve provided a JavaScript sample code to demonstrate how to:

This guide walks you through the process step by step—modify a few lines of code, and you’ll have your own token ready in minutes.


Requirements

1. Ubuntu 16.0.4

2. Node.js 8


Step 1: Install the Sample Code

Clone the repository:

git clone https://github.com/trustnote/trustnote-token.git

Install dependencies:

cd trustnote-token  
npm install

Note: Installation time varies based on network speed.


Step 2: Configure for Testnet

  1. Navigate to:

    trustnote-token/node_modules/trustnote-common/constants.js
  2. Locate GENESIS_UNIT (line 13) and replace the value with:

    MtzrZeOHHjqVZheuLylf0DX7zhp10nBsQX5e/+cA3PQ=

Step 3: Sync Your Node

Start the service:

node start.js

Tip: Sync may take 15+ minutes. Your wallet address is saved in address.json.


Step 4: Get TTT Test Notes

  1. Copy your address from address.json.
  2. Visit TrustNote Token Faucet, paste your address, and request test notes.
  3. Check balance on the testnet explorer.

⚠️ Note: TTT Test Notes work only on testnet.


Step 5: Issue Your Token

  1. Edit create_asset.js (line 14) to adjust token supply:

    cap: 1000000000000 // Default: 1 trillion
  2. Run:

    node create_asset.js
  3. Verify issuance via asset.json and the testnet explorer.

Step 6: Transfer Tokens

  1. Update transfer_asset.js (line 11):

    • Replace TokenID with your token’s ID.
    • Adjust transfer amount (e.g., 80 units).
  2. Execute:

    node transfer_asset.js
  3. Confirm the transfer by checking the destination address (LDFEZ5TWE4XW4NUAUQHCMEPEQV7NAX6X) on the explorer.

FAQs

Q1: Can I use this token on TrustNote’s mainnet?

A: No. This guide uses testnet-only TTT Notes.

Q2: How do I change the token name/symbol?

A: Modify name and symbol fields in create_asset.js.

Q3: What’s the transaction fee?

A: Testnet transactions are fee-free. Mainnet fees require real TTT Notes.

👉 Explore more about tokenization


Next Steps

Need help? Comment below!

👉 Master blockchain tokenization