【问题标题】:JSON-RPC Message error when starting geth node or testrpc启动 geth 节点或 testrpc 时出现 JSON-RPC 消息错误
【发布时间】:2017-02-27 00:07:29
【问题描述】:

我正在尝试创建一个专用网络,以便开始测试我的 Solidity 代码。但是,当使用 geth --rpc 启动 geth 专用网络时,我遇到了无效响应的错误。 {"jsonrpc":"2.0","error":{"code":-32600,"message":"EOF"}} 检查 localhost:8545 时。

我觉得没关系,但是我的 genesis.json 文件是

 {
"nonce": "0x0000000000000042",     "timestamp": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x0",     "gasLimit": "0x8000000",     "difficulty": "0x400",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x3333333333333333333333333333333333333333",     "alloc": {     }}

我也尝试使用 testrpc 仅使用命令 testrpc 创建测试网络,但这里 localhost:8545 返回解析错误 {"jsonrpc": "2.0", "id": null, "error": {"message": "Parse error", "code": -32700}}

我发送的 JSON 是什么,因为它似乎写错了?

谢谢

【问题讨论】:

    标签: json json-rpc ethereum private-network


    【解决方案1】:

    很难说你到底在尝试什么,但是 geth 的 JSON RPC 端点需要一个 JSON 命令,例如尝试使用以下请求查询 web3 版本:

    {
      "method": "web3_clientVersion",
      "params": []
    }
    

    它抱怨是因为你没有提供任何请求,即运行一个普通的 testrpc 命令。

    但在我读到的几行之间,您正在测试您的可靠性代码。你看过精彩的browser solidity吗?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-11-27
      • 2016-06-02
      • 1970-01-01
      • 2021-02-20
      • 2015-05-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多