mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-11 10:36:18 +00:00
rpc: consolidate RPC route map construction (#7582)
Define interfaces for the various methods a service may implement. This is basically just the set of things on Environment that are exported as RPCs, but these are also implemented by the light proxy. * internal/rpc: use NewRoutesMap to construct routes on service start * light/proxy: use NewRoutesMap to construct RPC routes
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"net/http"
|
||||
|
||||
tmpubsub "github.com/tendermint/tendermint/internal/pubsub"
|
||||
rpccore "github.com/tendermint/tendermint/internal/rpc/core"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
"github.com/tendermint/tendermint/light"
|
||||
lrpc "github.com/tendermint/tendermint/light/rpc"
|
||||
@@ -90,7 +91,7 @@ func (p *Proxy) listen(ctx context.Context) (net.Listener, *http.ServeMux, error
|
||||
mux := http.NewServeMux()
|
||||
|
||||
// 1) Register regular routes.
|
||||
r := RPCRoutes(p.Client)
|
||||
r := rpccore.NewRoutesMap(proxyService{Client: p.Client}, nil)
|
||||
rpcserver.RegisterRPCFuncs(mux, r, p.Logger)
|
||||
|
||||
// 2) Allow websocket connections.
|
||||
|
||||
Reference in New Issue
Block a user