mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-31 04:01:55 +00:00
docs: add client.Start() to RPC WS examples (#2936)
This commit is contained in:
committed by
Anton Kaliaev
parent
3d15579e0c
commit
9adcfe2804
@@ -54,11 +54,12 @@ import (
|
||||
// import "github.com/tendermint/tendermint/types"
|
||||
//
|
||||
// client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
|
||||
// err := client.Start()
|
||||
// ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||
// defer cancel()
|
||||
// query := query.MustParse("tm.event = 'Tx' AND tx.height = 3")
|
||||
// txs := make(chan interface{})
|
||||
// err := client.Subscribe(ctx, "test-client", query, txs)
|
||||
// err = client.Subscribe(ctx, "test-client", query, txs)
|
||||
//
|
||||
// go func() {
|
||||
// for e := range txs {
|
||||
@@ -116,7 +117,8 @@ func Subscribe(wsCtx rpctypes.WSRPCContext, query string) (*ctypes.ResultSubscri
|
||||
//
|
||||
// ```go
|
||||
// client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
|
||||
// err := client.Unsubscribe("test-client", query)
|
||||
// err := client.Start()
|
||||
// err = client.Unsubscribe("test-client", query)
|
||||
// ```
|
||||
//
|
||||
// > The above command returns JSON structured like this:
|
||||
@@ -155,7 +157,8 @@ func Unsubscribe(wsCtx rpctypes.WSRPCContext, query string) (*ctypes.ResultUnsub
|
||||
//
|
||||
// ```go
|
||||
// client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
|
||||
// err := client.UnsubscribeAll("test-client")
|
||||
// err := client.Start()
|
||||
// err = client.UnsubscribeAll("test-client")
|
||||
// ```
|
||||
//
|
||||
// > The above command returns JSON structured like this:
|
||||
|
Reference in New Issue
Block a user