Solana CLI Note

常用的 Solana CLI 指令筆記。

建立新 Wallet 並使用

# Create Keypair 
solana-keygen new --outfile ~/.config/solana/devnet.json

# Use Keypair
solana config set --keypair ~/.config/solana/devnet.json

查詢與切換網路

solana config set --url devnet
solana config get

# Config File: /Users/scissor.lee/.config/solana/cli/config.yml
# RPC URL: https://api.devnet.solana.com
# WebSocket URL: wss://api.devnet.solana.com/ (computed)
# Keypair Path: /Users/scissor.lee/.config/solana/devnet.json
# Commitment: confirmed

查詢 public key

solana address

Airdrop

目前空投 2 顆 Solana 以上的話會失敗

# Failed if > 2
solana airdrop 2

發佈留言