在线/离线环境下部署 区块链FISCO BCOS 3.11.0

在线:

复制代码
# 下载建链脚本
curl -#LO https://github.com/FISCO-BCOS/FISCO-BCOS/releases/download/v3.11.0/build_chain.sh && chmod u+x build_chain.sh

# Note: 若访问git网速太慢,可尝试如下命令下载建链脚本:
curl -#LO https://github.com/FISCO-BCOS/FISCO-BCOS/releases/download/v3.6.0/build_chain.sh && chmod u+x build_chain.sh

# 键入bash build_chain.sh -h展示脚本用法及参数
$ bash build_chain.sh
Usage:
air
    -C <Command>                        [Optional] the command, support 'deploy' and 'expand' now, default is deploy
    -g <group id>                       [Optional] set the group id, default: group0
    -I <chain id>                       [Optional] set the chain id, default: chain0
    -v <FISCO-BCOS binary version>      [Optional] Default is the latest v3.10.0
    -l <IP list>                        [Required] "ip1:nodeNum1,ip2:nodeNum2" e.g:"192.168.0.1:2,192.168.0.2:3"
    -L <fisco bcos lightnode exec>      [Optional] fisco bcos lightnode executable, input "download_binary" to download lightnode binary or assign correct lightnode binary path
    -e <fisco-bcos exec>                [Optional] fisco-bcos binary exec
    -t <mtail exec>                     [Optional] mtail binary exec
    -o <output dir>                     [Optional] output directory, default ./nodes
    -p <Start port>                     [Optional] Default 30300,20200 means p2p_port start from 30300, rpc_port from 20200
    -s <SM model>                       [Optional] SM SSL connection or not, default is false
    -H <HSM model>                      [Optional] Whether to use HSM(Hardware secure module), default is false
    -c <Config Path>                    [Required when expand node] Specify the path of the expanded node config.ini, config.genesis and p2p connection file nodes.json
    -d <CA cert path>                   [Required when expand node] When expanding the node, specify the path where the CA certificate and private key are located
    -D <docker mode>                    Default off. If set -D, build with docker
    -E <Enable debug log>               Default off. If set -E, enable debug log
    -a <Auth account>                   [Optional] when Auth mode Specify the admin account address.
    -w <WASM mode>                      [Optional] Whether to use the wasm virtual machine engine, default is false
    -R <Serial_mode>                    [Optional] Whether to use serial execute,default is true
    -k <key page size>                  [Optional] key page size, default is 10240
    -m <fisco-bcos monitor>             [Optional] node monitor or not, default is false
    -i <fisco-bcos monitor ip/port>     [Optional] When expanding the node, should specify ip and port
    -M <fisco-bcos monitor>             [Optional] When expanding the node, specify the path where prometheus are located
    -z <Generate tar packet>            [Optional] Pack the data on the chain to generate tar packet
    -n <node key path>                  [Optional] set the path of the node key file to load nodeid
    -N <node path>                      [Optional] set the path of the node modified to multi ca mode
    -u <multi ca path>                  [Optional] set the path of another ca for multi ca mode
    -6 <ipv6 mode>                      [Optional] IPv6 mode use :: as default listen ip, default is false
    -T <Consensus Algorithm>            [Optional] Default PBFT. Options can be pbft / rpbft, pbft is recommended
    -h Help
