docs: add client#Start/Stop to examples in RPC docs (#2939)

follow-up on https://github.com/tendermint/tendermint/pull/2936
This commit is contained in:
Anton Kaliaev
2018-12-03 16:17:06 +04:00
committed by GitHub
parent 8ef0c2681d
commit d9a1aad5c5
9 changed files with 117 additions and 0 deletions

View File

@ -17,6 +17,11 @@ import (
//
// ```go
// client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
// err := client.Start()
// if err != nil {
// // handle error
// }
// defer client.Stop()
// info, err := client.NetInfo()
// ```
//
@ -95,6 +100,11 @@ func UnsafeDialPeers(peers []string, persistent bool) (*ctypes.ResultDialPeers,
//
// ```go
// client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
// err := client.Start()
// if err != nil {
// // handle error
// }
// defer client.Stop()
// genesis, err := client.Genesis()
// ```
//