rm exp_ RPC API infrastructure; had no actual RPC endpoints (#2635)

* rm exp_ RPC API infrastructure; had no actual RPC endpoints

* update command-line flag descriptions
This commit is contained in:
tersec 2024-09-18 08:53:26 +00:00 committed by GitHub
parent 0ee8e61a3a
commit 3fb2e080ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 55 deletions

View File

@ -122,7 +122,6 @@ type
## RPC flags
Eth ## enable eth_ set of RPC API
Debug ## enable debug_ set of RPC API
Exp ## enable exp_ set of RPC API
DiscoveryType* {.pure.} = enum
None
@ -451,7 +450,7 @@ type
name: "rpc" }: bool
rpcApi {.
desc: "Enable specific set of RPC API (available: eth, debug, exp)"
desc: "Enable specific set of RPC API (available: eth, debug)"
defaultValue: @[]
defaultValueDesc: $RpcFlag.Eth
name: "rpc-api" }: seq[string]
@ -462,7 +461,7 @@ type
name: "ws" }: bool
wsApi {.
desc: "Enable specific set of Websocket RPC API (available: eth, debug, exp)"
desc: "Enable specific set of Websocket RPC API (available: eth, debug)"
defaultValue: @[]
defaultValueDesc: $RpcFlag.Eth
name: "ws-api" }: seq[string]
@ -702,7 +701,6 @@ proc getRpcFlags(api: openArray[string]): set[RpcFlag] =
case item.toLowerAscii()
of "eth": result.incl RpcFlag.Eth
of "debug": result.incl RpcFlag.Debug
of "exp": result.incl RpcFlag.Exp
else:
error "Unknown RPC API: ", name=item
quit QuitFailure

View File

@ -19,7 +19,6 @@ import
./rpc/jwt_auth,
./rpc/cors,
./rpc/rpc_server,
./rpc/experimental,
./rpc/oracle,
./rpc/server_api,
./nimbus_desc,
@ -33,7 +32,6 @@ export
jwt_auth,
cors,
rpc_server,
experimental,
oracle,
server_api
@ -49,7 +47,7 @@ func combinedServer(conf: NimbusConf): bool =
conf.httpServerEnabled and
conf.shareServerWithEngineApi
proc installRPC(server: RpcServer,
func installRPC(server: RpcServer,
nimbus: NimbusNode,
conf: NimbusConf,
com: CommonRef,
@ -65,9 +63,6 @@ proc installRPC(server: RpcServer,
# if RpcFlag.Debug in flags:
# setupDebugRpc(com, nimbus.txPool, server)
if RpcFlag.Exp in flags:
setupExpRpc(com, server)
server.rpc("admin_quit") do() -> string:
{.gcsafe.}:
nimbus.state = NimbusState.Stopping
@ -79,12 +74,12 @@ proc newRpcWebsocketHandler(): RpcWebSocketHandler =
wsserver: WSServer.new(rng = rng),
)
proc newRpcHttpHandler(): RpcHttpHandler =
func newRpcHttpHandler(): RpcHttpHandler =
RpcHttpHandler(
maxChunkSize: DefaultChunkSize,
)
proc addHandler(handlers: var seq[RpcHandlerProc],
func addHandler(handlers: var seq[RpcHandlerProc],
server: RpcHttpHandler) =
proc handlerProc(request: HttpRequestRef):
@ -100,7 +95,7 @@ proc addHandler(handlers: var seq[RpcHandlerProc],
handlers.add handlerProc
proc addHandler(handlers: var seq[RpcHandlerProc],
func addHandler(handlers: var seq[RpcHandlerProc],
server: RpcWebSocketHandler) =
proc handlerProc(request: HttpRequestRef):
@ -130,7 +125,7 @@ proc addHandler(handlers: var seq[RpcHandlerProc],
handlers.add handlerProc
proc addHandler(handlers: var seq[RpcHandlerProc],
func addHandler(handlers: var seq[RpcHandlerProc],
server: GraphqlHttpHandlerRef) =
proc handlerProc(request: HttpRequestRef):

View File

@ -1,17 +0,0 @@
# Nimbus
# Copyright (c) 2024 Status Research & Development GmbH
# Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
# at your option.
# This file may not be copied, modified, or distributed except according to
# those terms.
{.push raises: [].}
import json_rpc/rpcserver, ../constants, ../common/common
proc setupExpRpc*(com: CommonRef, server: RpcServer) =
# Currently no experimental endpoints
discard

View File

@ -111,18 +111,6 @@ proc configurationMain*() =
let cx = cc.getRpcFlags()
check { RpcFlag.Eth, RpcFlag.Debug } == cx
let dd = makeConfig(@["--rpc-api:eth", "--rpc-api:exp"])
let dx = dd.getRpcFlags()
check { RpcFlag.Eth, RpcFlag.Exp } == dx
let ee = makeConfig(@["--rpc-api:eth,exp"])
let ex = ee.getRpcFlags()
check { RpcFlag.Eth, RpcFlag.Exp } == ex
let ff = makeConfig(@["--rpc-api:eth,debug,exp"])
let fx = ff.getRpcFlags()
check { RpcFlag.Eth, RpcFlag.Debug, RpcFlag.Exp } == fx
test "ws-api":
let conf = makeTestConfig()
let flags = conf.getWsFlags()
@ -140,18 +128,6 @@ proc configurationMain*() =
let cx = cc.getWsFlags()
check { RpcFlag.Eth, RpcFlag.Debug } == cx
let dd = makeConfig(@["--ws-api:eth", "--ws-api:exp"])
let dx = dd.getWsFlags()
check { RpcFlag.Eth, RpcFlag.Exp } == dx
let ee = makeConfig(@["--ws-api:eth,exp"])
let ex = ee.getWsFlags()
check { RpcFlag.Eth, RpcFlag.Exp } == ex
let ff = makeConfig(@["--ws-api:eth,exp,debug"])
let fx = ff.getWsFlags()
check { RpcFlag.Eth, RpcFlag.Debug, RpcFlag.Exp } == fx
test "protocols":
let conf = makeTestConfig()
let flags = conf.getProtocolFlags()