pro or max
    -C <Command>                        [Optional] the command, support 'deploy' now, default is deploy
    -g <group id>                       [Optional] set the group id, default: group0
    -I <chain id>                       [Optional] set the chain id, default: chain0
    -V <chain version>                  [Optional] support 'air'、'pro'、'max', default is 'air'
    -l <IP list>                        [Required] "ip1:nodeNum1,ip2:nodeNum2" e.g:"192.168.0.1:2,192.168.0.2:3"
    -p <Start port>                     [Optional] Default 30300、20200、40400、2379 means p2p_port start from 30300, rpc_port from 20200, tars_port from 40400, tikv_port default 2379
    -e <service binary path>            [Optional] rpc gateway node service binary path
    -y <service binary download type>   [Optional] rpc gateway node service binary download type, default type is cdn
    -v <service binary version>         [Optional] Default is the latest v3.10.0
    -r <service binary download path>   [Optional] service binary download path, default is binary
    -c <Config Path>                    [Optional] Specify the path of the deploy node config.toml
    -t <deploy type>                    [Optional] support 'rpc'、'gateway'、'node'、'all', default is 'all'
    -o <output dir>                     [Optional] output directory, default genearted
    -s <SM model>                       [Optional] SM SSL connection or not, default is false
    -h Help

deploy nodes e.g
    bash build_chain.sh -p 30300,20200 -l 127.0.0.1:4 -o nodes -e ./fisco-bcos
    bash build_chain.sh -p 30300,20200 -l 127.0.0.1:4 -o nodes -e ./fisco-bcos -m
    bash build_chain.sh -p 30300,20200 -l 127.0.0.1:4 -o nodes -e ./fisco-bcos -s
expand node e.g
    bash build_chain.sh -C expand -c config -d config/ca -o nodes/127.0.0.1/node5 -e ./fisco-bcos
    bash build_chain.sh -C expand -c config -d config/ca -o nodes/127.0.0.1/node5 -e ./fisco-bcos -m -i 127.0.0.1:5 -M monitor/prometheus/prometheus.yml
    bash build_chain.sh -C expand -c config -d config/ca -o nodes/127.0.0.1/node5 -e ./fisco-bcos -s
    bash build_chain.sh -C expand_lightnode -c config -d config/ca -o nodes/lightnode1
    bash build_chain.sh -C expand_lightnode -c config -d config/ca -o nodes/lightnode1 -L ./fisco-bcos-lightnode
modify node e.g
    bash build_chain.sh -C modify -N ./node0 -u ./ca/ca.crt
    bash build_chain.sh -C modify -N ./node0 -u ./ca/ca.crt -s
deploy pro service e.g
    bash build_chain.sh -p 30300,20200 -l 172.31.184.227:2,172.30.93.111:2 -C deploy -V pro -o generate -t all
    bash build_chain.sh -p 30300,20200 -l 172.31.184.227:2,172.30.93.111:2 -C deploy -V pro -o generate -t all -s
    bash build_chain.sh -p 30300,20200 -l 172.31.184.227:2,172.30.93.111:2 -C deploy -V pro -o generate -e ./binary
    bash build_chain.sh -p 30300,20200,40400 -l 172.31.184.227:2,172.30.93.111:2 -C deploy -V pro -o generate -y cdn -v v3.10.0 -r ./binaryPath
deploy max service e.g
    bash build_chain.sh -p 30300,20200,40400,2379 -l 172.31.184.227:1,172.30.93.111:1,172.31.184.54:1,172.31.185.59:1 -C deploy -V max -o generate -t all
    bash build_chain.sh -p 30300,20200,40400,2379 -l 172.31.184.227:1,172.30.93.111:1,172.31.184.54:1,172.31.185.59:1 -C deploy -V max -o generate -t all -e ./binary -s
    bash build_chain.sh -p 30300,20200,40400,2379 -l 172.31.184.227:1,172.30.93.111:1,172.31.184.54:1,172.31.185.59:1 -C deploy -V max -o generate -y cdn -v v3.10.0 -r ./binaryPath
    bash build_chain.sh -c config.toml -C deploy -V max -o generate -t all
expand pro node e.g
    bash build_chain.sh -C expand_node -V pro -o expand_node -c ./config.toml
expand pro rpc/gateway e.g
    bash build_chain.sh -C expand_service -V pro -o expand_service -c ./config.toml
expand pro group e.g
    bash build_chain.sh -C expand_group -V pro -o expand_group -c ./config.toml
