4

It's unclear to me what the flow here should be. Typically I've done a test deploy locally, found the program_id that it was deployed to, and then copied that into the appropriate places.

I'm using Anchor, fwiw.

(I can grind an address, though I'm not sure how to specify program deployment to that address.)

2 Answers 2

4

Pass the path to your vanity keypair directly to solana program deploy with the --program-id KEYPAIR_PATH argument

Credit to @trent.sol above

2

Figured it out. You just have to copy your grinded .json key into ./target/deploy/MY_PROGRAM-keypair.json

3
  • 1
    You can also pass the path to your vanity keypair directly to solana program deploy with the --program-id KEYPAIR_PATH argument
    – trent.sol
    Commented Jul 13, 2022 at 20:19
  • 1
    What's not immediately obvious is that this keypair isn't needed after the first deploy, ie for upgrades. Only the program upgrade authority is required, which is the key currently in use by the CLI (ie call solana address or solana config get to see which one).
    – yamen
    Commented Jul 13, 2022 at 20:30
  • @yamen correct. The keypair is only needed to create the account itself. Once its created, that keypair hold no authority or capability against the program. In fact, you'll see some protocols share the program's key in their github. The upgrade authority is the only signer that matters after initial deploy. Commented Jul 13, 2022 at 21:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.