建立以太坊測試節點

本來是使用 Infura 來操作以太測試鏈,然而部份敏感 API 還是需要使用自己的節點!
在這邊選擇 Geth 作為 Ethereum Client.

# 安裝環境

以太坊公链Geth同步 (opens new window)

  • [ ] 安裝 GO 語言 dnf install golang
  • [ ] 安裝 Geth
    # 下載go-ethereum  
    git clone https://github.com/ethereum/go-ethereum.git
    cd go-ethereum
    make all
    mv go-ethereum /usr/share/  
    
    # 完成後在path中入geth路徑  
    echo "export PATH=$PATH:/usr/share/go-ethereum/build/bin" >> /etc/profile  
    source /etc/profile  
    

# 啟動以太坊測試節點

# 背景啟動
nohup geth --testnet --syncmode "fast" \
--port "30303" --cache=4096 \
--datadir /data/eth/testnet \
--http --http.port 12321 --http.addr 0.0.0.0 --http.corsdomain "*" \
--http.api db,eth,net,web3,personal,admin \
--maxpeers 999 --maxpendpeers 999 \
> /data/eth/testnet/output.log 2>&1 &
# 訪問 geth console
geth attach http://localhost:12321

# 其他

以太坊資料存放在另外一顆 HDD 上,
使用到一些相關指令:格式化、分區格式轉換、掛載、裝置忙碌中

# 判斷檔案系統
lsblk -f
# Device is busy
fuser -m /path/to/mnt

# 追記

Unchecked item means unsolved.

# ref