Я использую 1.4.0-rc2 для изображений докера и кода Java.
При попытке установить цепочечный код Java из cli в одноранговый узел с помощью следующей команды:
peer chaincode install -p github.com/hyperledger/chaincode/java/ -l java -n java_chaincode -v 0
Выдает следующую ошибку:
2019-01-09 14:36:11.799 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-01-09 14:36:11.819 UTC [main] SetOrdererEnv -> WARN 002 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-01-09 14:36:11.824 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2019-01-09 14:36:11.824 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
panic: 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(0x7fffb7459543, 0x31, 0x0, 0x0, 0x1874100, 0xc0002c4a50, 0x60, 0x1691f40)
/opt/gopath/src/github.com/hyperledger/fabric/core/container/util/writer.go:64 +0xcb
path/filepath.Walk(0x7fffb7459543, 0x31, 0xc0003b8c60, 0x2, 0x3)
/opt/go/src/path/filepath/path.go:402 +0x6a
github.com/hyperledger/fabric/core/container/util.WriteFolderToTarPackage(0xc00011dc00, 0x7fffb7459543, 0x31, 0xc000435858, 0x3, 0x3, 0x0, 0xc00012dc80, 0xc00011dc00, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/core/container/util/writer.go:136 +0x241
github.com/hyperledger/fabric/core/container/util.WriteJavaProjectToPackage(0xc00011dc00, 0x7fffb7459543, 0x31, 0xc000435940, 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, 0x7fffb7459543, 0x32, 0x4, 0xc000167188, 0x1716e01, 0x4, 0xc0004359c0)
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/platforms/java/platform.go:123 +0x1e0
github.com/hyperledger/fabric/core/chaincode/platforms.(*Registry).GetDeploymentPayload(0xc00000c540, 0x1716e08, 0x4, 0x7fffb7459543, 0x32, 0x4, 0x7fffb7459543, 0x32, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/platforms/platforms.go:103 +0x8f
github.com/hyperledger/fabric/core/container.GetChaincodePackageBytes(0xc00000c540, 0xc00024a5c0, 0x0, 0x16740c0, 0xc0000b2cd0, 0xc000040704, 0x4)
/opt/gopath/src/github.com/hyperledger/fabric/core/container/controller.go:191 +0xc7
github.com/hyperledger/fabric/peer/chaincode.getChaincodeDeploymentSpec(0xc00024a5c0, 0xc00024a501, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/peer/chaincode/common.go:58 +0x11c
github.com/hyperledger/fabric/peer/chaincode.genChaincodeDeploymentSpec(0xc0000c4c80, 0x7fffb7459581, 0x1b, 0x7fffb74595a0, 0x1, 0x0, 0x8020106, 0x2)
/opt/gopath/src/github.com/hyperledger/fabric/peer/chaincode/install.go:109 +0xac
github.com/hyperledger/fabric/peer/chaincode.chaincodeInstall(0xc0000c4c80, 0x0, 0x0, 0xc00003a4d0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/peer/chaincode/install.go:177 +0x156
github.com/hyperledger/fabric/peer/chaincode.installCmd.func1(0xc0000c4c80, 0xc000150480, 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(0xc0000c4c80, 0xc000150300, 0x8, 0x8, 0xc0000c4c80, 0xc000150300)
/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, 0xc00044ff40, 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
Внутри этой папки находится jar-файл, созданный после урока на github .
Редактировать 1:
Ошибка выше была из-за того, что путь был неправильным, я использовал путь относительно gopath, так как раньше мне приходилось делать это для кодов цепочки go, но для установки работал полный путь.
Для создания экземпляра:
peer chaincode instantiate -n chaincode -v 0 -C channel -c '{"Args":["init"]}' -l java
выдает следующую ошибку:
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 127 "/bin/sh: 1: ./build.sh: not found
"
Это журнал для пиров:
2019-01-10 07:43:44.504 UTC [chaincode.platform.java] GenerateDockerBuild -> ERRO 3e9 Can't build java chaincode Error returned from build: 127 "/bin/sh: 1: ./build.sh: not found
"
2019-01-10 07:43:44.505 UTC [chaincode.platform] func1 -> ERRO 3ea Failed to generate platform-specific docker build: Error returned from build: 127 "/bin/sh: 1: ./build.sh: not found
"
2019-01-10 07:43:44.505 UTC [dockercontroller] deployImage -> ERRO 3eb Error building image: Failed to generate platform-specific docker build: Error returned from build: 127 "/bin/sh: 1:./build.sh: not found
"
2019-01-10 07:43:44.505 UTC [dockercontroller] deployImage -> ERRO 3ec Build Output:
********************
********************
2019-01-10 07:43:44.507 UTC [endorser] callChaincode -> INFO 3ed [channel][6ba7c224] Exit chaincode: name:"lscc" (1563ms)
2019-01-10 07:43:44.507 UTC [endorser] SimulateProposal -> ERRO 3ee [channel][6ba7c224] failed to invoke chaincode name:"lscc" , error: Failed to generate platform-specific docker build: Error returned from build: 127 "/bin/sh: 1: ./build.sh: not found
"
error starting container
error starting container
Я буду рад предоставить дополнительную информацию и код.