metaplex-foundation / metaplex

A directory of what the Metaplex Foundation works on!
https://metaplex.com
Apache License 2.0
3.32k stars 6.26k forks source link

[Bug]: candy-machine-v2-cli upload | TypeError: anchorProgram.instruction.setCollection is not a function #2065

Closed nb312 closed 2 years ago

nb312 commented 2 years ago

Which package is this bug report for?

candy machine cli

Issue description

  1. git clone metaplex project
  2. then as run the yarn to install the package, same as readme see.
  3. cd to the folder, this all right.
  4. when I run the command below ts-node js/packages/cli/src/candy-machine-v2-cli.ts upload -e testnet -k ~/.config/solana/id.json -cp config.json -c temp --rpc-url https://api.testnet.solana.com ./assets It say an error: Error deploying config to Solana network. TypeError: anchorProgram.instruction.setCollection is not a function all logs are as follows, hope someone helps me.

Command

ts-node js/packages/cli/src/candy-machine-v2-cli.ts upload -e testnet -k ~/.config/solana/id.json -cp config.json -c temp --rpc-url https://api.testnet.solana.com ./assets

Relevant log output

wallet public key: EoGjAFA9rTNhPG6pAWo9aYrBmvmHAPtJShv55mJLN2wz
USING CUSTOM URL https://api.testnet.solana.com
(node:129404) ExperimentalWarning: buffer.Blob is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
WARNING: The "arweave" storage option will be going away soon. Please migrate to arweave-bundle or arweave-sol for mainnet.

Beginning the upload for 5 (img+json) pairs
started at: 1650272107397
initializing candy machine
Error deploying config to Solana network. TypeError: anchorProgram.instruction.setCollection is not a function
    at setCollection (/root/Workspace/metaplex/js/packages/cli/src/commands/set-collection.ts:160:37)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async uploadV2 (/root/Workspace/metaplex/js/packages/cli/src/commands/upload.ts:181:28)
    at async Command.<anonymous> (/root/Workspace/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts:269:7)
upload was not successful, please re-run. TypeError: anchorProgram.instruction.setCollection is not a function
    at setCollection (/root/Workspace/metaplex/js/packages/cli/src/commands/set-collection.ts:160:37)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async uploadV2 (/root/Workspace/metaplex/js/packages/cli/src/commands/upload.ts:181:28)
    at async Command.<anonymous> (/root/Workspace/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts:269:7)

Operating system

Ubuntu 20

Priority this issue should have

High (immediate attention needed)

Check the Docs First

baguettex commented 2 years ago

Same issues on testnet

nb312 commented 2 years ago

Same issues on testnet

Have you tried on the devnet, my wallet hasn't enough funds to call, and the airdrop failed on the devnet. So I can't try it on the devnet.

barjakuzu commented 2 years ago

same isue, airdropping is not working on devnet and I have this error on testnet

blacksky24 commented 2 years ago

I am facing the same issue on the testnet. Was using testnet as airdrop is not working on devnet

baguettex commented 2 years ago

devnet is down, so i can't trying on devnet.

you can check status on https://status.solana.com

margox commented 2 years ago
+  1 
soouzza commented 2 years ago

same issue, testnet with the same error and devnet is down

sdkayy commented 2 years ago

same issue on testnet

HZfive commented 2 years ago
anchorProgram.instruction.setCollection 
is an error because the function {setCollection} exist only in
@metaplex-foundation/mpl-candy-machine

the correct option on cli is {SetAndVerifyCollectionCollection }from @metaplex-foundation/mpl-token-metadata but got this error on testnet

Candy machine address: HrU21rcHGCnQCHQmHXQrz7gW4nC8r2fWaSeUKMEW6o8m Collection metadata address: ACJWBDnL8Q7SJnDkryefCEQFYZ3ScfqG1fkWG7BFdDtB Collection metadata authority: DfEAieXN4iqrraLb1JnuFzcQ2e4HGSvznLfaaVT79hnZ Collection master edition address: fWrFsTqYFgjfXg349YsKiXuc2ZUDHDGeq1bQoK5DThJ Collection mint address: 6CUd1h7vnntYRyFhVqUj38PaxEcL4GWyUL1Q3TkKnj5L Collection PDA address: X636zjsSC1VzgVDqwjW8e2TSpCFMtdxBtjPaq5vvPJ9 Collection authority record address: F7J75xCx45AdZTgXpyfevYrhVQDnSxAPVinefj7UxRYf (node:24515) UnhandledPromiseRejectionWarning: Error: Signature verification failed at Transaction.serialize (/home/hjzr69/metaplex/js/node_modules/@solana/web3.js/src/transaction.ts:676:13) at sendSignedTransaction (/home/hjzr69/metaplex/js/packages/cli/src/helpers/transactions.ts:79:44) at sendTransactionWithRetryWithKeypair (/home/hjzr69/metaplex/js/packages/cli/src/helpers/transactions.ts:59:32) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async setCollection (/home/hjzr69/metaplex/js/packages/cli/src/commands/set-collection.ts:196:5) at async Command. (/home/hjzr69/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts:943:16)

the usage of the function is :

{ SetAndVerifyCollectionCollection } from '@metaplex-foundation/mpl-token-metadata';

instructions.push( ...new SetAndVerifyCollectionCollection ( { feePayer: wallet.publicKey, }, {
metadata: metadataPubkey, collectionAuthority: candyMachineAddress, collectionMint: mintPubkey, updateAuthority:wallet.publicKey, collectionMetadata: collectionPDAPubkey, collectionMasterEdition: masterEditionPubkey, collectionAuthorityRecord:collectionAuthorityRecordPubkey,
}, ).instructions, ); but i know is the wrong var configuration

HectorNBL commented 2 years ago

The candy machine won't work on testnet. Use devnet instead for testing purposes.

HZfive commented 2 years ago

check this for the correction

nb312 commented 2 years ago

@sdkayy @margox @blacksky24 @HectorNBL Thanks to all of you.This problem is solved, it because of the different networks, in the test dev network it can not work, when the devnet can airdrop, it works well in the devnet.

sadliak commented 2 years ago

Any updates regarding this issue on testnet? Is there any way to get a candy-machine project working on testnet?

github-actions[bot] commented 2 years ago

This Issue has received no activity for 30 days. We will close it in 2 days, please reopen if you are still experiencing this issue.