在使用测试网络部署的时候,使用了以下步骤
1、启动测试网络,并创建channel
./network.sh up createChannel -c mychannel -ca
2、部署链码chaincode
./network.sh deployCC -ccl java
3、使用官方自带的java 示例程序尝试访问账本
在asset-transfer-basic/application-java目录 下
使用gradle run
可以得到正确的结果:对账本的一系列操作
在第一次启动并使用示例程序访问账本的时候,一切正常。
但是,,,当使用./network.sh down 关闭区块链网络之后,,再次按照上述1,2,3的步骤,
就会报错,报错如下:
> Task :run
An identity for the admin user "admin" already exists in the wallet
An identity for the user "appUser" already exists in the wallet
Channel Channel{id: 1, name: mychannel} Sending proposal with transaction: b84847ac413ec8388fa890988436489155382719ac32f47b844b7300755bae0d to Peer{ id: 2, name: peer0.org1.example.com, channelName: mychannel, url: grpcs://localhost:7051, mspid: Org1MSP} failed because of: gRPC failure=Status{code=UNKNOWN, description=error validating proposal: access denied: channel [mychannel] creator org [Org1MSP], cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: error validating proposal: access denied: channel [mychannel] creator org [Org1MSP]
at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:4965)
at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers