我正在 Ubuntu 虚拟机版本 16.04 中配置 Hyperledger Explorer,以与基于此链接的 Hyperledger Composer 集成:https ://github.com/hyperledger/blockchain-explorer/blob/master/README.md
我已经按照 github 链接执行了所有配置步骤,包括数据库设置,并修改了 config.json 文件以使用 Hyperledger Fabric 示例的 first-network 的结构,如下所示:
{
"network-config": {
"org1": {
"name": "peerOrg1",
"mspid": "Org1MSP",
"peer1": {
"requests": "grpcs://127.0.0.1:7051",
"events": "grpcs://127.0.0.1:7053",
"server-hostname": "peer0.org1.example.com",
"tls_cacerts":
"/home/diogosilva/fabric-dev-servers/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
},
"peer2": {
"requests": "grpcs://127.0.0.1:8051",
"events": "grpcs://127.0.0.1:8053",
"server-hostname": "peer1.org1.example.com",
"tls_cacerts":
"/home/diogosilva/fabric-dev-servers/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
},
"admin": {
"key":
"/home/diogosilva/fabric-dev-servers/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore",
"cert":
"/home/diogosilva/fabric-dev-servers/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts"
}
},
"org2": {
"name": "peerOrg2",
"mspid": "Org2MSP",
"peer1": {
"requests": "grpcs://127.0.0.1:9051",
"events": "grpcs://127.0.0.1:9053",
"server-hostname": "peer0.org2.example.com",
"tls_cacerts":
"/home/diogosilva/fabric-dev-servers/fabric-samples/first-network/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt"
},
"peer2": {
"requests": "grpcs://127.0.0.1:10051",
"events": "grpcs://127.0.0.1:10053",
"server-hostname": "peer1.org2.example.com",
"tls_cacerts":
"/home/diogosilva/fabric-dev-servers/fabric-samples/first-network/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls/ca.crt"
},
"admin": {
"key":
"/home/diogosilva/fabric-dev-servers/fabric-samples/first-network/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/keystore",
"cert":
"/home/diogosilva/fabric-dev-servers/fabric-samples/first-network/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/signcerts"
}
}
},
"channel": "mychannel",
"orderers": [
{
"mspid": "OrdererMSP",
"server-hostname": "orderer.example.com",
"requests": "grpcs://127.0.0.1:7050",
"tls_cacerts":
"/home/diogosilva/fabric-dev-servers/fabric-samples/first-network/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt"
}
],
"keyValueStore": "/tmp/fabric-client-kvs",
"configtxgenToolPath": "/home/diogosilva/fabric-dev-servers/fabric-samples/bin",
"SYNC_START_DATE_FORMAT": "YYYY/MM/DD",
"syncStartDate": "2018/01/01",
"eventWaitTime": "30000",
"license": "Apache-2.0",
"version": "1.1"
}
然后在构建 Hyperledger Explorer 时,运行命令时:
npm test -- -u --coverage
最后一个测试抛出以下错误:
RUNS src/components/View/LandingPage.spec.js
/home/diogosilva/blockchain-explorer/client/node_modules/react-scripts/scripts/test.js:20
throw err;
^
TypeError: getBlockActivity is not a function
at LandingPage.componentDidMount (/home/diogosilva/blockchain-explorer/client/src/components/View/LandingPage.js:136:5)
at <anonymous>
npm ERR! Test failed. See above for more details.
有人知道如何解决这个问题吗?