首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误:链码参数错误:查找值开头的字符‘-’无效

错误:链码参数错误:查找值开头的字符‘-’无效
EN

Stack Overflow用户
提问于 2020-07-17 21:58:23
回答 2查看 572关注 0票数 0

我正在尝试查询我在hyperledger fabric 2.2网络上安装的链码。

我正在尝试测试网络。我正在使用这个命令

代码语言:javascript
复制
peer chaincode query -C mychannel -n fabcar -c ‘{“Args”:[“queryAllCars”]}’

但是我得到了这个错误。

代码语言:javascript
复制
Error: chaincode argument error: invalid character 'â' looking for beginning of value
Usage:
  peer chaincode query [flags]

Flags:
  -C, --channelID string               The channel on which this command should be executed
      --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 "{}")
  -h, --help                           help for query
  -x, --hex                            If true, output the query value byte array in hexadecimal. Incompatible with --raw
  -n, --name string                    Name of the chaincode
      --peerAddresses stringArray      The addresses of the peers to connect to
  -r, --raw                            If true, output the query value as raw bytes, otherwise format as a printable string
      --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

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
  -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
EN

回答 2

Stack Overflow用户

发布于 2020-07-18 19:17:17

正如@alpha所评论的那样,peer chaincode query -C mychannel -n fabcar -c '{"Args":["queryAllCars"]}'将会工作。不同之处在于在传递参数时用'替换

票数 0
EN

Stack Overflow用户

发布于 2020-07-18 23:34:25

请将引号‘替换为’,并将‘替换为’。这里的问题是它无法检测引号。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62955553

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档