Skip to content

umeraqeel786/MintNFTsCardano

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

MintNFTsCardano

How to make a NFT collection on Cardano using javascript.

Prerequisites

cardano-node / cardano-cli set up on local machine (https://docs.cardano.org/projects/cardano-node/en/latest) Node.js installed version 14 cardano-cli-js package installed cardano-minter repo from the previous tutorial 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

Create an account 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 Speak about the various minting policies. https://docs.cardano.org/projects/cardano-node/en/latest/reference/simple-scripts.html#Step-1---construct-the-tx-body

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

build mint transaction with metadata.json calc fee rebuild sign 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published