Closed rickiey closed 2 years ago
can you be a little more clear on the steps to reproduce the error, please?
I understand, I have to declare program_id when I start writing code, so that it and the deployed program_id consistent
such as:
declare_id!("AnLTG7X1FJRcnxVsKXMn7B6GrVuMn6xgxJ8TqTmbd7GP");
const programId = new anchor.web3.PublicKey("AnLTG7X1FJRcnxVsKXMn7B6GrVuMn6xgxJ8TqTmbd7GP");
But I don't know how it is generated.
it may be that the keypair generated and written to ./target/deploy/<program>-keypair.json
is different that the public key you're asserting in the code with declare_id
.
try copying the keypair file you want to that path with the appropriate file name to ensure anchor is deploying with the same keypair that you're asserting and run it again.
thx, I know how to do it.
@rickiey hello, how do you solve the issue, can you tell me?
I used TOTURIAL in this step, and the result was a problem.
https://project-serum.github.io/anchor/tutorials/tutorial-0.html#generating-a-client
node client.js output: