Instant Mint
Lets mint!
Here is a straightforward example that illustrates how you can mint your very first token. To begin, you will need to add your private key to the testUtility.js file. To obtain a new random private key simply run this command in the terminal while in the /tests directory
The corresponding address will appear in the terminal console.
In order to utilize this address for minting purposes, you will need to first send funds to it. Please note that a minimum of 5000 satoshis will be required in order to run the test, although only a fraction of this amount will actually be used in the mint example. Please be sure to keep a copy of this private key if you still have funds that you would like to recover in the future. At any time you would like to withdraw the funds from the test address please refer to the /tests/getFundsFromAddress.js file and follow the instructions.
To proceed, take the private key string and replace the two values in the testUtility.js file. In this example, you can use the same private key for both variables on lines 11 and 16
Make sure to retain a copy of this private key if you have any remaining funds that you may wish to retrieve later. If you want to withdraw the funds from the test address at any point in time, consult the /tests/getFundsFromAddress.js file and adhere to the guidelines provided.
We're now set to conduct the test! Just go to the /test directory and execute this command in the terminal.
The process will start and the token will be minted onchain with all Txids provided.
As this is for testing purposes, we will also redeem the token back to native satoshis as part of this test.
Last updated