FISCO-BCOS单机多群组部署
作者:互联网
安装fisco
mkdir -p ./fisco && cd ./fisco
curl -LO https://github.com/FISCO-BCOS/FISCO-BCOS/releases/download/v2.7.1/build_chain.sh && chmod u+x build_chain.sh
bash build_chain.sh -l "127.0.0.1:4" -o multi_nodes -p 30300,20200,8545
启动fisco
cd ./fisco/multi_nodes/127.0.0.1;bash start_all.sh
检查是否安装成功
# 查看node0共识情况(Ctrl+c退回命令行)
tail -f node0/log/* | grep "g:1.*++"
# 查看node1共识情况
tail -f node1/log/* | grep "g:1.*++"
# 查看node2共识情况
tail -f node2/log/* | grep "g:1.*++"
# 查看node3共识情况
tail -f node3/log/* | grep "g:1.*++"
群组2加入
# 进入节点目录
cd ./fisco/multi_nodes/127.0.0.1
# 拷贝group1的配置
cp node0/conf/group.1.genesis node0/conf/group.2.genesis
# 修改群组ID
sed -i "s/id=1/id=2/g" node0/conf/group.2.genesis
cat node0/conf/group.2.genesis | grep "id"
# 已修改到 id=2
# 将配置拷贝到各个节点
cp node0/conf/group.2.genesis node1/conf/group.2.genesis
cp node0/conf/group.2.genesis node2/conf/group.2.genesis
cp node0/conf/group.2.genesis node3/conf/group.2.genesis
# 重启各个节点
bash stop_all.sh
bash start_all.sh
检查群组2是否成功
# 查看node0 group2共识情况(Ctrl+c退回命令行)
$ tail -f node0/log/* | grep "g:2.*++"
# 查看node1 group2共识情况
$ tail -f node1/log/* | grep "g:2.*++"
# 查看node2 group2共识情况
$ tail -f node2/log/* | grep "g:2.*++"
# 查看node3 group2共识情况
$ tail -f node3/log/* | grep "g:2.*++"
向群组发送交易
安装控制台
cd ./fisco
# 获取控制台
curl -#LO https://github.com/FISCO-BCOS/console/releases/download/v2.7.0/download_console.sh
bash download_console.sh -c 1.2.0
配置控制台
# 获取channel_port
$ grep "channel_listen_port" multi_nodes/127.0.0.1/node0/config.ini
multi_nodes/127.0.0.1/node0/config.ini: channel_listen_port=20200
# 进入控制台目录
$ cd console
# 拷贝节点证书
$ cp ~/bc/fisco/multi_nodes/127.0.0.1/sdk/* conf
标签:grep,FISCO,群组,tail,group.2,conf,BCOS,node0,genesis 来源: https://www.cnblogs.com/ybswc/p/14165148.html