1

I am starting to work on Hyperledger Fabric with Java and for that, I am following the Build your first network tutorial. I am trying to install the chaincode on the peers but I keep getting the same problem and don't know how to solve it. I suppose it would be a problem with the address of the chaincode but I couldn't really correct it. I paste here also the webpage from where I got the tutorial. https://hyperledger-fabric.readthedocs.io/en/latest/build_network.html

The command used:

peer chaincode install -n mycc -v 1.0 -l java -p /opt/gopath/src/github.com/hyperledger/fabric-samples/chaincode/abstore/java/

The error:

panic: runtime error: invalid memory address or nil pointer dereference 
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xea273b]

The complete result:

checkChaincodeCmdParams -> INFO 001 Using default escc
2019-03-08 09:23:44.382 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vsccpanic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xea273b]
goroutine 1 [running]:
github.com/hyperledger/fabric/core/container/util.WriteFolderToTarPackage.func1(0x7ffd07ebd54a, 0x48, 0x0, 0x0, 0x1874100, 0xc00014be30, 0x60, 0x1691f40)      /opt/gopath/src/github.com/hyperledger/fabric/core/container/util/writer.go:64 +0xcb
path/filepath.Walk(0x7ffd07ebd54a, 0x48, 0xc000162240, 0x2, 0x3)      
/opt/go/src/path/filepath/path.go:402 +0x6a
github.com/hyperledger/fabric/core/container/util.WriteFolderToTarPackage(0xc00024c700, 0x7ffd07ebd54a, 0x48, 0xc0003f5858, 0x3, 0x3, 0x0, 0xc000135230, 0xc00024c700, 0x0)     /opt/gopath/src/github.com/hyperledger/fabric/core/container/util/writer.go:136 +0x241
github.com/hyperledger/fabric/core/container/util.WriteJavaProjectToPackage(0xc00024c700, 0x7ffd07ebd54a, 0x48, 0xc0003f5940, 0x1)      /opt/gopath/src/github.com/hyperledger/fabric/core/container/util/writer.go:152 +0x158
github.com/hyperledger/fabric/core/chaincode/platforms/java.(*Platform).GetDeploymentPayload(0x2429b40, 0x7ffd07ebd54a, 0x49, 0x4, 0xc0000bf968, 0x1716e01, 0x4, 0xc0003f59c0)       /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/platforms/java/platform.go:123 +0x1e0
github.com/hyperledger/fabric/core/chaincode/platforms.(*Registry).GetDeploymentPayload(0xc00031c460, 0x1716e08, 0x4, 0x7ffd07ebd54a, 0x49, 0x4, 0x7ffd07ebd54a, 0x49, 0x0, 0x0)        /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/platforms/platforms.go:103 +0x8f
github.com/hyperledger/fabric/core/container.GetChaincodePackageBytes(0xc00031c460, 0xc0002b9d00, 0x0, 0x16740c0, 0xc0001834a0, 0xc0002cbb94, 0x4)
        /opt/gopath/src/github.com/hyperledger/fabric/core/container/controller.go:191 +0xc7
github.com/hyperledger/fabric/peer/chaincode.getChaincodeDeploymentSpec(0xc0002b9d00, 0xc0002b9d01, 0x0, 0x0, 0x0)
        /opt/gopath/src/github.com/hyperledger/fabric/peer/chaincode/common.go:58 +0x11c
github.com/hyperledger/fabric/peer/chaincode.genChaincodeDeploymentSpec(0xc0002f8780, 0x7ffd07ebd533, 0x4, 0x7ffd07ebd53b, 0x3, 0x0, 0x8020103, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/peer/chaincode/install.go:109 +0xac
github.com/hyperledger/fabric/peer/chaincode.chaincodeInstall(0xc0002f8780, 0x0, 0x0, 0xc00013e0b0, 0x0, 0x0)      /opt/gopath/src/github.com/hyperledger/fabric/peer/chaincode/install.go:177 +0x156
github.com/hyperledger/fabric/peer/chaincode.installCmd.func1(0xc0002f8780, 0xc0000c0b80, 0x0, 0x8, 0x0, 0x0)    /opt/gopath/src/github.com/hyperledger/fabric/peer/chaincode/install.go:44 +0x54
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).execute(0xc0002f8780, 0xc0000c0a00, 0x8, 0x8, 0xc0002f8780, 0xc0000c0a00)    /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:762 +0x473
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x2320300, 0x8, 0x0, 0x231f4c0)  /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:852 +0x2fd
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).Execute(0x2320300, 0xc00037bf40, 0x1)
        /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:800 +0x2b
main.main()
        /opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:53 +0x2f7
Egoes
  • 23
  • 5
  • check if the chaincode is present in the path /opt/gopath/src/github.com/hyperledger/fabric-samples/chaincode/abstore/java/ or try with chaincode_example02. – Harshit Mar 09 '19 at 13:36
  • 1
    @Harshit Thanks for the hel, they have alredy updated the docks whit the chaincode_example02 and it looks that alredy works. – Egoes Mar 12 '19 at 10:57

1 Answers1

0

They alredy updated the documentation with the new workin command.

peer chaincode install -n mycc -v 1.0 -l java -p /opt/gopath/src/github.com/chaincode/chaincode_example02/java/
Egoes
  • 23
  • 5