2️Creating Candy Machine
Once you have your collection prepared, the next step is to upload your assets and create a Candy Machine. This step is completed by a single command via the Candy Machine CLI.
Before you can proceed, you need to check that:
Your images and metadata are in the same format as
example-asset
folders and you already havemaster-csv
file.You have funds in your wallet.
You have pinata account and you config .env properly. You can copy .env-example and rename to .env
PINATA_API_KEY
Pinata api key
PINATA_SECRET_KEY
Pinata secret key
MNEMONIC
Mnemonic for wallet that will use to mint NFT (Minter account)
Uploading the IPFS
npx ts-node src/nft-cli.ts upload -d data -i "example-assets/images" -c "example-assets/master.csv"
-i, --image <string>
true
"example-assets/images"
Image asset folder
-c, --config <string>
true
"example-assets/master.csv"
Master csv file
-d, --data <string>
true
"data"
Data folder (or Working Directory) for store output master csv file
-m, --metadata <string>
false
"example-assets/metadata"
Metadata folder (optional)
████████████████████████████████████████ 100% | ETA: 0s | 10/10
Updated config file: data/master.csv
You will be greeted with this after its upload successfully.
Creating the NFT Contract
npx ts-node src/nft-cli.ts create -cn soil-test -cs SOIL -n testnet -d data
-cn, --name <string>
true
soil-test
NFT collection name
-cs, --symbol <string>
true
SOIL
NFT collection symbol
-n, --network <string>
true
testnet
Terra network. (localterra, testnet and mainnet)
-d, --data <string>
false
data
Data folder that will store created NFT contract information
collection create: terra1q9ur0llh76xantxp2r765ssuelwgs8nnvhafh373z9lvjg0hug7qkvxdfl
Updated config file: data/data.json
You will be greeted with this after its created successfully.
Creating Candy Machine
npx ts-node src/candy-machine-cli.ts create -d data -c example-assets/master.csv -n testnet --denom uluna --amount 100000 --creator minter
Replace the "testnet"
with the terra network name mint currency denom with your desired denom, amount \
-d, --data <string>
true
data
Data folder that will store created NFT contract information
-n, --network <string>
true
testnet
Terra network. (localterra, testnet and mainnet)
-c, --config <string>
true
"example-assets/master.csv"
Master csv file
--denom <string>
true
uluna
Currency denom (LUNA = uluna)
--amount <number>
true
1000000
Currency amount with 6 decimal (1000000 / 1e6 to be real number. Ex. 1000000 is 1 LUNA)
--creator <string>
true
minter
Mint receiving address. You can use 'minter' keyword, which will be same address as minter account
--whitelist
false
Enable whitelist (default value is false)
candy machine create: terra18tehsjdcx8jk6k6ukzl7k0089wt6rvcrpjl9mmvt0ym9w4q2zanqvhqgpz
update seed complete at txhash: 3FD4027720ABCA3BA77BB1E4C97B3E0599B32A6D0394BE399E89041BEB3ADECF
Updated config file: data/data.json
You will be greeted with this after its created successfully.
Minting NFT to Candy Machine
npx ts-node src/nft-cli.ts mint -d data -c data/master.csv -n testnet -m example-assets/metadata
-d, --data <string>
true
data
Data folder that will store created NFT contract information
-n, --network <string>
true
testnet
Terra network. (localterra, testnet and mainnet)
-c, --config <string>
true
data/master.csv
Master csv file. You need to upload images to IPFS first.
-m, --metadata <string>
false
example-assets/metadata
Metadata folder
████████████████████████████████████████ 100% | ETA: 0s | 10/10
Mint success 10 nft
Updated minted nfts file: data/nft_tx.csv
You will be greeted with this after its minting process successfully.
Last updated