2023年12月3日发(作者:为什么桑塔纳不买自动挡)

HyperLedgerExplore浏览器配置启动教程Hyperledger Fabric维护的实际上是一个区块链网络。为了能够直观的观察网络上的节点,交易等行为,Hyperledger Explore随之诞生。本文讲述如何搭建 Hyperledger Explore。Hyperledger Explorer目录结构├── app Application backend root, Explorer configuration ├── rest REST API ├── persistence Persistence layer ├── fabric Persistence API (Hyperledger Fabric) ├── platform Platforms ├── fabric Explorer API (Hyperledger Fabric) ├── test Application backend test├── client Web UI ├── public Assets ├── src Front end source code ├── components React framework ├── services Request library for API calls ├── state Redux framework ├── static Custom and Assets准备首先需要安装:nodejs 8.11.x (Note that v9.x is not yet supported)PostgreSQL 9.5 or greaterJq [/jq/]注意对应安装的版本。一般构建完BYFN下面这两个应该都安装了:docker 17.06.2-ce [/community-edition]docker-compose 1.14.0 [/compose/]下载源码git上下载源码git clone /hyperledger/ blockchain-explorer.配置/初始化数据库

cd blockchain-explorer/app
这个文件夹下有一个 里面可以配置数据库。[复制代码](javascript:void(0); \"复制代码\")
{ \"persistence\": \"postgreSQL\", \"platforms\": [\"fabric\"], \"postgreSQL\": { \"host\": \"127.0.0.1\", \"port\":\"5432\", \"database\": \"fabricexplorer\", //数据库名称 \"username\": \"admin123\", //用户名 \"passwd\": \"admin123\" //密码 }, \"sync\": { \"type\":\"local\", \"platform\": \"fabric\", \"blocksSyncTime\": \"3\" }}
[复制代码](javascript:void(0); \"复制代码\")后续的初始化脚本会读取这个文件,根据配置的信息登录数据库,执行初始化的创建语句。执行初始化:
cd blockchain-explorer/app/persistence/fabric/postgreSQL/db./
这个过程如果报错,需要用户自己登录postgresql 创建对应的数据库 fabricexplorer,用户名 admin123,密码 admin123.如果出现 Ident authentication failed for user XX错误,修改一下pg_hdconfig的配置就可以了。执行会执行同一个文件夹的 设置fabric网络需要配置浏览器能找到当前fabric网络。
cd blockchain-explorer/app/platform/fabricvi 
搜索中的所有fabric-path。我的fabric-sample安装目录是 /mnt/fabric-samples/ 。所以把fabric-path改成 /mnt/fabric-samples/ 。这样浏览器就能够凭借配置,找到tlsCACerts adminPrivateKey signedCert 来执行网络的查询。构建Hyperledger Explore[复制代码](javascript:void(0); \"复制代码\")
cd blockchain-explorernpm installcd blockchain-explorer/app/testnpm installnpm run testcd client/ npm installnpm test -- -u --coveragenpm run build
[复制代码](javascript:void(0); \"复制代码\")在运行test的时候要注意观察是不是所有的mocha的用例都通过了。启动 Hyperledger Explorercd blockchain-explorer/./启动浏览器。这个目录下的脚本 ./ 用来关闭。 默认的端口是8080访问对应端口:image

更多推荐

配置,网络,浏览器,执行,数据库,需要,对应,代码