1. 安裝go運行環境
https://dl.google.com/go/go1.10.2.windows-amd64.msi
3. 安裝gcc(go編譯geth需要使用)
https://jaist.dl.sourceforge.net/project/tdm-gcc/TDM-GCC%20Installer/tdm-gcc-5.1.0-3.exe
4. 安裝go集成開發環境,這裏介紹兩種方法
4.1 安裝go集成開發環境goeclipse,即在eclipse中添加go插件。
環境要求:
- Java VM version 8 or later.
- Eclipse 4.6 (Neon) or later.
- CDT 9.0 or later (this will be installed or updated automatically as part of the steps below).
打開eclipse > help > Install New Software…
在work with中輸入:goeclipse - http://goclipse.github.io/releases,點擊Add
4.2 安裝GoLand,不過該軟件是收費軟件,但可以免費使用30天
https://dl.google.com/go/go1.10.2.windows-amd64.msi
5.下載並編譯go-ethereum
git clone https://github.com/ethereum/go-ethereum.git
運行完後會在C:\Users\Administrator\go\src\github.com目錄下生成
6. 在eclipse或goland中導入go-ethereum代碼
7. go-ethereum代碼機構
accounts 實現了一個高等級的以太坊賬戶管理
bmt 二進制的默克爾樹的實現
build 主要是編譯和構建的一些腳本和配置
cmd 命令行工具,又分了很多的命令行工具,下面一個一個介紹
/abigen Source code generator to convert Ethereum contract definitions into easy to use, compile-time type-safe Go packages
/bootnode 啓動一個僅僅實現網絡發現的節點
/evm 以太坊虛擬機的開發工具, 用來提供一個可配置的,受隔離的代碼調試環境
/faucet
/geth 以太坊命令行客戶端,最重要的一個工具
/p2psim 提供了一個工具來模擬http的API
/puppeth 創建一個新的以太坊網絡的嚮導
/rlpdump 提供了一個RLP數據的格式化輸出
/swarm swarm網絡的接入點
/util 提供了一些公共的工具
/wnode 這是一個簡單的Whisper節點。 它可以用作獨立的引導節點。此外,可以用於不同的測試和診斷目的。
common 提供了一些公共的工具類
compression Package rle implements the run-length encoding used for Ethereum data.
consensus 提供了以太坊的一些共識算法,比如ethhash, clique(proof-of-authority)
console console類
contracts
core 以太坊的核心數據結構和算法(虛擬機,狀態,區塊鏈,布隆過濾器)
crypto 加密和hash算法,
eth 實現了以太坊的協議
ethclient 提供了以太坊的RPC客戶端
ethdb eth的數據庫(包括實際使用的leveldb和供測試使用的內存數據庫)
ethstats 提供網絡狀態的報告
event 處理實時的事件
les 實現了以太坊的輕量級協議子集
light 實現爲以太坊輕量級客戶端提供按需檢索的功能
log 提供對人機都友好的日誌信息
metrics 提供磁盤計數器
miner 提供以太坊的區塊創建和挖礦
mobile 移動端使用的一些warpper
node 以太坊的多種類型的節點
p2p 以太坊p2p網絡協議
rlp 以太坊序列化處理
rpc 遠程方法調用
swarm swarm網絡處理
tests 測試
trie 以太坊重要的數據結構Package trie implements Merkle Patricia Tries.
whisper 提供了whisper節點的協議。