温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

HyperLedger中如何搭建Explorer环境

发布时间:2021-12-07 09:32:48 来源:亿速云 阅读:197 作者:小新 栏目:互联网科技

这篇文章将为大家详细讲解有关HyperLedger中如何搭建Explorer环境,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

内容

  • 我本地的fabric-explorer路径和目录是/home/blockchain-explorer

  • 我本地能运行的first-network环境是/root/fabric-samples/first-network

搭建环境

  • 一、前期安装准备

    • (1)sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main"

    • (2)wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

    • (3)sudo apt-get update

    • 1、安装Postgresql客户端和服务器$ sudo apt-get install postgresql postgresql-client (一般安装好就是启动的了)

    • 1.1、可以用另一种安装方式

    • 2、还需要有docker-ce、docker-compose、nodejs(因为我本机有这些了

  • 二、下载blockchain-explorer代码

    • $ git clone https://github.com/hyperledger/blockchain-explorer.git

  • 三、postgreSQL数据库配置

    • 1、连接到postgreSql:$ sudo -u postgres psql

    • 2、创建数据库脚本:$ \i app/persistence/postgreSQL/db/explorerpg.sql(找到你本地explorerpg.sql) $ \i app/persistence/postgreSQL/db/updatepg.sqlupdatepg.sql应该也在那个目录

    • 3、查看数据库信息:$ \l展示数据库名 $ \d(查看创建的表格,但我没查出来啥help是提示符帮助,\q退出提示符

  • 四、启动byfn.sh并配置config.json

    • (1)、修改"fabric-path"

    • (2)、修改"tls_cacerts",是不是还得修改"key"和"cert"文件

    • (3)、确认"syncStartDate"的值是否需要修改

    • (4)、确认"channel"的值是否需要修改

    • 0、可以启动byfn.sh建立一个网络,也可以运行自己的网络

    • 1、修改config.json:但要路径,并不是只在当前目录中,我的情况是在app/platform/fabric/config.json这样的。

  • 五、package.json的配置

    • 与app/同级目录,在blockchain-explorer文件夹下 【这个属于依赖包的配置,基本无须改动

  • 六、构建Hyperledger Explorer

    • 0、打开新的终端

    • 1、cd blockchain-explorer

    • 2、npm install

    • 3、cd blockchain-explorer/app/test

    • 4、npm install

    • 5、npm run test

    • 6、cd client/

    • 7、npm install

    • 8、npm test -- -u --coverage

    • 9、npm run build

  • 七、运行Hyperledger Explorer

    • 0、打开新的终端

    • 1、cd blockchain-explorer

    • 2、./start.sh

    • 3、浏览器中输入http://localhost:8080 [ip地址在/home/fabric-explorer/blockchain-explorer/appconfig.json]

    • 4、./stop.sh

  • 八、日志查看

    • /home/fabric-explorer/blockchain-explorer/logs目录下有consoleappdb3个文件夹,分别可以查看对应的日志

关于“HyperLedger中如何搭建Explorer环境”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI