dcrd/rpcclient/examples/dcrdwebsockets
Dave Collins 798914eb03
rpcclient: Start v8 module dev cycle.
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)
2022-03-30 17:40:06 -05:00
..
main.go rpcclient: Start v8 module dev cycle. 2022-03-30 17:40:06 -05:00
README.md multi: Update README.md files for go modules. 2021-01-22 14:39:23 -06:00

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.