-
node.js
检查安装
node --version
-
rust https://kaisery.github.io/trpl-zh-cn/
检查安装
rustc -V
和cargo -V
-
solana-CLI https://docs.solana.com/cli/install-solana-cli-tools
检查安装
solana --version
-
anchor https://project-serum.github.io/anchor/getting-started/introduction.html
检查安装
anchor --version
npm install --save @solana/web3.js
cargo build-bpf
solana-test-validator
# Windows and Linux
npm run address
# Mac
cargo install --git https://github.com/project-serum/anchor --tag v0.24.2 anchor-cli --locked
anchor keys list
并将 programId 替换掉 /programs/src/lib.rs 中的
declare_id!("HesXTDtSzQpnBTJQeFGEBKcigNszXkLTGvqfW2EvPtbG");
cd deploy
npm i -S
# 修改网络
solana config set --url localhost
# 空投货币
solana airdrop 10000 HesXTDtSzQpnBTJQeFGEBKcigNszXkLTGvqfW2EvPtbG
npm run deploy
cd app
npm i -S
npm run serve