搭建fabric数据监控blockchain-explorer

Hyperledger Explorer


0、前提条件

1、下载代码

2、初始化数据
    sudo -u postgres psql
    \i app/db/explorerpg.sql
    \i app/db/updatepg.sql
重点:
vim  /var/lib/pgsql/10/data/pg_hba.conf
将所有登录要求全部改成信任(strust),否则启动项目时,会报错:用户登录失败
# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     all                                     peer
#host    replication     all             127.0.0.1/32            ident
#host    replication     all             ::1/128                 ident
host    all             all             0.0.0.0/0               trust  

3、开始启动hyperledger-explorer
打开一个控制台:
cd blockchain-explorer
(修改config.json中对应的ip、配置文件路径、通道名称、数据库连接名称密码ip等)
再打开一个控制台:
cd blockchain-explorer/app/test
npm install
npm run test
cd blockchain-explorer
npm install
cd client/
npm install
npm test -- -u --coverage
npm run build
再打开一个控制台:
cd blockchain-explorer/
./start.sh (it will have the backend up).
tail -f log.log (view log)
fabric-explorer的docker镜像可通过以下步骤安装和运行: 1. 首先,打开终端或命令提示符,并在浏览器中输入网址http://localhost:8080,以登录监视浏览器。 2. 接下来,在终端或命令提示符中输入以下命令来启动fabric-explorer的docker容器: ```shell echo "=========== Explorer start Installing ==============" # remove docker container docker rm -f explorer.mynetwork.com docker rm -f explorerdb.mynetwork.com # remove docker volumes docker volume rm artifacts_walletstore docker volume rm artifacts_pgdata # start up the docker container docker-compose up -d echo "=========== Explorer Successfully installed ==============" ``` 3. 之后,进入fabric-explorer的目录,并将fabric网络的crypto-config文件夹复制到该目录下。然后执行以下命令: ```shell cd fabric-explorer cp -R /path/to/crypto-config . touch docker-compose.yaml touch config.json touch connection-profile/test-network.json ``` 4. 最后,在终端或命令提示符中执行以下命令来启动fabric-explorer的docker容器: ```shell docker-compose up -d ``` 这样,fabric-explorer的docker镜像就成功安装并运行了。你可以通过访问http://localhost:8080来访问fabric-explorer,并使用以下登录凭据进行登录: - 用户名:admin - 密码:adminpw 请注意,上述的路径都是相对于docker容器的绝对路径,而不是容器外的路径。你需要根据自己的网络配置进行相应的调整。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [Fabric-explorer 搭建](https://blog.csdn.net/weixin_41946008/article/details/124609204)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [fabric-explorer快速搭建(dockercompose)](https://blog.csdn.net/qq_21553301/article/details/116948043)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值