Skip to content

Latest commit

 

History

History
45 lines (37 loc) · 1.05 KB

README.md

File metadata and controls

45 lines (37 loc) · 1.05 KB

bitcoin-rpc-api

JSONRPC supported interface using bitcoincore-rpc's RpcApi trait to access bitcoin RPC methods.

example bitcoin.conf

server=1
rest=1
daemon=1

rpcuser=<username>
rpcpassword=<password>
rpcport=8332

rpcallowip=<your_ip_address>

## only for testing, but still, avoid this
#rpcallowip=0.0.0.0/0

rpcallowip=127.0.0.1

rpcbind=127.0.0.1

how to add in substrate's node's rpc.rs:

inside rpc.rs

io.extend_with(
  BitcoinJsonRPCApi::to_delegate(new_client(
    "http://btc.mintlayer.org:8332".to_string(),
    "admin".to_string(),
    "admin".to_string()
  ))
);

curl example when used with substrate:

following an example in substrate recipes,

 $ curl http://localhost:9933 -H "Content-Type:application/json;charset=utf-8" -d   '{
     "jsonrpc":"2.0",
      "id":1,
      "method":"getnetworkinfo",
      "params": []
    }'