anoushk1234 / metaplex-anchor-nft

An example repo to demonstrate how to use anchor and metaplex to mint nfts on solana
https://anoushk.medium.com/how-to-mint-nfts-on-solana-using-rust-and-metaplex-f66bac717cb8
61 stars 26 forks source link

Why test doesn't run on localnet? #7

Open vadymsidachenko opened 2 years ago

vadymsidachenko commented 2 years ago

I tried to do test on local net.

But it's failed. error output:

Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: instruction expected an executable account
      at Connection.sendEncodedTransaction (node_modules/@solana/web3.js/src/connection.ts:4480:13)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at Connection.sendRawTransaction (node_modules/@solana/web3.js/src/connection.ts:4439:20)
      at sendAndConfirmRawTransaction (node_modules/@project-serum/anchor/src/provider.ts:284:21)
      at AnchorProvider.sendAndConfirm (node_modules/@project-serum/anchor/src/provider.ts:144:14)
      at MethodsBuilder.rpc [as _rpcFn] (node_modules/@project-serum/anchor/src/program/namespace/rpc.ts:29:16)

And another questions: 1.Why you don't create associate token on contract? 2.Can I change this contract to do batch mint?

I'm beginner at solana. so I need you help now. Please give me a hand.

anharu2394 commented 2 years ago

i have same issue

vadymsidachenko commented 2 years ago

I think it doesn't run on localnet because TOKEN_METADATA_PROGRAM_ID. I tried it on devnet and it runs correctly. But I can't find that test signature on devnet solcsan. What's the problem?

anharu2394 commented 2 years ago

I've solved and passed the test. You can check up Token metadata program id on localnet by using Solana explorer. https://explorer.solana.com/address/metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s?cluster=devnet

Make sure token metadata program is correct.

vadymsidachenko commented 2 years ago

I think it's just devent, not localnet? How do explorer localnet transaction?

anharu2394 commented 2 years ago

You can set the Custom rpc url, so you can explorer on localnet. image

vadymsidachenko commented 2 years ago

Thanks @anharu2394

anoushk1234 commented 2 years ago

You have to deploy the metaplex program on localnet for it to work, i used a tool called Amman that does that

anoushk1234 commented 2 years ago

Look at how Metaplex has implemented it https://github.com/metaplex-foundation/js/blob/main/.ammanrc.js

ThunderCross commented 2 years ago

https://github.com/anoushk1234/metaplex-anchor-nft/issues/6#issuecomment-1231194670