当前环境:mac os 10.13
准备
git clone
编译
按照 doc/build-osx.md
编译
# 不考虑 Qt GUI
brew install automake berkeley-db4 libtool boost miniupnpc openssl pkg-config protobuf python3 libevent
./autogen.sh
./configure --without-gui
make
make check
比特币的核心:
./src/bitcoind
也就是这个文件的 main 函数是入库。
启动
echo -e "rpcuser=bitcoinrpc\nrpcpassword=$(xxd -l 16 -p /dev/urandom)" > "/Users/${USER}/Library/Application Support/Bitcoin/bitcoin.conf"
chmod 600 "/Users/${USER}/Library/Application Support/Bitcoin/bitcoin.conf"
./src/bitcoind --testnet