本來是使用 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.
- [ ] eth.getBlock("latest").number is always 0 (opens new window)
呼叫節點執行轉帳後,出現餘額不足的提示
呼叫節點查詢餘額為 0
查詢節點最新高度 always 0
以太 --fast 同步問題Infura 支援 sendRawTransaction, 先繼續用 Infura
# ref
- Go Ethereum Official (opens new window)
- CentOS 7.6 以太坊Ethereum環境建置 - Geth篇 (opens new window)
- Ethereum 開發筆記 2–2:Geth 基礎用法及架設 Muti-Nodes 私有鏈 (opens new window)
- 以太坊; 如何架起監看網路狀態的ethstats (opens new window)
- Linux目錄結構 (opens new window)
- Linux 檔案系統:Ext 2、Ext 3 與 Ext 4 (opens new window)
- Linux: umount 時 出現 "Device is busy" 的解法 (opens new window)
- 鳥哥:16.4.3 查詢已開啟檔案或已執行程序開啟之檔案: fuser, lsof, pidof (opens new window)
- Linux 磁碟相關指令 (opens new window)