# yum install -y autoconf automake boost-devel gcc-c++ git libdb4-cxx libdb4-cxx-devel libevent-devel libtool openssl-devel wget
安装Berkeley DB
# wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
# sha256sum db-4.8.30.NC.tar.gz
最后一个命令必须已生成*哈希*12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef
# tar -xvf db-4.8.30.NC.tar.gz # cd db-4.8.30.NC/build_unix # BDB_PREFIX=$(pwd)/build # ../dist/configure -disable-shared -enable-cxx -with-pic -prefix=$BDB_PREFIX # make install
编译中
# cd ~
克隆存储库
# git clone https://github.com/bitcoin/bitcoin.git # cd bitcoin
列出可用的发行标签:
# git tag #[... other tags ...] v0.11.2 v0.11.2rc1 v0.12.0 v0.12.0rc1 v0.12.0rc2 v0.12.0rc3 v0.12.0rc4 v0.12.0rc5 v0.12.1 #[... other tags ...]
签出最新的稳定版本
git checkout v0.19.1
现在执行构建(注意:上面定义的$ BDB_PREFIX:]
# ./autogen.sh # ./configure LDFLAGS="-L${BDB_PREFIX}/lib/" CPPFLAGS="-I${BDB_PREFIX}/include/" # make
[如果要在$ PATH中使用二进制文件,则为可选
# make install
检查一切是否顺利
# bitcoind --version Bitcoin Core Daemon version v0.19.1 Copyright (C) 2009-2019 The Bitcoin Core developers
API JSON-RPC
# bitcoind
^C
转到默认在#HOME目录中的.bitcoin文件夹。创建或编辑包含RPC服务器用户名和密码的bitcoin.conf文件。〜/ .bitcoin / bitcoin.conf文件应为什么样的示例
server=1 dbcache=1536 rpcport=8332 rpcuser=bitcoinrpc rpcpassword=r44ByrgCWFzW # replace 10.0.0.15 with your server's IP address rpcbind=10.0.0.15 rpcbind=127.0.0.1 # replace 10.0.0.50 with the IP address that can connect via RPC rpcallowip=10.0.0.50 rpcallowip=127.0.0.1
完成所有这些步骤之后,您就可以将客户端软件设置为全节点运行。启动比特币核心
# bitcoind -daemon Bitcoin server starting
加密钱包
# bitcoin-cli encryptwallet your_password_here
再次启动bitcoind以检查新的加密钱包属性。
# bitcoin-cli stop # bitcoind -daemon # bitcoin-cli -getinfo { "version": 180000, "protocolversion": 70015, "walletversion": 169900, "balance": 0.00000000, "blocks": 387195, "timeoffset": 0, "connections": 8, "proxy": "", "difficulty": 79102380900.22598, "testnet": false, "keypoololdest": 1564418881, "keypoolsize": 999, "unlocked_until": 0, # <--- your wallet is protected "paytxfee": 0.00000000, "relayfee": 0.00001000, "warnings": "" }
要“打开”钱包,请使用命令walletpassphrase,然后输入密码以及希望钱包保持“打开”的时间。
# bitcoin-cli walletpassphrase your_password_here 60
再次调用getinfo时,可以验证目标为“打开”。
# bitcoin-cli -getinfo { "version": 180000, "protocolversion": 70015, "walletversion": 169900, "balance": 0.00000000, "blocks": 394234, "timeoffset": 0, "connections": 8, "proxy": "", "difficulty": 113354299801.4711, "testnet": false, "keypoololdest": 1564418881, "keypoolsize": 1000, "unlocked_until": 1564423839, <--- time in UNIX format until when the wallet will remain "open" "paytxfee": 0.00000000, "relayfee": 0.00001000, "warnings": "" }