See it live on https://solvation.vercel.app/!
app (the Next.js application) and program (the Solana backend) have their own READMEs.
solana airdrop 2
solana airdrop 2
solana airdrop 2
solana airdrop 2
solana balance # 8 SOL
git clone https://github.com/ilovehackathons/solvation
cd solvation/program
npm run project:init
solana balance # 1.52514244 SOL
cd ../app
npm i
npm run dev
Only needed if cluster = "localnet"
in Anchor.toml.
cd program && npm run validator
cd program && npm run project:init
cd app && npm i && npm run dev
solana-keygen new -f --no-bip39-passphrase # Careful, this command overwrites your existing keypair at ~/.config/solana/id.json.
$ npx create-solana-dapp sollery
Need to install the following packages:
create-solana-dapp@1.0.3
Ok to proceed? (y)
Creating Solana dApp
UI Framework : next
Program Framework : anchor
$ solana-test-validator --version
solana-test-validator 1.14.16 (src:ab6f3bda; feat:3488713414)
$ anchor --version
anchor-cli 0.26.0
$ solana --version
solana-cli 1.14.16 (src:ab6f3bda; feat:3488713414)
$ sed --version
sed (GNU sed) 4.9
$ grep --version
grep (BSD grep, GNU compatible) 2.6.0-FreeBSD
$ cd program
$ solana-test-validator # Creates a 'test-ledger' folder in 'program'.
...
JSON RPC URL: http://127.0.0.1:8899
$ cd program
$ anchor build
...
$ anchor deploy
...
Program Id: 5KeLPA4bsXnC9XxcVgAdKcFTNiYx74CHxa4FvLgBR2rU
...
$ solana address -k target/deploy/sollery-keypair.json
5KeLPA4bsXnC9XxcVgAdKcFTNiYx74CHxa4FvLgBR2rU
$ grep sollery Anchor.toml
sollery = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
$ sed "s/^sollery = \"[a-zA-Z0-9]*\"$/sollery = \"`solana address -k target/deploy/sollery-keypair.json`\"/" Anchor.toml -i
$ grep sollery Anchor.toml
sollery = "5KeLPA4bsXnC9XxcVgAdKcFTNiYx74CHxa4FvLgBR2rU"
$ grep declare_id programs/sollery/src/lib.rs
declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS");
$ sed "s/^declare_id\!(\"[a-zA-Z0-9]*\");$/declare_id\!(\"`solana address -k target/deploy/sollery-keypair.json`\");/" programs/sollery/src/lib.rs -i
$ grep declare_id programs/sollery/src/lib.rs
declare_id!("5KeLPA4bsXnC9XxcVgAdKcFTNiYx74CHxa4FvLgBR2rU");
$ echo "\n[test.validator]\nbind_address = \"127.0.0.1\"">>Anchor.toml
$ anchor run test
...
1 passing (319ms)
✨ Done in 5.53s.
$ cd app
$ npm i
$ npm run dev