Closed foreso-GitHub closed 4 years ago
在7545上试了还是出错: { "id": 1, "jsonrpc": "2.0", "result": "not such method: jt_sign", "status": "error" }
9545, 是链啊。。。
试下9545端口试试,我刚才也用7545试了半天,一直有问题,重新部署N次,以为部署有问题,结果发现测错端口了。。。
{"jsonrpc":"2.0","method":"jt_sign", "params":[ { "from":"root", "message":"deadbeaf" } ],"id":1}
执行成功: {"jsonrpc":"2.0","method":"jt_sign", "params":[ { "from":"jPdevNK8NeYSkg3TrWZa8eT6BrSp2oteUh", "secret":"ssSLJReyitmAELQ3E3zYpZti1YuRe", "message":"deadbeaf" } ],"id":1}
但是文档需要更新:https://github.com/caivega/ipfslib/wiki/ipfslib%E7%9A%84JSON_RPC%E6%89%8B%E5%86%8C#jt_sign
执行带secret参数的jt_sign请求 { "jsonrpc": "2.0", "method": "jt_sign", "params": [ "jPdevNK8NeYSkg3TrWZa8eT6BrSp2oteUh", "ssSLJReyitmAELQ3E3zYpZti1YuRe", "1230023424244000" ], "id": 1 } 返回: { "id": 1, "jsonrpc": "2.0", "result": "No secret found for jPdevNK8NeYSkg3TrWZa8eT6BrSp2oteUh", "status": "error" }
返回错误: { "id": 1, "jsonrpc": "2.0", "result": "No secret found for jPdevNK8NeYSkg3TrWZa8eT6BrSp2oteUh", "status": "error" }
但是用不带secret的root帐号执行是能成功的。 { "jsonrpc": "2.0", "method": "jt_sign", "params": [ "jHb9CJAWyB4jr91VRWn96DkukG4bwdtyTh", "1230023424244000" ], "id": 1 }
文档里jt_sign也应该增加一下secret参数的说明。