forked from rust-bitcoin/rust-bitcoincore-rpc
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
77 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,6 @@ | ||
[](https://travis-ci.org/rust-bitcoin/rust-bitcoincore-rpc) | ||
`ord-bitcoincore-rpc` | ||
===================== | ||
|
||
# Rust RPC client for Bitcoin Core JSON-RPC | ||
|
||
This is a Rust RPC client library for calling the Bitcoin Core JSON-RPC API. It provides a layer of abstraction over | ||
[rust-jsonrpc](https://github.com/apoelstra/rust-jsonrpc) and makes it easier to talk to the Bitcoin JSON-RPC interface | ||
|
||
This git package compiles into two crates. | ||
1. [bitcoincore-rpc](https://crates.io/crates/bitcoincore-rpc) - contains an implementation of an rpc client that exposes | ||
the Bitcoin Core JSON-RPC APIs as rust functions. | ||
|
||
2. [bitcoincore-rpc-json](https://crates.io/crates/bitcoincore-rpc-json) - contains rust data structures that represent | ||
the json responses from the Bitcoin Core JSON-RPC APIs. bitcoincore-rpc depends on this. | ||
|
||
# Usage | ||
Given below is an example of how to connect to the Bitcoin Core JSON-RPC for a Bitcoin Core node running on `localhost` | ||
and print out the hash of the latest block. | ||
|
||
It assumes that the node has password authentication setup, the RPC interface is enabled at port `8332` and the node | ||
is set up to accept RPC connections. | ||
|
||
```rust | ||
extern crate bitcoincore_rpc; | ||
|
||
use bitcoincore_rpc::{Auth, Client, RpcApi}; | ||
|
||
fn main() { | ||
|
||
let rpc = Client::new("http://localhost:8332", | ||
Auth::UserPass("<FILL RPC USERNAME>".to_string(), | ||
"<FILL RPC PASSWORD>".to_string())).unwrap(); | ||
let best_block_hash = rpc.get_best_block_hash().unwrap(); | ||
println!("best block hash: {}", best_block_hash); | ||
} | ||
``` | ||
|
||
See `client/examples/` for more usage examples. | ||
|
||
# Supported Bitcoin Core Versions | ||
The following versions are officially supported and automatically tested: | ||
* 0.18.0 | ||
* 0.18.1 | ||
* 0.19.0.1 | ||
* 0.19.1 | ||
* 0.20.0 | ||
* 0.20.1 | ||
* 0.21.0 | ||
|
||
# Minimum Supported Rust Version (MSRV) | ||
This library should always compile with any combination of features on **Rust 1.56.1**. | ||
This crate is a fork of | ||
[rust-bitcoin/rust-bitcoincore-rpc](https://github.com/rust-bitcoin/rust-bitcoincore-rpc) | ||
for use in [ord](https://github.com/ordinals/ord/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
// | ||
|
||
use crate::bitcoin; | ||
use serde_json; | ||
|
||
use crate::client::Result; | ||
use crate::client::RpcApi; | ||
|
Oops, something went wrong.