Make sure you've installed solana-cli, anchor, configured your solana-cli's RPC URL to localhost by following commands:
If you are new to Solana, you can run this command to generate new keypair:
solana config set --keypair "<path-to-your-keypair>.json"
then configure your solana-cli
solana config set --keypair "<path-to-your-keypair>.json"
solana config set --url http://127.0.0.1:8899
Optional, if you want to see log of transactions, you can do by "Open a new terminal and run
solana logs
"
- Update your keypair path in file
Anchor.toml
at[provider] > wallet
andutils/secret.ts
- Run
anchor build
, this will add a new keypair totarget/deploy
- Run
anchor keys list
, this will give you the new program id - Copy the new id, and paste it into:
- Set
declare_id!
inprograms/auction/src/lib.rs
- Set the
programAddress
variable intests/auction.test.ts
- Set the
[programs.localnet] > auction
variable inAnchor.toml
- Run
anchor build
again - Run
anchor test --skip-local-validator
Update RPC to Solana devnet
solana config set --url https://api.devnet.solana.com
Faucet SOL to pay for gas
solana airdrop 5 # maximum amount per airdrop is 5
solana balance
Configure variables in Anchor.toml
[programs.devnet]
[registry]
[provider]
Update program ID on Nextjs app at app/utils/constants.js
- Run
anchor deploy
cd app && yarn dev
and direct tohttp://localhost:3000
to see UI