I've been following this solana program tutorial https://moralis.io/solana-smart-contract-building/ and created a basic Hello World program.
I was wondering how can I force the program to have a new program ID after re-deploying?
I assume I can do it by starting the tutorial again from the start and creating a new cargo
project with cargo init
, but I want to know how to force the program ID to change in the current project.
For context, I don't want to update the program ID, I'm just interested in understanding how the program ID is created and how it can change.
If you want to change the program id, you can simply specify the exact program id keypair that you want to use during deployment, by running:
To generate a new keypair, you can use: