Upcoming changes constitute breaking public API changes to the rpcclient module, therefore, this follows the process for introducing major API breaks which consists of: - Bump the major version in the go.mod of the affected module if not already done since the last release tag - Add a replacement to the go.mod in the main module if not already done since the last release tag - Update all imports in the repo to use the new major version as necessary - Make necessary modifications to allow all other modules to use the new version in the same commit - Repeat the process for any other modules the require a new major as a result of consuming the new major(s) |
||
|---|---|---|
| .. | ||
| main.go | ||
| README.md | ||
dcrd Websockets Example
This example shows how to use the rpcclient package to connect to a dcrd RPC server using TLS-secured websockets, register for block connected and block disconnected notifications, and get the current block count.
This example also sets a timer to shutdown the client after 10 seconds to demonstrate clean shutdown.
Running the Example
After obtaining the source code, modify the main.go source to specify the
correct RPC username and password for the RPC server:
User: "yourrpcuser",
Pass: "yourrpcpass",
Then, navigate to the example's directory and run it with:
$ go run *.go
License
This example is licensed under the copyfree ISC License.