草プログラマー、それはつまり草

CS 会計 法律 サッカー 野球 bitcoin 数学 物理学 などいろいろやってます

ビットコインコア(satoshiクライアント) コンパイル

Githubからコードをcloneしてコンパイルするやり方を書いていきます。普通にインストールしたい人は、

Choose your wallet - Bitcoin からbitcoincoreをインストールしてください。エンジニアの人はソースコードからコンパイルしましょう。

Bitcoin Coreとは

ビットコインコア(BitcoinCore satoshiクライアント)はビットコインの全ての機能を実装・

ウォレット、トランザクション認証エンジン、peer-to-peerビットコインネットワークノードを含んでいる。

ビットコインコアコンパイル

まずgithubのビットコインページからコードをclone します。

$ git clone https://github.com/bitcoin/bitcoin.git
Cloning into 'bitcoin'...
remote: Counting objects: 85424, done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 85424 (delta 6), reused 2 (delta 2), pack-reused 85405
Receiving objects: 100% (85424/85424), 77.85 MiB | 333.00 KiB/s, done.
Resolving deltas: 100% (62718/62718), done.
Checking connectivity... done.

これでソースコードがダウンロードされます。
bitcoinディレクトリに移動します

$ cd bitcoin

次にバージョンを確認

$ git tag
省略
v0.13.0rc2
v0.13.0rc3
v0.13.1
v0.13.1rc1
v0.13.1rc2
v0.13.1rc3
v0.13.2
v0.13.2rc1

最新のv0.13.2rc1を同期します(最新版を選んでください)

$ git checkout v0.13.2rc1
Note: checking out 'v0.13.2rc1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 8e707e8... doc: Add #9382 to release notes

OSに合わせてちゃんとコンパイル説明書を読みましょう。

github.com

ubuntu(その他unix)は build-unix.md Macは build-osx.md Windowsは build-msw.md を読んでください。

コンパイルに必要なライブラリをbuild-unix.md(この先はubuntuですそれ以外の人は自分で確認)を読みながらインストールします。

$ sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils
$ sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev

ウォレットにはBerkeleyDBが必要

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev
sudo apt-get install libminiupnpc-dev

ZMQ

sudo apt-get install libzmq3-dev

ビルド

$ ./autogen.sh
$ ./configure
$ make
$ sudo make install 

これで私のubuntu16.04はうまく行きました。結構時間かかります。

$ bitcoind

.bitcoinディレクトリの中に .bitcoin/bitcoin.conf ファイルを作成し

rpcuser = xxxxx
rpcpassword = xxxxx

xxxxx は任意で決めてください。

あとで続き書きます。

Copyright © 2016 へなちょこプログラマー All rights reserved.