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
+1 -1
View File
@@ -59,7 +59,7 @@ func dumpCmdHandler(_ *cobra.Command, args []string) error {
}
}
rpc, err := rpchttp.New(nodeRPCAddr, "/websocket")
rpc, err := rpchttp.New(nodeRPCAddr)
if err != nil {
return fmt.Errorf("failed to create new http client: %w", err)
}
+2 -2
View File
@@ -28,7 +28,7 @@ go-routine state, and the node's WAL and config information. This aggregated dat
is packaged into a compressed archive.
Example:
$ tendermint debug 34255 /path/to/tm-debug.zip`,
$ tendermint debug kill 34255 /path/to/tm-debug.zip`,
Args: cobra.ExactArgs(2),
RunE: killCmdHandler,
}
@@ -44,7 +44,7 @@ func killCmdHandler(cmd *cobra.Command, args []string) error {
return errors.New("invalid output file")
}
rpc, err := rpchttp.New(nodeRPCAddr, "/websocket")
rpc, err := rpchttp.New(nodeRPCAddr)
if err != nil {
return fmt.Errorf("failed to create new http client: %w", err)
}
+1 -1
View File
@@ -217,7 +217,7 @@ func runProxy(cmd *cobra.Command, args []string) error {
cfg.WriteTimeout = config.RPC.TimeoutBroadcastTxCommit + 1*time.Second
}
rpcClient, err := rpchttp.NewWithTimeout(primaryAddr, "/websocket", cfg.WriteTimeout)
rpcClient, err := rpchttp.NewWithTimeout(primaryAddr, cfg.WriteTimeout)
if err != nil {
return fmt.Errorf("failed to create http client for %s: %w", primaryAddr, err)
}