From f666eddf756980f1483b6cb780c73f41ba73dc2b Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Fri, 9 May 2014 21:09:09 -0500 Subject: [PATCH] Add README.md for bitcoincorehttp example. Also, change the port in the example to the mainnet RPC port. --- examples/bitcoincorehttp/README.md | 34 ++++++++++++++++++++++++++++++ examples/bitcoincorehttp/main.go | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 examples/bitcoincorehttp/README.md diff --git a/examples/bitcoincorehttp/README.md b/examples/bitcoincorehttp/README.md new file mode 100644 index 00000000..de01350a --- /dev/null +++ b/examples/bitcoincorehttp/README.md @@ -0,0 +1,34 @@ +Bitcoin Core HTTP POST Example +============================== + +This example shows how to use the btcrpcclient package to connect to a Bitcoin +Core RPC server using HTTP POST mode with TLS disabled and gets the current +block count. + +## Running the Example + +The first step is to use `go get` to download and install the btcrpcclient +package: + +```bash +$ go get github.com/conformal/btcrpcclient +``` + +Next, modify the `main.go` source to specify the correct RPC username and +password for the RPC server: + +```Go + User: "yourrpcuser", + Pass: "yourrpcpass", +``` + +Finally, navigate to the example's directory and run it with: + +```bash +$ cd $GOPATH/src/github.com/conformal/btcrpcclient/examples/bitcoincorehttp +$ go run *.go +``` + +## License + +This example is licensed under the [copyfree](http://copyfree.org) ISC License. diff --git a/examples/bitcoincorehttp/main.go b/examples/bitcoincorehttp/main.go index 605bf844..235a6158 100644 --- a/examples/bitcoincorehttp/main.go +++ b/examples/bitcoincorehttp/main.go @@ -12,7 +12,7 @@ import ( func main() { // Connect to local bitcoin core RPC server using HTTP POST mode. connCfg := &btcrpcclient.ConnConfig{ - Host: "localhost:18332", + Host: "localhost:8332", User: "yourrpcuser", Pass: "yourrpcpass", HttpPostMode: true, // Bitcoin core only supports HTTP POST mode