【问题标题】:Monero - Json RPC - Method not foundMonero - Json RPC - 找不到方法
【发布时间】:2018-09-27 12:50:37
【问题描述】:

嘿,我正在使用来自 monero 的最新命令行工具:

monerod:

Monero 'Lithium Luna' (v0.12.3.0-release)
Started using: ./monerod
Running on: 127.0.0.1:18081

monero-wallet-rpc:

Monero 'Lithium Luna' (v0.12.3.0-release)
Started using: ./monero-wallet-rpc --wallet-dir /path/to/wallets/ --rpc-bind-port 28081 --disable-rpc-login
Running on: 127.0.0.1:28081

我目前正在测试来自以下的 rpc 调用:

https://getmonero.org/resources/developer-guides/wallet-rpc.html

它们中的大多数都可以工作,但是有很多 rpc 调用似乎不起作用...

例如:

curl -X POST http://localhost:28081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"refresh"}' -H 'Content-Type: application/json'

返回:

{
  "error": {
    "code": -32601,
    "message": "Method not found"
  },
  "id": "0",
  "jsonrpc": "2.0"
}

谁能参考一下?

我使用的是最新版本,文档也是最新的。

谢谢和问候!

【问题讨论】:

    标签: methods blockchain rpc wallet cryptocurrency


    【解决方案1】:

    使用 json 中的 params 选项尝试此命令。

    curl -X POST http://localhost:28081/json_rpc \
    -d '{"jsonrpc":"2.0","id":"0","method":"refresh","params":{"start_height":100000}}' \
    -H 'Content-Type: application/json'
    

    【讨论】:

      【解决方案2】:

      问题在于您使用的 --rpc-bind-port 等同于 testnet 钱包 RPC 端口。尝试使用另一个值,如 40000 并改为 curl 。

      相关端口在命名空间'config'下:

      https://github.com/monero-project/monero/blob/master/src/cryptonote_config.h

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-08-17
        • 1970-01-01
        • 1970-01-01
        • 2021-12-08
        相关资源
        最近更新 更多