超级账本卡尺事务生命周期错误:对等方 2 的建议响应错误 未知:访问被拒绝通道 [] 创建者组织



我想使用Hyperledger Caliper来测试我的链码,但遇到了一些问题。超级账本结构网络由byfn.sh up命令启动。

我使用命令npx caliper benchmark run --caliper-workspace . --caliper-benchconfig benchmarks/benchmark.yaml --caliper-networkconfig benchmarks/network.yaml来运行基准测试。错误日志如下:

Benchmark for target Blockchain type fabric about to start
2020.01.09-23:49:05.146 info  [caliper] [benchmark-validator]   No observer specified, will default to `none`
2020.01.09-23:49:05.147 info  [caliper] [caliper-flow]  ####### Caliper Test #######
2020.01.09-23:49:05.151 info  [caliper] [null-observer]         Configured observer
2020.01.09-23:49:05.154 info  [caliper] [adapters/fabric]       Fabric SDK version: 1.4.3; TLS: server
2020.01.09-23:49:05.155 warn  [caliper] [adapters/fabric]       Org1's registrar information not provided.
2020.01.09-23:49:05.155 warn  [caliper] [adapters/fabric]       Org2's registrar information not provided.
2020.01.09-23:49:05.385 warn  [caliper] [adapters/fabric]       Org1's admin's materials found locally in file system key-value stores. Make sure it is the right one!
2020.01.09-23:49:05.395 warn  [caliper] [adapters/fabric]       Org2's admin's materials found locally in file system key-value stores. Make sure it is the right one!
2020.01.09-23:49:05.411 warn  [caliper] [adapters/fabric]       client0.org1.example.com's materials found locally in file system key-value stores. Make sure it is the right one!
2020.01.09-23:49:05.421 warn  [caliper] [adapters/fabric]       client0.org2.example.com's materials found locally in file system key-value stores. Make sure it is the right one!
2020.01.09-23:49:05.422 info  [caliper] [adapters/fabric]       Channel 'mychannel' is configured as created, skipping creation
2020.01.09-23:49:05.463 info  [caliper] [adapters/fabric]       peer0.org1.example.com has already joined mychannel
2020.01.09-23:49:05.480 info  [caliper] [adapters/fabric]       peer0.org2.example.com has already joined mychannel
2020.01.09-23:49:05.482 info  [caliper] [adapters/fabric]       Installing chaincodes for mychannel...
2020.01.09-23:49:05.491 info  [caliper] [adapters/fabric]       automaster_route@1.0 is already installed on peer0.org1.example.com
2020.01.09-23:49:05.498 info  [caliper] [adapters/fabric]       automaster_route@1.0 is already installed on peer0.org2.example.com
2020.01.09-23:49:05.508 info  [caliper] [adapters/fabric]       exp0@1.0 is already installed on peer0.org1.example.com
2020.01.09-23:49:05.515 info  [caliper] [adapters/fabric]       exp0@1.0 is already installed on peer0.org2.example.com
2020.01.09-23:49:05.526 info  [caliper] [adapters/fabric]       exp1@1.0 is already installed on peer0.org1.example.com
2020.01.09-23:49:05.533 info  [caliper] [adapters/fabric]       exp1@1.0 is already installed on peer0.org2.example.com
2020.01.09-23:49:05.534 info  [caliper] [adapters/fabric]       Instantiating automaster_route@1.0 in mychannel. This might take some time...
2020.01.09-23:49:05.543 info  [caliper] [adapters/fabric]       automaster_route@1.0 is already instantiated in mychannel
2020.01.09-23:49:05.544 info  [caliper] [adapters/fabric]       Instantiating exp0@1.0 in mychannel. This might take some time...
2020.01.09-23:49:05.554 info  [caliper] [adapters/fabric]       exp0@1.0 is already instantiated in mychannel
2020.01.09-23:49:05.554 info  [caliper] [adapters/fabric]       Instantiating exp1@1.0 in mychannel. This might take some time...
2020.01.09-23:49:05.564 info  [caliper] [adapters/fabric]       exp1@1.0 is already instantiated in mychannel
2020.01.09-23:49:07.566 info  [caliper] [caliper-flow]  Started monitors successfully
2020.01.09-23:49:07.567 info  [caliper] [defaultTest]   ####### Testing 'upload' #######
2020.01.09-23:49:07.568 info  [caliper] [defaultTest]   ------ Test round 1 ------
2020.01.09-23:49:07.582 info  [caliper] [client.js]     Launching client with PID 
2020.01.09-23:49:07.583 info  [caliper] [client.js]     Waiting for 1 clients to be ready... 
2020.01.09-23:49:09.482 info  [caliper] [client.js]     Client ready message received
2020.01.09-23:49:09.481 info  [caliper] [fabric/fabricClientWorker]     Client ready
2020.01.09-23:49:09.482 info  [caliper] [client.js]     1 clients ready, starting test phase
2020.01.09-23:49:09.484 info  [caliper] [local-client.js]       txUpdateTime: 1000
2020.01.09-23:49:09.626 info  [caliper] [local-client.js]       Info: client 2183 init test :invoke
2020.01.09-23:49:10.627 info  [caliper] [local-client.js]       Info: client 2183 start test runFixedNumber():invoke
2020.01.09-23:49:10.650 error [caliper] [adapters/fabric]       Transaction[4751ea2b2c] life-cycle errors:
- Proposal response error by peer0.org1.example.com: 2 UNKNOWN: access denied: channel [mychannel] creator org [Org1MSP]
- Proposal response error by peer0.org2.example.com: 2 UNKNOWN: access denied: channel [mychannel] creator org [Org1MSP]

我认为这可能是tls或加密材料的问题,但我检查了加密材料的路径,什么也没发现,下面是我的network.yaml:

