本記事は Installation Instructions for Mac を翻訳・加筆したものです。
Homebrewをインストールする
Homebrewを使えば、gethを最も簡単にインストールできるらしいので早速インストールします。
gethをインストールする
Homebrewはbrew tapによって外部のリポジトリをフォーミュラとして追加することができます。
1. 以下のコマンドからtap
を追加してgethをインスール
brew tap ethereum/ethereum
brew install ethereum
2. --devel
を使ってdevelop branchをインストール
brew install ethereum --devel
3. ノードにアカウントを作成する
geth account new
gethのコードのオプションはgeth --help
または以下のページから参照できます。
ソースコードをビルドする
1. まず、任意のディレクトリにリポジトリをクローンします。
git clone https://github.com/ethereum/go-ethereum
2. gethのビルドにはGo言語のコンパイラをインストールする必要があります。
brew install go
3. 以下のコマンドでgethが動くか確認してみましょう。
cd go-ethereum
make geth
エラーを吐く場合
Mac OS system library関係のエラーであればXcode Command Line Toolsが正しくインストールされているか確認しましょう。
xcode-select --install
↓こんな感じで表示される場合はちゃんとインストールされています。↓
xcode-select: error: command line tools are already installed, use "Software Update" to install updates