更新文章

This commit is contained in:
2025-10-02 03:56:20 -04:00
parent 564040b8c3
commit e2c883233c
7 changed files with 137 additions and 240 deletions

View File

@@ -2,7 +2,7 @@
title: 2025 一带一路金砖 - 区块链应用开发与运维 样题详解
createTime: 2025/09/30 19:57:14
permalink: /article/2025-BR-BRICS-BC-App-Develop-Op-Sample-Q&A/
password: simeng
# password: simeng
---
## 第一部分:区块链平台运维
@@ -106,3 +106,44 @@ tcp LISTEN 0 4096 0.0.0.0:20400 0.0.0.0:*
4. 使用 swagger 对节点管理服务的 API 接口测试。
**【参考答案】**
切换到 WeBASE-Front 目录下,将 `dist/conf_template` 配置文件目录复制一份作为配置文件,命名为 `dist/conf`
```bash
# 当前工作目录为:/home/simeng/blockchain/WeBASE-Front
cp -r dist/conf_template dist/conf
```
将节点所在目录 `nodes/{$ip}/sdk` 下的所有文件拷贝到当前的 `dist/conf` 目录下
```bash
cp ../nodes/127.0.0.1/sdk/* ./dist/conf/
```
编辑配置文件 : `vim dist/conf/application.yml`
```bash
```
配置环境变量 JAVA_HOME
编辑配置文件:`~/.bashrc`,添加如下内容
```bash
export JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-amd64"
export PATH=$JAVA_HOME/bin:$PATH
```
刷新环境变量
```bash
source ~/.bashrc
```
切换到 `dist` 目录下,拉取 Solidity 开发工具 v0.8.11.js这一步可能会很慢建议直接把 v0.8.11.js 下载到本地,然后直接放到对应目录,WSL2 的机器是直接挂载在 Windows 上的Windows 可以直接操作)
```bash
wget https://github.com/WeBankBlockchain/WeBASELargeFiles/releases/download/v3.0.0/v0.8.11.js -O static/static/js/v0.8.11.js
```
运行 `bash start.sh` 启动 WeBASE-Node-Manager 管理平台服务
```bash
# 当前工作目录为:/home/simeng/blockchain/WeBASE-Front/dist
bash start.sh
```
由于 localhostForwarding 机制(具体参考:[配置WSL2资源](https://notes.simengweb.com/article/operate-wsl2/#%E7%BD%91%E7%BB%9C%E7%9B%B8%E5%85%B3%E9%85%8D%E7%BD%AE),我们可以直接通过localhost来访问WSL2容器的端口的服务
访问:[http://localhost:5002/WeBASE-Front](http://localhost:5002/WeBASE-Front)