HyperLedger Explore 浏览器配置启动教程
Hyperledger Fabric维护的实际上是一个区块链网络。为了能够直观的观察网络上的节点,交易等行为,Hyperledger Explore随之诞生。
本文讲述如何搭建 Hyperledger Explore。
Hyperledger Explorer
源代码链接: https://github.com/hyperledger/blockchain-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
浏览器的目的是为了维护网络,所以默认要启动一个fabric网络。默认读者已经部署了一个BYFN网络,如果没有,参考https://hyperledger-fabric.readthedocs.io/en/latest/build_network.html。
准备
首先需要安装:
- nodejs 8.11.x (Note that v9.x is not yet supported)
- PostgreSQL 9.5 or greater
- Jq [https://stedolan.github.io/jq/]
注意对应安装的版本。一般构建完BYFN下面这两个应该都安装了:
- docker 17.06.2-ce [https://www.docker.com/community-edition]
- docker-compose 1.14.0 [https://docs.docker.com/compose/]
下载源码
git上下载源码
git clone https://github.com/hyperledger/blockchain-explorer.git.cd blockchain-explorer.
配置/初始化数据库
cd blockchain-explorer/app
这个文件夹下有一个 explorerconfig.json 里面可以配置数据库。
{
"persistence": "postgreSQL",
"platforms": ["fabric"],
"postgreSQL": {
"host": "127.0.0.1",
"port": "",
"database": "fabricexplorer", //数据库名称
"username": "admin123", //用户名
"passwd": "admin123" //密码
},
"sync": {
"type": "local",
"platform": "fabric",
"blocksSyncTime": ""
}
}
后续的初始化脚本会读取这个文件,根据配置的信息登录数据库,执行初始化的创建语句。
执行初始化:
cd blockchain-explorer/app/persistence/fabric/postgreSQL/db
./createdb.sh
这个过程如果报错,需要用户自己登录postgresql 创建对应的数据库 fabricexplorer,用户名 admin123,密码 admin123.
如果出现 Ident authentication failed for user XX错误,修改一下pg_hdconfig的配置就可以了。
执行createdb.sh会执行同一个文件夹的 explorerpg.sql updatepg.sql
设置fabric网络
需要配置浏览器能找到当前fabric网络。
cd blockchain-explorer/app/platform/fabric
vi config.json
搜索config.json中的所有fabric-path。我的fabric-sample安装目录是 /mnt/fabric-samples/ 。所以把fabric-path改成 /mnt/fabric-samples/ 。这样浏览器就能够凭借配置,找到tlsCACerts adminPrivateKey signedCert 来执行网络的查询。
构建Hyperledger Explore
cd blockchain-explorer
npm install
cd blockchain-explorer/app/test
npm install
npm run test
cd client/
npm install
npm test -- -u --coverage
npm run build
在运行test的时候要注意观察是不是所有的mocha的用例都通过了。
启动 Hyperledger Explorer
cd blockchain-explorer/./start.sh
启动浏览器。这个目录下的脚本 ./stop.sh 用来关闭。 默认的端口是8080
访问对应端口:

HyperLedger Explore 浏览器配置启动教程的更多相关文章
- chrome浏览器 配置开机启动全屏(看板app模式设置)
chrome浏览器 配置开机启动全屏(看板app模式设置) 1.下载安装chrome浏览器. 2.建立一个chrome浏览器的快键方式,右键打开属性,如下图: 3.将目标选项卡的值修改为:&q ...
- tomcat是什么?Tomcat 下载、安装、配置图文教程
你用浏览器上网的所有操作,所有请求发送给服务器(tomcat),服务器通过请求,找相应的逻辑处理程序(jsp或servelet或java类,就是有关java语言的所有可以处理逻辑的代码,其中包括访问后 ...
- Emacs 安装配置使用教程
Emacs 安装配置使用教程 来源 https://www.jianshu.com/u/a27b97f900f7 序|Preface 先来一篇有趣的简介:Emacs和Vim:神的编辑器和编辑器之神 - ...
- 【运维技术】Jenkins配置使用教程
Jenkins配置使用教程 单机jenkins启动 软件安装和启动,必须含有java环境 # 安装jdk,参考其他教程,创建文件目录 mkdir -p /app/jenkins cd /app/jen ...
- MongoDB安装启动教程
MongoDB安装启动教程 简易教程:鉴于第一次大家使用分布式数据库,提供一个简易教程(也可看老师的PPT或者视频) 1.点击安装包(老师给的),安装目录不要更改,否则后面配置需要改,可能导致装不上 ...
- Hyperledger Fabric 2.1 搭建教程
Hyperledger Fabric 2.1 搭建教程 环境准备 版本 Ubuntu 18.04 go 1.14.4 fabric 2.1 fabric-sample v1.4.4 nodejs 12 ...
- VSCode PHP 开发环境配置 详细教程
VSCode PHP 开发环境配置 详细教程 这篇文章主要介绍了VScode+PHPstudy配置PHP开发环境的步骤,整理了官方以及优秀第三方的内容,对于学习和工作有一定借鉴意义. 配置过程 第一步 ...
- win7下IIS的安装和配置 图文教程
转自 http://www.jb51.net/article/29787.htm 最近工作需要IIS,自己的电脑又是Windows7系统,找了下安装的方法,已经安装成功.在博客里记录一下,给需要的 ...
- webpack安装配置使用教程详解
webpack安装配置使用教程详解 www.111cn.net 更新:2015-09-01 编辑:swteen 来源:转载 本文章来为各位详细的介绍一下关于webpack安装配置使用教程吧,这篇文章对 ...
随机推荐
- Linux虚拟机桥接网络
1.虚拟机网络设置为“桥接” 2.查看本机IP.Gateway.DNS 3.vi /etc/sysconfig/network-scripts/ifcfg-eth0,ONBOOT=“NO”改为“YES ...
- 在接口中的静态方法来获取model的实例对象
直接先上代码: 接口代码 abstract class BaseModel { /** * @var null */ protected static $_instances = Array(); / ...
- Leetcode 1002. Find Common Characters
python可重集合操作 class Solution(object): def commonChars(self, A): """ :type A: List[str] ...
- log4net调试
public delegate void LogReceivedEventHandler(object source, LogReceivedEventArgs e); public sealed c ...
- redis源码笔记 - redis-cli.c
这份代码是redis的client接口,其和server端的交互使用了deps目录下的hiredis c库,同时,在这部分代码中,应用了linenoise库完成类似history命令查询.自动补全等终 ...
- [转]为什么GOF的23种设计模式里面没有MVC?
GoF (Gang of Four,四人组, <Design Patterns: Elements of Reusable Object-Oriented Software>/<设计 ...
- 2 ubuntu 16.04 安装Elastic Stack
一: 安装JAVA8 添加ppa sudo add-apt-repository ppa:webupd8team/java sudo apt-get update 安装oracle- ...
- 数据库高手(DBA专家 ,SSIS,replacation ,tourble shooting)
http://www.cnblogs.com/qanholas/category/266780.html 随笔分类 - mssql SQL Server 2008 Datetime Cast 成 Da ...
- C笔试题(一)
a和b两个整数,不用if, while, switch, for,>, <, >=, <=, ?:,求出两者的较大值. 答案: int func(int a, int b) { ...
- Eclipse调试Java程序技巧
主要步骤.Debug As"->"Java Application".双击设置断点,F5是跳进,F6是执行下一步,F7是跳出 在看这篇文章前,我推荐你看一下Ecli ...