Skip to content

FlowFans/FlowChinaBadge

Repository files navigation

FlowChinaBadge

This project was generated with freshmint.

Setup

This project requires the Flow CLI and Docker.

Now install the project and its dependencies:

npm install

Quick start

This project uses the Flow emulator for rapid local development.

Start the emulator

docker-compose up -d

Deploy your contract to Flow

Ensure you run the remaining commands from your new project's directory.

fresh deploy

Mint your NFTs

This command mints the NFTs declared in nfts.csv. Edit that file to add your own NFTs!

Notes:

  • The metadata in the CSV is compatible with OpenSea's NFT standard. Freshmint does not enforce any standard metadata, but it is reccomended you consider using a standard format.

  • Only the image property is required, and it's value must be the name of a file in the assets/images directory of your project.

fresh mint

Mint a claimable NFT (i.e. airdrop support)

Use the claim flag to create claim keys for your minted NFTs. Each NFT gets a unique claim key. Give a key to a user to allow them to claim that NFT.

fresh mint --claim

Inspect an NFT

View the metadata for a single NFT.

fresh inspect 0

Pin the NFT metadata

After you mint your NFTs, you'll need to pin the metdata to IPFS so that it's available to the world.

Hint: you can implement a blind drop by pinning the metadata after your drop completes.

Configure your pinning service

Freshmint is compatible with NFT.Storage, Pinata and any other pinning service that implements the IPFS Remote Pinning API.

First configure your pinning service by editing .env:

Pin an NFT

Use the pin command to pin an NFT by ID.

fresh pin 0

Start your drop

Start an NFT drop. This will start a new drop that lists all the NFTs currently minted. Use the price argument to set the price of each NFT in FLOW.

fresh start-drop 10.0

Remove a drop

Remove a drop. Once your drop is sold out, run this command to remove it.

fresh remove-drop

Launch the web app

This is the last step! Run this command to launch the UI for you NFT project.

npm run dev

Deploy on testnet

Generate a new key pair for your testnet admin account:

flow keys generate

Save the private key to your .env file:

# .env
FLOW_TESTNET_PRIVATE_KEY=xxxx

Use the Flow Faucet to create a new account with the public key.

Save the resulting address to your .env file:

# .env
FLOW_TESTNET_ADDRESS=xxxx

Deploy your contract

You can now run the project commands with the testnet flag:

fresh deploy --network testnet

Mint your NFTs and manage drops

fresh mint --network testnet

fresh start-drop 10.0 --network testnet
fresh stop-drop --network testnet

Launch your app on testnet

NETWORK=testnet npm run dev