rpc/client/http: drop endpoint arg from New and add WSOptions (#6176)

also

- replace `MaxReconnectAttempts`, `ReadWait`, `WriteWait` and `PingPeriod` options with `WSOptions` in `WSClient` (rpc/jsonrpc/client/ws_client.go).
- set default write wait to 10s for `WSClient`(rpc/jsonrpc/client/ws_client.go)
- unexpose `WSEvents`(rpc/client/http.go)

Closes #6162
This commit is contained in:
Anton Kaliaev
2021-02-25 06:57:31 +00:00
committed by GitHub
parent bd14bb66e9
commit e9e5026dac
15 changed files with 344 additions and 314 deletions
+4 -4
View File
@@ -340,7 +340,7 @@ paths:
import rpchttp "github.com/tendermint/rpc/client/http"
import "github.com/tendermint/tendermint/types"
client := rpchttp.New("tcp:0.0.0.0:26657", "/websocket")
client := rpchttp.New("tcp://0.0.0.0:26657")
err := client.Start()
if err != nil {
handle error
@@ -397,7 +397,7 @@ paths:
operationId: unsubscribe
description: |
```go
client := rpchttp.New("tcp:0.0.0.0:26657", "/websocket")
client := rpchttp.New("tcp://0.0.0.0:26657")
err := client.Start()
if err != nil {
handle error
@@ -1221,7 +1221,7 @@ components:
example: "5576458aef205977e18fd50b274e9b5d9014525a"
listen_addr:
type: string
example: "tcp:0.0.0.0:26656"
example: "tcp://0.0.0.0:26656"
network:
type: string
example: "cosmoshub-2"
@@ -1242,7 +1242,7 @@ components:
example: "on"
rpc_address:
type: string
example: "tcp:0.0.0.0:26657"
example: "tcp://0.0.0.0:26657"
SyncInfo:
type: object
properties: