This doc lets you go from zero to deployed on testnet in <15 minutes.
Install system dependencies (Linux & WSL2)
Install Rust
Check for updates (if you have an older install)
Install updates
Install the CLI
Check version
Install Anchor Version Manager
Install anchor
Check Anchor version
If the version of anchor-cli doesn't show as the latest after avm use latest
, you might have an older version installed with NPM, you can find it with
If you see @project-srum/anchor-cli
in the list, you can remove it with:
Set up Anchor with AVM using:
Update your terminal with
Generate a new keypair
Passphrase not necessary but highly recommended for mainnet deployments. Check file system wallet commands here.
Set network to devnet
Options for url flag: mainnet-beta, testnet, devnet, localhost
or m, t, d, l
Get testnet SOL
Check balance
Print address
View Solana config
Create a new anchor project (remove the js flag if u want ts)
Test that everything is working with
This may take a while, as long as it says "1 passing" near the bottom, you're ready to proceed.
After adding contract code to src/lib.rs
in the programs
folder, fetch address with
Finall, you can deploy with
TBA
Call ur mom
Go to sleep
Run the same command again without any changes