1

I'm running a local test validator via:

solana-test-validator --ledger=".anchor/test-ledger" --clone="metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s" --url="https://api.mainnet-beta.solana.com"

But running my local NFT minting with Metadata fails locally (works on DevNet).

    'Program log: Instruction: MintTo',
    'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4538 of 130977 compute units',
    'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success',
    'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [2]',
    'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s failed: invalid account data for instruction',

And have cloned the MetaPlex Metadata contract (see above). Do I need to initialise it somehow? As explorer.solana locally says it's not executable unlike the devnet version?

0

1 Answer 1

1

Ok I've found a better solution:

https://www.quicknode.com/guides/solana-development/accounts-and-data/fork-programs-to-localnet

Basically instead of --clone, dump the file from mainnet locally:

solana program dump -u m metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s .anchor/metaplex.so

Then Load using:

solana-test-validator -r --bpf-program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s .anchor/metaplex.so

1
  • Oh nice trick, thanks for sharing!
    – Jonas H.
    Feb 2 at 11:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.