1 修改fabric配置 本文对接的是fabric-samples下的first-network网络
组织:org1 org2
节点:peer0.org1.example.com、peer0.org2.example.com、peer1.org1.example.com、peer1.org2.example.com
通道:mychannel
修改连接的json配置文件
cd /opt/gopath/src/github.com/hyperledger/blockchain-explorer/app/platform/fabric
vim config.json
{
"network-configs": {
"fitst-network": { //连接的json文件名称
"name": "First Network", //浏览器登陆界面上的网络名称
"profile": "./connection-profile/first-network.json" //区块链后台网络配置文件位置
}
},
"license": "Apache-2.0"
}
查看当前网络信息
docker network ls
修改配置文件 配置文件名称可自己拟定 路径对应即可
vim connection-profile/first-network.json
{
"name": "net_byfn", //当前网络名称 启动first-network 网络后建立的网络名称
"version": "1.0.0",
"license": "Apache-2.0",
"client": {
"tlsEnable": false, //关闭tls服务
"adminCredential": {
"id": "admin", //登录浏览器界面时的用户名
"password": "adminpw" //登录浏览器时用户admin的密码
},
"enableAuthentication": true,
"organization": "Org1MSP", //只需要指定组织1即可
"connection": {
"timeout": {
"peer": {
"endorser": "300"
},
"orderer": "300"
}
}
},
"channels": {
"mychannel": { //通道名称
"peers": {
"peer0.org1.example.com": {}
},
"connection": {
"timeout": {
"peer": {
"endorser": "6000",
"eventHub": "6000",
"eventReg": "6000"
}
}
}
}
},
"organizations": {
"Org1MSP": {
"mspid": "Org1MSP",
"adminPrivateKey": { //私钥路径
"path": "/opt/gopath/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/c9568d43d7010cd0b3b765f46d1cc94c4620ab0f02167b0701305928db12b198_sk"
},
"peers": ["peer0.org1.example.com"],
"signedCert": { //签名文件
"path": "/opt/gopath/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem"
}
}
},
"peers": {
"peer0.org1.example.com": {
"tlsCACerts": { //证书位置
"path": "/opt/gopath/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
},
"url": "grpcs://localhost:7051", //为节点peer0.org1赋予的端口
"grpcOptions": {
"ssl-target-name-override": "peer0.org1.example.com"
}
}
}
}
2 与后端区块链网络对接网络配置文件修改完成后 下一步安装浏览器依赖
cd /opt/gopath/src/github.com/hyperledger/blockchain-explorer
通过脚本文件或手动执行
脚本文件
./main.sh install
或者手动执行命令 安装环境依赖包 开启服务 生成前端页面
分为四部分
(1)安装app下环境依赖
cd /opt/gopath/src/github.com/hyperledger/blockchain-explorer
npm install -ddd
安装blockchain-explorer路径下的package.json中的dependencies依赖
npm run build
生成dist文件夹
(2) 进入client路径 安装依赖 开启react页面服务
cd client
npm install -ddd
npm run build
生成build文件夹
3 环境依赖 以及前端页面生成后 回到浏览器根目录下执行 npm start
cd /opt/gopath/src/github.com/hyperledger/blockchain-explorer
npm start
查看start.sh脚本文件
启动dist文件夹下的main.js文件
介绍Hyperledger fabric的PPT(52页)
密码学笔记
区块链知识体系简介
部署 ipfs 网络 对接联盟链网络
Hyperledger fabric网络(多共识 多版本 多数据库 ca ) 封装接口sdk
Hyperledger Caliper 测试(多组织 多节点 多共识)
区块链浏览器
联系We-chat V : 18852897525