Solana 教學

Solana 是一個類似於 Ethereum 的公鏈,底層是 Rust

安裝

1. sh -c "$(curl -sSfL https://release.solana.com/v1.5.8/install)"

2. 加入環境變數到 ~/.zshrc
vim ~/.zshrc
export PATH="/Users/easonwang/.local/share/solana/install/active_release/bin:$PATH"

使用

查看目前設置:

solana config get

SPL Token Program

solana 的預設 library 之一,方面我們創建 token 相關的應用。

安裝

cargo install spl-token-cli

改變網路環境

solana config set --url https://testnet.solana.com

創建新的 account keypair

之後會產生 /Users/easonwang/.config/solana/id.json 即為你的 private key,可以引入 sollet 網頁錢包。

創建一個 mint token

記得裡面要有 sol 餘額

創建這個 mint token 下的 account

然後產生 120 個 mint token

要先有 associate account 才能 mint token

一個 mint token account 下只能有一個 associate token account

這時查看 mint token 跟 mint token account 的餘額都是 120

將 custom mint token 轉給其他 wallet account

Last updated

Was this helpful?