1. 程式人生 > 實用技巧 >虛擬機器搭建FISCO BCOS的WeBase

虛擬機器搭建FISCO BCOS的WeBase

前提條件

環境 版本
Java JDK8或以上版本
MySQL MySQL-5.6或以上版本
Python Python3.5+
PyMySQL 使用python3時需安裝

注:可以參考我的部落格配置環境:https://www.cnblogs.com/Coder-Photographer/p/13569791.html

拉取部署指令碼

獲取部署安裝包,解壓安裝包:

1. wget https://github.com/WeBankFinTech/WeBASELargeFiles/releases/download/v1.4.0/webase-deploy.zip
2. unzip webase-deploy.zip

進入目錄:

cd webase-deploy

修改配置

vi common.properties

可以參考官網的中文說明自己配置:https://webasedoc.readthedocs.io/zh_CN/latest/docs/WeBASE/install.html#id8

#--------------------我的common.properties, 可以做參考--------------------

[common]

# Webase Subsystem Version (v1.1.0 or above)
webase.web.version=v1.4.0
webase.mgr.version=v1.4.0
webase.sign.version=v1.4.0
webase.front.version=v1.4.0

# Mysql database configuration of WeBASE-Node-Manager
mysql.ip=127.0.0.1
mysql.port=3306
mysql.user=test
mysql.password=123456
mysql.database=webasenodemanager

# Mysql database configuration of WeBASE-Sign
sign.mysql.ip=127.0.0.1
sign.mysql.port=3306
sign.mysql.user=test
sign.mysql.password=123456
sign.mysql.database=webasesign

# H2 database name of WeBASE-Front
front.h2.name=webasefront

# WeBASE-Web service port
web.port=5000

# WeBASE-Node-Manager service port
mgr.port=5001

# WeBASE-Front service port
front.port=5002

# WeBASE-Sign service port
sign.port=5004

# Node listening IP
node.listenIp=127.0.0.1
# Node p2p service port
node.p2pPort=30300
# Node channel service port
node.channelPort=20200
# Node rpc service port
node.rpcPort=8545

# Encrypt type (0: standard, 1: guomi)
encrypt.type=0

# Use existing chain or not (yes/no)
if.exist.fisco=yes  # 如果在已有鏈上搭建,改為yes

# Configuration is required when using the existing chain
# The path of the existing chain, the path of the start_all.sh script
# Under the path, there should be a SDK directory where the SDK certificates (ca.crt, node.crt and node. Key) are stored
fisco.dir=/home/adam/fisco/nodes/127.0.0.1  #這裡修改成自己的目錄,找到start_all.sh的路徑即可
# Absolute path of the connected node in WeBASE-Front
# Under the path, there is a conf directory where node certificates (ca.crt, node.crt and node. Key) are stored
node.dir=/home/adam/fisco/nodes/127.0.0.1/node0 #這裡修改成自己的目錄,找到start_all.sh的路徑/node0 目錄即可

# Configuration required when building a new chain
# Fisco-bcos version
fisco.version=2.4.1
# Number of building nodes (two by default)
node.counts=4

一鍵部署

# 1. 部署並啟動所有服務
python deploy.py installAll

其他命令:

# 2. 停止一鍵部署的所有服務
python deploy.py stopAll

# 3. 啟動一鍵部署的所有服務
python deploy.py startAll

通過WEB訪問介面

http://{deployIP}:{webPort}
示例:http://127.0.0.1:5000

截圖

登入

預設賬號為admin,預設密碼為Abcd1234。首次登陸要求重置密碼

新增節點

一鍵部署時,節點前置與節點管理服務預設是同機部署,新增前置則填寫IP為127.0.0.1,預設埠為5002。參考上文中common.properties

的配置項front.port={frontPort}

修改密碼

字母,數字組成,且至少包含一個大寫字母和一個小寫字母

最後

  1. 本教程基於官網文件搭建
  2. 結合B站UP主林宣名的視訊,他的視訊做的很好,強烈推薦