First, I tried with deploying on localhost with anchor deploy
it works fine. But then I changed the cluster to devnet, changed Anchor.toml
and lib.rs
file with the address I got after anchor build
. Then tried with anchor deploy --provider.cluster devnet
Changed the solana cluster also solana config set --url https://api.devnet.solana.com
, then solana program deploy /target/deploy/voter.so
. Still getting the error for both of the methods.
Deploying workspace: https://api.devnet.solana.com
Upgrade authority: /home/XXXXXX/.config/solana/id.json
Deploying program "voter"...
Program path: /home/<user>/workspace/voter/target/deploy/voter.so...
Error: Account xxxx is not an upgradeable program or already in use
There was a problem deploying: Output { status: ExitStatus(unix_wait_status(256)), stdout: "", stderr: "" }.