diff --git a/nimbus/config.nim b/nimbus/config.nim index 4ba55e8883..1760cf35d9 100644 --- a/nimbus/config.nim +++ b/nimbus/config.nim @@ -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 diff --git a/nimbus/rpc.nim b/nimbus/rpc.nim index de84341a56..c3276bf2c1 100644 --- a/nimbus/rpc.nim +++ b/nimbus/rpc.nim @@ -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): diff --git a/nimbus/rpc/experimental.nim b/nimbus/rpc/experimental.nim deleted file mode 100644 index 55e57ceb6a..0000000000 --- a/nimbus/rpc/experimental.nim +++ /dev/null @@ -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 diff --git a/tests/test_configuration.nim b/tests/test_configuration.nim index bef16f6705..77ad07d344 100644 --- a/tests/test_configuration.nim +++ b/tests/test_configuration.nim @@ -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()