This is a Next.js project bootstrapped with create-next-app
.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx
. The page auto-updates as you edit the file.
This project uses next/font
to automatically optimize and load Inter, a custom Google Font.
Install avm
using Cargo. Note this will replace your anchor
binary if you had one installed.
cargo install --git https://github.com/coral-xyz/anchor avm --locked --force
avm install anchor
avm install latest
avm use latest
anchor --version
cargo install --git https://github.com/coral-xyz/anchor --tag v0.28.0 anchor-cli --locked
anchor deploy --provider.cluster devnet
sh -c "$(curl -sSfL https://release.solana.com/v1.16.13/install)"
# Generating a new keypair
solana-keygen new -o ./solana/id.json
solana address
solana config set --url localhost
solana config set --url devnet
solana balance
solana airdrop 1
anchor init hello_world
config
solana config set --url localhost
solana config get
solana-test-validator
构建和部署
cargo build-sbf
tree -d 2 target/
solana program deploy <PATH>
# solana program deploy target/deploy/hello_world.so
solana logs <PROGRAM_ID>
solana logs DKtPpFnJoMn6qUFiPxWN61DJqFqPpYoGShrwaG2QJfRx
solana program close
# 部署合约较耗SOL,用于合约的存储费用。如果合约不再使用,可以用命令释放掉合约,指定接收人,支付的SOL就会返还
solana program close --buffers
Buffer Address | Authority | Balance
ER5KN9u6uy9N8d2TPFLwUhuBXwmbz5TDYZuR9tiXctTu | HxJHFKt8nFxmXL8HVnD84YJFrsZmHC1ux9fgwm2awkS8 | 3.42752856 SOL
HczChndCYcydwemUsNqePGZzE139NnoVbnWZ6d8PQudE | HxJHFKt8nFxmXL8HVnD84YJFrsZmHC1ux9fgwm2awkS8 | 0.2798268 SOL
9PWdoUoZ2q76x7dZCWUqoabnpmGdEAh5xp5ub1bV9Pz5 | HxJHFKt8nFxmXL8HVnD84YJFrsZmHC1ux9fgwm2awkS8 | 0.2798268 SOL
8q9B696b3ZWVNTuikNsrwBfXRnew3hcqoKiBGzeD4uz9 | HxJHFKt8nFxmXL8HVnD84YJFrsZmHC1ux9fgwm2awkS8 | 0.2798268 SOL
https://www.datawallet.com/crypto/how-to-get-solana-faucet-tokens
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.