You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在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.

Step 1: Validate Your Candy Machine Setup First

Before diving into the storefront, confirm your existing Candy Machine is configured correctly for sales:

  • Locate your cache.json file in your project root—this holds your candyMachineId (the public key of your Candy Machine account) and core settings.
  • Verify key details match your minted collection by running this CLI command:
    ts-node src/cli.ts show --env mainnet-beta --keypair <path-to-your-keypair>
    
    Double-check that itemsAvailable equals 30, itemsRedeemed also equals 30 (since all NFTs are minted), and a valid price is set. Ensure goLiveDate is set to a past timestamp (so the storefront recognizes the collection as available for sale).
Step 2: Set Up the Metaplex Storefront

If you’re using the official storefront boilerplate:

  1. Clone the repo and install dependencies:
    git clone https://github.com/metaplex-foundation/metaplex-storefront.git
    cd metaplex-storefront
    yarn install
    
  2. Create a .env file 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
    
  3. Tweak src/constants.ts to match your collection (update name, description, social links, etc.).
Step 3: Adjust for Pre-Minted NFTs

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 for itemsRedeemed vs itemsAvailable. 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
    
Step 4: Test Locally

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).
Step 5: Deploy (Optional)

If you want a public storefront:

  • Use platforms like Vercel or Netlify to deploy the repo. Make sure to copy your .env variables into the hosting provider’s environment settings.
  • Test the live site to confirm all flows work as expected.
Troubleshooting Common Hurdles
  • Storefront won’t load your Candy Machine: Double-check the NEXT_PUBLIC_CANDY_MACHINE_ID in .env—copy-paste errors are super common. Also confirm your RPC host matches your network.
  • Purchase button is disabled: Ensure goLiveDate is 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 verify CLI 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 goLiveDate and whitelists, which are critical for activating sales.

内容的提问来源于stack exchange,提问作者piña

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.28 16:52:45