Deploying FISCO BCOS Blockchain with WeBASE

📢 This article was translated by gemini-2.5-flash

This article was written on 2024-04-29, then revised once. I thought it was finished, but apparently not when I checked today. Unfortunately, I’ve already deleted the relevant stuff, so I guess this is it.

Deploying WeBASE Directly for FISCO BCOS

Docker Deployment

Install using Docker on CentOS.

Environment Setup

First, install yum-utils to use yum-config-manager.

1
yum install -y yum-utils

Configure Repositories

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Official Repo
yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

# Aliyun Repo
yum-config-manager \
    --add-repo \
    https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

# Tsinghua University Repo
yum-config-manager \
    --add-repo \
    https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/docker-ce.repo

Install

1
yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin

Configure Docker Mirror

1
vim /etc/docker/daemon

Content as follows (USTC Mirror):

1
2
3
{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
}

Start Docker

1
systemctl start docker

Alternatively, if modifying config files, reload the daemon and restart the Docker service.

1
2
systemctl daemon-reload
systemctl restart docker.service

Install Python

1
yum install -y python36 epel-release python36-pip

Download Docker Compose

1
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Change Execution Permissions

1
chmod +x /usr/local/bin/docker-compose

Install PyMySQL

1
pip3 install PyMySQL

Deploy Blockchain

Pull Deployment Script

1
wget https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/releases/download/v1.5.5/webase-deploy.zip

Unzip Installation Package

1
unzip webase-deploy.zip

Enter Directory

1
cd webase-deploy

Modify Configuration File

1
vim common.properties

Pull Images

1
python3 deploy.py pullDockerAll

When pulling images, you’ll be prompted for a timeout. Enter 30, 60, or 120.

If pulling fails, you can manually pull the relevant images, e.g., fiscoorg/fiscobcos:v2.9.1.

1
docker pull fiscoorg/fiscobcos:v2.9.1

Deploy

1
python3 deploy.py installDockerAll

Seeing deploy has completed means deployment was successful.

Common Commands

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# One-Click Deployment
Deploy and start all services        python3 deploy.py installDockerAll
Stop all services deployed via one-click    python3 deploy.py stopDockerAll
Start all services deployed via one-click    python3 deploy.py startDockerAll
# Node Start/Stop
Start all FISCO-BCOS nodes:      python3 deploy.py startNode
Stop all FISCO-BCOS nodes:      python3 deploy.py stopNode
# WeBASE Service Start/Stop
Start all WeBASE services:      python3 deploy.py dockerStart
Stop all WeBASE services:      python3 deploy.py dockerStop

Java Environment Deployment

If not using Docker, you’ll need a Java environment. For CentOS, use Oracle JDK. Download JDK8 from its official website , then unzip it. Assume the filename is jdk-8u411-linux-x64.tar.gz.

1
tar -zxvf jdk-8u411-linux-x64.tar.gz

Rename After Unzip

1
mv jdk1.8.0_411 jdk-8u411

Configure environment variables, modify vim /etc/profile.

1
2
3
export JAVA_HOME=/home/yexca/software/jdk-8u411
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOMR/lib/tools.jar

Apply Changes

1
source /etc/profile

Verify

1
java -version

Database

If not using Docker, a database is required. Install MariaDB; first, create a repo file.

1
vim /etc/yum.repos.d/mariadb.repo

File content as follows, using Aliyun mirror:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# MariaDB 11.2 CentOS repository list - created 2024-04-30 03:16 UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
# rpm.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details.
# baseurl = https://rpm.mariadb.org/11.2/centos/$releasever/$basearch
baseurl = https://mirrors.aliyun.com/mariadb/yum/11.2/centos/$releasever/$basearch
module_hotfixes = 1
# gpgkey = https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
gpgkey = https://mirrors.aliyun.com/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck = 1

Clear Cache

1
2
yum clean all
yum makecache all

Install

1
yum install -y MariaDB-server MariaDB-client

Start Service

1
systemctl start mariadb.service

Configure

1
mariadb-secure-installation

Deploy Blockchain

Pull Installation Package

1
wget https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/releases/download/v1.5.5/webase-deploy.zip

Unzip

1
unzip webase-deploy.zip

Enter Directory

1
cd webase-deploy

Modify Configuration File

1
vim common.properties

Deploy

1
python3 deploy.py installAll

Start/Stop Operations

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# One-Click Deployment
Deploy and start all services        python3 deploy.py installAll
Stop all services deployed via one-click    python3 deploy.py stopAll
Start all services deployed via one-click    python3 deploy.py startAll
# Individual Service Start/Stop
Start FISCO-BCOS nodes:      python3 deploy.py startNode
Stop FISCO-BCOS nodes:      python3 deploy.py stopNode
Start WeBASE-Web:          python3 deploy.py startWeb
Stop WeBASE-Web:          python3 deploy.py stopWeb
Start WeBASE-Node-Manager: python3 deploy.py startManager
Stop WeBASE-Node-Manager: python3 deploy.py stopManager
Start WeBASE-Sign:        python3 deploy.py startSign
Stop WeBASE-Sign:        python3 deploy.py stopSign
Start WeBASE-Front:        python3 deploy.py startFront
Stop WeBASE-Front:        python3 deploy.py stopFront
# Visualized Deployment
Deploy and start all services for visualized deployment  python3 deploy.py installWeBASE
Stop all services for visualized deployment  python3 deploy.py stopWeBASE
Start all services for visualized deployment  python3 deploy.py startWeBASE

Access

Access the admin backend based on the web.port=5000 config item (default is 5000).

Firewall

1
2
3
4
5
6
7
8
# Query open ports
firewall-cmd --zone=public --list-ports
# Open port (--permanent for permanent access)
firewall-cmd --zone=public --add-port=5000/tcp --permanent
# Restart firewall
firewall-cmd --reload
# Query if port is open
firewall-cmd --zone=public --query-port=5000/tcp

Smart Contracts

2025-03-13: Honestly, I’m not sure what I was writing here anymore.

Create contracts using the Contract IDE in the WeBASE backend’s Contract Management.

After compiling, create a new user via Private Key Management.

Test for success by sending a transaction.

References

WeBASE Documentation

https://www.runoob.com/docker/centos-docker-install.html

https://mariadb.org/download/?t=repo-config&d=CentOS+7&v=11.2&r_m=aliyun

https://blog.csdn.net/default7/article/details/122672341

https://www.cnblogs.com/potato-chip/p/13973780.html