bitcoin私链搭建

初学bitcoin私有链搭建

写在前面:
搭建私有链过程其实很简单:简单说就是自己启动多个节点,然后相互链接,连接方式添加节点

addnode ip:port add
#我是在qt界面上使用console进行连接的。也可以直接写到bitcoin.conf配置文件中写法方式不同。
#例 addnode :127.0.0.1:12345 add

安装依赖

sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3
sudo apt-get install libevent-dev libboost-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev
sudo apt install libsqlite3-dev
sudo apt install libminiupnpc-dev libnatpmp-dev
sudo apt-get install libzmq3-dev
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools
sudo apt-get install libqrencode-dev

个人补充:
如果执行过程中出现:Berkeley DB,libdb4.8问题可采用下面的

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

或者

#berkleydb4.8
wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz'
tar -xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix/
../dist/configure --enable-cxx --disable-shared --with-pic --prefix=/usr/local
make install
export BDB_CFLAGS=/usr/local/BerkeleyDB.4.8/
#执行configure如果无法引用,则configure是指定berkeleydb的路径
#berkleydb刚刚安装到:/usr/local目录(--prefix=/usr/local)
#./configure LDFLAGS="-L/berkleydb刚刚安装目录/lib/" CPPFLAGS="-I/berkleydb刚刚安装目录/include/"
#例如./configure LDFLAGS="-L/usr/local/lib/" CPPFLAGS="-I/usr/local/include/"

如果执行过程中出现:libxxx,libevent的问题可采用下面的

#libevent-2.0.21
#(下载:https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz)
#https://zhuanlan.zhihu.com/p/52788581可直接编译安装无需下载依赖库及其他操作
./configure -prefix=/usr
make
sudo make install

1.编译过程中直接使用:

./autogen.sh
./configure 
make
make install

2.使用该语句出错。提示需要新建钱包(可能是我使能钱包导致的)

./bitcoin-cli -rpcuser=btc -rpcpassword=btcbtc -rpcport=18443 getnewaddress

3.新建钱包命令

./bitcoin-cli -rpcuser=btc -rpcpassword=btcbtc -rpcport=18443 createwallet "此处填写钱包名"
#或规范表示为需要添加双引号。
./bitcoin-cli -rpcuser=btc -rpcpassword=btcbtc -rpcport=18443 createwallet [wallet_name]

转账时提示:未启用fallbackfee

Fee estimation failed. Fallbackfee is disabled. Wait a few blocks or enable -fallbackfee

使用如下自己添加手续费

bitcoin-cli  -rpcuser=btc -rpcpassword=btcbtc -rpcport=18443 -regtest -named sendtoaddress \
  address=bcrt1qd3jck0lv87yuk25tk3xy5rqq67apwasee874xk \
  amount=25 \
  fee_rate=100

4.搭建两节点bitcoin网络

链接内容为引用方便个人查找,仅学习使用

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值