wujian0327 / CP-ABE-Blockchain

CP-ABE-Blockchain experiments
9 stars 2 forks source link

如您推荐的一样,我的go版本为1.18,但是仍然报错 #2

Open Oracle0927 opened 3 weeks ago

Oracle0927 commented 3 weeks ago

如题,我在多次尝试运行go test -v ./test/ -run=TestGetBlockData这一步时候报错: go test -v ./test/ -run=TestGetBlockData === RUN TestGetBlockData fabric_sdk_test.go:19: failed to get ledgerClient: could not get chConfig cache reference: QueryBlockConfig failed: QueryBlockConfig failed: queryChaincode failed: Transaction processing for endorser [peer0.org1.example.com:7051]: Endorser Client Status Code: (2) CONNECTION_FAILED. Description: dialing connection on target [peer0.org1.example.com:7051]: connection is in TRANSIENT_FAILURE --- FAIL: TestGetBlockData (1.53s) panic: runtime error: invalid memory address or nil pointer dereference [recovered] panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0xb0 pc=0xc0d47d]

goroutine 66 [running]: testing.tRunner.func1.2({0xcf4200, 0x15a42e0}) /usr/local/go/src/testing/testing.go:1389 +0x24e testing.tRunner.func1() /usr/local/go/src/testing/testing.go:1392 +0x39f panic({0xcf4200, 0x15a42e0}) /usr/local/go/src/runtime/panic.go:838 +0x207 github.com/hyperledger/fabric-sdk-go/pkg/fabsdk.(FabricSDK).Close(0x0) /home/a2/go/pkg/mod/github.com/hyperledger/fabric-sdk-go@v1.0.0/pkg/fabsdk/fabsdk.go:334 +0x5d CP-ABE-Blockchain/test.TestGetBlockData(0xc000503520) /home/a2/Desktop/CP-ABE-Blockchain/test/fabric_sdk_test.go:20 +0xf5 testing.tRunner(0xc000503520, 0xea7d50) /usr/local/go/src/testing/testing.go:1439 +0x102 created by testing.(T).Run /usr/local/go/src/testing/testing.go:1486 +0x35f FAIL CP-ABE-Blockchain/test 1.569s FAIL

wujian0327 commented 3 weeks ago

Maybe you can check if you can access the fabric node normally. Try:

telnet peer0.org1.example.com 7051

You should see: image