после успешного прохождения учебника «Построение первой сети» на javascript и учебника «Написание первого приложения» на языке по умолчанию я получаю сообщение об ошибке при попытке выполнить его с помощью java:
./startFabric.sh java
Это важно, так как мой проект будет разрабатываться как на цепочке, так и на клиенте на Java.
Ошибка в том, что скрипт пытается создать интеллектуальный контракт на канале. Предыдущие команды выполняются ОК:
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg chaincode registration failed: container exited with 1
Я пробовал аналогичные шаги, основанные на сценариях BYFN, и у меня все работает для цепного кода Java, пока я расширяю класс ChaincodeBase. Если я реализую ContractInterface, я получаю описанную ошибку также при использовании BYFN. Есть ли какие-либо специальные действия при активации java chaincode с использованием ContractInterface, которые я должен рассмотреть? (Обратите внимание, что у меня не получается с моими пользовательскими классами в учебнике BYFN, а также с простым стандартным учебником «Написание вашего первого приложения». Может ли быть проблема с этими типами Java в 1.4.3?)
Полный выводошибки генерации команды (я включил DEBUG в файле docker-compose-cli.yaml учебника BYFN, использованного в этом другом учебнике):
+ echo 'Instantiating smart contract on mychannel'
Instantiating smart contract on mychannel
+ docker exec -e CORE_PEER_LOCALMSPID=Org1MSP -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp cli peer chaincode instantiate -o orderer.example.com:7050 -C mychannel -n fabcar -l java -v 1.0 -c '{"Args":[]}' -P 'AND('\''Org1MSP.member'\'','\''Org2MSP.member'\'')' --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --peerAddresses peer0.org1.example.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
2019-10-05 20:53:15.020 UTC [viperutil] getKeysRecursively -> DEBU 001 Found map[string]interface{} value for peer.BCCSP
2019-10-05 20:53:15.021 UTC [viperutil] getKeysRecursively -> DEBU 002 Found map[string]interface{} value for peer.BCCSP.PKCS11
2019-10-05 20:53:15.022 UTC [viperutil] unmarshalJSON -> DEBU 003 Unmarshal JSON: value is not a string: <nil>
2019-10-05 20:53:15.028 UTC [viperutil] getKeysRecursively -> DEBU 004 Found real value for peer.BCCSP.PKCS11.Label setting to <nil> <nil>
2019-10-05 20:53:15.028 UTC [viperutil] unmarshalJSON -> DEBU 005 Unmarshal JSON: value is not a string: <nil>
2019-10-05 20:53:15.029 UTC [viperutil] getKeysRecursively -> DEBU 006 Found real value for peer.BCCSP.PKCS11.Pin setting to <nil> <nil>
2019-10-05 20:53:15.030 UTC [viperutil] unmarshalJSON -> DEBU 007 Unmarshal JSON: value is not a string: <nil>
2019-10-05 20:53:15.031 UTC [viperutil] getKeysRecursively -> DEBU 008 Found real value for peer.BCCSP.PKCS11.Hash setting to <nil> <nil>
2019-10-05 20:53:15.031 UTC [viperutil] unmarshalJSON -> DEBU 009 Unmarshal JSON: value is not a string: <nil>
2019-10-05 20:53:15.032 UTC [viperutil] getKeysRecursively -> DEBU 00a Found real value for peer.BCCSP.PKCS11.Security setting to <nil> <nil>
2019-10-05 20:53:15.033 UTC [viperutil] getKeysRecursively -> DEBU 00b Found map[string]interface{} value for peer.BCCSP.PKCS11.FileKeyStore
2019-10-05 20:53:15.033 UTC [viperutil] unmarshalJSON -> DEBU 00c Unmarshal JSON: value is not a string: <nil>
2019-10-05 20:53:15.034 UTC [viperutil] getKeysRecursively -> DEBU 00d Found real value for peer.BCCSP.PKCS11.FileKeyStore.KeyStore setting to <nil> <nil>
2019-10-05 20:53:15.035 UTC [viperutil] unmarshalJSON -> DEBU 00e Unmarshal JSON: value is not a string: <nil>
2019-10-05 20:53:15.036 UTC [viperutil] getKeysRecursively -> DEBU 00f Found real value for peer.BCCSP.PKCS11.Library setting to <nil> <nil>
2019-10-05 20:53:15.037 UTC [viperutil] unmarshalJSON -> DEBU 010 Unmarshal JSON: value cannot be unmarshalled: invalid character 'S' looking for beginning of value
2019-10-05 20:53:15.037 UTC [viperutil] getKeysRecursively -> DEBU 011 Found real value for peer.BCCSP.Default setting to string SW
2019-10-05 20:53:15.038 UTC [viperutil] getKeysRecursively -> DEBU 012 Found map[string]interface{} value for peer.BCCSP.SW
2019-10-05 20:53:15.038 UTC [viperutil] unmarshalJSON -> DEBU 013 Unmarshal JSON: value cannot be unmarshalled: invalid character 'S' looking for beginning of value
2019-10-05 20:53:15.038 UTC [viperutil] getKeysRecursively -> DEBU 014 Found real value for peer.BCCSP.SW.Hash setting to string SHA2
2019-10-05 20:53:15.039 UTC [viperutil] unmarshalJSON -> DEBU 015 Unmarshal JSON: value is not a string: 256
2019-10-05 20:53:15.039 UTC [viperutil] getKeysRecursively -> DEBU 016 Found real value for peer.BCCSP.SW.Security setting to int 256
2019-10-05 20:53:15.040 UTC [viperutil] getKeysRecursively -> DEBU 017 Found map[string]interface{} value for peer.BCCSP.SW.FileKeyStore
2019-10-05 20:53:15.040 UTC [viperutil] unmarshalJSON -> DEBU 018 Unmarshal JSON: value cannot be unmarshalled: unexpected end of JSON input
2019-10-05 20:53:15.040 UTC [viperutil] getKeysRecursively -> DEBU 019 Found real value for peer.BCCSP.SW.FileKeyStore.KeyStore setting to string
2019-10-05 20:53:15.040 UTC [viperutil] EnhancedExactUnmarshalKey -> DEBU 01a map[peer.BCCSP:map[PKCS11:map[Label:<nil> Pin:<nil> Hash:<nil> Security:<nil> FileKeyStore:map[KeyStore:<nil>] Library:<nil>] Default:SW SW:map[FileKeyStore:map[KeyStore:] Hash:SHA2 Security:256]]]
2019-10-05 20:53:15.049 UTC [bccsp_sw] openKeyStore -> DEBU 01b KeyStore opened at [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore]...done
2019-10-05 20:53:15.050 UTC [bccsp] initBCCSP -> DEBU 01c Initialize BCCSP [SW]
2019-10-05 20:53:15.051 UTC [msp] getPemMaterialFromDir -> DEBU 01d Reading directory /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts
2019-10-05 20:53:15.054 UTC [msp] getPemMaterialFromDir -> DEBU 01e Inspecting file /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem
2019-10-05 20:53:15.057 UTC [msp] getPemMaterialFromDir -> DEBU 01f Reading directory /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/cacerts
2019-10-05 20:53:15.074 UTC [msp] getPemMaterialFromDir -> DEBU 020 Inspecting file /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/cacerts/ca.org1.example.com-cert.pem
2019-10-05 20:53:15.078 UTC [msp] getPemMaterialFromDir -> DEBU 021 Reading directory /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/admincerts
2019-10-05 20:53:15.081 UTC [msp] getPemMaterialFromDir -> DEBU 022 Reading directory /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/intermediatecerts
2019-10-05 20:53:15.082 UTC [msp] getMspConfig -> DEBU 023 Intermediate certs folder not found at [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/intermediatecerts]. Skipping. [stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/intermediatecerts: no such file or directory]
2019-10-05 20:53:15.082 UTC [msp] getPemMaterialFromDir -> DEBU 024 Reading directory /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/tlscacerts
2019-10-05 20:53:15.084 UTC [msp] getPemMaterialFromDir -> DEBU 025 Inspecting file /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/tlscacerts/tlsca.org1.example.com-cert.pem
2019-10-05 20:53:15.087 UTC [msp] getPemMaterialFromDir -> DEBU 026 Reading directory /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/tlsintermediatecerts
2019-10-05 20:53:15.088 UTC [msp] getMspConfig -> DEBU 027 TLS intermediate certs folder not found at [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/tlsintermediatecerts]. Skipping. [stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/tlsintermediatecerts: no such file or directory]
2019-10-05 20:53:15.088 UTC [msp] getPemMaterialFromDir -> DEBU 028 Reading directory /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/crls
2019-10-05 20:53:15.089 UTC [msp] getMspConfig -> DEBU 029 crls folder not found at [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/crls]. Skipping. [stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/crls: no such file or directory]
2019-10-05 20:53:15.092 UTC [msp] getMspConfig -> DEBU 02a Loading NodeOUs
2019-10-05 20:53:15.101 UTC [msp] newBccspMsp -> DEBU 02b Creating BCCSP-based MSP instance
2019-10-05 20:53:15.101 UTC [msp] New -> DEBU 02c Creating Cache-MSP instance
2019-10-05 20:53:15.101 UTC [msp] loadLocaMSP -> DEBU 02d Created new local MSP
2019-10-05 20:53:15.101 UTC [msp] Setup -> DEBU 02e Setting up MSP instance Org1MSP
2019-10-05 20:53:15.101 UTC [msp.identity] newIdentity -> DEBU 02f Creating identity instance for cert -----BEGIN CERTIFICATE-----
MIICUTCCAfegAwIBAgIQCbARM9hKjIu8+CFIr6eBgjAKBggqhkjOPQQDAjBzMQsw
CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
YW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eu
b3JnMS5leGFtcGxlLmNvbTAeFw0xOTEwMDUyMDQ3MDBaFw0yOTEwMDIyMDQ3MDBa
MHMxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1T
YW4gRnJhbmNpc2NvMRkwFwYDVQQKExBvcmcxLmV4YW1wbGUuY29tMRwwGgYDVQQD
ExNjYS5vcmcxLmV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE
EB0CfJUn5SVC5wnRigjgn5ly3RqG71rMB/kpor6424CXA7nGkbNYrYMLpvphl269
ZTJw29eX8yMcFDdJiOGk96NtMGswDgYDVR0PAQH/BAQDAgGmMB0GA1UdJQQWMBQG
CCsGAQUFBwMCBggrBgEFBQcDATAPBgNVHRMBAf8EBTADAQH/MCkGA1UdDgQiBCDV
sUe8vAO3KUVLi9k3fFC1lOKAcof29iGCfW/FL+Af2zAKBggqhkjOPQQDAgNIADBF
AiEA3ZnwKLtTxA5dLaTMlo3bvM9rxePNgrXfks7PpCgcvJkCICewXOoL728OHKsf
FVfdXsxcYuvCAYxA01gOhIaDYeZv
-----END CERTIFICATE-----
2019-10-05 20:53:15.101 UTC [msp.identity] newIdentity -> DEBU 030 Creating identity instance for cert -----BEGIN CERTIFICATE-----
MIICKjCCAdCgAwIBAgIRAOKj1RX6UST5URhwxCLpuGwwCgYIKoZIzj0EAwIwczEL
MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh
Lm9yZzEuZXhhbXBsZS5jb20wHhcNMTkxMDA1MjA0NzAwWhcNMjkxMDAyMjA0NzAw
WjBrMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN
U2FuIEZyYW5jaXNjbzEOMAwGA1UECxMFYWRtaW4xHzAdBgNVBAMMFkFkbWluQG9y
ZzEuZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAR/gLdyUdjv
nfpc3a6AwB8a7rl3JyVX+MOjjqbgpLC3WCr/2PP7ruc9eykCBIldbYFjT5cmHSBx
gyRrwdaHKmewo00wSzAOBgNVHQ8BAf8EBAMCB4AwDAYDVR0TAQH/BAIwADArBgNV
HSMEJDAigCDVsUe8vAO3KUVLi9k3fFC1lOKAcof29iGCfW/FL+Af2zAKBggqhkjO
PQQDAgNIADBFAiEA68aYxGYh25KTsVL80q7Ije6IEJDLy7j19sTgbLrkvSECIEg9
L5Xolh50rmr9FUzGbrVZ1EXwrCUPlVj1JuGOuJhf
-----END CERTIFICATE-----
2019-10-05 20:53:15.103 UTC [bccsp_sw] loadPrivateKey -> DEBU 031 Loading private key [1213fbf8cd9319e6818538fcdac1e85754eca7a67e5edfa08b6bf776a36eb509] at [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/1213fbf8cd9319e6818538fcdac1e85754eca7a67e5edfa08b6bf776a36eb509_sk]...
2019-10-05 20:53:15.106 UTC [msp.identity] newIdentity -> DEBU 032 Creating identity instance for cert -----BEGIN CERTIFICATE-----
MIICKjCCAdCgAwIBAgIRAOKj1RX6UST5URhwxCLpuGwwCgYIKoZIzj0EAwIwczEL
MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh
Lm9yZzEuZXhhbXBsZS5jb20wHhcNMTkxMDA1MjA0NzAwWhcNMjkxMDAyMjA0NzAw
WjBrMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN
U2FuIEZyYW5jaXNjbzEOMAwGA1UECxMFYWRtaW4xHzAdBgNVBAMMFkFkbWluQG9y
ZzEuZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAR/gLdyUdjv
nfpc3a6AwB8a7rl3JyVX+MOjjqbgpLC3WCr/2PP7ruc9eykCBIldbYFjT5cmHSBx
gyRrwdaHKmewo00wSzAOBgNVHQ8BAf8EBAMCB4AwDAYDVR0TAQH/BAIwADArBgNV
HSMEJDAigCDVsUe8vAO3KUVLi9k3fFC1lOKAcof29iGCfW/FL+Af2zAKBggqhkjO
PQQDAgNIADBFAiEA68aYxGYh25KTsVL80q7Ije6IEJDLy7j19sTgbLrkvSECIEg9
L5Xolh50rmr9FUzGbrVZ1EXwrCUPlVj1JuGOuJhf
-----END CERTIFICATE-----
2019-10-05 20:53:15.107 UTC [msp] setupSigningIdentity -> DEBU 033 Signing identity expires at 2029-10-02 20:47:00 +0000 UTC
2019-10-05 20:53:15.114 UTC [grpc] DialContext -> DEBU 034 parsed scheme: ""
2019-10-05 20:53:15.114 UTC [grpc] DialContext -> DEBU 035 scheme "" not registered, fallback to default scheme
2019-10-05 20:53:15.115 UTC [grpc] watcher -> DEBU 036 ccResolverWrapper: sending new addresses to cc: [{peer0.org1.example.com:7051 0 <nil>}]
2019-10-05 20:53:15.115 UTC [grpc] switchBalancer -> DEBU 037 ClientConn switching balancer to "pick_first"
2019-10-05 20:53:15.115 UTC [grpc] HandleSubConnStateChange -> DEBU 038 pickfirstBalancer: HandleSubConnStateChange: 0xc0001fe630, CONNECTING
2019-10-05 20:53:15.122 UTC [grpc] HandleSubConnStateChange -> DEBU 039 pickfirstBalancer: HandleSubConnStateChange: 0xc0001fe630, READY
2019-10-05 20:53:15.131 UTC [grpc] DialContext -> DEBU 03a parsed scheme: ""
2019-10-05 20:53:15.131 UTC [grpc] DialContext -> DEBU 03b scheme "" not registered, fallback to default scheme
2019-10-05 20:53:15.133 UTC [grpc] watcher -> DEBU 03c ccResolverWrapper: sending new addresses to cc: [{peer0.org1.example.com:7051 0 <nil>}]
2019-10-05 20:53:15.134 UTC [grpc] switchBalancer -> DEBU 03d ClientConn switching balancer to "pick_first"
2019-10-05 20:53:15.135 UTC [grpc] HandleSubConnStateChange -> DEBU 03e pickfirstBalancer: HandleSubConnStateChange: 0xc0002701a0, CONNECTING
2019-10-05 20:53:15.141 UTC [grpc] HandleSubConnStateChange -> DEBU 03f pickfirstBalancer: HandleSubConnStateChange: 0xc0002701a0, READY
2019-10-05 20:53:15.146 UTC [msp] GetDefaultSigningIdentity -> DEBU 040 Obtaining default signing identity
2019-10-05 20:53:15.151 UTC [grpc] DialContext -> DEBU 041 parsed scheme: ""
2019-10-05 20:53:15.151 UTC [grpc] DialContext -> DEBU 042 scheme "" not registered, fallback to default scheme
2019-10-05 20:53:15.151 UTC [grpc] watcher -> DEBU 043 ccResolverWrapper: sending new addresses to cc: [{orderer.example.com:7050 0 <nil>}]
2019-10-05 20:53:15.152 UTC [grpc] switchBalancer -> DEBU 044 ClientConn switching balancer to "pick_first"
2019-10-05 20:53:15.153 UTC [grpc] HandleSubConnStateChange -> DEBU 045 pickfirstBalancer: HandleSubConnStateChange: 0xc0001c6ff0, CONNECTING
2019-10-05 20:53:15.161 UTC [grpc] HandleSubConnStateChange -> DEBU 046 pickfirstBalancer: HandleSubConnStateChange: 0xc0001c6ff0, READY
2019-10-05 20:53:15.163 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 047 Using default escc
2019-10-05 20:53:15.163 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 048 Using default vscc
2019-10-05 20:53:15.167 UTC [msp.identity] Sign -> DEBU 049 Sign: plaintext: 0ABE070A6608031A0B08BB85E4EC0510...324D53500A04657363630A0476736363
2019-10-05 20:53:15.167 UTC [msp.identity] Sign -> DEBU 04a Sign: digest: F54E5852AADCA181D55B7C517AFC1E292D1A59CB19AB0B37EAED68244A4A0190
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg chaincode registration failed: container exited with 1