hyperledger-explorer 部署在Fabric 1.1(mac)

部署環(huán)境:

fabric1.1
macOS 10.13.4
git 2.15.2
node v8.11.3
npm v6.1

1.配置fabric 基礎(chǔ)環(huán)境(略)

2.啟動網(wǎng)絡(luò)

cd /Users/yunlong/go/src/github.com/hyperledger/fabric-samples/first-network
./byfn.sh -m up

啟動成功得樣子

1.png

3.找到fabric 配置文件路徑(復(fù)制)

2.png
本機:/Users/yunlong/go/src/github.com/hyperledger/fabric-samples/first-network/crypto-config

4.克隆源碼,進入源碼目錄下

https://github.com/hyperledger/blockchain-explorer.git
cd blockchain-explorer

5.安裝postgreSQL 數(shù)據(jù)庫

brew install PostgreSQL
配置環(huán)境變量
3.png

6.鏈接數(shù)據(jù)庫

psql postgres
4.png

7.執(zhí)行創(chuàng)建數(shù)據(jù)庫

\i app/persistance/postgreSQL/db/explorerpg.sql
\i app/persistance/postgreSQL/db/updatepg.sql

8.查看創(chuàng)建數(shù)據(jù)庫

\l view created fabricexplorer database
\d view created tables

9.配置數(shù)據(jù)庫

文件路徑如圖所示(app/persistance/postgreSQL/db/pgconfig.json)

5.png

(注意:可先命令行測試鏈接數(shù)據(jù)庫是否成功,psql postgres://hppoc:password@127.0.0.1:5432/fabricexplorer)

10.將圖中標出路徑本文件全部替換為 第3步 的路徑

6.png

11.另起來一個終端 build hyperledger explorer(部分不成功,可全局代理)

  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

12.啟動區(qū)塊瀏覽器

cd  blockchain-explorer
node main.js
7.png

13.打開chrome 訪問:http://localhost:8080/

8.png
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容