Using the nit module to create asset commits is free, but there will still be a gas fee associated with the transaction. To ensure that the transaction can be completed, it is important to have Mainnet NUM or Testnet NUM in the wallet being used.
Before starting, make sure in your working environment. Here are the basic steps to commit via the nit module.
Prepare nit config
Generate AssetTree
Create commit
Prepare nit config
In order to commit via nit module, you need to complete the following steps:
Follow and acquire YOUR_INFURA_PROJECT_ID andYOUR_INFURA_PROJECT_SECRET
Create a wallet and set up YOUR_PRIVATE_KEY in order to commit and create transactions. This wallet will appear as the committer in the .
Make sure there are Mainnet NUM in the wallet
[Option] Make sure there are Testnet NUM in the wallet
The following example is an example to create a commit for the asset on Numbers Mainnet using nit library. Before you start, follow the to prepare the information for your asset and put them in the inputData.
If your asset has been minted as NFTs and you wish to include NFT records in the , please follow the specifications outlined in the to prepare the nftRecord file. Then, add the following code to your AssetTree preparation process.