References:
- Post giving an overview of deploying to devnet, from lorisleiva.com
- Post about automation and scripting of deploys, from learn.figment.io
If you are upgrading, see "Upgrading" below.
- Make sure you have around 4 SOL to deploy.
- Create a local
/deploy
folder. - Run
yarn devnet:generate-keypair
- Airdrop for atleast 4 SOL for deployment via
yarn devnet:airdrop
-- run twice to get 4 SOL - Update
Anchor.toml
to make sure `[provider]' is updated. Seems to be needed -- wallet override didn't seem to be working:
[provider]
cluster = "devnet"
# wallet = "~/.config/solana/id.json"
wallet = "~/rust-programs/deploy/programauthority-keypair.json"
- Run deploy solana balance --url devnet # to find balance before yarn devnet:deploy solana balance --url devnet # to find balance after
-
At the end it copies the IDL to the front-end, you need to check this in and deploy the front-end.
cp target/idl/${projectName}.json ../flobrij-frontend/src/idl.json
- Make sure you save the following keypair files to a password safe:
./deploy/programauthority-keypair.json
and 12-word seeds for recovery./target/deploy/flobrij-keypair.json
Upgrading is much cheaper than initial deploy. It's about 0.001 SOL.
Same setup as "First-time Deploy" except run:
solana balance --url devnet # to find balance before yarn devnet:upgrade solana balance --url devnet # to find balance after