webase搭建教程

1.前提条件

  1. mysql 的安装
1
2
3
4
5
6
7
8
sudo apt-get install mysql-server
#安装完成之后进人mysql 密码为空
sudo mysql -uroot -p
#修改密码
use mysql;
update user set authentication_string='' where user='root';//用户名
ALTER user 'root'@'localhost' IDENTIFIED BY '123456';//密码
flush privileges;//刷新权限
2.Java的安装
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# ubuntu系统安装java
sudo apt install -y default-jdk
#安装完成之后配置环境变量
1.查看Java所在目录
sudo ls /lib/jvm/



2,使用命令
sudo vim /etc/profile
3.添加环境变量
sudo vim /etc/profile
JAVA_HOME=/lib/jvm/java-11-openjdk-amd64
PATH=$PATH:$JAVA_HOME/bin


4.更新保存文件
source /etc/profile
3.python的安装
1
2
3
4
5
// 添加仓库,回车继续
sudo add-apt-repository ppa:deadsnakes/ppa
// 安装python 3.6
sudo apt-get install -y python3.6
sudo apt-get install -y python3-pip
4 . pymysql的安装
1
sudo apt-get install pymysql

2.拉取部署脚本:

  • 获取部署安装包
1
2
wget https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/releases/download/v1.5.4/webase-deploy.zip

  • 解压安装包:
1
unzip webase-deploy.zip
  • 进入目录:
1
2
cd webase-deploy
cat /etc/mysql/debian.cnf

我们进入到mysql配置文件中debian.cnf复制用户名和密码

0

  • 然后我们进入到webase-deploy这个目录里面

0

  • 使用命令sudo vim common.properties修改配置文件
  • 然后启动
1
python3 deploy.py installAll
  • 如果Java的环境配置成功 还是报错,我们就使用临时配置

image-20230107132531597

1
2
3
4
export JAVA_HOME=/lib/jvm/java-11-openjdk-amd64
export CLASSPATH=.:${JAVA_HOME}/lib
export PATH=.:${JAVA_HOME}/bin:$PATH
source /etc/profile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
common]

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

#####################################################################
# if use [installDockerAll] to install WeBASE by docker
# if use [installAll] or [installWeBASE], ignore configuration here

# 1: enable mysql in docker
# 0: mysql run in host, required fill in the configuration of webase-node-mgr and webase-sign
docker.mysql=0

# if [docker.mysql=1], mysql run in host (only works in [installDockerAll])
# run mysql 5.6 by docker
docker.mysql.port=23306
# default user [root]
docker.mysql.password=123456
#####################################################################

# Mysql database configuration of WeBASE-Node-Manager
mysql.ip=localhost
mysql.port=3306
mysql.user=root //需要将/etc/mysql/debian.cnf数据库用户名复制到这里
mysql.password=00000000 //需要将/etc/mysql/debian.cnf数据库用户名复制到这里
mysql.database=webasenodemanager

# Mysql database configuration of WeBASE-Sign
sign.mysql.ip=localhost
sign.mysql.port=3306
sign.mysql.user=root//需要将/etc/mysql/debian.cnf数据库用户名复制到这里
sign.mysql.password=00000000//需要将/etc/mysql/debian.cnf数据库密码复制到这里
sign.mysql.database=webasesign
# if docker mysql disabled[docker.mysql=0] above

# H2 database name of WeBASE-Front (docker mode ignore this)
front.h2.name=webasefront
front.org=fisco

# WeBASE-Web service port
web.port=5000
# enable WeBASE-Web overview pages for mobile phone(docker mode not support h5 yet)
# (0: disable, 1: enable)
web.h5.enable=1

# 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
# ssl encrypt type (0: standard ssl, 1: guomi ssl)
# only guomi type support guomi ssl
encrypt.sslType=0

# Use existing chain or not (yes/no)
if.exist.fisco=yes

### if build new chain, [if.exist.fisco=no]
# Configuration required when building a new chain
# Fisco-bcos version
fisco.version=2.8.0
# Number of building nodes (default value: 2)
node.counts=4 //需要将这里改为4

### if using exited chain, [if.exist.fisco=yes]
# 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, sdk.crt, node.key and gm directory(gm ssl)) are stored
fisco.dir=/root/fisco/nodes/127.0.0.1
# Node directory in [fisco.dir] for WeBASE-Front to connect
# example: 'node.dir=node0' would auto change to '/data/app/nodes/127.0.0.1/node0'
# Under the path, there is a conf directory where node certificates (ca.crt, node.crt and node.key) are stored
node.dir=node0

0

  • 此处默认是2个节点,改成4ji
  • 等待部署即可

0

  • 完成之后
  • 打开浏览器输入127.0.0.1 :5000

3.验证码报错解决办法

0

将url改成

1
2
3
jdbc:mysql://localhost:3306/webasenodemanager?serverTimezone=GMT%2B8&useUnicode=true&useSSL=false&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull


1
2
3
默认账号为admin,默认密码为Abcd1234