当我尝试部署带有 anchor 的 IDL 时,我收到一条神秘的“自定义错误 0x1004”消息。这是什么意思:?
$ anchor idl init --provider.cluster testnet --filepath ./target/idl/myprogram.json sa3BafcCxwD6G3tUbvTcvnCD28sCXhpasauLtpw9HdA
Error: Error processing Instruction 0: custom program error: 0x1004
最佳答案
0x1004 是十六进制的 4100,或者 DeclaredProgramIdMismatch错误。
因此,在您的程序中的某个位置,您声明了一个与您部署的程序 ID 不同的程序 ID:
declare_id!("some_other_program_id"); // this is not your program id!
关于solana - 为什么我在尝试部署 solana anchor IDL 时收到 "0x1004"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71272678/