向彪fisco bcos入门教程,正式安装webase(五)

前言:

上一章节,我们的底层链已经安装完毕。我们准备开始安装webase,让我们更方便的管理区块链,这里我们参照官方的文档来搭建https://webasedoc.readthedocs.io/zh_CN/latest/docs/WeBASE/install.html

但是发现我们安装的最新版本的fisco2.6不支持webase,无奈只能更新为fisco2.4.1版本

目前WeBASE支持FISCO BCOS v2.4.x版本,暂未支持FISCO BCOS 2.5.x,节点与WeBASE对应版本请查看WeBASE-ChangeLog。我的个乖乖。那我们安装的2.4.1版本的吧!!

正文:

正式开始安装webase,jdk8我们已经在上一章节安装了,Python腾讯云的服务器自带的有我们节省了一步,如果你的服务器上没有则需要手动安装方法见官方文档,这里我们先安装mysql 。

前提条件

环境

版本

Java

JDK8或以上版本

MySQL

MySQL-5.6或以上版本

Python

推荐Python3.4+

PyMySQL

使用python3时需安装

一、安装Mysql

宝塔镇河妖,小鸡炖蘑菇。我们用宝塔一键安装mysql,步骤如下图所示:

上个wc压压惊,等待其安装完成

提示安装成功,我们验证一下,先退出fisco控制台

直接输入mysql,看到下图的提示表示安装成功。

二、开始安装webase

1.下载webase

进入目录/root/fisco 获取部署安装包:

wget https://github.com/WeBankFinTech/WeBASELargeFiles/releases/download/v1.3.2/webase-deploy.zip

2.解压安装包

unzip webase-deploy.zip

3.进入目录:

cd webase-deploy

修改配置

① mysql数据库需提前安装,已安装直接配置即可,还未安装请参看数据库部署

② 修改配置文件(vi common.properties),没有变化的可以不修改;

原配置如下:

[common]

# Webase Subsystem Version (v1.1.0 or above)

webase.web.version=v1.3.2

webase.mgr.version=v1.3.2

webase.sign.version=v1.3.2

webase.front.version=v1.3.2

# Mysql database configuration of WeBASE-Node-Manager

mysql.ip=localhost

mysql.port=3306

mysql.user=dbUsername

mysql.password=dbPassword

mysql.database=webasenodemanager

# Mysql database configuration of WeBASE-Sign

sign.mysql.ip=localhost

sign.mysql.port=3306

sign.mysql.user=dbUsername

sign.mysql.password=dbPassword

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=10.206.0.10

# 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=no

# 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=/data/app/nodes/127.0.0.1

# 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=/data/app/nodes/127.0.0.1/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=nodeCounts

我们在宝塔里面创建相关的数据库如下图所示:

③ 一键部署支持使用已有链或者搭建新链。通过参数”if.exist.fisco”配置是否使用已有链,以下配置二选一即可。

  • 当配置”yes”时,需配置已有链的路径
  • 当配置”no”时,需配置节点fisco版本和节点安装个数,搭建的新链默认两个群组

这里我们选择yes,因为我们已经安装了自己的链。

新配置如下:

[common]

# Webase Subsystem Version (v1.1.0 or above)

webase.web.version=v1.3.2

webase.mgr.version=v1.3.2

webase.sign.version=v1.3.2

webase.front.version=v1.3.2

# Mysql database configuration of WeBASE-Node-Manager

mysql.ip=127.0.0.1

mysql.port=3306

mysql.user=wbnodemg

mysql.password=axxxxxxxxJM

mysql.database=wbnodemg

# Mysql database configuration of WeBASE-Sign

sign.mysql.ip=127.0.0.1

sign.mysql.port=3306

sign.mysql.user=webasesign

sign.mysql.password=6AHGxxxxxxN5TFNWH

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=10.206.0.10

# 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

# 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=/root/fisco/generator/tmp_one_click/agencyA/node

# 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=/root/fisco/generator/tmp_one_click/agencyA/node/node_10.206.0.10_30300

# Configuration required when building a new chain

# Fisco-bcos version

fisco.version=2.4.1

# Number of building nodes (two by default)

node.counts=nodeCounts

4.部署所有服务:

python deploy.py installAll

pip3 install PyMySQL

Linux报错:bash: pip: command not found

$ wget https://bootstrap.pypa.io/get-pip.py

$ python get-pip.py

$ pip -V  #查看pip版本

接下来就可以随便pip安装东西了

python2.7+版本安装MySQL-python依赖包方法:

4.1 MySQL-python部署(Python2.7)

CentOS

sudo yum install -y MySQL-python

Ubuntu

sudo apt-get install -y python-pip sudo pip install MySQL-python

继续python deploy.py installAll

发现Nginx没有,这里宝塔一键安装,步骤如下图所示:

先停止python deploy.py stopAll

后安装python deploy.py installAll

发现没有JAVA_HOME。这个没想到,宝塔居然没自动配置,好吧我们手动来。

find / -name java

发现位置在 /usr/java/jdk1.8.0_121/bin/java

vi /etc/profile

又重启脚本,发现报错403 什么鬼,这个在官方群里问问,感觉是官方的问题。

很赞,官方都是秒回。fisco就凭这点,我感觉她后续发展肯定不错。大概过了20分钟左右的时间官方修复了该问题。

官方修复后运行如下:

下载正常了。但是Nginx有出错这里参考https://www.yc-l.com/question/52.html解决相关的问题

重新执行安装脚本,发现以下错误。

FISCO-BCOS sdk dir:/root/fisco/generator/tmp_one_click/agencyA/node/sdk is not exist. please check!

web-front报错:我们修改相关的配置文件

keyServer: 10.206.0.10:5004 # webase-sign服务的IP:Port(单个)

注意: 需要将节点所在目录nodes/${ip}/sdk下的ca.crt、node.crt和node.key文件拷贝到当前conf目录,供SDK与节点建立连接时使用。

服务部署后,如果需要单独启停,可以使用以下命令:

启动FISCO-BCOS节点: python deploy.py startNode 停止FISCO-BCOS节点: python deploy.py stopNode 启动WeBASE-Web: python deploy.py startWeb 停止WeBASE-Web: python deploy.py stopWeb 启动WeBASE-Node-Manager: python deploy.py startManager 停止WeBASE-Node-Manager: python deploy.py stopManager 启动WeBASE-Sign: python deploy.py startSign 停止WeBASE-Sign: python deploy.py stopSign 启动WeBASE-Front: python deploy.py startFront 停止WeBASE-Front: python deploy.py stopFront

我们执行 启动WeBASE-Front: python deploy.py startFront

之后我们要启动webase只需要执行 python deploy.py startAll 即可

发现成功、我们在宝塔中开放相关的端口5000

然后访问以下服务,成功了,嘿嘿嘿:

webase默认用户名:admin 密码:Abcd1234

我们登陆,成功,

这章节就到此结束了。

猜你喜欢

转载自blog.csdn.net/ws327443752/article/details/108134564