0

I need to create a collection with a total of 100 NFTs, where the first 10 (IDs 0 to 9) will be minted to the same wallet from the start, and the remaining 90 will have the possibility to be minted through a web page.

I understand that the procedure would be as follows:

  1. Create a CMv2 with a total of 10 assets.

  2. Mint all of them (because the minting is random, it must be done before adding the remaining NFTs).

  3. Create the second CMv2 with the remaining 90 assets. I must specify the address of the mint created in the first CMv2 (the "collection mint address") with the -m parameter.

However, I encounter several errors when doing this:

  • Case 1:

private.json -> "number": 10
public.json -> "number": 90

assets
├── private
│   ├── 0.json
│   ├── 0.png
│   ├── ...
│   ├── 9.json
│   └── 9.png
└── public
    ├── 10.json
    ├── 10.png
    ├── ...
    ├── 99.json
    └── 99.png
config
├── private.json
└── public.json
  • Case 2 (same file structure as above):

private.json -> "number": 10
public.json -> "number": 100

  • Case 3:

private.json -> "number": 10
public.json -> "number": 90

assets
├── private
│   ├── 0.json
│   ├── 0.png
│   ├── ...
│   ├── 9.json
│   └── 9.png
└── public
    ├── 0.json
    ├── 0.png
    ├── ...
    ├── 89.json
    └── 89.png
config
├── private.json
└── public.json
  • Case 4 (same file structure as above):

private.json -> "number": 10
public.json -> "number": 100

All 4 cases return the same error: Error Number: 6003. Error Message: Index greater than length!.

2 Answers2

0

Once,you have uploaded your assets and created a Candy Machine then you cannot add or remove assets from that Candy Machine So to answer this question on how to merge two Candy Machine Together you can create a Single Collection/Parent NFT and point both the Candy machine assets to that Collection/Parent NFT. You can use the tool metaboss to do that

Pratik.js
  • 250
  • 1
  • 9
0

I had the same issue not to long ago take a look here: One Collection, Multiple Candy Machines

First of all, I recommend using SUGAR CLI to upload & deploy the Candy Machines - the experience is smoother. If you are on Windows you can use WSL2. I also recommend getting a custom RPC, take a look at Quiknode - it's easy to setup.

To upload and then deploy the public collection:

sugar upload assets/public -c config/public.json --cache .cache/public.json -k <WALLET KEYPAIR.json> -l debug -r <RPC ENDPOINT URL>

sugar deploy -c config/public.json --cache .cache/public.json -k <WALLET KEYPAIR.json> -l debug -r <RPC ENDPOINT URL>

Repeat the same steps as above for the private collection (just change private wherever there is public).

To set the same collection using SUGAR:

sugar collection set --cache .cache/public.json -k <WALLET KEYPAIR.json> --candy-machine <CANDY MACHINE ID> --collection-mint <COLLECTION ADDRESS> -r <RPC ENDPOINT URL>

Repeat for private assets.

I've managed to show total number of NFTs on UI by connecting to the private machine and the public machine (you however cannot mint from the private machine using the UI) - this behavior is not supported by default, you are going to have to do some coding for that.

And regarding the index problem, the different configurations should have done the trick (private.json & public.json) but if Metadata is the problem I used a python script to renumber the indexes properly - if that is something you are interested in I can provide.

buttcreamz
  • 28
  • 2
  • One important thing to mention is that you should secure your Private Machine as well - using SPL Tokens / Whitelist, otherwise if you leave it a 0 SOL and someone finds the machine's ID on Solscan they can mint for free. – buttcreamz Jul 18 '22 at 07:56