This document is a guide to the installation, configuration and operation of the BSN Spartan Network Data Center Portal System. This system connects to the Data Center Management System v1.2.0 and later version.
Minimum Requirements:
- 1 CPU
- Memory: 2GB
Recommended Requirements:
- 2 CPU
- Memory: 4GB
Software | Version |
---|---|
Node.js | 14+ |
git | 2.39.0+ |
Spartan-I Chain Default Node | - |
Data Center Management System | 1.1.0+ |
Data Center Gateway (recommended) | - |
PM2 (optional) | latest |
Note: Data Center Gateway is provided by the Data Center Operator to its end-users for accessing the Spartan Network. It can protect the node access, and regulates the transaction amount of end-users. We strongly recommend that the Data Center Operator should set up the Data Center Gateway before installing the portal system.
You can either use the command line to deploy and start the portal referring to Chapter 2-4, or use the docker image to deploy and start the portal referring to Chapter 5.
Download the data center portal deployment package to a local directory:
git clone https://github.com/BSN-Spartan/Data-Center-Portal.git
Configure the port number and IP address in Data-Center-Portal/config.js
file:
module.exports = {
baseURL: "data_center_url",
PORT: "data center portal port",
};
Example: baseURL: "http://10.18.52.107:8085" PORT: "3000"
Note: After changing the port number of Data Center Portal or the URL of Data Center Management System, you must run the command below to rebuild the project.
Rebuild the project:
npm run build
The logo and other information of the portal can be set in the Data Center Management System.
Please refer to Portal Management section to configure the information of the portal.
Go to the directory where the deployment package is located
npm install
npm run build
npm run start
ctrl+C
Install PM2:
npm install pm2@latest -g
Check whether PM2 is successfully installed:
pm2 -v
Please be noted that PM2 is not a must, it's a node application management tool that we recommended, you can use whatever you like.
npm run build
pm2 start server.js
pm2 stop server.js
Download the application package of the Data Center Portal from here.
In Data-Center-Portal/standalone/config.js
, change the baseURL to the link of Data Center Management System:
module.exports = {
baseURL: "data center url",
};
Example: baseURL: "http://10.18.52.107:8085"
In the configuration file, you need only to modify the local port for this service. The corresponding service port in the container does not need to be modified. For example, if the URL of the portal is http://10.18.52.107:3333, you can change the ports as - "3333:3000"
.
'docker-compose.yaml'
version: '3.1'
services:
nodejs:
image: gengxiaofang/nodejs17.3_pm2-5.2.2:v1
ports:
- "xxxx:3000"
privileged: true
restart: always
volumes:
- ./standalone:/data
command: [ "/bin/sh", "-c", "pm2 start /data/server.js --no-daemon" ]
- If you start the service in the directory where the docker-compose.yaml file is located, and it is the only yaml file in the directory, you can start the service directly using the following command:
docker-compose up -d
- If there are more than one yaml files in the directory, you can start the service by specifying the file name, such as
xxxx.yaml
:
docker-compose -f xxxx.yaml up -d
You can run below command to stop all docker-compose services:
docker-compose down
Or you can stop a specific service by:
docker-compose -f xxxx.yaml down
After deploying the portal, you need to customize the default user manual to meet the actual business requirements.
We have provided the user manual in both .docx and .md versions, which can be obtained in Data-Center-Portal/public/static/
directory.
When using the user manual in markdown format, make sure you have already installed gitbook locally. Here we take Windows system as an example to introduce how to install and use it:
-
Download and install Node.js from Official Website, you need to use a lower version of Node.js (for example v12.12.0) to install gitbook.
-
Open command prompt and check the version:
node -v
v12.12.0npm -v
6.11.3 -
Install gitbook by command prompt:
npm install gitbook-cli -g
Run command below to check the version:gitbook --version
CLI version: 2.3.2 GitBook version: 3.2.3 -
Create a folder and run command below to check whether gitbook has been successfully installed:
gitbook init
If installed, the following message will be returned:
warn: no summary file in this book info: create README.md info: create SUMMARY.md info: initialization is finished
-
Copy the user manual in word format and
user-manual
folder to this folder. The user manual in markdown format is saved in inuser-manual
folder.You can edit the word document and then export it to the pdf version and store that file in the same path.
Please keep the name consistent among different user manual formats.
-
Edit markdown documents. You can open
user-manual
folder through Visual Studio Code to edit the markdown document.
-
Click SUMMARY.md to change the directory. Please note that the directory structure is consistent with the word document.
-
Click README.md, edit the name, version and revision date of the user manual. If you do not need to provide the pdf version, you can delete the last row of data.
-
Configure the logo and copyright information of your online user manual in book.json.
-
The default user manual creates folders according to chapters. The contents of each chapter are stored in the corresponding folder as markdown documents. You can edit them directly.
-
After editing the markdown documents, you can check the user manual by typing
gitbook serve
command to generate html file. You can also directly typegitbook build
command to generate the user manual in the terminal, and the generated manual will be stored in_ Book
folder. After saving the file, pressCtrl+C
to terminate the command. -
Enable global search, replace
<a href="./">
with<a href="./index. html">
, replace< A href="../">
with<a href="../index. html">
. Then, findindex.html file
in_book
folder and replace../
with./
. -
After the above operations are completed, replace the files in the
Data-Center-Portal/public/static/user-manual
folder in the server with the files in_book
folder.