Mint NFT

Minting NFT and linking metadata to Logosphere

Make sure that docker containers for cardano-wallet and cardano-node are running and the chain is in sync. Use the following command to check the status:

curl http://localhost:7070/v2/network/information

Custodial Minting

Custodial minting is happening into an app-managed wallet and signed by a key managed by the app. For non-custodial minting into a user wallet, where user signs the transaction and the asset is minted into a user's wallet, see the next section.

Make sure that environment variables are set for custodial minting and the wallet's address is funded with test ADA. To fund the wallet, go to Cardano Testnet Faucetarrow-up-right.

# CARDANO
# Cardano network: testnet (preview, preprod) or mainnet
CARDANO_NETWORK=preview
# Wallet ID for custodial minting of NFT assets (used in mintNft API methods)
CARDANO_WALLET_ID=
# Mnemonic for the custodial wallet (15 words, comma separated)
CARDANO_WALLET_MNEMONIC= <mnemonic> # very,rescue,palm,hazard,certain,buddy,topic,profit,office,split,bravo,tango,lima,novel,poncho
# Address of the custodial wallet
CARDANO_WALLET_ADDRESS=<address> # addr_test1qpzm3kh2rg7y0rsdz9qg72f0cap9ecqvremlp3mwzx9zmhrz0zdwlafjp6wpke3ryv7rzqr35vn0ja5lcghymxghs7sq3jfga0

Update music model for NFT minting

Add nft: true to the Track entity props in the music.model.ts

@Entity('track', { nft: true })
export class Track {
...
}

Rebuild the model and update the API

Update docker image and restart the music service

Mint NFT

Mutation:

Variables:

Noteable properties are all that start with nft

The output of the mutation will be transaction hash on the Cardano blockchain.

Navigate to the Cardano testnet explorer to see the status of the minting transaction and explore it's metadata.

Non-custodial Minting

TODO: // complete this section and show example minting to a user's Nami wallet.

Last updated