I've forked the metaplex code, and am trying to implement a candy machine with presale capabilities. You can see this pull request for reference: https://github.com/FluffyPorcupine/metaplex/pull/1/files. I've modified both the rust lib.rs and candy-machine-cli.ts files to implement how I think it might work.
I was able to successfully deploy the program to solana and anchor, deployed the idl to anchor (following these steps), and uploaded the files in the assets folder using the cli. My next step is to try and actually create a candy machine. This is the command I'm trying to run:
ts-node js/packages/cli/src/candy-machine-cli.ts create_candy_machine --env devnet --keypair .config/solana/devnet.json --presale-enabled true --presale-items-available 5
When I run the command, I get the following stack trace:
ProgramError: 102: The program could not deserialize the given instruction
at Function.parse (/home/my-user/dev/Solana/metaplex/js/packages/cli/node_modules/@project-serum/anchor/src/error.ts:41:14)
at Object.rpc [as initializeCandyMachine] (/home/my-user/dev/Solana/metaplex/js/packages/cli/node_modules/@project-serum/anchor/src/program/namespace/rpc.ts:23:42)
at processTicksAndRejections (node:internal/process/task_queues:96:5) { code: 102,
msg: 'The program could not deserialize the given instruction'
}
I'm very new to debugging rust/anchor. Is there something in my code obvious to someone as to why I would be getting this error based on my changes in the PR to the relavant files? Or any tips on ways that I could debug this? I've tried running "anchor test" as well, but just get the same error.