V2? V2!
There are different reasons for a new Version. The one that triggered our man Jordan was probably bots sniping on mints.
Follow me on Twitter
Have a look at
There are quite big changes and I will elaborate on them in the future, but first have some top level bullet points to get an overview:
From my point of view the things got much easier. At least less commands are required. But let's do it step by step:
Clone & install Metaplex
git clone https://github.com/metaplex-foundation/metaplex.git
Clone metaplex from github. If you already have metaplex locally make sure to run git pull
.cd js
)yarn install
One huge difference to v1: The candy machine and config are one account now. Therefore we need to provide all the information directly (can be updated though). We don't have a create_candy_machine command later on.
We do not do the configuration with hundreds of CLI parameters anymore. Instead we can build a config.json file for most of our parameters. The documentation on this is already quite good, so I will skip explaining all the parameters for now.
Make sure that you do not delete anything but instead set them to null
. E.g. if you don't need the endSettings do '"endSettings": null' instead of removing the line completely. Otherwise you will receive error 0x66
Use this as basis and save it somewhere e.g. as config.json
{
"price": 0.01,
"number": 6,
"gatekeeper": null,
"solTreasuryAccount": "G2j7mmWuA9AH7u8Ykxm1hSuizxJk8u8YYBUZkuMvmytM",
"splTokenAccount": null,
"splToken": null,
"goLiveDate": "11 Dec 2021 13:00:00 GMT",
"endSettings": {
"endSettingType": { "amount": true },
"value": 5
},
"whitelistMintSettings": {
"mode": { "burnEveryTime": true },
"mint": "7nE1GmnMmDKiycFkpHF7mKtxt356FQzVonZqBWsTWZNf",
"presale": true,
"discountPrice": 0.5
},
"hiddenSettings": null,
"storage": "arweave",
"ipfsInfuraProjectId": null,
"ipfsInfuraSecret": null,
"awsS3Bucket": null,
"noRetainAuthority": false,
"noMutable": false
}
Explanation for the different fields in config.json
Option | Sub-Option | possible values | description |
---|---|---|---|
Price | Numbers | Price in SOL or SPL tokens | |
number | Integer | Amount of NFTs in the candy machine | |
solTreasuryAccount | Publickey / null | Account SOL proceedings should go to | |
splTokenAccount | Publickey / null | Account SPL proceedings should go to | |
splToken | Publickey / null | Mint Adress of the SPL token the machine is paid with | |
goLiveDate | Datetime | Date where "normal" users can mint. (Can be circumvented by CM Authority and whitelist) | |
endSettings | options / null | Date or mint amount after which the Candy machine is closed | |
endSettingstype | type of end setting | ||
-amount | boolean | end after n mints | |
-value | Integer | amount of mints before end | |
tbc… |
This step is similar to v1. Except that we need to add one config parameter -cp <config location>
e.g. your command could look like this:
ts-node candy-machine-v2-cli.ts upload -e devnet -k <path to keyfile> -cp <path to config.json> <path to assets> -c <cache file name>
DO NOT SKIP THIS STEP!
This step checks if the upload of all files was successful. Command can look like that:
ts-node candy-machine-v2-cli.ts verify -e devnet -k <path to keyfile> -cp <path to config.json> -c <cache file name>
Only proceed if it says successful. Otherwise run the upload command again!
That's it already. You can test your candy machine with the mint_one_token command.
ts-node candy-machine-v2-cli.ts mint_one_token -e devnet -k <path to keyfile> -cp <path to config.json> -c <cache file name>
Well, I lied. The candy machine is set up and technically you can mint, but obviously you want to give your community the chance to mint, too. Unfortunately the v1 standard "exiledApes" mint button repository does not work anymore. But there are alternatives.
You can use the frontend of the fair launch protocol which is already in the metaplex repository. Just go into metaplex/js/packages/candy-machine-ui
and modify the .env
file.
metaplex/js/packages/cli/src/.cache
#
is in front of the lines with devnet (line 3+4) but instead in front of mainnet (line 6+7) like you can see belowREACT_APP_CANDY_MACHINE_ID=<YOUR CANDY MACHINE PROGRAM ID>
REACT_APP_SOLANA_NETWORK=devnet
REACT_APP_SOLANA_RPC_HOST=https://api.devnet.solana.com
yarn start
in metaplex/js/packages/candy-machine-ui
to run a local version of the front end. You can test minting here!https://github.com/tonyboylehub/candymachine-v2-boiler-mint-site-noFLP
Currently Gumdrop will not directly work with v2 right now. Jordan confirmed that it will work in the future, though.
There is a workaround:
--decimals 0
e.g. like spl-token create-token --decimals 0
One examle config file that has been confirmed working. Look into the docs for more details!
"price": 0.01,
"number": 10,
"gatekeeper": null,
"solTreasuryAccount": "<your wallet>",
"splTokenAccount": null,
"splToken": null,
"goLiveDate": "1st Jan 2022 00:00:00 GMT",
"endSettings": {
"endSettingType": { "date":true },
"value":"25 Dec 2022 23:59:00 GMT"
},
"whitelistMintSettings": { // THIS IS THE IMPORTANT THING HERE!
"mode" : { "burnEveryTime": true },
"mint" : "E5BuTQcD22n6FyC2RWMtVNH2uZVNqAcy5855P8GrTxx4", //your SPL token mint
"presale" : true, //enable the wallets having the token to mint before start date
"discountPrice" : null // preminter have same price as normal minters
},
"hiddenSettings": null,
"storage": "arweave",
"ipfsInfuraProjectId": null,
"ipfsInfuraSecret": null,
"awsS3Bucket": null,
"noRetainAuthority": false,
"noMutable": false
}
Thats an issue with the current master branch. FLP frontend is broken here. You can e.g. use the branch
fix-arweave-upload
Clone it with git clone -b fix-arweave-upload https://github.com/metaplex-foundation/metaplex.git
or just copy the flp folder out of this branch.
Some Reports say that it helps to
/js/packages/fair-launch
folder to another locationyarn add -d @types/canvas-confetti
if that does not work try npm i --save-dev @types/canvas-confetti
yarn install
and yarn start
The sign_all CLI command does currently not work for candy machine v2. It does not find unverified metadata. What you can do is use Metaboss to sign your NFTs. Donwload it and run
metaboss sign all -k <path-to-keypair> --candy-machine-id <first-creator-pubkey>
Make sure that you are NOT using the candy machine ID but the first creator instead.
There is a hidden Folder called .DS_Store in your asset folder. In case you can't find it you can run this script to delete it.
find ./assets -name .DS_Store -exec rm {} ;