Can the Solana Program ID be the same as the provider wallet?
For example, in the Anchor.toml
file, can
[programs.localnet]
my_program_name = "address_defined_in_declare_id_macro_of_librs_file"
and the public key of the wallet
[provider]
cluster = "Devnet"
wallet = "/Users/johndoe/my-program-name/target/deploy/my_program_name-keypair.json"
be the same?
I have seen someone mention in the Anchor discord server that they can, but when I had them as the same I ran into deploy errors and was only able to deploy after I change the wallet provider in the Anchor.toml
file. When I did have them as the same, I would fund the wallet by running the solana airdrop AMOUNT WALLET_ADDRESS
command, and when I would run anchor deploy
I would get this error:
Error: Account address_defined_in_declare_id_macro_of_librs_file is not an upgradeable program or already in use
There was a problem deploying: Output { status: ExitStatus(unix_wait_status(256)), stdout: "", stderr: "" }.
And I am almost certain that was due to the fact that the Account had SOL funds in it.