Skip to content

armada-alliance/cardano-minter-collection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to make a NFT collection on Cardano using javascript.

Prerequisites

If you haven't already, watch the previous video tutorial here: https://youtu.be/OeOliguGn7Y

Clone the repo if you haven't already...

git clone https://github.com/armada-alliance/cardano-minter-collection.git
cd cardano-minter-collection

Install additional dependencies

npm install form-data dotenv axios lodash sharp promise-parallel-throttle prompt-sync --save

After that, make sure to use the newest cardanocli-js repo by directly cloning it into the modules folder with the command:

git clone https://github.com/Berry-Pool/cardanocli-js.git temp_mod
cp -r temp_mod/* node_modules/cardanocli-js/
rm -rf temp_mod

Tutorial Overview

1. Create our initial assets

  • Create a script that will generate our assets in a nicely formatted json file called "assets.json".
node src/create-initial-assets-json.js

2. Download random images for testing

node src/download-test-images.js

3. Extend metadata.json with thumbnails (optional)

  • generate thumbnails based on images from the metadata.json and give them same name with _thumbnail tag added to the name
node src/generate-thumbnails.js

4. Create our pinata.cloud account to get our API keys

  1. Create an account
  2. Create api keys

5. Need to safely store our API keys

  • create .env file and paste in our keys

6. upload and pin our data to ipfs

  • create pin-to-ipfs.js
  • iterate over each item in metadata.json and:
    • pin the original image to ipfs
    • pin the thumbnail to ipfs
    • store the reference to both src and image on ipfs in metadata.json
  • create pin-images-to-ipfs.js
node src/pin-to-ipfs.js
node src/pin-images-to-ipfs.js

Before you mint transaction

7. Create an "open" or "unlocked" minting policy and script

  • We will create a open minting policy script and export it in a JSON and TXT format.
node src/create-mint-policy.js

8. Create an "time-locked" minting policy and script

  • Create a "time-locked" minting policy script and export it in a JSON and TXT format.
node src/create-time-locked-mint-policy.js

9. Create a a script to get our policy ID

  • We want to make a script that can get our Policy ID to be used in other parts of our program
node src/get-policy-id.js

9. Define the mint transaction

  1. build mint transaction with metadata.json
  2. calc fee
  3. rebuild
  4. sign
  5. submit
node src/mint-multiple-assets.js

10. Send assets back to wallet

-Make a script to send multiple assets back to a wallet in a single transaction.

node src/send-multiple-assets-back-to-wallet.js

Optional: Burn all assets

If there are any errors with the metadata, this script is able to burn the entire wallet content:

bash node src/burn-all-assets.js

WARNING: All assets will be burned. Use with caution.