fabric explorer 是帮助大家学习、管理、监控fabric 的开源项目。
Please follow the Pre-requisites from Hyperledger Fabric
Following are the software dependencies required to install and run this fabric-explorer (Please refer to the above link for specific versions)
- docker-ce 17.06.2-ce
- docker-compose 1.14.0
- golang 1.9.x
- nodejs 6.9.x
- git
- mysql 5 or greater
Run the database setup scripts located under db/fabricexplorer.sql
mysql -u<username> -p < db/fabricexplorer.sql
git clone https://github.com/onechain/fabric-docker-compose-svt.git
mv fabric-docker-compose-svt $GOPATH/src/github.com/hyperledger/fabric/examples/
cd $GOPATH/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt
./download_images.sh
./start.sh
-
git clone https://github.com/hyperledger/blockchain-explorer.git
-
cd blockchain-explorer/fabric-explorer
-
mkdir artifacts
-
cp -r $GOPATH/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/crypto-config artifacts/crypto-config/
-
modify config.json,set channel,mysql,tls (if you use tls communication, please set enableTls true ,if not set false)
"channelsList": ["mychannel"],
"mysql":{
"host":"172.16.10.162",
"database":"fabricexplorer",
"username":"root",
"passwd":"123456"
}
- 修改 app/network-config.json ,配置节点信息
{
"network-config": {
"orderer": [{
"url": "grpc://112.124.115.82:7050",
"server-hostname": "orderer0.example.com"
},{
"url": "grpc://112.124.115.82:8050",
"server-hostname": "orderer1.example.com"
},{
"url": "grpc://112.124.115.82:9050",
"server-hostname": "orderer2.example.com"
}],
"org1": {
"name": "peerOrg1",
"mspid": "Org1MSP",
"ca": "http://112.124.115.82:7054",
"peer1": {
"requests": "grpc://112.124.115.82:7051",
"events": "grpc://112.124.115.82:7053",
"server-hostname": "peer0.org1.example.com"
},
"peer2": {
"requests": "grpc://112.124.115.82:8051",
"events": "grpc://112.124.115.82:8053",
"server-hostname": "peer1.org1.example.com"
},
"admin": {
"key": "/artifacts/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore",
"cert": "/artifacts/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts"
}
},
"org2": {
"name": "peerOrg2",
"mspid": "Org2MSP",
"ca": "http://112.124.115.82:8054",
"peer1": {
"requests": "grpc://112.124.115.82:9051",
"events": "grpc://112.124.115.82:9053",
"server-hostname": "peer0.org2.example.com"
},
"peer2": {
"requests": "grpc://112.124.115.82:10051",
"events": "grpc://112.124.115.82:10053",
"server-hostname": "peer1.org2.example.com"
},
"admin": {
"key": "../artifacts/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/keystore/5681d5bed252077272137ebbcd141616229862fa4deeedbb9c1cb515e95ed82d_sk",
"cert": "../artifacts/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/signcerts/Admin@org2.example.com-cert.pem"
}
}
}
}
npm install
./start.sh
Launch the URL http://localhost:8080 on a browser.
这是系统的截图
I provide a simple rest-api
//get block info
curl -X POST http://localhost:8080/api/block/json -H 'cache-control: no-cache' -H 'content-type: application/json' -d '{
"number":"${block number}"
}'
//get transcation JOSN
curl -X POST http://localhost:8080/api/tx/json -H 'cache-control: no-cache' -H 'content-type: application/json' -d '{
"number":"${ Tx hex }"
}'
//get peer status
curl -X POST http://localhost:8080/api/status/get -H 'cache-control: no-cache' -H 'content-type: application/json' -d ''
//get chaincode list
curl -X POST http://localhost:8080/chaincodelist -H 'cache-control: no-cache' -H 'content-type: application/json' -d ''