FabCar Hyperledger Fabric ./startFabric.sh执行不完全有效

问题描述 投票:0回答:1

我正在试验Hyperledger Fabric FabCar基本示例。

使用registerAdmin.js和registerUser.js成功注册了管理员和用户。运行节点query.js后,我当前遇到此错误。

~/fabric-samples/fabcar$ node query.js 
Store path:/home/****/fabric-samples/fabcar/hfc-key-store
Successfully loaded user1 from persistence
2020-02-21T07:08:00.564Z - error: [Remote.js]: Error: Failed to connect before the deadline URL:grpc://localhost:7051
Query has completed, checking results
error from query =  { Error: Failed to connect before the deadline URL:grpc://localhost:7051
    at checkState (/home/****/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc/src/client.js:833:16) connectFailed: true }

在我以前的question中类似地提到过>

同时检查docker ps -a

时,我发现对等端已退出
~/fabric-samples/fabcar$ docker ps -a
CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS                      PORTS                                        NAMES
1619413cd23c        hyperledger/fabric-peer      "peer node start"        13 minutes ago      Exited (2) 12 minutes ago                                                peer0.org1.example.com
de74d2459574        hyperledger/fabric-couchdb   "tini -- /docker-ent…"   13 minutes ago      Up 13 minutes               4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp   couchdb
356fb281acbe        hyperledger/fabric-orderer   "orderer"                13 minutes ago      Up 13 minutes               0.0.0.0:7050->7050/tcp                       orderer.example.com
5e52be445c99        hyperledger/fabric-ca        "sh -c 'fabric-ca-se…"   13 minutes ago      Up 13 minutes               0.0.0.0:7054->7054/tcp                       ca.example.com

检查工作流程后,我发现./ startFabric.sh

执行未完全运行,在INFO 001 Endorser和订购者连接已初始化之后,它退出了。
~/fabric-samples/fabcar$ ./startFabric.sh

# don't rewrite paths for Windows Git Bash users
export MSYS_NO_PATHCONV=1

docker-compose -f docker-compose.yml down
Removing network net_basic

docker-compose -f docker-compose.yml up -d ca.example.com orderer.example.com peer0.org1.example.com couchdb
Creating network "net_basic" with the default driver
Creating ca.example.com      ... done
Creating couchdb             ... done
Creating orderer.example.com ... done
Creating peer0.org1.example.com ... done

# wait for Hyperledger Fabric to start
# incase of errors when running later commands, issue export FABRIC_START_TIMEOUT=<larger number>
export FABRIC_START_TIMEOUT=10
#echo ${FABRIC_START_TIMEOUT}
sleep ${FABRIC_START_TIMEOUT}

# Create the channel
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/[email protected]/msp" peer0.org1.example.com peer channel create -o orderer.example.com:7050 -c mychannel -f /etc/hyperledger/configtx/channel.tx
2020-02-21 07:07:06.183 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-02-21 07:07:06.222 UTC [channelCmd] InitCmdFactory -> INFO 002 Endorser and orderer connections initialized
2020-02-21 07:07:06.432 UTC [main] main -> INFO 003 Exiting.....
# Join peer0.org1.example.com to the channel.
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/[email protected]/msp" peer0.org1.example.com peer channel join -b mychannel.block
2020-02-21 07:07:06.907 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized

:~/fabric-samples/fabcar$

请注意。

*已用Conatiner的Docker日志更新:

2020-02-21 08:51:13.123 UTC [nodeCmd] serve -> INFO 001 Starting peer:
 Version: 1.1.0
 Go version: go1.9.2
 OS/Arch: linux/amd64
 Experimental features: false
 Chaincode:
  Base Image Version: 0.4.6
  Base Docker Namespace: hyperledger
  Base Docker Label: org.hyperledger.fabric
  Docker Namespace: hyperledger

