|
|
@ -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:
|
|
|
|