Teach you step by step how to use the build_chain.sh script to deploy a single group four-node blockchain network locally

Teach you step by step how to use the build_chain.sh script to deploy a single group four-node blockchain network locally

introduction

Just get started and you're done. It is recommended that you analyze the structure of the nodes directory yourself. Some of the main configuration files in the nodes directory will be explained in detail later.

Environmental requirements

Install ubuntu dependencies

sudo apt install -y openssl curl

Install centos dependencies

sudo yum install -y openssl openssl-devel

Create an operating directory and download the installation script

## 创建操作目录
cd ~ && mkdir -p fisco && cd fisco

## 下载脚本
curl -#LO https://github.com/FISCO-BCOS/FISCO-BCOS/releases/download/v2.9.1/build_chain.sh && chmod u+x build_chain.sh

After downloading, get the build_chain.sh script

Insert image description here

annotation

  • If the build_chain.sh script cannot be downloaded for a long time due to network problems, please try curl -#LO https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/FISCO-BCOS/FISCO-BCOS/releases/v2. 9.1/build_chain.sh && chmod u+x build_chain.sh
  • chmod u+x build_chain.sh adds execution permissions to ordinary users

Insert image description here

Build a single group 4-node alliance chain

Execute the following command in the fisco directory to generate a single group 4-node FISCO chain. Please make sure that the machine's port30300~30303,20200~20203,8545~8548 is not occupied.

bash build_chain.sh -l 127.0.0.1:4 -p 30300,20200,8545

annotation

  • The -p option specifies the starting port, which are p2p_port, channel_port, and jsonrpc_port.
  • For security and ease of use, the latest configuration of version v2.3.0 splits listen_ip into jsonrpc_listen_ip and channel_listen_ip, but still retains the parsing function of listen_ip.
  • To facilitate development and experience, the reference configuration of channel_listen_ip is 0.0.0.0. For security reasons, please change it to a safe listening address based on the actual business network conditions, such as an internal IP or a specific external IP.

Insert image description here
Insert image description here

Start FISCO BCOS chain

  • Start all nodes
bash nodes/127.0.0.1/start_all.sh

Insert image description here
Started successfully! ! !
Insert image description here

Check progress

  • Check if the process is started
ps -ef | grep -v grep | grep fisco-bcos

Normally, there will be output similar to the following; if the number of processes is not 4, the process has not started (usually caused by the port being occupied)

Insert image description here

Check log output

  • As follows, check the number of nodes linked to node node0
tail -f nodes/127.0.0.1/node0/log/log*  | grep connected

Insert image description here

  • Execute the following command to check whether the consensus is reached
tail -f nodes/127.0.0.1/node0/log/log*  | grep +++

SvKhzQ-1687249736363)]

  • Execute the following command to check whether the consensus is reached
tail -f nodes/127.0.0.1/node0/log/log*  | grep +++

Insert image description here

At this point, it has been explained that a blockchain network running a single group of four nodes has been successfully deployed locally! ! !

Guess you like

Origin blog.csdn.net/weixin_63706760/article/details/131310143