Latest versions of Anchor handles program id declarations automatically if the program is created using anchor init or anchor new. However, if the user downloads the program from GitHub, they would have to run anchor keys sync to update their program id to the correct id, and this causes confusion for new devs as mentioned in https://github.com/coral-xyz/anchor/issues/3022.
Summary of changes
Sync the program ids automatically on the first ever build (depending on target/deploy exists).
Problem
Latest versions of Anchor handles program id declarations automatically if the program is created using
anchor init
oranchor new
. However, if the user downloads the program from GitHub, they would have to runanchor keys sync
to update their program id to the correct id, and this causes confusion for new devs as mentioned in https://github.com/coral-xyz/anchor/issues/3022.Summary of changes
Sync the program ids automatically on the first ever build (depending on
target/deploy
exists).Resolves https://github.com/coral-xyz/anchor/issues/3022