name: Fabric
version: "1.0"
mutual-tls: false
caliper:
blockchain: fabric
# command:
#   start: ./byfn.sh up && docker exec cli bash ./scripts/setup4peers.sh && docker exec cli bash ./scripts/joinuser4peers.sh "user1"
#   end: docker kill $(docker ps -q) && ./byfn.sh down
info:
Version: 1.4.3
Size: 2 Orgs with 1 Peer
Orderer: Solo
Distribution: Single Host
StateDB: GoLevelDB
clients:
client0.org1.example.com:
client:
organization: Org1
credentialStore:
path: /tmp/hfc-kvs/org1
cryptoStore:
path: /tmp/hfc-cvs/org1
clientPrivateKey:
path: crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/keystore/04650a709ab38a8024c6168344688e1b16a29a7b4d435bc864628ac2afc251bb_sk
clientSignedCert:
path: crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/signcerts/User1@org1.example.com-cert.pem
client0.org2.example.com:
client:
organization: Org2
credentialStore:
path: /tmp/hfc-kvs/org2
cryptoStore:
path: /tmp/hfc-cvs/org2
clientPrivateKey:
path: crypto-config/peerOrganizations/org2.example.com/users/User1@org2.example.com/msp/keystore/2190942bdaa028b7e21802e6aa210add753b466210fcac136374fb0b37d24307_sk
clientSignedCert:
path: crypto-config/peerOrganizations/org2.example.com/users/User1@org2.example.com/msp/signcerts/User1@org2.example.com-cert.pem

channels:
mychannel:
configBinary: ../channel-artifacts/channel.tx
created: true
orderers:
- orderer.example.com
peers:
peer0.org1.example.com:
eventSource: true
# peer1.org1.example.com:
#   eventSource: true      
peer0.org2.example.com:
eventSource: true
# peer1.org2.example.com:
#   eventSource: true
chaincodes:
- id: automaster_route
version: "1.0"
language: java
path: ../chaincode/master-liuqi/java
# created: true
- id: exp0
version: "1.0"
language: java
path: ../chaincode/exp
# created: true
- id: exp1
version: "1.0"
language: java
path: ../chaincode/exp
# created: true
organizations:
Org1:
mspid: Org1MSP
peers:
- peer0.org1.example.com
# certificateAuthorities:
# - ca.org1.example.com
adminPrivateKey:
path: crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/67bdf39a46463e67fa8d317fe181c4c32ea371e1d4d40175a78c6ed6137410b5_sk
signedCert:
path: crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem
Org2:
mspid: Org2MSP
peers:
- peer0.org2.example.com
# certificateAuthorities:
# - ca.org2.example.com
adminPrivateKey:
path: crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/keystore/43432725a9c2b277991c413607326bf2f68932cd99a980183e2487926341583a_sk
signedCert:
path: crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/signcerts/Admin@org2.example.com-cert.pem
orderers:
orderer.example.com:
url: grpcs://localhost:7050
grpcOptions:
ssl-target-name-override: orderer.example.com
tlsCACerts:
path: crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
# crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
peers:
peer0.org1.example.com:
url: grpcs://localhost:7051
grpcOptions:
ssl-target-name-override: peer0.org1.example.com
grpc.keepalive_time_ms: 600000
tlsCACerts:
path: crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/tlscacerts/tlsca.org1.example.com-cert.pem
# crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/tlscacerts/tlsca.org1.example.com-cert.pem

peer0.org2.example.com:
url: grpcs://localhost:9051
grpcOptions:
ssl-target-name-override: peer0.org2.example.com
grpc.keepalive_time_ms: 600000
tlsCACerts:
path: crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp/tlscacerts/tlsca.org2.example.com-cert.pem
# crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp/tlscacerts/tlsca.org2.example.com-cert.pem

# peer1.org1.example.com:
#   url: grpc://localhost:8051
#   grpcOptions:
#     ssl-target-name-override: peer1.org1.example.com
#     grpc.keepalive_time_ms: 600000
# peer1.org2.example.com:
#   url: grpc://localhost:10051
#   grpcOptions:
#     ssl-target-name-override: peer1.org2.example.com
#     grpc.keepalive_time_ms: 600000

有没有人知道如何解决这个问题?

如果您使用卡尺基准测试,那么问题出在织物上.js node_modules/@hyperledger/卡尺织物/库。你应该打开那个 文件并将第 760 行 (async_initializeChannel( 更改为:

async _initializeChannel(profiles, channel) {
// initialize the channel for every client profile from the local config
for (let profile of profiles.entries()) {
let orgs = this.networkUtil.getOrganizationsOfChannel(channel);
for (let org of orgs) {
if (profile[0]===org){
let ch = profile[1].getChannel(channel, true);
if (ch) {
try {
await ch.initialize();
} catch (err) {
logger.error(`Couldn't initialize ${channel} for ${profile[0]}: ${err.message}`);
throw err;
}
}
}
}
}
}

如果不是来自那里,还有另外两种可能性:来自您的 network.yaml (1( 或您的 expo 链码基准测试 Java 文件配置 (2(。

(1( 通常,如果有两个以上的组织,则仅从此文件中的客户端配置中即可更轻松地创建隶属组织。只需删除 clientPrivateKey 和 clientSignedCert 并添加隶属关系即可。例如:

client0.org1.example.com:
client:
organization: Org1
affiliation: org1.department1
credentialStore:
path: /tmp/hfc-kvs/org1
cryptoStore:
path: /tmp/hfc-cvs/org1

(2( 从链码基准 Java 文件配置中,您应该添加您的 invokerIdentity

另外两个问题实际上已经在Hyperledger Caliper网站上给出了关于结构配置的问题

相关内容

最新更新