Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Blockchain 如何使用infura使用eth_call_Blockchain - Fatal编程技术网

Blockchain 如何使用infura使用eth_call

Blockchain 如何使用infura使用eth_call,blockchain,Blockchain,大家好,我试着用infura编写测试代码 我已经构建了这样的json消息 {"jsonrpc":"2.0","method":"eth_call","params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155","to": "0xd46e8dd67c5d32be8

大家好,我试着用infura编写测试代码

我已经构建了这样的json消息

{"jsonrpc":"2.0","method":"eth_call","params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155","to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567","gas": "0x76c0","gasPrice": "0x0.1999999999999a","value": "0x9.e666666666668","data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"],"id":1}
但我得到了回应

{ “jsonrpc”:“2.0”, “id”:1, “错误”:{ “代码”:-32602, “消息”:“无效参数0:json:无法将前导零位的十六进制数解组到Go结构字段CallArgs.gasPrice中,类型为*hexutil.Big” } }

我想发送有关的信息

  • 我使用infura文档中的默认值使用from、to和数据,如下例所示:

    {“jsonrpc”:“2.0”,“方法”:“eth_调用”,“参数”:[{“from”:“0xb60e8dd61c5d32be8058bb8eb970870f07233155”,“to”:“0xd46e8dd67c5d32be8058bb8eb970870f07244567”,“gas”:“0x76c0”,“gasPrice”:“0x9184e72a000”,“值”:“0x9184e72a”,“数据”:“0xD46E8DDD46E67C5D32BE8D46E8D46E8DD67D32BE8058BB8EB97070707070707070705758BB970075”,“最新版本”]

  • 对于气体,我使用0,所以我的十六进制是0x0

  • 对于gasprice,我使用0.1,因此我的十六进制将是0x0.19999999a

  • 对于值,我使用0.9,因此我的十六进制将是0x9.E6668