2020-02-21 08:51:13.123 UTC [ledgermgmt] initialize -> INFO 002 Initializing ledger mgmt
2020-02-21 08:51:13.123 UTC [kvledger] NewProvider -> INFO 003 Initializing ledger provider
2020-02-21 08:51:13.795 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 004 Created state database _users
2020-02-21 08:51:14.058 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 005 Created state database _replicator
2020-02-21 08:51:14.326 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 006 Created state database _global_changes
2020-02-21 08:51:14.366 UTC [kvledger] NewProvider -> INFO 007 ledger provider Initialized
2020-02-21 08:51:14.366 UTC [ledgermgmt] initialize -> INFO 008 ledger mgmt initialized
2020-02-21 08:51:14.367 UTC [peer] func1 -> INFO 009 Auto-detected peer address: 172.25.0.5:7051
2020-02-21 08:51:14.368 UTC [peer] func1 -> INFO 00a Returning peer0.org1.example.com:7051
2020-02-21 08:51:14.368 UTC [peer] func1 -> INFO 00b Auto-detected peer address: 172.25.0.5:7051
2020-02-21 08:51:14.368 UTC [peer] func1 -> INFO 00c Returning peer0.org1.example.com:7051
2020-02-21 08:51:14.373 UTC [eventhub_producer] start -> INFO 00d Event processor started
2020-02-21 08:51:14.374 UTC [nodeCmd] computeChaincodeEndpoint -> INFO 00e Entering computeChaincodeEndpoint with peerHostname: peer0.org1.example.com
2020-02-21 08:51:14.375 UTC [nodeCmd] computeChaincodeEndpoint -> INFO 00f Exit with ccEndpoint: peer0.org1.example.com:7052
2020-02-21 08:51:14.375 UTC [nodeCmd] createChaincodeServer -> WARN 010 peer.chaincodeListenAddress is not set, using peer0.org1.example.com:7052
2020-02-21 08:51:14.378 UTC [chaincode] NewChaincodeSupport -> INFO 011 Chaincode support using peerAddress: peer0.org1.example.com:7052
2020-02-21 08:51:14.379 UTC [sccapi] registerSysCC -> INFO 012 system chaincode cscc(github.com/hyperledger/fabric/core/scc/cscc) registered
2020-02-21 08:51:14.380 UTC [sccapi] registerSysCC -> INFO 013 system chaincode lscc(github.com/hyperledger/fabric/core/scc/lscc) registered
2020-02-21 08:51:14.380 UTC [sccapi] registerSysCC -> INFO 014 system chaincode escc(github.com/hyperledger/fabric/core/scc/escc) registered
2020-02-21 08:51:14.380 UTC [sccapi] registerSysCC -> INFO 015 system chaincode vscc(github.com/hyperledger/fabric/core/scc/vscc) registered
2020-02-21 08:51:14.380 UTC [sccapi] registerSysCC -> INFO 016 system chaincode qscc(github.com/hyperledger/fabric/core/chaincode/qscc) registered
2020-02-21 08:51:14.382 UTC [gossip/service] func1 -> INFO 017 Initialize gossip with endpoint peer0.org1.example.com:7051 and bootstrap set [127.0.0.1:7051]
2020-02-21 08:51:14.386 UTC [msp] DeserializeIdentity -> INFO 018 Obtaining identity
2020-02-21 08:51:14.389 UTC [gossip/discovery] NewDiscoveryService -> INFO 019 Started { [] [61 97 241 125 96 173 40 203 239 81 147 191 102 161 39 23 0 117 69 217 56 120 139 152 120 223 29 9 23 115 238 6] peer0.org1.example.com:7051 <nil>} incTime is 1582275074389049506
2020-02-21 08:51:14.389 UTC [gossip/gossip] NewGossipService -> INFO 01a Creating gossip service with self membership of { [] [61 97 241 125 96 173 40 203 239 81 147 191 102 161 39 23 0 117 69 217 56 120 139 152 120 223 29 9 23 115 238 6] peer0.org1.example.com:7051 <nil>}
2020-02-21 08:51:14.392 UTC [gossip/gossip] NewGossipService -> WARN 01b External endpoint is empty, peer will not be accessible outside of its organization
2020-02-21 08:51:14.392 UTC [gossip/gossip] start -> INFO 01c Gossip instance peer0.org1.example.com:7051 started
2020-02-21 08:51:14.393 UTC [cscc] Init -> INFO 01d Init CSCC
2020-02-21 08:51:14.393 UTC [sccapi] deploySysCC -> INFO 01e system chaincode cscc/(github.com/hyperledger/fabric/core/scc/cscc) deployed
2020-02-21 08:51:14.394 UTC [sccapi] deploySysCC -> INFO 01f system chaincode lscc/(github.com/hyperledger/fabric/core/scc/lscc) deployed
2020-02-21 08:51:14.395 UTC [escc] Init -> INFO 020 Successfully initialized ESCC
2020-02-21 08:51:14.395 UTC [sccapi] deploySysCC -> INFO 021 system chaincode escc/(github.com/hyperledger/fabric/core/scc/escc) deployed
2020-02-21 08:51:14.395 UTC [sccapi] deploySysCC -> INFO 022 system chaincode vscc/(github.com/hyperledger/fabric/core/scc/vscc) deployed
2020-02-21 08:51:14.396 UTC [qscc] Init -> INFO 023 Init QSCC
2020-02-21 08:51:14.396 UTC [sccapi] deploySysCC -> INFO 024 system chaincode qscc/(github.com/hyperledger/fabric/core/chaincode/qscc) deployed
2020-02-21 08:51:14.396 UTC [nodeCmd] initSysCCs -> INFO 025 Deployed system chaincodes
2020-02-21 08:51:14.397 UTC [nodeCmd] serve -> INFO 026 Starting peer with ID=[name:"peer0.org1.example.com" ], network ID=[dev], address=[peer0.org1.example.com:7051]
2020-02-21 08:51:14.398 UTC [nodeCmd] serve -> INFO 027 Started peer with ID=[name:"peer0.org1.example.com" ], network ID=[dev], address=[peer0.org1.example.com:7051]
2020-02-21 08:51:24.451 UTC [ledgermgmt] CreateLedger -> INFO 028 Creating ledger [mychannel] with genesis block
2020-02-21 08:51:24.488 UTC [fsblkstorage] newBlockfileMgr -> INFO 029 Getting block information from block storage
2020-02-21 08:51:25.005 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 02a Created state database mychannel_
2020-02-21 08:51:25.145 UTC [kvledger] CommitWithPvtData -> INFO 02b Channel [mychannel]: Committed block [0] with 1 transaction(s)
2020-02-21 08:51:25.151 UTC [couchdb] CreateCouchDatabase -> ERRO 02c Error during CouchDB CreateDatabaseIfNotExist() for dbName: mychannel_  error: json: cannot unmarshal string into Go struct field DBInfo.purge_seq of type int
panic: Error during commit to txmgr:json: cannot unmarshal string into Go struct field DBInfo.purge_seq of type int

