如何获取 eth trace block

我想获取eth的 block trace,尝试几次都报错,我该如何做呢?

使用Go请求的报错

{\"code\":-32601,\"message\":\"The method debug_traceTransaction does not exist/is not available\"}

使用json rpc 的报错

sdev@n-app-14:~$ curl -X POST -H "Content-Type: application/json" http://02-04:8545 --data '{"jsonrpc": "2.0", "id": 1, "method": "debug_traceBlockByNumber", "params": ["latest"]}'
{"jsonrpc":"2.0","id":1,"error":{"code":-32601,"message":"the method debug_traceBlockByNumber does not exist/is not available"}}
请先 登录 后评论

最佳答案 2022-01-25 18:58

这个API默认没有开放,需要在启动geth节点的时候指定参数:

geth --http --http.api eth,net,web3,debug
请先 登录 后评论

其它 0 个回答