Add upgrading notes for the new Events RPC interface. (#7993)

Add deprecation logs when websocket is enabled
As promised in ADR 075, this causes the node to log (without error) when
websocket transport is enabled, and also when subscribers connect.
This commit is contained in:
M. J. Fromberger
2022-02-24 15:04:55 -08:00
committed by GitHub
parent 3e2d5db289
commit 0875074ea2
3 changed files with 48 additions and 7 deletions
+2
View File
@@ -287,6 +287,8 @@ func (env *Environment) StartService(ctx context.Context, conf *config.Config) (
if conf.RPC.ExperimentalDisableWebsocket {
rpcLogger.Info("Disabling websocket endpoints (experimental-disable-websocket=true)")
} else {
rpcLogger.Info("WARNING: Websocket RPC access is deprecated and will be removed " +
"in Tendermint v0.37. See https://tinyurl.com/adr075 for more information.")
wmLogger := rpcLogger.With("protocol", "websocket")
wm := rpcserver.NewWebsocketManager(wmLogger, routes,
rpcserver.OnDisconnect(func(remoteAddr string) {
+2
View File
@@ -38,6 +38,8 @@ func (env *Environment) Subscribe(ctx context.Context, query string) (*coretypes
return nil, errors.New("maximum query length exceeded")
}
env.Logger.Info("WARNING: Websocket subscriptions are deprecated and will be removed " +
"in Tendermint v0.37. See https://tinyurl.com/adr075 for more information.")
env.Logger.Info("Subscribe to query", "remote", addr, "query", query)
q, err := tmquery.New(query)