expand max node e.g
    bash build_chain.sh -C expand_node -V max -o expand_node -c ./config.toml
expand max rpc/gateway e.g
    bash build_chain.sh -C expand_service -V max -o expand_service -c ./config.toml

# 两个节点的P2P服务分别占用30300和30301端口,RPC服务分别占用20200和20201端口
# -L 启动轻节点模块,"download_binary" 默认拉去最新版本二进制文件
$ bash build_chain.sh -p 30300,20200 -l 127.0.0.1:2 -L download_binary
# 指定轻节点二进制路径
$ bash build_chain.sh -p 30300,20200 -l 127.0.0.1:2 -L /bin/fisco-bcos-lightnode

启动

复制代码
cd ./nodes/127.0.0.1
bash start_all.sh

验证:

复制代码
cat node0/log/fisco-bcos.log | grep "start successfully"

离线(X86):

下载所有依赖文件:https://download.csdn.net/download/weixin_38959210/92451367

导入包:

复制代码
#tassl-1.1.1b-linux-x86_64
mkdir -p /root/.fisco
tar -zxvf tassl-1.1.1b-linux-x86_64.tar.gz -C /root/.fisco
mv /root/.fisco/tassl-1.1.1b-linux-x86_64 /root/.fisco/tassl-1.1.1b

#get_account.sh
mv get_account.sh /root/.fisco/get_account.sh

启动脚本

复制代码
# 键入bash build_chain.sh -h展示脚本用法及参数
bash build_chain.sh

提示:

脚本build_chain.sh尝试调用路径/root/.fisco/tassl-1.1.1b,提示报错

解决办法:

复制代码
#tassl-1.1.1b-linux-x86_64
mkdir -p /root/.fisco
tar -zxvf tassl-1.1.1b-linux-x86_64.tar.gz -C /root/.fisco
mv /root/.fisco/tassl-1.1.1b-linux-x86_64 /root/.fisco/tassl-1.1.1b

#指定轻节点二进制路径

复制代码
# 指定轻节点二进制路径
bash build_chain.sh -p 30300,20200 -l 127.0.0.1:2 -L ./bin/fisco-bcos-lightnode -e ./bin/fisco-bcos

启动前请将下面文件放入同级 bin 目录中

复制代码
fisco-bcos-lightnode-linux-x86_64.tar.gz
fisco-bcos-linux-x86_64.tar.gz
fisco-bcos-lightnode
fisco-bcos

启动

复制代码
cd ./nodes/127.0.0.1
bash start_all.sh

验证:

复制代码
cat node0/log/fisco-bcos.log | grep "start successfully"
相关推荐
许强0xq10 小时前
订单流战争:AI、区块链与市场透明度的终极博弈
web3·区块链·智能合约·solidity·dapp
BlockChain88810 小时前
以太坊交易全流程详解
区块链
weixin_4138385610 小时前
基于区块链的校园二手书交易系统
vue.js·spring·区块链·fabric
f164225410 小时前
区块链入门知识
区块链
迷藏4941 天前
**发散创新:基于Solid协议的Web3.0去中心化身份认证系统实战解析**在Web3.
java·python·web3·去中心化·区块链
CIO_Alliance1 天前
区块链技术在iPaaS系统集成中的应用
区块链·ipaas·系统集成·制造业·企业数智化转型·零售电商
The_Ticker2 天前
印度股票实时行情API(低成本方案)
python·websocket·算法·金融·区块链
苏慕白的博客2 天前
精度套利:藏在盘口缝隙里的稳定机会
区块链·量化·高频量化·套利
Tattoo_Welkin4 天前
【RWA 机制,ERC-4626,ERC-3643,ERC-7540,ERC-7575,LayerZero】
区块链
魑魅魍魎14 天前
基于全同态加密的逻辑回归心脏病预测示例详解
区块链·逻辑回归·同态加密