一、地址路徑
github原始碼地址:
https://github.com/hyperledger/blockchain-explorer.git
gitee極速鏡像地址:
https://gitee.com/ryou5416/blockchain-explorer.git

二、系統環境要求
| 作業系統 | 記憶體 | CPU | 網路環境 |
|---|---|---|---|
| CentOS7.8 | 4G以上 | 4核以上 | 可訪問互聯網 |
三、基礎環境搭建
centos系統中的docker環境搭建
四、blockchain-explorer并部署
1.we need:
使用以下命令克隆此存盤庫以獲取最新版本,
$ git clone https://github.com/hyperledger/blockchain-explorer.git $ cd blockchain-explorer
資料庫設定
$ cd blockchain-explorer/app
-
修改
app/explorerconfig.json以更新PostgreSQL資料庫設定,“ postgreSQL ”:{ “主機”: “ 127.0.0.1 ”, “埠”: “ 5432 ”, “資料庫”: “ fabricexplorer ”, “用戶名”: “ hppoc ”, “ passwd ”: “密碼” }
-
配置資料庫設定的另一種方法是使用環境變數,例如設定:
DATABASE_HOST = 127.0.0.1 DATABASE_PORT = 5432 DATABASE_DATABASE = fabricexplorer DATABASE_USERNAME = hppoc DATABASE_PASSWD = pass12345
在每次git pull之后重復重要的操作(在某些情況下,您可能需要從blockchain-explorer / app / persistence / fabric / postgreSQL運行對db /目錄應用權限:
chmod -R 775 db/ -
更新配置
-
修改
app/platform/fabric/config.json以定義網路連接組態檔:{ “ network-configs ”:{ “ first-network ”:{ “ name ”:“ firstnetwork ”, “ profile ”:“ ./connection-profile/first-network.json ”, “ enableAuthentication ”:false } }, “license”: “ Apache-2.0 ” }first-network是您的連接組態檔的名稱,可以更改為任何名稱name是您要為網路指定的名稱,您只能更改密鑰的值nameprofile是您的連接組態檔的位置,您只能更改密鑰的值profile
-
修改JSON檔案中的連接組態檔
app/platform/fabric/connection-profile/first-network.json:fabric-path在first-network.json檔案中更改為網路磁盤路徑:- 提供adminPrivateKey config選項的完整磁盤路徑,它通常以結尾
_sk,例如:/fabric-path/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/aaacd899a6362a5c8cc1e6f86d13bfccc777375365bbda9c710bb7119993d71c_sk adminUser并且adminPassword是Explorer的用戶登錄儀表板的憑據enableAuthentication是用于使用登錄頁面啟用身份驗證的標志,設定為false將跳過身份驗證,
運行創建資料庫腳本:
-
$ cd blockchain-explorer/app/persistence/fabric/postgreSQL/db $ ./createdb.sh
連接到PostgreSQL資料庫并運行資料庫狀態命令:
sudo -u postgres psql -c ' \ l '
建立Hyperledger Explorer
重要提示:每次git pull后重復以下步驟
./main.sh install- 安裝,運行測驗和構建專案
./main.sh clean- 清理/ node_modules,client / node_modules,client / build,client / coverage,app / test / node_modules目錄
要么
$ cd blockchain-explorer
$ npm install
$ cd client/
$ npm install
$ npm run build
運行Hyperledger Explorer
使用命令:npm start
或者直接:./start.sh
停止:./stop.sh
注意事項:
1.adminCredential在首次啟動時,會向CA注冊用戶exploreradmin,并在客戶端留存(保持目錄- walletstore:/opt/explorer/wallet),請不要重復注冊(例如移除容器和匿名卷時,丟失exploreradmin.id檔案,此時需要換一個id重新注冊,或者在ca服務器中洗掉原有用戶),否則瀏覽器啟動失敗!!!
"adminCredential": {
"id": "exploreradmin",
"password": "exploreradminpw",
"affiliation": "org1.department1"
},
防火墻設定
firewall-cmd --zone=public --add-port= 80/tcp –permanent
firewall-cmd --zone=public --add-port= 5432/tcp –permanent
firewall-cmd reload
訪問地址:http://localhost:8080
用戶名:exploreradmin
密碼:exploreradminpw
本專案為基于最新版本Hyperledger Fabric v2.2區塊鏈的單據存盤解決方案,專案主要包括鏈碼和 Web應用兩部分,Fabric鏈碼采用JAVA開發,負責維護和存盤資料及交易資料,后臺為采用java開發 的Web應用,負責為用戶提供訪問區塊鏈上單據的操作界面,例如資料查詢、創建通道、部署鏈碼等等操作,并提供搭建最新版本區塊鏈瀏覽器blockchain-explorer v1.1.3專案,可以方便查看區塊鏈上的資料存盤情況,
典型案例:
基于Hyperledger Fabric區塊鏈技術的疫苗監控平臺
基于Hyperledger Fabric區塊鏈技術的電動汽車充電交易資訊記錄溯源系統
基于Hyperledger Fabric區塊鏈技術的疫情健康資訊及外出記錄監控平臺
基于Hyperledger Fabric區塊鏈技術的電子訂單溯源系統
基于Hyperledger Fabric區塊鏈技術的智慧物流資訊監控系統
基于Hyperledger Fabric區塊鏈技術的學生成績資訊管理系統
基于Hyperledger Fabric區塊鏈技術的智慧圖書館管理系統
基于Hyperledger Fabric區塊鏈技術的農產品溯源系統
... ... 等等,需要聯系博主
運行效果如下:

轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/198108.html
標籤:其他
