Skip to content

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

License

Notifications You must be signed in to change notification settings

mintlayer/bitcoin-rpc-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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": []
    }'

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages