尝试实例化Chaincode时出现错误

时间:2018-10-23 15:32:24

标签: hyperledger-fabric hyperledger

尝试实例化我的链码时出现以下错误。我只是想在kubernetes中运行的同位体上实例化fabcar链码。

kubectl exec -n blockchain $PEER_POD -- bash -c 'CORE_PEER_MSPCONFIGPATH=$ADMIN_MSP_PATH peer chaincode instantiate -o ord1-hlf-ord.blockchain.svc.cluster.local:7050  -C mychannel -n mycc -l node -v 1.0 -c '{"Args":[""]}''

这会给我以下错误:

  

错误:chaincode参数错误:无效字符'A'寻找对象密钥字符串的开头

我认为这与通过命令('{"Args":[""]}')传递构造函数参数有关,但我将这些参数与startFabric.sh脚本中使用的命令及其相同格式进行了比较:

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 "$LANGUAGE" -v 1.0 -c '{"Args":[""]}' -P "OR ('Org1MSP.member','Org2MSP.member')"

用这个抓我的头,如果有人知道问题出在哪里,我将不胜感激。

Fabric v1.2

日志:

kubectl exec -n blockchain $PEER_POD -- bash -c 'CORE_PEER_MSPCONFIGPATH=$ADMIN_MSP_PATH peer chaincode instantiate -o ord1-hlf-ord.blockchain.svc.cluster.local:7050  -C mychannel -n mycc -l node -v 1.0 -c '{"Args":[""]}''
2018-10-23 15:22:14.570 UTC [viperutil] getKeysRecursively -> DEBU 001 Found map[string]interface{} value for peer.BCCSP
2018-10-23 15:22:14.571 UTC [viperutil] unmarshalJSON -> DEBU 002 Unmarshal JSON: value cannot be unmarshalled: invalid character 'S' looking for beginning of value
2018-10-23 15:22:14.571 UTC [viperutil] getKeysRecursively -> DEBU 003 Found real value for peer.BCCSP.Default setting to string SW
2018-10-23 15:22:14.571 UTC [viperutil] getKeysRecursively -> DEBU 004 Found map[string]interface{} value for peer.BCCSP.SW
2018-10-23 15:22:14.572 UTC [viperutil] unmarshalJSON -> DEBU 005 Unmarshal JSON: value is not a string: 256
2018-10-23 15:22:14.572 UTC [viperutil] getKeysRecursively -> DEBU 006 Found real value for peer.BCCSP.SW.Security setting to int 256
2018-10-23 15:22:14.572 UTC [viperutil] getKeysRecursively -> DEBU 007 Found map[string]interface{} value for peer.BCCSP.SW.FileKeyStore
2018-10-23 15:22:14.572 UTC [viperutil] unmarshalJSON -> DEBU 008 Unmarshal JSON: value cannot be unmarshalled: unexpected end of JSON input
2018-10-23 15:22:14.573 UTC [viperutil] getKeysRecursively -> DEBU 009 Found real value for peer.BCCSP.SW.FileKeyStore.KeyStore setting to string 
2018-10-23 15:22:14.573 UTC [viperutil] unmarshalJSON -> DEBU 00a Unmarshal JSON: value cannot be unmarshalled: invalid character 'S' looking for beginning of value
2018-10-23 15:22:14.573 UTC [viperutil] getKeysRecursively -> DEBU 00b Found real value for peer.BCCSP.SW.Hash setting to string SHA2
2018-10-23 15:22:14.573 UTC [viperutil] getKeysRecursively -> DEBU 00c Found map[string]interface{} value for peer.BCCSP.PKCS11
2018-10-23 15:22:14.574 UTC [viperutil] unmarshalJSON -> DEBU 00d Unmarshal JSON: value is not a string: <nil>
2018-10-23 15:22:14.574 UTC [viperutil] getKeysRecursively -> DEBU 00e Found real value for peer.BCCSP.PKCS11.Pin setting to <nil> <nil>
2018-10-23 15:22:14.574 UTC [viperutil] unmarshalJSON -> DEBU 00f Unmarshal JSON: value is not a string: <nil>
2018-10-23 15:22:14.575 UTC [viperutil] getKeysRecursively -> DEBU 010 Found real value for peer.BCCSP.PKCS11.Hash setting to <nil> <nil>
2018-10-23 15:22:14.575 UTC [viperutil] unmarshalJSON -> DEBU 011 Unmarshal JSON: value is not a string: <nil>
2018-10-23 15:22:14.575 UTC [viperutil] getKeysRecursively -> DEBU 012 Found real value for peer.BCCSP.PKCS11.Security setting to <nil> <nil>
2018-10-23 15:22:14.576 UTC [viperutil] getKeysRecursively -> DEBU 013 Found map[string]interface{} value for peer.BCCSP.PKCS11.FileKeyStore
2018-10-23 15:22:14.576 UTC [viperutil] unmarshalJSON -> DEBU 014 Unmarshal JSON: value is not a string: <nil>
2018-10-23 15:22:14.576 UTC [viperutil] getKeysRecursively -> DEBU 015 Found real value for peer.BCCSP.PKCS11.FileKeyStore.KeyStore setting to <nil> <nil>
2018-10-23 15:22:14.576 UTC [viperutil] unmarshalJSON -> DEBU 016 Unmarshal JSON: value is not a string: <nil>
2018-10-23 15:22:14.577 UTC [viperutil] getKeysRecursively -> DEBU 017 Found real value for peer.BCCSP.PKCS11.Library setting to <nil> <nil>
2018-10-23 15:22:14.577 UTC [viperutil] unmarshalJSON -> DEBU 018 Unmarshal JSON: value is not a string: <nil>
2018-10-23 15:22:14.577 UTC [viperutil] getKeysRecursively -> DEBU 019 Found real value for peer.BCCSP.PKCS11.Label setting to <nil> <nil>
2018-10-23 15:22:14.578 UTC [viperutil] EnhancedExactUnmarshalKey -> DEBU 01a map[peer.BCCSP:map[Default:SW SW:map[Hash:SHA2 Security:256 FileKeyStore:map[KeyStore:]] PKCS11:map[Pin:<nil> Hash:<nil> Security:<nil> FileKeyStore:map[KeyStore:<nil>] Library:<nil> Label:<nil>]]]
2018-10-23 15:22:14.578 UTC [bccsp_sw] openKeyStore -> DEBU 01b KeyStore opened at [/var/hyperledger/admin_msp/keystore]...done
2018-10-23 15:22:14.578 UTC [bccsp] initBCCSP -> DEBU 01c Initialize BCCSP [SW]
2018-10-23 15:22:14.579 UTC [msp] getPemMaterialFromDir -> DEBU 01d Reading directory /var/hyperledger/admin_msp/signcerts
2018-10-23 15:22:14.579 UTC [msp] getPemMaterialFromDir -> DEBU 01e Inspecting file /var/hyperledger/admin_msp/signcerts/cert.pem
2018-10-23 15:22:14.579 UTC [msp] getPemMaterialFromDir -> DEBU 01f Reading directory /var/hyperledger/admin_msp/cacerts
2018-10-23 15:22:14.579 UTC [msp] getPemMaterialFromDir -> DEBU 020 Inspecting file /var/hyperledger/admin_msp/cacerts/blockaviation-services.pem
2018-10-23 15:22:14.580 UTC [msp] getPemMaterialFromDir -> DEBU 021 Reading directory /var/hyperledger/admin_msp/admincerts
2018-10-23 15:22:14.580 UTC [msp] getPemMaterialFromDir -> DEBU 022 Inspecting file /var/hyperledger/admin_msp/admincerts/cert.pem
2018-10-23 15:22:14.580 UTC [msp] getPemMaterialFromDir -> DEBU 023 Reading directory /var/hyperledger/admin_msp/intermediatecerts
2018-10-23 15:22:14.580 UTC [msp] getPemMaterialFromDir -> DEBU 024 Reading directory /var/hyperledger/admin_msp/tlscacerts
2018-10-23 15:22:14.580 UTC [msp] getMspConfig -> DEBU 025 TLS CA certs folder not found at [/var/hyperledger/admin_msp/tlsintermediatecerts]. Skipping and ignoring TLS intermediate CA folder. [stat /var/hyperledger/admin_msp/tlscacerts: no such file or directory]
2018-10-23 15:22:14.580 UTC [msp] getPemMaterialFromDir -> DEBU 026 Reading directory /var/hyperledger/admin_msp/crls
2018-10-23 15:22:14.581 UTC [msp] getMspConfig -> DEBU 027 crls folder not found at [/var/hyperledger/admin_msp/crls]. Skipping. [stat /var/hyperledger/admin_msp/crls: no such file or directory]
2018-10-23 15:22:14.581 UTC [msp] getMspConfig -> DEBU 028 MSP configuration file not found at [/var/hyperledger/admin_msp/config.yaml]: [stat /var/hyperledger/admin_msp/config.yaml: no such file or directory]
2018-10-23 15:22:14.581 UTC [msp] newBccspMsp -> DEBU 029 Creating BCCSP-based MSP instance
2018-10-23 15:22:14.581 UTC [msp] New -> DEBU 02a Creating Cache-MSP instance
2018-10-23 15:22:14.582 UTC [msp] loadLocaMSP -> DEBU 02b Created new local MSP
2018-10-23 15:22:14.582 UTC [msp] Setup -> DEBU 02c Setting up MSP instance BlockAviationMSP
2018-10-23 15:22:14.582 UTC [msp/identity] newIdentity -> DEBU 02d Creating identity instance for cert -----BEGIN CERTIFICATE-----
MIIB9zCCAZ2gAwIBAgIUCE/wmCRC7YD+GhpuARvf2L/kf0AwCgYIKoZIzj0EAwIw
WDELMAkGA1UEBhMCSUUxDzANBgNVBAgTBkR1YmxpbjEWMBQGA1UEChMNQmxvY2tB
dmlhdGlvbjETMBEGA1UECxMKQmxvY2tjaGFpbjELMAkGA1UEAxMCY2EwHhcNMTgx
MDEwMDkwNTAwWhcNMzMxMDA2MDkwNTAwWjBYMQswCQYDVQQGEwJJRTEPMA0GA1UE
CBMGRHVibGluMRYwFAYDVQQKEw1CbG9ja0F2aWF0aW9uMRMwEQYDVQQLEwpCbG9j
a2NoYWluMQswCQYDVQQDEwJjYTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABMTw
E+YnpUu1r9CwI59Hd1/kti4hLNBfmqeJeYQjswCImGjI+2T+0ppo6n1+PcRvwS5o
ngo2cx/xd5+HPTjh3aqjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG
AQH/AgEBMB0GA1UdDgQWBBTVE0UL2bC1lTxg0ALgzYUAPfvuyDAKBggqhkjOPQQD
AgNIADBFAiEAnOSGBJJvz8CeZWNU649XF9S7DKExrwMXnUbYP25qDoMCIFJJUlmP
Fcn5L1OUAFsOHl5yqlecHKTxw7cOSxajNv3n
-----END CERTIFICATE-----
2018-10-23 15:22:14.583 UTC [msp/identity] newIdentity -> DEBU 02e Creating identity instance for cert -----BEGIN CERTIFICATE-----
MIICqTCCAk+gAwIBAgIUche39/1Fn4Vr3QCrlTiApXyLSQQwCgYIKoZIzj0EAwIw
WDELMAkGA1UEBhMCSUUxDzANBgNVBAgTBkR1YmxpbjEWMBQGA1UEChMNQmxvY2tB
dmlhdGlvbjETMBEGA1UECxMKQmxvY2tjaGFpbjELMAkGA1UEAxMCY2EwHhcNMTgx
MDEwMDkyNzAwWhcNMTkxMDEwMDkzMjAwWjBbMQswCQYDVQQGEwJJRTEPMA0GA1UE
CBMGRHVibGluMRYwFAYDVQQKEw1CbG9ja0F2aWF0aW9uMQ8wDQYDVQQLEwZjbGll
bnQxEjAQBgNVBAMTCW9yZy1hZG1pbjBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA
BElbCKujSewmoNGmPjysC3guQrtzG/zckAj5HsmScv8x9Cv75QTBllbfuOCbVobV
mIfizTsPL/fiJF7xpY+hNdijgfMwgfAwDgYDVR0PAQH/BAQDAgeAMAwGA1UdEwEB
/wQCMAAwHQYDVR0OBBYEFKE14HVT0hEuCG+oLQxV1IcQZTq3MB8GA1UdIwQYMBaA
FNUTRQvZsLWVPGDQAuDNhQA9++7IMCMGA1UdEQQcMBqCGFNpbW9ucy1NYWNCb29r
LVByby5sb2NhbDBrBggqAwQFBgcIAQRfeyJhdHRycyI6eyJhZG1pbiI6InRydWUi
LCJoZi5BZmZpbGlhdGlvbiI6IiIsImhmLkVucm9sbG1lbnRJRCI6Im9yZy1hZG1p
biIsImhmLlR5cGUiOiJjbGllbnQifX0wCgYIKoZIzj0EAwIDSAAwRQIhALezaB2/
rNSKJHaDMo++yQJS3kWQTJnKe2WxWqpA2wEWAiAMM0BgXiV8Losu5quVGHi8F0pF
MRpjqst5LP+uaQu4rg==
-----END CERTIFICATE-----
2018-10-23 15:22:14.600 UTC [msp/identity] newIdentity -> DEBU 02f Creating identity instance for cert -----BEGIN CERTIFICATE-----
MIICqTCCAk+gAwIBAgIUche39/1Fn4Vr3QCrlTiApXyLSQQwCgYIKoZIzj0EAwIw
WDELMAkGA1UEBhMCSUUxDzANBgNVBAgTBkR1YmxpbjEWMBQGA1UEChMNQmxvY2tB
dmlhdGlvbjETMBEGA1UECxMKQmxvY2tjaGFpbjELMAkGA1UEAxMCY2EwHhcNMTgx
MDEwMDkyNzAwWhcNMTkxMDEwMDkzMjAwWjBbMQswCQYDVQQGEwJJRTEPMA0GA1UE
CBMGRHVibGluMRYwFAYDVQQKEw1CbG9ja0F2aWF0aW9uMQ8wDQYDVQQLEwZjbGll
bnQxEjAQBgNVBAMTCW9yZy1hZG1pbjBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA
BElbCKujSewmoNGmPjysC3guQrtzG/zckAj5HsmScv8x9Cv75QTBllbfuOCbVobV
mIfizTsPL/fiJF7xpY+hNdijgfMwgfAwDgYDVR0PAQH/BAQDAgeAMAwGA1UdEwEB
/wQCMAAwHQYDVR0OBBYEFKE14HVT0hEuCG+oLQxV1IcQZTq3MB8GA1UdIwQYMBaA
FNUTRQvZsLWVPGDQAuDNhQA9++7IMCMGA1UdEQQcMBqCGFNpbW9ucy1NYWNCb29r
LVByby5sb2NhbDBrBggqAwQFBgcIAQRfeyJhdHRycyI6eyJhZG1pbiI6InRydWUi
LCJoZi5BZmZpbGlhdGlvbiI6IiIsImhmLkVucm9sbG1lbnRJRCI6Im9yZy1hZG1p
biIsImhmLlR5cGUiOiJjbGllbnQifX0wCgYIKoZIzj0EAwIDSAAwRQIhALezaB2/
rNSKJHaDMo++yQJS3kWQTJnKe2WxWqpA2wEWAiAMM0BgXiV8Losu5quVGHi8F0pF
MRpjqst5LP+uaQu4rg==
-----END CERTIFICATE-----
2018-10-23 15:22:14.601 UTC [msp/identity] newIdentity -> DEBU 030 Creating identity instance for cert -----BEGIN CERTIFICATE-----
MIICqTCCAk+gAwIBAgIUche39/1Fn4Vr3QCrlTiApXyLSQQwCgYIKoZIzj0EAwIw
WDELMAkGA1UEBhMCSUUxDzANBgNVBAgTBkR1YmxpbjEWMBQGA1UEChMNQmxvY2tB
dmlhdGlvbjETMBEGA1UECxMKQmxvY2tjaGFpbjELMAkGA1UEAxMCY2EwHhcNMTgx
MDEwMDkyNzAwWhcNMTkxMDEwMDkzMjAwWjBbMQswCQYDVQQGEwJJRTEPMA0GA1UE
CBMGRHVibGluMRYwFAYDVQQKEw1CbG9ja0F2aWF0aW9uMQ8wDQYDVQQLEwZjbGll
bnQxEjAQBgNVBAMTCW9yZy1hZG1pbjBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA
BElbCKujSewmoNGmPjysC3guQrtzG/zckAj5HsmScv8x9Cv75QTBllbfuOCbVobV
mIfizTsPL/fiJF7xpY+hNdijgfMwgfAwDgYDVR0PAQH/BAQDAgeAMAwGA1UdEwEB
/wQCMAAwHQYDVR0OBBYEFKE14HVT0hEuCG+oLQxV1IcQZTq3MB8GA1UdIwQYMBaA
FNUTRQvZsLWVPGDQAuDNhQA9++7IMCMGA1UdEQQcMBqCGFNpbW9ucy1NYWNCb29r
LVByby5sb2NhbDBrBggqAwQFBgcIAQRfeyJhdHRycyI6eyJhZG1pbiI6InRydWUi
LCJoZi5BZmZpbGlhdGlvbiI6IiIsImhmLkVucm9sbG1lbnRJRCI6Im9yZy1hZG1p
biIsImhmLlR5cGUiOiJjbGllbnQifX0wCgYIKoZIzj0EAwIDSAAwRQIhALezaB2/
rNSKJHaDMo++yQJS3kWQTJnKe2WxWqpA2wEWAiAMM0BgXiV8Losu5quVGHi8F0pF
MRpjqst5LP+uaQu4rg==
-----END CERTIFICATE-----
2018-10-23 15:22:14.601 UTC [msp] setupSigningIdentity -> DEBU 031 Signing identity expires at 2019-10-10 09:32:00 +0000 UTC
2018-10-23 15:22:14.601 UTC [msp] Validate -> DEBU 032 MSP BlockAviationMSP validating identity
2018-10-23 15:22:14.602 UTC [grpc] Printf -> DEBU 033 parsed scheme: ""
2018-10-23 15:22:14.603 UTC [grpc] Printf -> DEBU 034 scheme "" not registered, fallback to default scheme
2018-10-23 15:22:14.603 UTC [grpc] Printf -> DEBU 035 ccResolverWrapper: sending new addresses to cc: [{peer1-hlf-peer:7051 0  <nil>}]
2018-10-23 15:22:14.603 UTC [grpc] Printf -> DEBU 036 ClientConn switching balancer to "pick_first"
2018-10-23 15:22:14.603 UTC [grpc] Printf -> DEBU 037 pickfirstBalancer: HandleSubConnStateChange: 0xc4202110c0, CONNECTING
2018-10-23 15:22:14.606 UTC [grpc] Printf -> DEBU 038 pickfirstBalancer: HandleSubConnStateChange: 0xc4202110c0, READY
2018-10-23 15:22:14.607 UTC [grpc] Printf -> DEBU 039 parsed scheme: ""
2018-10-23 15:22:14.607 UTC [grpc] Printf -> DEBU 03a scheme "" not registered, fallback to default scheme
2018-10-23 15:22:14.607 UTC [grpc] Printf -> DEBU 03b ccResolverWrapper: sending new addresses to cc: [{peer1-hlf-peer:7051 0  <nil>}]
2018-10-23 15:22:14.607 UTC [grpc] Printf -> DEBU 03c ClientConn switching balancer to "pick_first"
2018-10-23 15:22:14.607 UTC [grpc] Printf -> DEBU 03d pickfirstBalancer: HandleSubConnStateChange: 0xc42052e630, CONNECTING
2018-10-23 15:22:14.609 UTC [grpc] Printf -> DEBU 03e pickfirstBalancer: HandleSubConnStateChange: 0xc42052e630, READY
2018-10-23 15:22:14.610 UTC [msp] GetDefaultSigningIdentity -> DEBU 03f Obtaining default signing identity
2018-10-23 15:22:14.610 UTC [grpc] Printf -> DEBU 040 parsed scheme: ""
2018-10-23 15:22:14.610 UTC [grpc] Printf -> DEBU 041 scheme "" not registered, fallback to default scheme
2018-10-23 15:22:14.610 UTC [grpc] Printf -> DEBU 042 ccResolverWrapper: sending new addresses to cc: [{ord1-hlf-ord.blockchain.svc.cluster.local:7050 0  <nil>}]
2018-10-23 15:22:14.610 UTC [grpc] Printf -> DEBU 043 ClientConn switching balancer to "pick_first"
2018-10-23 15:22:14.611 UTC [grpc] Printf -> DEBU 044 pickfirstBalancer: HandleSubConnStateChange: 0xc4200e9b70, CONNECTING
2018-10-23 15:22:14.625 UTC [grpc] Printf -> DEBU 045 pickfirstBalancer: HandleSubConnStateChange: 0xc4200e9b70, READY
2018-10-23 15:22:14.625 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 046 Using default escc
2018-10-23 15:22:14.626 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 047 Using default vscc
Error: chaincode argument error: invalid character 'A' looking for beginning of object key string
Usage:
  peer chaincode instantiate [flags]

