ここで説明する仕様に基づいてカスタムビジネスネットワークを作成しようとしました: https://hyperledger-fabric.readthedocs.io/en/latest/build_network.html#using-couchdb
Org1.example.com用に5つのピアを作成し、org2.example.com用に1つのピアを作成しました。
ネットワークを起動し、peer0.org1.example.comでdocker cliを使用してチェーンコードをインストールできますが、インスタンス化しようとすると、次のエラーが発生します。
エラー:チェーンコードの承認エラー:rpcエラー:コード=不明なdesc =コンテナの起動エラー:APIエラー(404):{"メッセージ": "ネットワーク_byfnが見つかりません"}
これがbusineesネットワークロガーの出力です:
peer0.org1.example.com | 2017-10-16 15:59:20.826 UTC [ccprovider] NewCCContext -> DEBU 3c1 NewCCCC (chain=c1,chaincode=mycc,version=1.0,txid=cc0e1367388a59a5186343adc6d4e526004728c73d53070e794d9f663e704795,syscc=false,proposal=0xc421b9fea0,canname=mycc:1.0
peer0.org1.example.com | 2017-10-16 15:59:20.826 UTC [chaincode] Launch -> DEBU 3c2 launchAndWaitForRegister fetched 2411 bytes from file system
peer0.org1.example.com | 2017-10-16 15:59:20.826 UTC [chaincode] launchAndWaitForRegister -> DEBU 3c3 chaincode mycc:1.0 is being launched
peer0.org1.example.com | 2017-10-16 15:59:20.826 UTC [chaincode] getArgsAndEnv -> DEBU 3c4 Executable is chaincode
peer0.org1.example.com | 2017-10-16 15:59:20.826 UTC [chaincode] getArgsAndEnv -> DEBU 3c5 Args [chaincode -peer.address=peer0.org1.example.com:7051]
peer0.org1.example.com | 2017-10-16 15:59:20.827 UTC [chaincode] launchAndWaitForRegister -> DEBU 3c6 start container: mycc:1.0(networkid:dev,peerid:peer0.org1.example.com)
peer0.org1.example.com | 2017-10-16 15:59:20.827 UTC [chaincode] launchAndWaitForRegister -> DEBU 3c7 start container with args: chaincode -peer.address=peer0.org1.example.com:7051
peer0.org1.example.com | 2017-10-16 15:59:20.827 UTC [chaincode] launchAndWaitForRegister -> DEBU 3c8 start container with env:
peer0.org1.example.com | CORE_CHAINCODE_ID_NAME=mycc:1.0
peer0.org1.example.com | CORE_PEER_TLS_ENABLED=true
peer0.org1.example.com | CORE_CHAINCODE_LOGGING_LEVEL=info
peer0.org1.example.com | CORE_CHAINCODE_LOGGING_SHIM=warning
peer0.org1.example.com | CORE_CHAINCODE_LOGGING_FORMAT=%{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} -> %{level:.4s} %{id:03x}%{color:reset} %{message}
peer0.org1.example.com | 2017-10-16 15:59:20.827 UTC [container] lockContainer -> DEBU 3c9 waiting for container(dev-peer0.org1.example.com-mycc-1.0) lock
peer0.org1.example.com | 2017-10-16 15:59:20.827 UTC [container] lockContainer -> DEBU 3ca got container (dev-peer0.org1.example.com-mycc-1.0) lock
peer0.org1.example.com | 2017-10-16 15:59:20.827 UTC [dockercontroller] Start -> DEBU 3cb Cleanup container dev-peer0.org1.example.com-mycc-1.0
peer0.org1.example.com | 2017-10-16 15:59:20.832 UTC [dockercontroller] stopInternal -> DEBU 3cc Stop container dev-peer0.org1.example.com-mycc-1.0(No such container: dev-peer0.org1.example.com-mycc-1.0)
peer0.org1.example.com | 2017-10-16 15:59:20.834 UTC [dockercontroller] stopInternal -> DEBU 3cd Kill container dev-peer0.org1.example.com-mycc-1.0 (No such container: dev-peer0.org1.example.com-mycc-1.0)
peer0.org1.example.com | 2017-10-16 15:59:20.835 UTC [dockercontroller] stopInternal -> DEBU 3ce Remove container dev-peer0.org1.example.com-mycc-1.0 (No such container: dev-peer0.org1.example.com-mycc-1.0)
peer0.org1.example.com | 2017-10-16 15:59:20.836 UTC [dockercontroller] Start -> DEBU 3cf Start container dev-peer0.org1.example.com-mycc-1.0
peer0.org1.example.com | 2017-10-16 15:59:20.836 UTC [dockercontroller] getDockerHostConfig -> DEBU 3d0 docker container hostconfig NetworkMode: _byfn
peer0.org1.example.com | 2017-10-16 15:59:20.836 UTC [dockercontroller] createContainer -> DEBU 3d1 Create container: dev-peer0.org1.example.com-mycc-1.0
peer0.org1.example.com | 2017-10-16 15:59:20.844 UTC [dockercontroller] Start -> DEBU 3d2 start-could not find image <dev-peer0.org1.example.com-mycc-1.0-384f11f484b9302df90b453200cfb25174305fce8f53f4e94d45ee3b6cab0ce9> (container id <dev-peer0.org1.example.com-mycc-1.0>), because of <no such image>...attempt to recreate image
peer0.org1.example.com | 2017-10-16 15:59:20.844 UTC [chaincode-platform] generateDockerfile -> DEBU 3d3
peer0.org1.example.com | FROM hyperledger/fabric-baseos:x86_64-0.3.2
peer0.org1.example.com | ADD binpackage.tar /usr/local/bin
peer0.org1.example.com | LABEL org.hyperledger.fabric.chaincode.id.name="mycc" \
peer0.org1.example.com | org.hyperledger.fabric.chaincode.id.version="1.0" \
peer0.org1.example.com | org.hyperledger.fabric.chaincode.type="GOLANG" \
peer0.org1.example.com | org.hyperledger.fabric.version="1.0.2" \
peer0.org1.example.com | org.hyperledger.fabric.base.version="0.3.2"
peer0.org1.example.com | ENV CORE_CHAINCODE_BUILDLEVEL=1.0.2
peer0.org1.example.com | ENV CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/peer.crt
peer0.org1.example.com | COPY peer.crt /etc/hyperledger/fabric/peer.crt
peer0.org1.example.com | 2017-10-16 15:59:20.846 UTC [util] DockerBuild -> DEBU 3d4 Attempting build with image hyperledger/fabric-ccenv:x86_64-1.0.2
peer0.org1.example.com | 2017-10-16 15:59:46.596 UTC [dockercontroller] deployImage -> DEBU 3d5 Created image: dev-peer0.org1.example.com-mycc-1.0-384f11f484b9302df90b453200cfb25174305fce8f53f4e94d45ee3b6cab0ce9
peer0.org1.example.com | 2017-10-16 15:59:46.596 UTC [dockercontroller] Start -> DEBU 3d6 start-recreated image successfully
peer0.org1.example.com | 2017-10-16 15:59:46.596 UTC [dockercontroller] createContainer -> DEBU 3d7 Create container: dev-peer0.org1.example.com-mycc-1.0
peer0.org1.example.com | 2017-10-16 15:59:46.664 UTC [dockercontroller] createContainer -> DEBU 3d8 Created container: dev-peer0.org1.example.com-mycc-1.0-384f11f484b9302df90b453200cfb25174305fce8f53f4e94d45ee3b6cab0ce9
peer0.org1.example.com | 2017-10-16 15:59:46.745 UTC [dockercontroller] Start -> ERRO 3d9 start-could not start container: API error (404): {"message":"network _byfn not found"}
peer0.org1.example.com | 2017-10-16 15:59:46.745 UTC [container] unlockContainer -> DEBU 3da container lock deleted(dev-peer0.org1.example.com-mycc-1.0)
peer0.org1.example.com | 2017-10-16 15:59:46.745 UTC [chaincode] func1 -> DEBU 3db chaincode mycc:1.0 launch seq completed
peer0.org1.example.com | 2017-10-16 15:59:46.745 UTC [chaincode] **Launch -> ERRO 3dc launchAndWaitForRegister failed Error starting container: API error (404): {"message":"network _byfn not found"}**
peer0.org1.example.com | 2017-10-16 15:59:46.745 UTC [endorser] callChaincode -> DEBU 3dd Exit
peer0.org1.example.com | 2017-10-16 15:59:46.745 UTC [endorser] simulateProposal -> ERRO 3de failed to invoke chaincode name:"lscc" on transaction cc0e1367388a59a5186343adc6d4e526004728c73d53070e794d9f663e704795, error: Error starting container: API error (404): {"message":"network _byfn not found"}
peer0.org1.example.com | 2017-10-16 15:59:46.745 UTC [endorser] simulateProposal -> DEBU 3df Exit
peer0.org1.example.com | 2017-10-16 15:59:46.745 UTC [lockbasedtxmgr] Done -> DEBU 3e0 Done with transaction simulation / query execution [1a086ccc-1882-413a-a679-047b8478fae0]
peer0.org1.example.com | 2017-10-16 15:59:46.745 UTC [endorser] ProcessProposal -> DEBU 3e1 Exit
orderer.example.com | 2017-10-16 15:59:46.748 UTC [orderer/common/broadcast] Handle -> WARN 8de Error reading from stream: rpc error: code = Canceled desc = context canceled
orderer.example.com | 2017-10-16 15:59:46.748 UTC [orderer/main] func1 -> DEBU 8df Closing Broadcast stream
^Fpeer0.org1.example.com | 2017-10-16 16:04:03.628 UTC [endorser] ProcessProposal -> DEBU 3e2 Entry
peer0.org1.example.com | 2017-10-16 16:04:03.628 UTC [protoutils] ValidateProposalMessage -> DEBU 3e3 ValidateProposalMessage starts for signed proposal 0xc4218fa060
peer0.org1.example.com | 2017-10-16 16:04:03.628 UTC [protoutils] validateChannelHeader -> DEBU 3e4 validateChannelHeader info: header type 3
peer0.org1.example.com | 2017-10-16 16:04:03.628 UTC [protoutils] checkSignatureFromCreator -> DEBU 3e5 checkSignatureFromCreator starts
peer0.org1.example.com | 2017-10-16 16:04:03.629 UTC [protoutils] checkSignatureFromCreator -> DEBU 3e6 checkSignatureFromCreator info: creator is &{Org1MSP 3cd83aa899c76517d9acd559d130c87e9c8bc4ca893f4116d7dbc85b14b734d3}
peer0.org1.example.com | 2017-10-16 16:04:03.629 UTC [protoutils] checkSignatureFromCreator -> DEBU 3e7 checkSignatureFromCreator info: creator is valid
peer0.org1.example.com | 2017-10-16 16:04:03.629 UTC [protoutils] checkSignatureFromCreator -> DEBU 3e8 checkSignatureFromCreator exists successfully
peer0.org1.example.com | 2017-10-16 16:04:03.629 UTC [protoutils] validateChaincodeProposalMessage -> DEBU 3e9 validateChaincodeProposalMessage starts for proposal 0xc421d14aa0, header 0xc4218fa090
peer0.org1.example.com | 2017-10-16 16:04:03.629 UTC [protoutils] validateChaincodeProposalMessage -> DEBU 3ea validateChaincodeProposalMessage info: header extension references chaincode name:"mycc"
peer0.org1.example.com | 2017-10-16 16:04:03.629 UTC [endorser] ProcessProposal -> DEBU 3eb processing txid: 854682493d27b8613c504f0780f750520367f328a63526516191727f33a355eb
peer0.org1.example.com | 2017-10-16 16:04:03.629 UTC [fsblkstorage] retrieveTransactionByID -> DEBU 3ec retrieveTransactionByID() - txId = [854682493d27b8613c504f0780f750520367f328a63526516191727f33a355eb]
peer0.org1.example.com | 2017-10-16 16:04:03.630 UTC [lockbasedtxmgr] NewTxSimulator -> DEBU 3ed constructing new tx simulator
peer0.org1.example.com | 2017-10-16 16:04:03.630 UTC [lockbasedtxmgr] newLockBasedTxSimulator -> DEBU 3ee constructing new tx simulator [18598d15-803e-4ca0-87dd-6da03d90c9a8]
peer0.org1.example.com | 2017-10-16 16:04:03.630 UTC [endorser] simulateProposal -> DEBU 3ef Entry - txid: 854682493d27b8613c504f0780f750520367f328a63526516191727f33a355eb channel id: c1
peer0.org1.example.com | 2017-10-16 16:04:03.630 UTC [ccprovider] NewCCContext -> DEBU 3f0 NewCCCC (chain=c1,chaincode=lscc,version=1.0.2,txid=854682493d27b8613c504f0780f750520367f328a63526516191727f33a355eb,syscc=true,proposal=0xc421d14aa0,canname=lscc:1.0.2
peer0.org1.example.com | 2017-10-16 16:04:03.630 UTC [chaincode] Launch -> DEBU 3f1 chaincode is running(no need to launch) : lscc:1.0.2
peer0.org1.example.com | 2017-10-16 16:04:03.630 UTC [chaincode] Execute -> DEBU 3f2 Entry
peer0.org1.example.com | 2017-10-16 16:04:03.630 UTC [chaincode] Execute -> DEBU 3f3 chaincode canonical name: lscc:1.0.2
peer0.org1.example.com | 2017-10-16 16:04:03.630 UTC [chaincode] sendExecuteMessage -> DEBU 3f4 [85468249]Inside sendExecuteMessage. Message TRANSACTION
peer0.org1.example.com | 2017-10-16 16:04:03.630 UTC [chaincode] setChaincodeProposal -> DEBU 3f5 Setting chaincode proposal context...
peer0.org1.example.com | 2017-10-16 16:04:03.630 UTC [chaincode] setChaincodeProposal -> DEBU 3f6 Proposal different from nil. Creating chaincode proposal context...
peer0.org1.example.com | 2017-10-16 16:04:03.630 UTC [chaincode] sendExecuteMessage -> DEBU 3f7 [85468249]sendExecuteMsg trigger event TRANSACTION
peer0.org1.example.com | 2017-10-16 16:04:03.630 UTC [chaincode] processStream -> DEBU 3f8 [85468249]Move state message TRANSACTION
peer0.org1.example.com | 2017-10-16 16:04:03.630 UTC [chaincode] HandleMessage -> DEBU 3f9 [85468249]Fabric side Handling ChaincodeMessage of type: TRANSACTION in state ready
peer0.org1.example.com | 2017-10-16 16:04:03.630 UTC [chaincode] filterError -> DEBU 3fa Ignoring NoTransitionError: no transition
peer0.org1.example.com | 2017-10-16 16:04:03.630 UTC [chaincode] processStream -> DEBU 3fb [85468249]sending state message TRANSACTION
peer0.org1.example.com | 2017-10-16 16:04:03.630 UTC [shim] func1 -> DEBU 3fc [85468249]Received message TRANSACTION from shim
peer0.org1.example.com | 2017-10-16 16:04:03.630 UTC [shim] handleMessage -> DEBU 3fd [85468249]Handling ChaincodeMessage of type: TRANSACTION(state:ready)
peer0.org1.example.com | 2017-10-16 16:04:03.630 UTC [shim] beforeTransaction -> DEBU 3fe [85468249]Received TRANSACTION, invoking transaction on chaincode(Src:ready, Dst:ready)
peer0.org1.example.com | 2017-10-16 16:04:03.631 UTC [shim] handleGetState -> DEBU 3ff [85468249]Sending GET_STATE
peer0.org1.example.com | 2017-10-16 16:04:03.631 UTC [chaincode] processStream -> DEBU 400 [85468249]Received message GET_STATE from shim
peer0.org1.example.com | 2017-10-16 16:04:03.631 UTC [chaincode] HandleMessage -> DEBU 401 [85468249]Fabric side Handling ChaincodeMessage of type: GET_STATE in state ready
peer0.org1.example.com | 2017-10-16 16:04:03.631 UTC [chaincode] afterGetState -> DEBU 402 [85468249]Received GET_STATE, invoking get state from ledger
peer0.org1.example.com | 2017-10-16 16:04:03.631 UTC [chaincode] filterError -> DEBU 403 Ignoring NoTransitionError: no transition
peer0.org1.example.com | 2017-10-16 16:04:03.631 UTC [chaincode] func1 -> DEBU 404 [85468249] getting state for chaincode lscc, key mycc, channel c1
peer0.org1.example.com | 2017-10-16 16:04:03.631 UTC [statecouchdb] GetState -> DEBU 405 GetState(). ns=lscc, key=mycc
peer0.org1.example.com | 2017-10-16 16:04:03.631 UTC [couchdb] ReadDoc -> DEBU 406 Entering ReadDoc() id=[lsccmycc]
peer0.org1.example.com | 2017-10-16 16:04:03.631 UTC [couchdb] handleRequest -> DEBU 407 Entering handleRequest() method=GET url=http://couchdb0:5984/c1/lscc%00mycc?attachments=true
peer0.org1.example.com | 2017-10-16 16:04:03.632 UTC [couchdb] handleRequest -> DEBU 408 HTTP Request: GET /c1/lscc%00mycc?attachments=true HTTP/1.1 | Host: couchdb0:5984 | User-Agent: Go-http-client/1.1 | Accept: multipart/related | Accept-Encoding: gzip | |
peer0.org1.example.com | 2017-10-16 16:04:03.634 UTC [couchdb] handleRequest -> DEBU 409 Couch DB Error:not_found, Status Code:404, Reason:missing
peer0.org1.example.com | 2017-10-16 16:04:03.634 UTC [couchdb] ReadDoc -> DEBU 40a Document not found (404), returning nil value instead of 404 error
peer0.org1.example.com | 2017-10-16 16:04:03.634 UTC [chaincode] func1 -> DEBU 40b [85468249]No state associated with key: mycc. Sending RESPONSE with an empty payload
peer0.org1.example.com | 2017-10-16 16:04:03.634 UTC [chaincode] 1 -> DEBU 40c [85468249]handleGetState serial send RESPONSE
peer0.org1.example.com | 2017-10-16 16:04:03.634 UTC [shim] func1 -> DEBU 40d [85468249]Received message RESPONSE from shim
peer0.org1.example.com | 2017-10-16 16:04:03.634 UTC [shim] handleMessage -> DEBU 40e [85468249]Handling ChaincodeMessage of type: RESPONSE(state:ready)
peer0.org1.example.com | 2017-10-16 16:04:03.635 UTC [shim] sendChannel -> DEBU 40f [85468249]before send
peer0.org1.example.com | 2017-10-16 16:04:03.635 UTC [shim] sendChannel -> DEBU 410 [85468249]after send
peer0.org1.example.com | 2017-10-16 16:04:03.635 UTC [shim] afterResponse -> DEBU 411 [85468249]Received RESPONSE, communicated (state:ready)
peer0.org1.example.com | 2017-10-16 16:04:03.635 UTC [shim] handleGetState -> DEBU 412 [85468249]GetState received payload RESPONSE
peer0.org1.example.com | 2017-10-16 16:04:03.635 UTC [lscc] Invoke -> ERRO 413 error getting chaincode mycc on channel: c1(err:could not find chaincode with name 'mycc')
peer0.org1.example.com | 2017-10-16 16:04:03.635 UTC [shim] func1 -> DEBU 414 [85468249]Transaction completed. Sending COMPLETED
peer0.org1.example.com | 2017-10-16 16:04:03.635 UTC [shim] func1 -> DEBU 415 [85468249]Move state message COMPLETED
peer0.org1.example.com | 2017-10-16 16:04:03.635 UTC [shim] handleMessage -> DEBU 416 [85468249]Handling ChaincodeMessage of type: COMPLETED(state:ready)
peer0.org1.example.com | 2017-10-16 16:04:03.635 UTC [shim] func1 -> DEBU 417 [85468249]send state message COMPLETED
peer0.org1.example.com | 2017-10-16 16:04:03.635 UTC [chaincode] processStream -> DEBU 418 [85468249]Received message COMPLETED from shim
peer0.org1.example.com | 2017-10-16 16:04:03.635 UTC [chaincode] HandleMessage -> DEBU 419 [85468249]Fabric side Handling ChaincodeMessage of type: COMPLETED in state ready
peer0.org1.example.com | 2017-10-16 16:04:03.635 UTC [chaincode] HandleMessage -> DEBU 41a [854682493d27b8613c504f0780f750520367f328a63526516191727f33a355eb]HandleMessage- COMPLETED. Notify
peer0.org1.example.com | 2017-10-16 16:04:03.635 UTC [chaincode] notify -> DEBU 41b notifying Txid:854682493d27b8613c504f0780f750520367f328a63526516191727f33a355eb
peer0.org1.example.com | 2017-10-16 16:04:03.635 UTC [chaincode] Execute -> DEBU 41c Exit
peer0.org1.example.com | 2017-10-16 16:04:03.635 UTC [endorser] simulateProposal -> DEBU 41d Exit
peer0.org1.example.com | 2017-10-16 16:04:03.635 UTC [lockbasedtxmgr] Done -> DEBU 41e Done with transaction simulation / query execution [18598d15-803e-4ca0-87dd-6da03d90c9a8]
peer0.org1.example.com | 2017-10-16 16:04:03.635 UTC [endorser] ProcessProposal -> DEBU 41f Exit
また、前述のエラーが発生するまで同じJIRAログを見つけました: https://jira.hyperledger.org/secure/attachment/12212/peer0.org1.example.com。 log 。
ご協力ありがとうございました!
編集2:peer0.org0.example.comからの.envファイル:
HOSTNAME=6998ded553e4
TERM=xterm
CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.Zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.Zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
CORE_PEER_PROFILE_ENABLED=true
CORE_PEER_GOSSIP_ORGLEADER=false
CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb0:5984
CORE_PEER_LOCALMSPID=Org1MSP
CORE_VM_ENDPOINT=unix:///Host/var/run/docker.sock
CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=
CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/opt/gopath/src/github.com/hyperledger/fabric/peer
CORE_PEER_TLS_ENABLED=true
CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=_byfn
CORE_PEER_ID=peer0.org1.example.com
SHLVL=1
HOME=/root
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
FABRIC_CFG_PATH=/etc/hyperledger/fabric
CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
CORE_LEDGER_STATE_STATEDATABASE=CouchDB
CORE_PEER_GOSSIP_USELEADERELECTION=true
_=/usr/bin/printenv
編集3:
peer0.org1.example.com | 2017-10-17 15:37:48.352 UTC [chaincode] Launch -> ERRO 52f launchAndWaitForRegister failed Timeout expired while starting chaincode mycc:1.0(networkid:dev,peerid:peer0.org1.example.com,tx:21de5c78faf2938ec4d64f3c3deb762bd20e56187921dddb895e8f4e1ced220f)
peer0.org1.example.com | 2017-10-17 15:37:48.352 UTC [endorser] callChaincode -> DEBU 530 Exit
peer0.org1.example.com | 2017-10-17 15:37:48.352 UTC [endorser] simulateProposal -> ERRO 531 failed to invoke chaincode name:"lscc" on transaction 21de5c78faf2938ec4d64f3c3deb762bd20e56187921dddb895e8f4e1ced220f, error: Timeout expired while starting chaincode mycc:1.0(networkid:dev,peerid:peer0.org1.example.com,tx:21de5c78faf2938ec4d64f3c3deb762bd20e56187921dddb895e8f4e1ced220f)
提供したログファイルからエラーを検査することにより、次のようになります。
peer0.org1.example.com | 2017-10-16 15:59:46.745 UTC [dockercontroller]開始-> ERRO 3d9開始-コンテナーを開始できませんでした:APIエラー(404):{"メッセージ": "ネットワーク_byfnが見つかりません"}
ネットワーク名に意図しないスペース文字network _byfn
が含まれているようです。したがって、docker-compose.yaml
ファイルで修正する必要があると思います。
CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE
環境変数の値を確認してください。 base/peer-base.yaml
にあります。
version: '2'
services:
peer-base:
image: hyperledger/fabric-peer
environment:
- CORE_VM_ENDPOINT=unix:///Host/var/run/docker.sock
# the following setting starts chaincode containers on the same
# bridge network as the peers
# https://docs.docker.com/compose/networking/
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=${COMPOSE_PROJECT_NAME}_byfn
#- CORE_LOGGING_LEVEL=ERROR
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false
- CORE_PEER_PROFILE_ENABLED=true
- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: peer node start
また、 .env
ファイルの内容を確認することもできます。通常は次のようになります。
COMPOSE_PROJECT_NAME=net
したがって、ここでの問題はCOMPOSE_PROJECT_NAME環境にあります。ネットワーク仕様のフォルダからネットワークを起動しようとすると、何らかの理由でこの環境が空のままになり、前述のエラーが発生します。ネットワーク仕様を/ fabric-samples/firtst-networkフォルダーにコピーして再起動しようとすると、COMPOSE_PROJECT_NAMEが「net」値に設定され、すべてが正常に機能します。また、この値を/base/peer-base.yamlの "net"にハードコードして、デフォルトフォルダーからネットワークを再起動しようとすると、ピアでタイムアウトERRが発生します。
編集1:
最終的な答えは次のようになります。前述のenvの.envファイルを設定していません。フォルダ内の変数。
私の場合、私が定義した.env
ファイルで
COMPOSE_PROJECT_NAME=xxx
そしてdocker-compose.ymlファイルで私は持っていました
version: '2'
networks:
yyy: <----------------
services:
...
...
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=zzz
...
...
ある時点で私は同じ問題に遭遇します
failed to invoke chaincode name:"lscc" , error: API error (404): network zzz not found
Dockerネットワーク(docker network ls
)を一覧表示すると、xxx_yyy
という名前のネットワークが作成されるため、基本的にCORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE
の値をxxx_yyy
に変更すると問題が解決します。
CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=xxx_yyy
COMPOSE_PROJECT_NAME=block_chain
を設定すると、同様のエラーが発生します。
Error: Error endorsing chaincode: rpc error: code = Unknown desc = error starting container:
API error (404): {"message":"network block_chain_network not found"}
しかし、ネットワークは実際にはblockchain_network
という名前で作成されました。したがって、私の場合は機能しませんでした。
私の観察:COMPOSE_PROJECT_NAME
は特殊文字を受け入れません。この後、COMPOSE_PROJECT_NAME=blockchain
を設定することで、チェーンコードを正常にインスタンス化できます。
これが同じ問題に遭遇する可能性のある他の人に役立つことを願っています。
これが機能するようになったときに気付いたもう1つの重要なことは、docker-compose-cli.yamlでネットワークとして指定する名前が「myconsortium」であるということです。
myorderer.myril.com:
container_name: myorderer.myril.com
extends:
file: base/docker-compose-base.yaml
service: myorderer.myril.com
networks:
- myconsortium
cORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE = $ {COMPOSE_PROJECT_NAME} _myconsortiumとしてpeer-base.yamlの値と一致する必要があります
scrpiptsが実行しているように見えるのは、cli.yamlで指定したネットワーク名を取得し、その前にenv変数を$ {COMPOSE_PROJECT_NAME} _として追加することです。