请问怎么用jsonrpc4j调用eth查询的rpc

{"id":26,"jsonrpc":"2.0","method":"eth_call","params":[{"data":"0x293c2958","from":"0x0376bd02af21006c32eA46A2E323EF22ff10B520","to":"0x44E09f556102D361112dE04aCce162e1D69d870B"},"latest"]}



String methodName = "eth_call";
String url = "https://mainnet.infura.io/v3/da934ef9865046ef94b5e09edbadeb9e";
String params = "{\"data\":\"0x293c2958\",\"from\":\"0x0376bd02af21006c32eA46A2E323EF22ff10B520\",\"to\":\"0x44E09f556102D361112dE04aCce162e1D69d870B\"}";
JsonRpcHttpClient client = new JsonRpcHttpClient(new URL(url));

Object result = client.invoke(methodName, new Object[]{params,"latest"}, Object.class);
Log.e("xxx", result.toString());

如上面的数据,怎么用jsonrpc4j 去调用

用java的代码,注一定要java代码,下载这个是我写的,但是总是

报 httpExcextion :close 

或者:com.googlecode.jsonrpc4j.JsonRpcClientException: invalid argument 0: json: cannot unmarshal string into Go value of type ethapi.CallArgs






请先 登录 后评论
  • 0 关注
  • 0 收藏,63 浏览
  • 提出于 2018-11-26 22:31

相似问题