goroutine 87 [running]:
github.com/hyperledger/fabric/core/ledger/kvledger.(*kvLedger).CommitWithPvtData(0xc420058180, 0xc4215a7200, 0x0, 0x0)
    /opt/gopath/src/github.com/hyperledger/fabric/core/ledger/kvledger/kv_ledger.go:251 +0x921
github.com/hyperledger/fabric/core/ledger/kvledger.(*Provider).Create(0xc4201aa200, 0xc4216da360, 0x27, 0xc421708250, 0x1, 0x1)
    /opt/gopath/src/github.com/hyperledger/fabric/core/ledger/kvledger/kv_ledger_provider.go:107 +0x37f
github.com/hyperledger/fabric/core/ledger/ledgermgmt.CreateLedger(0xc4216da360, 0x0, 0x0, 0x0, 0x0)
    /opt/gopath/src/github.com/hyperledger/fabric/core/ledger/ledgermgmt/ledger_mgmt.go:88 +0x1ac
github.com/hyperledger/fabric/core/peer.CreateChainFromBlock(0xc4216da360, 0x40000000000, 0x10)
    /opt/gopath/src/github.com/hyperledger/fabric/core/peer/peer.go:433 +0x64
github.com/hyperledger/fabric/core/scc/cscc.joinChain(0xc42165d360, 0x9, 0xc4216da360, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /opt/gopath/src/github.com/hyperledger/fabric/core/scc/cscc/configure.go:212 +0x65
github.com/hyperledger/fabric/core/scc/cscc.(*PeerConfiger).Invoke(0x169e160, 0x166f740, 0xc42032d220, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /opt/gopath/src/github.com/hyperledger/fabric/core/scc/cscc/configure.go:140 +0xa1e
github.com/hyperledger/fabric/core/chaincode/shim.(*Handler).handleTransaction.func1(0xc4202419d0, 0xc4216bed80)
    /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim/handler.go:329 +0x4f3
created by github.com/hyperledger/fabric/core/chaincode/shim.(*Handler).handleTransaction
    /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim/handler.go:295 +0x49

正在试验Hyperledger Fabric FabCar的基本示例。使用registerAdmin.js和registerUser.js成功注册了管理员和用户。运行节点查询后,我当前遇到此错误。...

node.js docker hyperledger-fabric hyperledger hyperledger-chaincode
1个回答
0
投票

我通过使用以下路径从路径[[fabric-samples / basic-network

© www.soinside.com 2019 - 2024. All rights reserved.