-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update README.md #281
base: master
Are you sure you want to change the base?
Update README.md #281
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,8 @@ the Bitcoin Core JSON-RPC APIs as rust functions. | |
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. | ||
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. | ||
|
@@ -26,7 +26,7 @@ use bitcoincore_rpc::{Auth, Client, RpcApi}; | |
|
||
fn main() { | ||
|
||
let rpc = Client::new("http://localhost:8332", | ||
let rpc = Client::new("http://127.0.0.1:8332", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm pretty skeptical of this change, TBH. It explicitly encodes ipv4 and will break if Core is not listening on ipv4. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Understood, maybe just revert it back and add a short caveat at the bottom for those on macOS? its a pretty subtle "feature" of using this crate with macOS - kinda frustrating to run into (I had known about this actually but completely forgot). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm curious if there's any other network client crate that gets this "right". Definitely happy to add some extra text to the README suggesting that people try replacing |
||
Auth::UserPass("<FILL RPC USERNAME>".to_string(), | ||
"<FILL RPC PASSWORD>".to_string())).unwrap(); | ||
let best_block_hash = rpc.get_best_block_hash().unwrap(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you've added trailing whitespace here. Can you instead remove all the existing trailing whitespace?