Flags:
  -C, --channelID string               The channel on which this command should be executed
      --collections-config string      The fully qualified path to the collection JSON file including the file name
      --connectionProfile string       Connection profile that provides the necessary connection information for the network. Note: currently only supported for providing peer connection information
  -c, --ctor string                    Constructor message for the chaincode in JSON format (default "{}")
  -E, --escc string                    The name of the endorsement system chaincode to be used for this chaincode
  -h, --help                           help for instantiate
  -l, --lang string                    Language the chaincode is written in (default "golang")
  -n, --name string                    Name of the chaincode
      --peerAddresses stringArray      The addresses of the peers to connect to
  -P, --policy string                  The endorsement policy associated to this chaincode
      --tlsRootCertFiles stringArray   If TLS is enabled, the paths to the TLS root cert files of the peers to connect to. The order and number of certs specified should match the --peerAddresses flag
  -v, --version string                 Version of the chaincode specified in install/instantiate/upgrade commands
  -V, --vscc string                    The name of the verification system chaincode to be used for this chaincode

Global Flags:
      --cafile string                       Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
      --certfile string                     Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint
      --clientauth                          Use mutual TLS when communicating with the orderer endpoint
      --connTimeout duration                Timeout for client to connect (default 3s)
      --keyfile string                      Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint
      --logging-level string                Default logging level and overrides, see core.yaml for full syntax
  -o, --orderer string                      Ordering service endpoint
      --ordererTLSHostnameOverride string   The hostname override to use when validating the TLS connection to the orderer.
      --tls                                 Use TLS when communicating with the orderer endpoint
      --transient string                    Transient map of arguments in JSON encoding

command terminated with exit code 1

0 个答案:

没有答案
相关问题