call

执行一个可以立即获得结果的请求,无需区块链共识

参数

  • groupID: unsigned int - 群组ID
  • object: - 请求信息,其字段如下:
    • from: string - 发送者的地址
    • to: string - 接收者的地址
    • value: string - (可选)转移的值
    • data: string - (可选)编码的参数,编码规范参考Ethereum Contract ABI

返回值

  • object: - 执行的结果
    • currentBlockNumber: string - 当前区块高度
    • output: string - 请求结果
    • status: string - 请求状态(与交易状态码一致)
  • 示例
  1. // Request
  2. curl -X POST --data '{"jsonrpc":"2.0","method":"call","params":[1,{"from":"0x6bc952a2e4db9c0c86a368d83e9df0c6ab481102","to":"0xd6f1a71052366dbae2f7ab2d5d5845e77965cf0d","value":"0x1","data":"0x3"}],"id":1}' http://127.0.0.1:8545 |jq
  3. // Result
  4. {
  5. "id": 1,
  6. "jsonrpc": "2.0",
  7. "result": {
  8. "currentBlockNumber": "0xb",
  9. "output": "0x",
  10. "status": "0x0"
  11. }
  12. }