美文网首页
hyperledger-fabric-sample-2

hyperledger-fabric-sample-2

作者: 当一切都结束时 | 来源:发表于2020-12-07 16:10 被阅读0次

    hyperledger-fabric-sample-1中使用下方的命令创建一个包含两个两个对等节点(two peer nodes)和一个排序节点(ordering node)后

    ./network.sh up
    

    接着跟随hyperledger官方文档来做。

    The components of the test network

    这部分介绍了测试网络的组成部分


    测试网络的组成部分.png

    创建通道

    使用下面的命令创建通道

    ./network.sh createChannel
    

    得到:

    root@lennon-System-Product-Name:/home/lennon/桌面/fabric-samples/test-network# ./network.sh createChannel -c channel1
    Creating channel 'channel1'.
    If network is not up, starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'leveldb 
    Generating channel create transaction 'channel1.tx'
    + configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel1.tx -channelID channel1
    2020-12-04 16:57:51.153 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
    2020-12-04 16:57:51.158 CST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/lennon/桌面/fabric-samples/test-network/configtx/configtx.yaml
    2020-12-04 16:57:51.158 CST [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 003 Generating new channel configtx
    2020-12-04 16:57:51.159 CST [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 004 Writing new channel tx
    + res=0
    Generating anchor peer update transactions
    Generating anchor peer update transaction for Org1MSP
    + configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID channel1 -asOrg Org1MSP
    2020-12-04 16:57:51.175 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
    2020-12-04 16:57:51.180 CST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/lennon/桌面/fabric-samples/test-network/configtx/configtx.yaml
    2020-12-04 16:57:51.180 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 003 Generating anchor peer update
    2020-12-04 16:57:51.181 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 004 Writing anchor peer update
    + res=0
    Generating anchor peer update transaction for Org2MSP
    + configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org2MSPanchors.tx -channelID channel1 -asOrg Org2MSP
    2020-12-04 16:57:51.197 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
    2020-12-04 16:57:51.201 CST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/lennon/桌面/fabric-samples/test-network/configtx/configtx.yaml
    2020-12-04 16:57:51.201 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 003 Generating anchor peer update
    2020-12-04 16:57:51.202 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 004 Writing anchor peer update
    + res=0
    Creating channel channel1
    Join Org1 peers to the channel...
    Using organization 1
    + peer channel join -b ./channel-artifacts/channel1.block
    + res=0
    2020-12-04 16:57:58.641 CST [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
    2020-12-04 16:57:59.058 CST [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
    Join Org2 peers to the channel...
    Using organization 2
    + peer channel join -b ./channel-artifacts/channel1.block
    + res=0
    2020-12-04 16:58:02.104 CST [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
    2020-12-04 16:58:02.502 CST [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
    Updating anchor peers for org1...
    Using organization 1
    + peer channel update -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com -c channel1 -f ./channel-artifacts/Org1MSPanchors.tx --tls --cafile /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
    + res=0
    2020-12-04 16:58:05.548 CST [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
    2020-12-04 16:58:05.556 CST [channelCmd] update -> INFO 002 Successfully submitted channel update
    Anchor peers updated for org 'Org1MSP' on channel 'channel1'
    Updating anchor peers for org2...
    Using organization 2
    + peer channel update -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com -c channel1 -f ./channel-artifacts/Org2MSPanchors.tx --tls --cafile /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
    + res=0
    2020-12-04 16:58:11.596 CST [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
    2020-12-04 16:58:11.605 CST [channelCmd] update -> INFO 002 Successfully submitted channel update
    Anchor peers updated for org 'Org2MSP' on channel 'channel1'
    Channel successfully joined
    

    此时通道创建成功。

    在通道上创建一个链码

    ./network.sh deployCC
    

    结果如下:

    deploying chaincode on channel 'mychannel'
    executing with the following
    - CHANNEL_NAME: mychannel
    - CC_NAME: basic
    - CC_SRC_PATH: NA
    - CC_SRC_LANGUAGE: go
    - CC_VERSION: 1.0
    - CC_SEQUENCE: 1
    - CC_END_POLICY: NA
    - CC_COLL_CONFIG: NA
    - CC_INIT_FCN: NA
    - DELAY: 3
    - MAX_RETRY: 5
    - VERBOSE: false
    Determining the path to the chaincode
    asset-transfer-basic
    Vendoring Go dependencies at ../asset-transfer-basic/chaincode-go/
    /home/lennon/桌面/fabric-samples/asset-transfer-basic/chaincode-go /home/lennon/桌面/fabric-samples/test-network
    go: downloading github.com/hyperledger/fabric-contract-api-go v1.1.0
    go: downloading github.com/hyperledger/fabric-chaincode-go v0.0.0-20200424173110-d7076418f212
    go: downloading github.com/hyperledger/fabric-protos-go v0.0.0-20200424173316-dd554ba3746e
    go: downloading github.com/golang/protobuf v1.3.2
    go: downloading google.golang.org/grpc v1.23.0
    go: downloading github.com/xeipuuv/gojsonschema v1.2.0
    go: downloading github.com/gobuffalo/packr v1.30.1
    go: downloading github.com/go-openapi/spec v0.19.4
    go: downloading github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415
    go: downloading github.com/gobuffalo/packd v0.3.0
    go: downloading gopkg.in/yaml.v2 v2.2.8
    go: downloading github.com/gobuffalo/envy v1.7.0
    go: downloading google.golang.org/genproto v0.0.0-20180831171423-11092d34479b
    go: downloading golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297
    go: downloading github.com/go-openapi/jsonpointer v0.19.3
    go: downloading github.com/go-openapi/swag v0.19.5
    go: downloading github.com/go-openapi/jsonreference v0.19.2
    go: downloading golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542
    go: downloading github.com/rogpeppe/go-internal v1.3.0
    go: downloading github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e
    go: downloading github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f
    go: downloading github.com/joho/godotenv v1.3.0
    go: downloading github.com/PuerkitoBio/purell v1.1.1
    go: downloading golang.org/x/text v0.3.2
    go: downloading github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578
    /home/lennon/桌面/fabric-samples/test-network
    Finished vendoring Go dependencies
    + peer lifecycle chaincode package basic.tar.gz --path ../asset-transfer-basic/chaincode-go/ --lang golang --label basic_1.0
    + res=0
    Chaincode is packaged
    Installing chaincode on peer0.org1...
    Using organization 1
    + peer lifecycle chaincode install basic.tar.gz
    + res=0
    2020-12-04 18:01:17.627 CST [cli.lifecycle.chaincode] submitInstallProposal -> INFO 001 Installed remotely: response:<status:200 payload:"\nJbasic_1.0:4ec191e793b27e953ff2ede5a8bcc63152cecb1e4c3f301a26e22692c61967ad\022\tbasic_1.0" > 
    2020-12-04 18:01:17.627 CST [cli.lifecycle.chaincode] submitInstallProposal -> INFO 002 Chaincode code package identifier: basic_1.0:4ec191e793b27e953ff2ede5a8bcc63152cecb1e4c3f301a26e22692c61967ad
    Chaincode is installed on peer0.org1
    Install chaincode on peer0.org2...
    Using organization 2
    + peer lifecycle chaincode install basic.tar.gz
    + res=0
    2020-12-04 18:01:33.096 CST [cli.lifecycle.chaincode] submitInstallProposal -> INFO 001 Installed remotely: response:<status:200 payload:"\nJbasic_1.0:4ec191e793b27e953ff2ede5a8bcc63152cecb1e4c3f301a26e22692c61967ad\022\tbasic_1.0" > 
    2020-12-04 18:01:33.096 CST [cli.lifecycle.chaincode] submitInstallProposal -> INFO 002 Chaincode code package identifier: basic_1.0:4ec191e793b27e953ff2ede5a8bcc63152cecb1e4c3f301a26e22692c61967ad
    Chaincode is installed on peer0.org2
    Using organization 1
    + peer lifecycle chaincode queryinstalled
    + res=0
    Installed chaincodes on peer:
    Package ID: basic_1.0:4ec191e793b27e953ff2ede5a8bcc63152cecb1e4c3f301a26e22692c61967ad, Label: basic_1.0
    Query installed successful on peer0.org1 on channel
    Using organization 1
    + peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --channelID mychannel --name basic --version 1.0 --package-id basic_1.0:4ec191e793b27e953ff2ede5a8bcc63152cecb1e4c3f301a26e22692c61967ad --sequence 1
    + res=1
    Error: proposal failed with status: 500 - channel 'mychannel' not found
    Chaincode definition approved on peer0.org1 on channel 'mychannel' failed
    Deploying chaincode failed
    

    第一次执行首先会下载相关依赖。此时出现了\color{red}{Error},提示mychannel通道没有找到
    然后再运行一次

    ./network.sh deployCC
    

    出现:

    root@lennon-System-Product-Name:/home/lennon/桌面/fabric-samples/test-network# ./network.sh deployCC
    deploying chaincode on channel 'mychannel'
    executing with the following
    - CHANNEL_NAME: mychannel
    - CC_NAME: basic
    - CC_SRC_PATH: NA
    - CC_SRC_LANGUAGE: go
    - CC_VERSION: 1.0
    - CC_SEQUENCE: 1
    - CC_END_POLICY: NA
    - CC_COLL_CONFIG: NA
    - CC_INIT_FCN: NA
    - DELAY: 3
    - MAX_RETRY: 5
    - VERBOSE: false
    Determining the path to the chaincode
    asset-transfer-basic
    Vendoring Go dependencies at ../asset-transfer-basic/chaincode-go/
    /home/lennon/桌面/fabric-samples/asset-transfer-basic/chaincode-go /home/lennon/桌面/fabric-samples/test-network
    /home/lennon/桌面/fabric-samples/test-network
    Finished vendoring Go dependencies
    + peer lifecycle chaincode package basic.tar.gz --path ../asset-transfer-basic/chaincode-go/ --lang golang --label basic_1.0
    + res=0
    Chaincode is packaged
    Installing chaincode on peer0.org1...
    Using organization 1
    + peer lifecycle chaincode install basic.tar.gz
    + res=1
    Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': chaincode already successfully installed
    Chaincode installation on peer0.org1 has failed
    Deploying chaincode failed
    root@lennon-System-Product-Name:/home/lennon/桌面/fabric-samples/test-network# source /etc/profile
    root@lennon-System-Product-Name:/home/lennon/桌面/fabric-samples/test-network# peer chaincode query -C mychannel -n fabcar -c '{"Args":["queryAllCars"]}'
    Error: endorsement failure during query. response: status:500 message:"make sure the chaincode fabcar has been successfully defined on channel mychannel and try again: chaincode fabcar not found"
    

    出现\color{red}{Error:}endorsement failure during query. response: status:500 message:"make sure the chaincode fabcar has been successfully defined on channel mychannel and try again: chaincode fabcar not found,提示链码 fabcar 没有在通道上被定义。
    \color{green}{解决办法:}
    1.进入fabcar目录:

    root@lennon-System-Product-Name:/home/lennon/桌面/fabric-samples/test-network# cd /home/lennon/桌面/fabric-samples/fabcar
    

    2.执行启动指令:

    ./startFabric.sh
    

    等待命令执行完成,显示:

    root@lennon-System-Product-Name:/home/lennon/桌面/fabric-samples/fabcar# ./startFabric.sh
    /home/lennon/桌面/fabric-samples/test-network /home/lennon/桌面/fabric-samples/fabcar
    Stopping network
    Stopping peer0.org1.example.com ... done
    Stopping orderer.example.com    ... done
    Stopping peer0.org2.example.com ... done
    Removing peer0.org1.example.com ... done
    Removing orderer.example.com    ... done
    Removing peer0.org2.example.com ... done
    Removing network net_test
    Removing volume net_orderer.example.com
    Removing volume net_peer0.org1.example.com
    Removing volume net_peer0.org2.example.com
    Removing network net_test
    WARNING: Network net_test not found.
    Removing volume net_peer0.org3.example.com
    WARNING: Volume net_peer0.org3.example.com not found.
    No containers available for deletion
    Untagged: dev-peer0.org2.example.com-basic_1.0-4ec191e793b27e953ff2ede5a8bcc63152cecb1e4c3f301a26e22692c61967ad-6c0d5b0755cb92ed5555bd2e8a8765a6f425d1ed5ed9a90e625e01939e2113be:latest
    Deleted: sha256:7a48c7f080612cde1a1492caf0ee1c43ff9be34a6015b202afdc8a1cb74a23e6
    Deleted: sha256:44d093f2b5f939e63b4ab83381ba2e7241f6d4a6c568582b1a25b21ae868eda2
    Deleted: sha256:1bbe05d45853b7ccd57c822e21c9fe83d6b375138778d322e6ab03f520bf86c6
    Deleted: sha256:dcf218260d9a08955e7946595bbba2f14bea162a53d1227f6b44fa41ec5f1b99
    Untagged: dev-peer0.org1.example.com-basic_1.0-4ec191e793b27e953ff2ede5a8bcc63152cecb1e4c3f301a26e22692c61967ad-42f57faac8360472e47cbbbf3940e81bba83439702d085878d148089a1b213ca:latest
    Deleted: sha256:f44457e6da34a39c062ac6f0e58469324733a6430c4058f1f430ba7a104fbdc0
    Deleted: sha256:810f47b0f818e02a8fe4820c8fab792e8a7787032756876135f9b4f826c9b96e
    Deleted: sha256:802fcbb66235b65788fdba69bb878f21f859ad6bc504b532cf3134008464b325
    Deleted: sha256:7d0f43f2ce843acda67b1b5ac6c24a9109cadfa3bfb2b6c0795a4ca312491248
    Creating channel 'mychannel'.
    If network is not up, starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'couchdb with crypto from 'Certificate Authorities'
    Bringing up network
    LOCAL_VERSION=2.3.0
    DOCKER_IMAGE_VERSION=2.3.0
    CA_LOCAL_VERSION=1.4.9
    CA_DOCKER_IMAGE_VERSION=1.4.9
    Generate certificates using Fabric CA's
    Creating network "net_test" with the default driver
    Creating ca_org1    ... done
    Creating ca_org2    ... done
    Creating ca_orderer ... done
    Create Org1 Identities
    Enroll the CA admin
    + fabric-ca-client enroll -u https://admin:adminpw@localhost:7054 --caname ca-org1 --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/org1/tls-cert.pem
    2020/12/05 11:51:29 [INFO] Created a default configuration file at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/fabric-ca-client-config.yaml
    2020/12/05 11:51:29 [INFO] TLS Enabled
    2020/12/05 11:51:29 [INFO] generating key: &{A:ecdsa S:256}
    2020/12/05 11:51:29 [INFO] encoded CSR
    2020/12/05 11:51:30 [INFO] Stored client certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/msp/signcerts/cert.pem
    2020/12/05 11:51:30 [INFO] Stored root CA certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/msp/cacerts/localhost-7054-ca-org1.pem
    2020/12/05 11:51:30 [INFO] Stored Issuer public key at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/msp/IssuerPublicKey
    2020/12/05 11:51:30 [INFO] Stored Issuer revocation public key at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/msp/IssuerRevocationPublicKey
    Register peer0
    + fabric-ca-client register --caname ca-org1 --id.name peer0 --id.secret peer0pw --id.type peer --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/org1/tls-cert.pem
    2020/12/05 11:51:30 [INFO] Configuration file location: /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/fabric-ca-client-config.yaml
    2020/12/05 11:51:30 [INFO] TLS Enabled
    2020/12/05 11:51:30 [INFO] TLS Enabled
    Password: peer0pw
    Register user
    + fabric-ca-client register --caname ca-org1 --id.name user1 --id.secret user1pw --id.type client --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/org1/tls-cert.pem
    2020/12/05 11:51:30 [INFO] Configuration file location: /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/fabric-ca-client-config.yaml
    2020/12/05 11:51:30 [INFO] TLS Enabled
    2020/12/05 11:51:30 [INFO] TLS Enabled
    Password: user1pw
    Register the org admin
    + fabric-ca-client register --caname ca-org1 --id.name org1admin --id.secret org1adminpw --id.type admin --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/org1/tls-cert.pem
    2020/12/05 11:51:30 [INFO] Configuration file location: /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/fabric-ca-client-config.yaml
    2020/12/05 11:51:30 [INFO] TLS Enabled
    2020/12/05 11:51:30 [INFO] TLS Enabled
    Password: org1adminpw
    Generate the peer0 msp
    + fabric-ca-client enroll -u https://peer0:peer0pw@localhost:7054 --caname ca-org1 -M /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp --csr.hosts peer0.org1.example.com --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/org1/tls-cert.pem
    2020/12/05 11:51:30 [INFO] TLS Enabled
    2020/12/05 11:51:30 [INFO] generating key: &{A:ecdsa S:256}
    2020/12/05 11:51:30 [INFO] encoded CSR
    2020/12/05 11:51:30 [INFO] Stored client certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/signcerts/cert.pem
    2020/12/05 11:51:30 [INFO] Stored root CA certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/cacerts/localhost-7054-ca-org1.pem
    2020/12/05 11:51:30 [INFO] Stored Issuer public key at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/IssuerPublicKey
    2020/12/05 11:51:30 [INFO] Stored Issuer revocation public key at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/IssuerRevocationPublicKey
    Generate the peer0-tls certificates
    + fabric-ca-client enroll -u https://peer0:peer0pw@localhost:7054 --caname ca-org1 -M /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls --enrollment.profile tls --csr.hosts peer0.org1.example.com --csr.hosts localhost --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/org1/tls-cert.pem
    2020/12/05 11:51:30 [INFO] TLS Enabled
    2020/12/05 11:51:30 [INFO] generating key: &{A:ecdsa S:256}
    2020/12/05 11:51:30 [INFO] encoded CSR
    2020/12/05 11:51:31 [INFO] Stored client certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/signcerts/cert.pem
    2020/12/05 11:51:31 [INFO] Stored TLS root CA certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/tlscacerts/tls-localhost-7054-ca-org1.pem
    2020/12/05 11:51:31 [INFO] Stored Issuer public key at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/IssuerPublicKey
    2020/12/05 11:51:31 [INFO] Stored Issuer revocation public key at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/IssuerRevocationPublicKey
    Generate the user msp
    + fabric-ca-client enroll -u https://user1:user1pw@localhost:7054 --caname ca-org1 -M /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/org1/tls-cert.pem
    2020/12/05 11:51:31 [INFO] TLS Enabled
    2020/12/05 11:51:31 [INFO] generating key: &{A:ecdsa S:256}
    2020/12/05 11:51:31 [INFO] encoded CSR
    2020/12/05 11:51:31 [INFO] Stored client certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/signcerts/cert.pem
    2020/12/05 11:51:31 [INFO] Stored root CA certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/cacerts/localhost-7054-ca-org1.pem
    2020/12/05 11:51:31 [INFO] Stored Issuer public key at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/IssuerPublicKey
    2020/12/05 11:51:31 [INFO] Stored Issuer revocation public key at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/IssuerRevocationPublicKey
    Generate the org admin msp
    + fabric-ca-client enroll -u https://org1admin:org1adminpw@localhost:7054 --caname ca-org1 -M /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/org1/tls-cert.pem
    2020/12/05 11:51:31 [INFO] TLS Enabled
    2020/12/05 11:51:31 [INFO] generating key: &{A:ecdsa S:256}
    2020/12/05 11:51:31 [INFO] encoded CSR
    2020/12/05 11:51:31 [INFO] Stored client certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/cert.pem
    2020/12/05 11:51:31 [INFO] Stored root CA certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/cacerts/localhost-7054-ca-org1.pem
    2020/12/05 11:51:31 [INFO] Stored Issuer public key at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/IssuerPublicKey
    2020/12/05 11:51:31 [INFO] Stored Issuer revocation public key at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/IssuerRevocationPublicKey
    Create Org2 Identities
    Enroll the CA admin
    + fabric-ca-client enroll -u https://admin:adminpw@localhost:8054 --caname ca-org2 --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/org2/tls-cert.pem
    2020/12/05 11:51:31 [INFO] Created a default configuration file at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/fabric-ca-client-config.yaml
    2020/12/05 11:51:31 [INFO] TLS Enabled
    2020/12/05 11:51:31 [INFO] generating key: &{A:ecdsa S:256}
    2020/12/05 11:51:31 [INFO] encoded CSR
    2020/12/05 11:51:31 [INFO] Stored client certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/msp/signcerts/cert.pem
    2020/12/05 11:51:31 [INFO] Stored root CA certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/msp/cacerts/localhost-8054-ca-org2.pem
    2020/12/05 11:51:31 [INFO] Stored Issuer public key at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/msp/IssuerPublicKey
    2020/12/05 11:51:31 [INFO] Stored Issuer revocation public key at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/msp/IssuerRevocationPublicKey
    Register peer0
    + fabric-ca-client register --caname ca-org2 --id.name peer0 --id.secret peer0pw --id.type peer --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/org2/tls-cert.pem
    2020/12/05 11:51:31 [INFO] Configuration file location: /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/fabric-ca-client-config.yaml
    2020/12/05 11:51:31 [INFO] TLS Enabled
    2020/12/05 11:51:31 [INFO] TLS Enabled
    Password: peer0pw
    Register user
    + fabric-ca-client register --caname ca-org2 --id.name user1 --id.secret user1pw --id.type client --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/org2/tls-cert.pem
    2020/12/05 11:51:32 [INFO] Configuration file location: /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/fabric-ca-client-config.yaml
    2020/12/05 11:51:32 [INFO] TLS Enabled
    2020/12/05 11:51:32 [INFO] TLS Enabled
    Password: user1pw
    Register the org admin
    + fabric-ca-client register --caname ca-org2 --id.name org2admin --id.secret org2adminpw --id.type admin --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/org2/tls-cert.pem
    2020/12/05 11:51:32 [INFO] Configuration file location: /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/fabric-ca-client-config.yaml
    2020/12/05 11:51:32 [INFO] TLS Enabled
    2020/12/05 11:51:32 [INFO] TLS Enabled
    Password: org2adminpw
    Generate the peer0 msp
    + fabric-ca-client enroll -u https://peer0:peer0pw@localhost:8054 --caname ca-org2 -M /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp --csr.hosts peer0.org2.example.com --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/org2/tls-cert.pem
    2020/12/05 11:51:32 [INFO] TLS Enabled
    2020/12/05 11:51:32 [INFO] generating key: &{A:ecdsa S:256}
    2020/12/05 11:51:32 [INFO] encoded CSR
    2020/12/05 11:51:32 [INFO] Stored client certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp/signcerts/cert.pem
    2020/12/05 11:51:32 [INFO] Stored root CA certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp/cacerts/localhost-8054-ca-org2.pem
    2020/12/05 11:51:32 [INFO] Stored Issuer public key at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp/IssuerPublicKey
    2020/12/05 11:51:32 [INFO] Stored Issuer revocation public key at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp/IssuerRevocationPublicKey
    Generate the peer0-tls certificates
    + fabric-ca-client enroll -u https://peer0:peer0pw@localhost:8054 --caname ca-org2 -M /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls --enrollment.profile tls --csr.hosts peer0.org2.example.com --csr.hosts localhost --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/org2/tls-cert.pem
    2020/12/05 11:51:32 [INFO] TLS Enabled
    2020/12/05 11:51:32 [INFO] generating key: &{A:ecdsa S:256}
    2020/12/05 11:51:32 [INFO] encoded CSR
    2020/12/05 11:51:32 [INFO] Stored client certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/signcerts/cert.pem
    2020/12/05 11:51:32 [INFO] Stored TLS root CA certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/tlscacerts/tls-localhost-8054-ca-org2.pem
    2020/12/05 11:51:32 [INFO] Stored Issuer public key at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/IssuerPublicKey
    2020/12/05 11:51:32 [INFO] Stored Issuer revocation public key at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/IssuerRevocationPublicKey
    Generate the user msp
    + fabric-ca-client enroll -u https://user1:user1pw@localhost:8054 --caname ca-org2 -M /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/User1@org2.example.com/msp --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/org2/tls-cert.pem
    2020/12/05 11:51:33 [INFO] TLS Enabled
    2020/12/05 11:51:33 [INFO] generating key: &{A:ecdsa S:256}
    2020/12/05 11:51:33 [INFO] encoded CSR
    2020/12/05 11:51:33 [INFO] Stored client certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/User1@org2.example.com/msp/signcerts/cert.pem
    2020/12/05 11:51:33 [INFO] Stored root CA certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/User1@org2.example.com/msp/cacerts/localhost-8054-ca-org2.pem
    2020/12/05 11:51:33 [INFO] Stored Issuer public key at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/User1@org2.example.com/msp/IssuerPublicKey
    2020/12/05 11:51:33 [INFO] Stored Issuer revocation public key at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/User1@org2.example.com/msp/IssuerRevocationPublicKey
    Generate the org admin msp
    + fabric-ca-client enroll -u https://org2admin:org2adminpw@localhost:8054 --caname ca-org2 -M /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/org2/tls-cert.pem
    2020/12/05 11:51:33 [INFO] TLS Enabled
    2020/12/05 11:51:33 [INFO] generating key: &{A:ecdsa S:256}
    2020/12/05 11:51:33 [INFO] encoded CSR
    2020/12/05 11:51:33 [INFO] Stored client certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/signcerts/cert.pem
    2020/12/05 11:51:33 [INFO] Stored root CA certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/cacerts/localhost-8054-ca-org2.pem
    2020/12/05 11:51:33 [INFO] Stored Issuer public key at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/IssuerPublicKey
    2020/12/05 11:51:33 [INFO] Stored Issuer revocation public key at /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/IssuerRevocationPublicKey
    Create Orderer Org Identities
    Enroll the CA admin
    + fabric-ca-client enroll -u https://admin:adminpw@localhost:9054 --caname ca-orderer --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/ordererOrg/tls-cert.pem
    2020/12/05 11:51:33 [INFO] Created a default configuration file at /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/fabric-ca-client-config.yaml
    2020/12/05 11:51:33 [INFO] TLS Enabled
    2020/12/05 11:51:33 [INFO] generating key: &{A:ecdsa S:256}
    2020/12/05 11:51:33 [INFO] encoded CSR
    2020/12/05 11:51:33 [INFO] Stored client certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/msp/signcerts/cert.pem
    2020/12/05 11:51:33 [INFO] Stored root CA certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/msp/cacerts/localhost-9054-ca-orderer.pem
    2020/12/05 11:51:33 [INFO] Stored Issuer public key at /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/msp/IssuerPublicKey
    2020/12/05 11:51:33 [INFO] Stored Issuer revocation public key at /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/msp/IssuerRevocationPublicKey
    Register orderer
    + fabric-ca-client register --caname ca-orderer --id.name orderer --id.secret ordererpw --id.type orderer --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/ordererOrg/tls-cert.pem
    2020/12/05 11:51:33 [INFO] Configuration file location: /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/fabric-ca-client-config.yaml
    2020/12/05 11:51:33 [INFO] TLS Enabled
    2020/12/05 11:51:33 [INFO] TLS Enabled
    Password: ordererpw
    Register the orderer admin
    + fabric-ca-client register --caname ca-orderer --id.name ordererAdmin --id.secret ordererAdminpw --id.type admin --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/ordererOrg/tls-cert.pem
    2020/12/05 11:51:33 [INFO] Configuration file location: /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/fabric-ca-client-config.yaml
    2020/12/05 11:51:33 [INFO] TLS Enabled
    2020/12/05 11:51:33 [INFO] TLS Enabled
    Password: ordererAdminpw
    Generate the orderer msp
    + fabric-ca-client enroll -u https://orderer:ordererpw@localhost:9054 --caname ca-orderer -M /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp --csr.hosts orderer.example.com --csr.hosts localhost --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/ordererOrg/tls-cert.pem
    2020/12/05 11:51:34 [INFO] TLS Enabled
    2020/12/05 11:51:34 [INFO] generating key: &{A:ecdsa S:256}
    2020/12/05 11:51:34 [INFO] encoded CSR
    2020/12/05 11:51:34 [INFO] Stored client certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/signcerts/cert.pem
    2020/12/05 11:51:34 [INFO] Stored root CA certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/cacerts/localhost-9054-ca-orderer.pem
    2020/12/05 11:51:34 [INFO] Stored Issuer public key at /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/IssuerPublicKey
    2020/12/05 11:51:34 [INFO] Stored Issuer revocation public key at /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/IssuerRevocationPublicKey
    Generate the orderer-tls certificates
    + fabric-ca-client enroll -u https://orderer:ordererpw@localhost:9054 --caname ca-orderer -M /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls --enrollment.profile tls --csr.hosts orderer.example.com --csr.hosts localhost --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/ordererOrg/tls-cert.pem
    2020/12/05 11:51:34 [INFO] TLS Enabled
    2020/12/05 11:51:34 [INFO] generating key: &{A:ecdsa S:256}
    2020/12/05 11:51:34 [INFO] encoded CSR
    2020/12/05 11:51:34 [INFO] Stored client certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/signcerts/cert.pem
    2020/12/05 11:51:34 [INFO] Stored TLS root CA certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/tlscacerts/tls-localhost-9054-ca-orderer.pem
    2020/12/05 11:51:34 [INFO] Stored Issuer public key at /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/IssuerPublicKey
    2020/12/05 11:51:34 [INFO] Stored Issuer revocation public key at /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/IssuerRevocationPublicKey
    Generate the admin msp
    + fabric-ca-client enroll -u https://ordererAdmin:ordererAdminpw@localhost:9054 --caname ca-orderer -M /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/users/Admin@example.com/msp --tls.certfiles /home/lennon/桌面/fabric-samples/test-network/organizations/fabric-ca/ordererOrg/tls-cert.pem
    2020/12/05 11:51:34 [INFO] TLS Enabled
    2020/12/05 11:51:34 [INFO] generating key: &{A:ecdsa S:256}
    2020/12/05 11:51:34 [INFO] encoded CSR
    2020/12/05 11:51:34 [INFO] Stored client certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/users/Admin@example.com/msp/signcerts/cert.pem
    2020/12/05 11:51:34 [INFO] Stored root CA certificate at /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/users/Admin@example.com/msp/cacerts/localhost-9054-ca-orderer.pem
    2020/12/05 11:51:34 [INFO] Stored Issuer public key at /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/users/Admin@example.com/msp/IssuerPublicKey
    2020/12/05 11:51:34 [INFO] Stored Issuer revocation public key at /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/users/Admin@example.com/msp/IssuerRevocationPublicKey
    Generate CCP files for Org1 and Org2
    /home/lennon/桌面/fabric-samples/test-network/../bin/configtxgen
    Generating Orderer Genesis block
    + configtxgen -profile TwoOrgsOrdererGenesis -channelID system-channel -outputBlock ./system-genesis-block/genesis.block
    2020-12-05 11:51:34.961 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
    2020-12-05 11:51:34.965 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 002 orderer type: etcdraft
    2020-12-05 11:51:34.966 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 Orderer.EtcdRaft.Options unset, setting to tick_interval:"500ms" election_tick:10 heartbeat_tick:1 max_inflight_blocks:5 snapshot_interval_size:16777216 
    2020-12-05 11:51:34.966 CST [common.tools.configtxgen.localconfig] Load -> INFO 004 Loaded configuration: /home/lennon/桌面/fabric-samples/test-network/configtx/configtx.yaml
    2020-12-05 11:51:34.967 CST [common.tools.configtxgen] doOutputBlock -> INFO 005 Generating genesis block
    2020-12-05 11:51:34.967 CST [common.tools.configtxgen] doOutputBlock -> INFO 006 Creating system channel genesis block
    2020-12-05 11:51:34.967 CST [common.tools.configtxgen] doOutputBlock -> INFO 007 Writing genesis block
    + res=0
    Creating volume "net_orderer.example.com" with default driver
    Creating volume "net_peer0.org1.example.com" with default driver
    Creating volume "net_peer0.org2.example.com" with default driver
    WARNING: Found orphan containers (ca_orderer, ca_org1, ca_org2) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
    Pulling couchdb1 (couchdb:3.1.1)...
    3.1.1: Pulling from library/couchdb
    852e50cd189d: Pull complete
    322f96e7be50: Pull complete
    262bec889258: Pull complete
    29b9d158db8a: Pull complete
    7c72b2efdea7: Pull complete
    110e6db7fd12: Pull complete
    9825dab89339: Pull complete
    e7cdc95b1e0d: Pull complete
    5d05a4aba437: Pull complete
    64299fcc5fbc: Pull complete
    ac1678db0fbc: Pull complete
    Digest: sha256:033d1cb88b8e0bdde67541dfd24d5d58fd99952202136d84b35406dd3fe4815d
    Status: Downloaded newer image for couchdb:3.1.1
    Creating couchdb1               ... done
    Creating couchdb0            ... done
    Creating orderer.example.com    ... done
    Creating peer0.org1.example.com ... done
    Creating peer0.org2.example.com ... done
    CONTAINER ID        IMAGE                               COMMAND                  CREATED              STATUS                  PORTS                                        NAMES
    56f1daea327c        hyperledger/fabric-peer:latest      "peer node start"        6 seconds ago        Up Less than a second   7051/tcp, 0.0.0.0:9051->9051/tcp             peer0.org2.example.com
    6cf9ee30a2c1        hyperledger/fabric-peer:latest      "peer node start"        6 seconds ago        Up Less than a second   0.0.0.0:7051->7051/tcp                       peer0.org1.example.com
    6088af1d2119        hyperledger/fabric-orderer:latest   "orderer"                14 seconds ago       Up 4 seconds            0.0.0.0:7050->7050/tcp                       orderer.example.com
    773d7da71a1b        couchdb:3.1.1                       "tini -- /docker-ent…"   14 seconds ago       Up 6 seconds            4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp   couchdb0
    25e611bb1fe9        couchdb:3.1.1                       "tini -- /docker-ent…"   14 seconds ago       Up 6 seconds            4369/tcp, 9100/tcp, 0.0.0.0:7984->5984/tcp   couchdb1
    aa5f16a572d4        hyperledger/fabric-ca:latest        "sh -c 'fabric-ca-se…"   About a minute ago   Up About a minute       7054/tcp, 0.0.0.0:9054->9054/tcp             ca_orderer
    079c593f5031        hyperledger/fabric-ca:latest        "sh -c 'fabric-ca-se…"   About a minute ago   Up About a minute       0.0.0.0:7054->7054/tcp                       ca_org1
    952f413f0844        hyperledger/fabric-ca:latest        "sh -c 'fabric-ca-se…"   About a minute ago   Up About a minute       7054/tcp, 0.0.0.0:8054->8054/tcp             ca_org2
    Generating channel create transaction 'mychannel.tx'
    + configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/mychannel.tx -channelID mychannel
    2020-12-05 11:52:39.677 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
    2020-12-05 11:52:39.682 CST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/lennon/桌面/fabric-samples/test-network/configtx/configtx.yaml
    2020-12-05 11:52:39.682 CST [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 003 Generating new channel configtx
    2020-12-05 11:52:39.683 CST [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 004 Writing new channel tx
    + res=0
    Generating anchor peer update transactions
    Generating anchor peer update transaction for Org1MSP
    + configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID mychannel -asOrg Org1MSP
    2020-12-05 11:52:39.699 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
    2020-12-05 11:52:39.704 CST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/lennon/桌面/fabric-samples/test-network/configtx/configtx.yaml
    2020-12-05 11:52:39.704 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 003 Generating anchor peer update
    2020-12-05 11:52:39.705 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 004 Writing anchor peer update
    + res=0
    Generating anchor peer update transaction for Org2MSP
    + configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org2MSPanchors.tx -channelID mychannel -asOrg Org2MSP
    2020-12-05 11:52:39.721 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
    2020-12-05 11:52:39.725 CST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/lennon/桌面/fabric-samples/test-network/configtx/configtx.yaml
    2020-12-05 11:52:39.725 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 003 Generating anchor peer update
    2020-12-05 11:52:39.726 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 004 Writing anchor peer update
    + res=0
    Creating channel mychannel
    Using organization 1
    + peer channel create -o localhost:7050 -c mychannel --ordererTLSHostnameOverride orderer.example.com -f ./channel-artifacts/mychannel.tx --outputBlock ./channel-artifacts/mychannel.block --tls --cafile /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
    + res=0
    2020-12-05 11:52:42.794 CST [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
    2020-12-05 11:52:42.805 CST [cli.common] readBlock -> INFO 002 Expect block, but got status: &{NOT_FOUND}
    2020-12-05 11:52:42.806 CST [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
    2020-12-05 11:52:43.203 CST [cli.common] readBlock -> INFO 004 Expect block, but got status: &{SERVICE_UNAVAILABLE}
    2020-12-05 11:52:43.208 CST [channelCmd] InitCmdFactory -> INFO 005 Endorser and orderer connections initialized
    2020-12-05 11:52:43.411 CST [cli.common] readBlock -> INFO 006 Expect block, but got status: &{SERVICE_UNAVAILABLE}
    2020-12-05 11:52:43.418 CST [channelCmd] InitCmdFactory -> INFO 007 Endorser and orderer connections initialized
    2020-12-05 11:52:43.620 CST [cli.common] readBlock -> INFO 008 Expect block, but got status: &{SERVICE_UNAVAILABLE}
    2020-12-05 11:52:43.625 CST [channelCmd] InitCmdFactory -> INFO 009 Endorser and orderer connections initialized
    2020-12-05 11:52:43.827 CST [cli.common] readBlock -> INFO 00a Expect block, but got status: &{SERVICE_UNAVAILABLE}
    2020-12-05 11:52:43.833 CST [channelCmd] InitCmdFactory -> INFO 00b Endorser and orderer connections initialized
    2020-12-05 11:52:44.034 CST [cli.common] readBlock -> INFO 00c Expect block, but got status: &{SERVICE_UNAVAILABLE}
    2020-12-05 11:52:44.037 CST [channelCmd] InitCmdFactory -> INFO 00d Endorser and orderer connections initialized
    2020-12-05 11:52:44.244 CST [cli.common] readBlock -> INFO 00e Received block: 0
    Channel 'mychannel' created
    Join Org1 peers to the channel...
    Using organization 1
    + peer channel join -b ./channel-artifacts/mychannel.block
    + res=0
    2020-12-05 11:52:47.294 CST [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
    2020-12-05 11:52:48.712 CST [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
    Join Org2 peers to the channel...
    Using organization 2
    + peer channel join -b ./channel-artifacts/mychannel.block
    + res=0
    2020-12-05 11:52:51.757 CST [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
    2020-12-05 11:52:53.220 CST [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
    Updating anchor peers for org1...
    Using organization 1
    + peer channel update -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com -c mychannel -f ./channel-artifacts/Org1MSPanchors.tx --tls --cafile /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
    + res=0
    2020-12-05 11:52:56.266 CST [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
    2020-12-05 11:52:56.274 CST [channelCmd] update -> INFO 002 Successfully submitted channel update
    Anchor peers updated for org 'Org1MSP' on channel 'mychannel'
    Updating anchor peers for org2...
    Using organization 2
    + peer channel update -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com -c mychannel -f ./channel-artifacts/Org2MSPanchors.tx --tls --cafile /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
    + res=0
    2020-12-05 11:53:02.312 CST [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
    2020-12-05 11:53:02.320 CST [channelCmd] update -> INFO 002 Successfully submitted channel update
    Anchor peers updated for org 'Org2MSP' on channel 'mychannel'
    Channel successfully joined
    deploying chaincode on channel 'mychannel'
    executing with the following
    - CHANNEL_NAME: mychannel
    - CC_NAME: fabcar
    - CC_SRC_PATH: ../chaincode/fabcar/go/
    - CC_SRC_LANGUAGE: go
    - CC_VERSION: 1
    - CC_SEQUENCE: 1
    - CC_END_POLICY: NA
    - CC_COLL_CONFIG: NA
    - CC_INIT_FCN: initLedger
    - DELAY: 3
    - MAX_RETRY: 5
    - VERBOSE: false
    Vendoring Go dependencies at ../chaincode/fabcar/go/
    /home/lennon/桌面/fabric-samples/chaincode/fabcar/go /home/lennon/桌面/fabric-samples/test-network
    /home/lennon/桌面/fabric-samples/test-network
    Finished vendoring Go dependencies
    + peer lifecycle chaincode package fabcar.tar.gz --path ../chaincode/fabcar/go/ --lang golang --label fabcar_1
    + res=0
    Chaincode is packaged
    Installing chaincode on peer0.org1...
    Using organization 1
    + peer lifecycle chaincode install fabcar.tar.gz
    + res=0
    2020-12-05 11:53:24.988 CST [cli.lifecycle.chaincode] submitInstallProposal -> INFO 001 Installed remotely: response:<status:200 payload:"\nIfabcar_1:762e0fe3dbeee0f7b08fb6200adeb4a3a20f649a00f168c0b3c2257e53b6e506\022\010fabcar_1" > 
    2020-12-05 11:53:24.988 CST [cli.lifecycle.chaincode] submitInstallProposal -> INFO 002 Chaincode code package identifier: fabcar_1:762e0fe3dbeee0f7b08fb6200adeb4a3a20f649a00f168c0b3c2257e53b6e506
    Chaincode is installed on peer0.org1
    Install chaincode on peer0.org2...
    Using organization 2
    + peer lifecycle chaincode install fabcar.tar.gz
    + res=0
    2020-12-05 11:53:40.827 CST [cli.lifecycle.chaincode] submitInstallProposal -> INFO 001 Installed remotely: response:<status:200 payload:"\nIfabcar_1:762e0fe3dbeee0f7b08fb6200adeb4a3a20f649a00f168c0b3c2257e53b6e506\022\010fabcar_1" > 
    2020-12-05 11:53:40.827 CST [cli.lifecycle.chaincode] submitInstallProposal -> INFO 002 Chaincode code package identifier: fabcar_1:762e0fe3dbeee0f7b08fb6200adeb4a3a20f649a00f168c0b3c2257e53b6e506
    Chaincode is installed on peer0.org2
    Using organization 1
    + peer lifecycle chaincode queryinstalled
    + res=0
    Installed chaincodes on peer:
    Package ID: fabcar_1:762e0fe3dbeee0f7b08fb6200adeb4a3a20f649a00f168c0b3c2257e53b6e506, Label: fabcar_1
    Query installed successful on peer0.org1 on channel
    Using organization 1
    + peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --channelID mychannel --name fabcar --version 1 --package-id fabcar_1:762e0fe3dbeee0f7b08fb6200adeb4a3a20f649a00f168c0b3c2257e53b6e506 --sequence 1 --init-required
    + res=0
    2020-12-05 11:53:44.898 CST [chaincodeCmd] ClientWait -> INFO 001 txid [4e3562490c17e3b08a240e6854ad34b9bb90a532a37d23493fd27cf2ba5efed1] committed with status (VALID) at localhost:7051
    Chaincode definition approved on peer0.org1 on channel 'mychannel'
    Using organization 1
    Checking the commit readiness of the chaincode definition on peer0.org1 on channel 'mychannel'...
    Attempting to check the commit readiness of the chaincode definition on peer0.org1, Retry after 3 seconds.
    + peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name fabcar --version 1 --sequence 1 --init-required --output json
    + res=0
    {
        "approvals": {
            "Org1MSP": true,
            "Org2MSP": false
        }
    }
    Checking the commit readiness of the chaincode definition successful on peer0.org1 on channel 'mychannel'
    Using organization 2
    Checking the commit readiness of the chaincode definition on peer0.org2 on channel 'mychannel'...
    Attempting to check the commit readiness of the chaincode definition on peer0.org2, Retry after 3 seconds.
    + peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name fabcar --version 1 --sequence 1 --init-required --output json
    + res=0
    {
        "approvals": {
            "Org1MSP": true,
            "Org2MSP": false
        }
    }
    Checking the commit readiness of the chaincode definition successful on peer0.org2 on channel 'mychannel'
    Using organization 2
    + peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --channelID mychannel --name fabcar --version 1 --package-id fabcar_1:762e0fe3dbeee0f7b08fb6200adeb4a3a20f649a00f168c0b3c2257e53b6e506 --sequence 1 --init-required
    + res=0
    2020-12-05 11:53:54.813 CST [chaincodeCmd] ClientWait -> INFO 001 txid [7d3f6ef76b8c92a331b44e89d873cf67fa4346d4b5e0e6b760c6403bfa444d2a] committed with status (VALID) at localhost:9051
    Chaincode definition approved on peer0.org2 on channel 'mychannel'
    Using organization 1
    Checking the commit readiness of the chaincode definition on peer0.org1 on channel 'mychannel'...
    Attempting to check the commit readiness of the chaincode definition on peer0.org1, Retry after 3 seconds.
    + peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name fabcar --version 1 --sequence 1 --init-required --output json
    + res=0
    {
        "approvals": {
            "Org1MSP": true,
            "Org2MSP": true
        }
    }
    Checking the commit readiness of the chaincode definition successful on peer0.org1 on channel 'mychannel'
    Using organization 2
    Checking the commit readiness of the chaincode definition on peer0.org2 on channel 'mychannel'...
    Attempting to check the commit readiness of the chaincode definition on peer0.org2, Retry after 3 seconds.
    + peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name fabcar --version 1 --sequence 1 --init-required --output json
    + res=0
    {
        "approvals": {
            "Org1MSP": true,
            "Org2MSP": true
        }
    }
    Checking the commit readiness of the chaincode definition successful on peer0.org2 on channel 'mychannel'
    Using organization 1
    Using organization 2
    + peer lifecycle chaincode commit -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --channelID mychannel --name fabcar --peerAddresses localhost:7051 --tlsRootCertFiles /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses localhost:9051 --tlsRootCertFiles /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt --version 1 --sequence 1 --init-required
    + res=0
    2020-12-05 11:54:05.019 CST [chaincodeCmd] ClientWait -> INFO 001 txid [0c2b684740b0fa1f825b471970f33922c39ebe1073bd21c4df832b03de001600] committed with status (VALID) at localhost:7051
    2020-12-05 11:54:05.019 CST [chaincodeCmd] ClientWait -> INFO 002 txid [0c2b684740b0fa1f825b471970f33922c39ebe1073bd21c4df832b03de001600] committed with status (VALID) at localhost:9051
    Chaincode definition committed on channel 'mychannel'
    Using organization 1
    Querying chaincode definition on peer0.org1 on channel 'mychannel'...
    Attempting to Query committed status on peer0.org1, Retry after 3 seconds.
    + peer lifecycle chaincode querycommitted --channelID mychannel --name fabcar
    + res=0
    Committed chaincode definition for chaincode 'fabcar' on channel 'mychannel':
    Version: 1, Sequence: 1, Endorsement Plugin: escc, Validation Plugin: vscc, Approvals: [Org1MSP: true, Org2MSP: true]
    Query chaincode definition successful on peer0.org1 on channel 'mychannel'
    Using organization 2
    Querying chaincode definition on peer0.org2 on channel 'mychannel'...
    Attempting to Query committed status on peer0.org2, Retry after 3 seconds.
    + peer lifecycle chaincode querycommitted --channelID mychannel --name fabcar
    + res=0
    Committed chaincode definition for chaincode 'fabcar' on channel 'mychannel':
    Version: 1, Sequence: 1, Endorsement Plugin: escc, Validation Plugin: vscc, Approvals: [Org1MSP: true, Org2MSP: true]
    Query chaincode definition successful on peer0.org2 on channel 'mychannel'
    Using organization 1
    Using organization 2
    + fcn_call='{"function":"initLedger","Args":[]}'
    + infoln 'invoke fcn call:{"function":"initLedger","Args":[]}'
    + println '\033[0;34minvoke fcn call:{"function":"initLedger","Args":[]}\033[0m'
    + echo -e '\033[0;34minvoke fcn call:{"function":"initLedger","Args":[]}\033[0m'
    invoke fcn call:{"function":"initLedger","Args":[]}
    + peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile /home/lennon/桌面/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n fabcar --peerAddresses localhost:7051 --tlsRootCertFiles /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses localhost:9051 --tlsRootCertFiles /home/lennon/桌面/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt --isInit -c '{"function":"initLedger","Args":[]}'
    + res=0
    2020-12-05 11:54:11.821 CST [chaincodeCmd] chaincodeInvokeOrQuery -> INFO 001 Chaincode invoke successful. result: status:200 
    Invoke transaction successful on peer0.org1 peer0.org2 on channel 'mychannel'
    /home/lennon/桌面/fabric-samples/fabcar
    
    Total setup execution time : 197 secs ...
    
    Next, use the FabCar applications to interact with the deployed FabCar contract.
    The FabCar applications are available in multiple programming languages.
    Follow the instructions for the programming language of your choice:
    
    JavaScript:
    
      Start by changing into the "javascript" directory:
        cd javascript
    
      Next, install all required packages:
        npm install
    
      Then run the following applications to enroll the admin user, and register a new user
      called appUser which will be used by the other applications to interact with the deployed
      FabCar contract:
        node enrollAdmin
        node registerUser
    
      You can run the invoke application as follows. By default, the invoke application will
      create a new car, but you can update the application to submit other transactions:
        node invoke
    
      You can run the query application as follows. By default, the query application will
      return all cars, but you can update the application to evaluate other transactions:
        node query
    
    TypeScript:
    
      Start by changing into the "typescript" directory:
        cd typescript
    
      Next, install all required packages:
        npm install
    
      Next, compile the TypeScript code into JavaScript:
        npm run build
    
      Then run the following applications to enroll the admin user, and register a new user
      called appUser which will be used by the other applications to interact with the deployed
      FabCar contract:
        node dist/enrollAdmin
        node dist/registerUser
    
      You can run the invoke application as follows. By default, the invoke application will
      create a new car, but you can update the application to submit other transactions:
        node dist/invoke
    
      You can run the query application as follows. By default, the query application will
      return all cars, but you can update the application to evaluate other transactions:
        node dist/query
    
    Java:
    
      Start by changing into the "java" directory:
        cd java
    
      Then, install dependencies and run the test using:
        mvn test
    
      The test will invoke the sample client app which perform the following:
        - Enroll admin and appUser and import them into the wallet (if they don't already exist there)
        - Submit a transaction to create a new car
        - Evaluate a transaction (query) to return details of this car
        - Submit a transaction to change the owner of this car
        - Evaluate a transaction (query) to return the updated details of this car
    
    Go:
    
      Start by changing into the "go" directory:
        cd go
    
      Then, install dependencies and run the test using:
        go run fabcar.go
    
      The test will invoke the sample client app which perform the following:
        - Import user credentials into the wallet (if they don't already exist there)
        - Submit a transaction to create a new car
        - Evaluate a transaction (query) to return details of this car
        - Submit a transaction to change the owner of this car
        - Evaluate a transaction (query) to return the updated details of this car
    
    root@lennon-System-Product-Name:/home/lennon/桌面/fabric-samples/fabcar# cd /home/lennon/桌面/fabric-samples/test-network
    root@lennon-System-Product-Name:/home/lennon/桌面/fabric-samples/test-network# peer chaincode query -C mychannel -n fabcar -c '{"Args":["queryAllCars"]}'
    [{"Key":"CAR0","Record":{"make":"Toyota","model":"Prius","colour":"blue","owner":"Tomoko"}},{"Key":"CAR1","Record":{"make":"Ford","model":"Mustang","colour":"red","owner":"Brad"}},{"Key":"CAR2","Record":{"make":"Hyundai","model":"Tucson","colour":"green","owner":"Jin Soo"}},{"Key":"CAR3","Record":{"make":"Volkswagen","model":"Passat","colour":"yellow","owner":"Max"}},{"Key":"CAR4","Record":{"make":"Tesla","model":"S","colour":"black","owner":"Adriana"}},{"Key":"CAR5","Record":{"make":"Peugeot","model":"205","colour":"purple","owner":"Michel"}},{"Key":"CAR6","Record":{"make":"Chery","model":"S22L","colour":"white","owner":"Aarav"}},{"Key":"CAR7","Record":{"make":"Fiat","model":"Punto","colour":"violet","owner":"Pari"}},{"Key":"CAR8","Record":{"make":"Tata","model":"Nano","colour":"indigo","owner":"Valeria"}},{"Key":"CAR9","Record":{"make":"Holden","model":"Barina","colour":"brown","owner":"Shotaro"}}]
    

    相关文章

      网友评论

          本文标题:hyperledger-fabric-sample-2

          本文链接:https://www.haomeiwen.com/subject/qxjgwktx.html