# **Candy Machine FAQ**
#solana #metaplex #nft #candymachine #fml
Hey all, it's Eric from [@DearSantaNFT](https://www.twitter.com/dearsantanft). A lot of people were having trouble with broken uploads / broken metadata in their Candy Machines. After helping people one-by-one, and seeing this was a widespread problem, I decided to write this FAQ.
Good luck!
### Before You Do Anything:
**Did you generate your json/pngs with Hashlips?**
- There's a bug in a recent Hashlips repo where it generates one less file than you specify. This has happened to myself and five others that I've seen.
- For example: 99.json, 100.json, 102.json.
- Where did 101 go?
- If you don't catch this before uploading, your upload will NEVER work.
- Let's say you have a collection 200 NFTs-- highlight your 0.json to 199.json and make sure it says you have 200 items.
- If it says you have fewer than 200...
- Regenerate with +1 file.
- Check again.
- Find the missing .json/.png pair.
- Rename the last files to those missing numbers.
- Open the metadata, and replace the #'s where necessary.
**"I already uploaded my Candy Machine, and it's broken..."**
1. The money you spent on Arweave is gone. Sorry!
2. Run the [withdraw command](https://docs.metaplex.com/create-candy/withdraw) from the CLI, and get your Candy Machine Config money back.
3. Delete the mainnet-beta-temp.json (or devnet-temp.json) file in your .cache folder.
4. You can use the keypair you were using before.
Now that we're starting fresh, you'll find a guide for Candy Machine v1 and v2 below.
**Note**
When I wrote this guide, CMv2 was completely broken. The repos below work now. I would recommend using CMv2. If you feel you need to use v1, the guide below **works**.
## How to get Candy Machine v1 to upload correctly (12/21 and earlier)
**Get the Right Repo**
1. Any repo with candy_machine_v2_cli.ts in it is broken. Metaplex are purposefully NOT fixing v1 issues, they want you to use v2.
2. Download the latest Master branch from Metaplex, go into the metaplex folder and run this in your cli...
3. git checkout 8ac3a5f11d80b632942850454db4c7d23df03bff
4. This will take you back to Nov 15, 2021. Confirmed working.
- Yeah, but I ran that and got a fatal error!
1. That means you probably downloaded a .zip file from Github, and didn't clone the repo with the CLI. No problem.
2. Download this: https://github.com/metaplex-foundation/metaplex/tree/Pull-request-template
3. You'll need to yarn install and yarn build this folder. You can still use the keypair you generated earlier.
**Now we need to make sure your metadata is configured correctly.**
1. Check your 0.json, 1.json files, and make sure that in the "image" and "uri" sections it says "image.png."
2. If it says 0.png, 1.png, I can't be sure it'll work.
3. (Hashlips will write the metadata that way.)
Upload away. If your uploads seem to bonk out, just run the upload command again until they all get up.
If you need a tutorial, follow this one:
https://hackmd.io/@hnbl/hector
**Important to Note**
This repo does NOT have the withdraw function. It's from the Before Times. If you need to withdraw, you...
1. Get a new repo
2. Yarn install / Yarn Build it
3. Withdraw
4. Go back to your old repo.
5. Yarn install / Yarn Build
6. Back in business.
## How to get Candy Machine v2 to upload correctly
### (12/27) It's been a couple days since I updated this, and I think things have changed. I think you can use the latest master branch now, and it works.
You might be able to ignore the info about "Get the Right Repo" now.
---
**Get the right repo.**
- The newest Master from Metaplex is broken, and can't Yarn Build. #1257
- This one is vouched for by a Metaplex dev, #1273
https://github.com/metaplex-foundation/metaplex/pull/1273/commits
gh pr checkout 1273
commit 27cb33e755f9818ec3d6b7f7c3cd2a615e25cd4d
(Install the master branch from the gh cli, then type gh pr checkout 1273 in the metaplex folder.)
- This specific repo from today fixes a few problems.
- You can use "arweave-sol" in your config instead of "arweave."
- This is significant because you can upload WAY more reliably, as it goes up in "bundles."
- That does NOT mean it works for CM v1. Stick with regular old arweave one-by-one upload on v1.
- Your metadata can now be formatted with either 0.png or image.png in there.
**Config File Location**
- You’ll find an example config file in: metaplex/js/packages/cli/example-candy-machine-upload-config.json
- Change that to config.json, edit accordingly, and call that in your CLI commands. How? 👇
- [Follow Mark's tutorial](https://hackmd.io/@MarkSackerberg/candyV2).
**A Vanilla Config File Example**
https://docs.metaplex.com/candy-machine-v2/Configuration
```
{
"price": 0.01,
"number": 10000, // The number of NFTs in your collection
"gatekeeper": null,
"solTreasuryAccount": "YOUR TREASURY WALLET ID",
"splTokenAccount": null,
"splToken": null,
"goLiveDate": "11 Dec 2021 13:00:00 CST",
"endSettings": null,
"whitelistMintSettings": null,
"hiddenSettings": null,
"storage": "arweave-sol",
"ipfsInfuraProjectId": null,
"ipfsInfuraSecret": null,
"awsS3Bucket": null,
"noRetainAuthority": false,
"noMutable": false
}
```
**Mint Website for v2**
If you work in this repo...: https://github.com/metaplex-foundation/metaplex/pull/1249
The FLP mint site will work. Not yet working on newer versions of Metaplex.
(Thanks to WrathionTBP on Discord for the info. He suggested pulling and building this separately, so you have the other one to upload with, and don't have to switch back and forth.)
**Mint Website Option 2**
Next Candy Machine v2
https://github.com/rez-cpu/next-candy-machinev2
Word is that this works too.
**Everything Else v2**
Use this tutorial: https://hackmd.io/@MarkSackerberg/candyV2
---
Follow the official docs: https://docs.metaplex.com/candy-machine-v2/MintFrontend
# Did it Work?
*Send your thank you's in the form of mints from www.dearsantanft.com or www.mintyourelf.com. 100% of proceeds to go charity-- Kidsave.org. Heart emoji.*
*Twitter love is also appreciated. twitter.com/dearsantanft*
---
# Additional FAQs
**CM v1**
- Verify isn't working. I check my config, and it's all onChain True, and my links are all working.
- NOTE: Betterverify doesn't work with the old Nov 15 Metaplex repo. If you try to commit that in, and build, it will fail. (Maybe you'd need to have another Newer Metaplex installed, in order to use BV? I don't know. Need to try it.)
- Use **Betterverify**. In your metaplex folder, in your cli...
- git fetch origin pull/985/head:betterverify
- git checkout betterverify
- Re-run verify
- Thanks to @jasonrun on Metaplex Discord
- My Exiled Apes "Candy-Machine-Mint" site is showing 0 supply, 0 everything!
- You need a custom RPC server. Info about that [here](https://hackmd.io/@hnbl/hector).
- You'll have to update your Exiled Apes .env file with this RPC server.
**CM v1 and v2**
- Error message about Lamports: Add more SOL to your wallet.
- Error message during withdraw.
- *Timeout Error caught { timeout: true }. Withdraw has failed for config account*
- FIX: You need SOL in your wallet.
- My mint site is reporting all 0's instead of the correct wallet info.
- As far as I'm reading you need to get a custom RPC server AND make sure you have an SSL certificate installed on your website.
-
**CM v2**
- "Number of config lines must be at least number of items available."
- Your config file isn't set up right. CM v2 has a separate config json where you set parameters. There's one called number. Let's say you have a collection of 3,333 NFTs. That number should be 3,333.
- You'll find an example config file in: metaplex/js/packages/cli/example-candy-machine-upload-config.json
- Change that to config.json, edit accordingly, and call that in your CLI commands. How? 👇
- [Follow Mark's tutorial](https://hackmd.io/@MarkSackerberg/candyV2).
- Don't use the arweave-sol option in your config. Leave it as arweave. [Source: Twitter, @redacted_j](https://twitter.com/redacted_j/status/1473404321391906818?s=20).