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:
- Create a TRC-20 compatible token
- Transfer assets
- Check balances on TrustNote’s testnet
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
- A non-root user account with sudo privileges.
2. Node.js 8
- Verify installation with
node -v. - Install via Node.js official guide if needed.
Step 1: Install the Sample Code
Clone the repository:
git clone https://github.com/trustnote/trustnote-token.gitInstall dependencies:
cd trustnote-token
npm installNote: Installation time varies based on network speed.
Step 2: Configure for Testnet
Navigate to:
trustnote-token/node_modules/trustnote-common/constants.jsLocate
GENESIS_UNIT(line 13) and replace the value with:MtzrZeOHHjqVZheuLylf0DX7zhp10nBsQX5e/+cA3PQ=
Step 3: Sync Your Node
Start the service:
node start.js- Press Enter for default prompts.
Monitor sync status via:
tail -f [log-file-path]
Tip: Sync may take 15+ minutes. Your wallet address is saved in address.json.
Step 4: Get TTT Test Notes
- Copy your
addressfromaddress.json. - Visit TrustNote Token Faucet, paste your address, and request test notes.
- Check balance on the testnet explorer.
⚠️ Note: TTT Test Notes work only on testnet.
Step 5: Issue Your Token
Edit
create_asset.js(line 14) to adjust token supply:cap: 1000000000000 // Default: 1 trillionRun:
node create_asset.js- Verify issuance via
asset.jsonand the testnet explorer.
Step 6: Transfer Tokens
Update
transfer_asset.js(line 11):- Replace
TokenIDwith your token’s ID. - Adjust transfer amount (e.g.,
80units).
- Replace
Execute:
node transfer_asset.js- 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
- Test token functionalities thoroughly.
- Deploy to mainnet with real TTT Notes.
- Integrate tokens into dApps or exchanges.
Need help? Comment below!