【问题标题】:无法将配置部署到 Solana 网络
【发布时间】:2021-12-15 10:10:42
【问题描述】:

我正在将 nft 资产上传到 Solana 网络并收到此错误。

TypeError: Cannot read properties of undefined (reading 'map')

虽然我参考了许多教程,但我不确定要调整什么。下面是metaplex上传脚本中的sn-p代码:

if (i === 0 && !cacheContent.program.uuid) {
        // initialize config
        log.info(`initializing config`);
        try {
          const res = await createConfig(anchorProgram, walletKeyPair, {
            maxNumberOfLines: new BN(totalNFTs),
            symbol: manifest.symbol,
            sellerFeeBasisPoints: manifest.seller_fee_basis_points,
            isMutable: mutable,
            maxSupply: new BN(0),
            retainAuthority: retainAuthority,
            creators: manifest.properties.creators.map(creator => {
              return {
                address: new PublicKey(creator.address),
                verified: true,
                share: creator.share,
              };
            }),
          });
          cacheContent.program.uuid = res.uuid;
          cacheContent.program.config = res.config.toBase58();
          config = res.config;

          log.info(
            `initialized config for a candy machine with publickey: ${res.config.toBase58()}`,
          );

          saveCache(cacheName, env, cacheContent);
        } catch (exx) {
          log.error('Error deploying config to Solana network.', exx);
          throw exx;
        }
      }

我正在使用以下命令通过 CLI 上传资产:

ts-node ~/metaplex-master/js/packages/cli/src/candy-machine-cli.ts upload /nft-assets --env devnet --keypair ~/.config/solana/devnet.json

【问题讨论】:

  • 你发现了吗?如果是这样,您可以发布解决方案吗?
  • 我实际上找到了我的案子失败的原因。你能发布你的回溯吗?

标签: solana metaplex


【解决方案1】:

再次检查assets 文件夹中的*.json 文件。确保创建者属性遵循https://docs.metaplex.com/nft-standard#json-structure 中的正确结构:

{
...
    "creators": [
      {
        "address": "SOLFLR15asd9d21325bsadythp547912501b",
        "share": 100
      }
    ]
}

虽然它不是一个普通的公钥数组

【讨论】:

    【解决方案2】:

    这个问题缺少回溯,因此很难判断问题到底出在哪里。

    就我而言,我在元数据中缺少properties.creators。要修复它,请验证您是否缺少所需条目之一。

    【讨论】:

      猜你喜欢
      • 2021-08-07
      • 1970-01-01
      • 2023-01-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-07
      • 2012-10-22
      相关资源
      最近更新 更多