Need help with rpc/rest interface


#1

Hi, question about using rpc interface from running lbrycrd on local network - when I open 127.0.0.1:9245 in chrome then I get message “JSONRPC server handles only POST requests”

Ok … but for example with “127.0.0.1:9245/getinfo” or /status I get the error “Page not found”. Whats the right syntax to get correct rpc infos over url!?

Or can I use REST interface? I have activated it (REST=1 in config) but curl in console (curl 127.0.0.1:18332/rest/chaininfo.json) give me no access!?

By the way: I have just seen in the logs that the windows wallet has also api interface: “lbrynet API listening on TCP localhost:5279”


#2

To use the lbrycrdd json api below are some sample curl request:

curl -v --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getclaimsfortx", "params": ["cb730df84f51a7d0272ed09d4b0fd6ba7c9c49e0e828371601b9f3fca7bab267"] }' -H 'content-type: application/json;' http://lbry:lbry@127.0.0.1:9245/

curl -v --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getrawtransaction", "params": ["947040264fc3bd07029d1a4a8856950226763fd6cc90f99cd05853e6a83ee102",1] }' -H 'content-type: application/json;' http://lbry:lbry@127.0.0.1:9245/

curl -v --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getclaimbyid", "params": ["e8a793484074bf2aab0967acb50940849be13c12"] }' -H 'content-type: application/json;' http://lbry:lbry@127.0.0.1:9245/

curl -v --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblock", "params": ["f0e56e70782af63ccb49c76e852540688755869ba59ec68cac9c04a6b4d9f5ca"] }' -H 'content-type: application/json;' http://lbry:lbry@127.0.0.1:9245/

#3

OP was able to find a solution:
I found now a solution for myself to get over the rest api interface the stats and more infos from lbry network (from local running lbrycrd). For those who are interested and maybe need it: http://<ip daemon>:9245/rest/<request>.json Example: http://192.168.0.10:9245/rest/chaininfo.json More infos and possible requests here: https://github.com/lbryio/lbrycrd/blob/master/doc/REST-interface.md(edited)


#4

Thank you for the console version with curl.