How to create a Custom Token/Token Issuer using CLI

Creating a custom token involves writing and deploying smart contract code to a blockchain network. The smart contract defines the properties and behavior of the token, such as its name, symbol, and total supply.

  • Basic understanding of Command line

  • Basic understanding of Accumulate CLI commands

To create a custom token, you will need to have a basic understanding of the Accumulate commands (CLI) and access to a development environment. The steps typically involved in creating a custom token are:

  1. Creation of an ADI

  2. Creation of your token

Creating a custom token in Accumulate via CLI is straightforward. You do that by creating an ADI and using the ADI information to create your custom token.

Your account connects to the accumulate mainnet by default.

If you want to connect to the testnet, add this flag and argument -s https://testnet.accumulatenetwork.io/v2

Example:

I will use the faucet command for this example.

./accumulate faucet acc://5c33543157a40920252fa27d20079925807f611a9c4746c4/ACME -s 
https://testnet.accumulatenetwork.io/v2

Create an ADI

There are two ways to create an ADI in Accumulate: "Create new ADI for another ADI" and." Create New ADI from Lite Account " for this tutorial. You will use a lite account to create your ADI.

ADI create (Create New ADI from Lite Account)

Follow the steps below to create an ADI from a lite account

  • Generate a lite account

  • Get Faucets

  • Add credits to your lite account

  • Choose a name for the ADI

  • Generate a key

  • Create your ADI

  • Credit your keypage.

To be able to process this transaction, you must have at least 500 credits of ACME

1: Generate a lite account

Generate random Lite Identity and ACME Lite Token Account

Syntax:

./accumulate account generate 

Command:

./accumulate account generate 

The above command will return an output similar to the following:

acc://809050d340268983b1cc6a4c2ea57faef7ad96823588ce48/ACME : bb25657569c503c96eb03a7d36287b77d5e20672aa57692ce8fb9af468f74bfe 

2: Get ACME from Faucets

Syntax:

 ./accumulate faucet [(lite account]) 

Example of a lite account: acc://809050d340268983b1cc6a4c2ea57faef7ad96823588ce48/ACME

Command

./accumulate faucet acc://809050d340268983b1cc6a4c2ea57faef7ad96823588ce48/ACME ./accumulate faucet acc://809050d340268983b1cc6a4c2ea57faef7ad96823588ce48/ACME 

The above command will return an output similar to the following:

Transaction Hash : 3919c22fc05bdaa615e1e863d15c0feb4f46797fafd03e1d418c2e1bf1536b28 
Envelope Hash : 
Simple Hash : 2ccc8e1da92ad7d70417e1c553287bb54c66d169f914a1a3317c6ffa235b4434 
Error code : ok 

3: Add credits to your lite account

Syntax:

./accumulate credits [(lite account]) [(lite identity]) [(cCredit amount]) 

Command:

./accumulate credits acc://3a9355bb9ad36221fdde3b9a8dc6565cf6c2be2560724785/ACME acc://3a9355bb9ad36221fdde3b9a8dc6565cf6c2be2560724785/ACME 100 
 

The above command will return an output similar to the following:

  Transaction Hash : 5456edf0cc24173e5c6e841a0c5505b4600bdccf0cf7e1c1655d0e04692d8ac8 
        Signature 0 Hash : 52f26026c59945ad484a126a090c519dcb8c18324c21c927a24a7d117d2dd0e9 
        Simple Hash : 051c3aa0b829c88ef25ffd54f58efc927d1206f811a58ac74a2f77806f3552d9 
        Error code : ok 
        Result : Oracle $0.05 / ACME 
                                  Credits 10000.00 
                                  Amount 2000.00000000 ACME 

4: Generate a key

Syntax:

./accumulate key generate [name for this key] 
 

Command:

./accumulate key generate key1234 

The above command will return an output similar to the following:

key1234 : e7f1541f7460fc38ef8ffeb5d483415074d68621b004614209d3d461d7abee12 
 

5: Create an ADI

Syntax:

accumulate adi create [origin-lite-account] [adi url to create] [public-key or wallet key label] [key-book-name (optional)] [key-page-name (optional)] 

Example

./accumulate adi create acc://5a33ebee80f411ec8f9661e86c625ecb81d105aacfe3bd35/ACME acc://Tesla.acme key1234 acc://Tesla.acme/wize 

The above command will return an output similar to the following:

Transaction Hash : 1396c5a52c7efd7f0464c9a9ab0e2f29ead9ec7da74009dc32892cfd7ded9e56 
Signature 0 Hash : 756538bda02637b83590b1322ccd4218ce141dd4006c6c461b2214164ffd3f86 
Simple Hash : ed71a4f1363f5de1137075ae92aff18446b4143586b926e22b5a95f1e75373b1 
Error code : ok 
Result : 

To create a token, you will need to credit your keypage with at least 100 credits. Because your keypage was generated by the system, it will look similar to this:

acc://Tesla.acme/wize/1 

6: Credits your keypage

Syntax

./accumulate credits [lite acount], [keybook url], [amount] 
 

Command

./accumulate credits acc://f327de65ed0a1bcde589d31ef0058a49d0636b5fb619f1d7/ACME acc://Teslaz.acme/wize/1 10000  

The above command will return an output similar to the following:

  Transaction Hash : 5456edf0cc24173e5c6e841a0c5505b4600bdccf0cf7e1c1655d0e04692d8ac8 
        Signature 0 Hash : 52f26026c59945ad484a126a090c519dcb8c18324c21c927a24a7d117d2dd0e9 
        Simple Hash : 051c3aa0b829c88ef25ffd54f58efc927d1206f811a58ac74a2f77806f3552d9 
        Error code : ok 
        Result : Oracle $0.05 / ACME 
                                  Credits 10000.00 
                                  Amount 2000.00000000 ACME 

Create your custom token

Syntax

accumulate token create [origin adi or lite url] [adi signer key name (if applicable)] [token url] [symbol] [precision (0 - 18)] [supply limit] [properties URL (optional)] [flags]  

Example

./accumulate account create token acc://Tesla.acme key1234 acc://Tesla.acme/Tokens acc://WIZECOIN 

The above command will return an output similar to the following:

 Transaction Hash : d326bc6c904aae2db29b1120104f4564da2195c29e5baf3c48780865fea65630 
        Signature 0 Hash : fba7ee943b434cc61b8da949099a489ceefc09f4be8a9aae12a2b14134c7b747 
        Simple Hash : 79b96289f4d6648468b3334d15adb0f6ea0014dcff40d938f0db33ba4820f92c 
        Error code : ok 
        Result   

You can view it on Accumulate explorer using the tx hash

Last updated