Search code examples
solanasolana-web3jsmetaplexcandy-machine

One Collection, Multiple Candy Machines


I'm trying to create a NFT collection of 999 pieces. Out of this 999 pieces 23 will be reserved for early investors (they will receive a custom NFT). Because there is no way to mint a specific NFT (investor NFT) - I was advised to create 2 candy machines, one public which will be connected to the Candy Machine UI and one private which I will use to mint all investor NFTs and airdrop manually.

I set up the folder like this
./public-assets/ - NFTs for the Public Machine
./private-assets/ - NFTs for the Private Machine
./public-config.json - Configuration for the Public Machine
./private-config.json - Configuration for the Private Machine

Now in theory the public-assets directory will contain 976 assets and the private-assets directory will contain 23 NFTs and configurations will match that number.

I have a number of issues regarding this approach:

  1. I have duplicate NFT numbers e.g. "Collection Name #0" (public mint)" = "Collection Name #0" (private mint) - even though the NFTs are different
  2. Total number of items remaining on minting platform UI is 999 - 23 // this one I solved by modifying the candy machine UI to connect to the private machine and get the number of remaining items - but I don't know if there is a better way
  3. The NFTs do not seem to be part of the same collection, even though the metadata attached to every asset has the same collection name and family

Would there be a better approach to this problem? And if so how can it solve all the issues I'm facing? TMy first stack overflow post, sorry if didn't provide enough details.


Solution

    1. you will have to take care of that on metadata generation / rename them before creating the candy machine
    2. yes, best method is to either connect to the private machine, too or just hardcode the whole number.
    3. You need to make sure that they are all part of the same on chain collection. The collection name and family in the off chain JSON does not matter for that. To achieve that you can for example
    • create the first candy machine as normal. This will create a new collection
    • use this collection mint on upload of the second machine with -m <collection>. This will automatically make the minted NFTs part of that collection.