[lbry] rpc: update README.md for examples

This commit is contained in:
Roy Lee 2022-01-04 09:59:47 -08:00
parent 1e6d53b950
commit b6d3f5d21e

View file

@ -1,5 +1,4 @@
lbcd Websockets Example # lbcd Websockets Example
=======================
This example shows how to use the rpcclient package to connect to a btcd RPC This example shows how to use the rpcclient package to connect to a btcd RPC
server using TLS-secured websockets, register for block connected and block server using TLS-secured websockets, register for block connected and block
@ -7,25 +6,27 @@ disconnected notifications, and get the current block count.
## Running the Example ## Running the Example
The first step is to use `go get` to download and install the rpcclient package: The first step is to clone the lbcd package:
```bash ```bash
$ go get github.com/lbryio/lbcd/rpcclient $ git clone github.com/lbryio/lbcd
``` ```
Next, modify the `main.go` source to specify the correct RPC username and Next, navigate to the example's directory and modify the `main.go` source to
password for the RPC server: specify the correct RPC username and password for the RPC server:
```bash
$ cd rpcclient/examples/lbcdblocknotify
```
```Go ```Go
User: "yourrpcuser", User: "yourrpcuser",
Pass: "yourrpcpass", Pass: "yourrpcpass",
``` ```
Finally, navigate to the example's directory and run it with: Finally, run it with:
```bash ```bash
$ git clone github.com/lbryio/lbcd
$ cd rpcclient/examples/lbcdblocknotify
$ go run . $ go run .
``` ```