如何在Metaplex商店前端展示并售卖我的Candy Machine NFT?
Absolutely, you can connect your pre-minted Candy Machine to the Metaplex Storefront to sell your NFTs—you didn’t misremember this feature! Let’s break down the steps to get this working again, plus troubleshooting tips and reliable guidance.
Before diving into the storefront, confirm your existing Candy Machine is configured correctly for sales:
- Locate your
cache.jsonfile in your project root—this holds yourcandyMachineId(the public key of your Candy Machine account) and core settings. - Verify key details match your minted collection by running this CLI command:
Double-check thatts-node src/cli.ts show --env mainnet-beta --keypair <path-to-your-keypair>itemsAvailableequals 30,itemsRedeemedalso equals 30 (since all NFTs are minted), and a validpriceis set. EnsuregoLiveDateis set to a past timestamp (so the storefront recognizes the collection as available for sale).
If you’re using the official storefront boilerplate:
- Clone the repo and install dependencies:
git clone https://github.com/metaplex-foundation/metaplex-storefront.git cd metaplex-storefront yarn install - Create a
.envfile in the storefront root and add your configs:NEXT_PUBLIC_CANDY_MACHINE_ID=<your-candy-machine-id-from-cache.json> NEXT_PUBLIC_SOLANA_NETWORK=mainnet-beta # or devnet/testnet if you're testing NEXT_PUBLIC_SOLANA_RPC_HOST=https://api.mainnet-beta.solana.com - Tweak
src/constants.tsto match your collection (update name, description, social links, etc.).
The default storefront is built for mint-on-demand, so make these small tweaks to support your pre-minted collection:
- In
src/components/CandyMachine/CandyMachine.tsx, ensure the logic checks foritemsRedeemedvsitemsAvailable. Since all 30 NFTs are minted, the storefront should still display the collection for sale as long as the Candy Machine is active. - If you had a whitelist enabled for minting, disable it via the CLI to open sales to all users:
ts-node src/cli.ts update_candy_machine --env mainnet-beta --keypair <path-to-keypair> --whitelistMintSettings null
Run the storefront locally to confirm everything connects:
yarn dev
- Open
http://localhost:3000—you should see your collection displayed with purchase options. - Test a transaction with your Phantom wallet to verify ownership transfers correctly (no minting will happen since NFTs are already created).
If you want a public storefront:
- Use platforms like Vercel or Netlify to deploy the repo. Make sure to copy your
.envvariables into the hosting provider’s environment settings. - Test the live site to confirm all flows work as expected.
- Storefront won’t load your Candy Machine: Double-check the
NEXT_PUBLIC_CANDY_MACHINE_IDin.env—copy-paste errors are super common. Also confirm your RPC host matches your network. - Purchase button is disabled: Ensure
goLiveDateis set to a past time. Update it with:ts-node src/cli.ts update_candy_machine --env mainnet-beta --keypair <path-to-keypair> --goLiveDate "2023-01-01T00:00:00Z" - NFTs don’t appear in the storefront: Verify each NFT’s metadata URI is valid via Solana Explorer (search your Candy Machine ID). If metadata is missing, re-run the
verifyCLI command to fix it.
The official Metaplex docs have tailored guidance for this exact use case:
- The Metaplex Storefront Setup Guide walks through every step from config to deployment, including adjustments for pre-minted collections.
- The Candy Machine CLI Advanced Docs cover updating settings like
goLiveDateand whitelists, which are critical for activating sales.
内容的提问来源于stack exchange,提问作者piña

