From 3b0277837034744895ab5a8406836e9028d8e95b Mon Sep 17 00:00:00 2001 From: benbierens Date: Thu, 15 Jun 2023 08:42:41 +0200 Subject: [PATCH] Removes unused debug support --- codex/rest/api.nim | 29 ----------------------------- docker/debug/buildlocal.bat | 2 -- docker/debug/buildsetup.bat | 2 -- docker/debug/local.Dockerfile | 12 ------------ docker/debug/setup.Dockerfile | 6 ------ 5 files changed, 51 deletions(-) delete mode 100644 docker/debug/buildlocal.bat delete mode 100644 docker/debug/buildsetup.bat delete mode 100644 docker/debug/local.Dockerfile delete mode 100644 docker/debug/setup.Dockerfile diff --git a/codex/rest/api.nim b/codex/rest/api.nim index 6069a299..04f1218b 100644 --- a/codex/rest/api.nim +++ b/codex/rest/api.nim @@ -46,33 +46,6 @@ proc validate( {.gcsafe, raises: [Defect].} = 0 -proc formatEnginePeers(peers: OrderedTable[PeerId, BlockExcPeerCtx]): JsonNode = - let jarray = newJArray() - for key, value in peers: - jarray.add(%* - { - "peerId": $key, - "context": { - "blocks": value.blocks.len, - "peerWants": value.peerWants.len, - "exchanged": value.exchanged, - "lastExchange": $(value.lastExchange), - } - }) - - return jarray - -proc formatSwitchPeers(peers: Table[PeerId, seq[MultiAddress]]): JsonNode = - let jarray = newJArray() - for key, value in peers: - jarray.add(%* - { - "peerId": $key, - "numberOfAddresses": $value.len - }) - - return jarray - proc initRestApi*(node: CodexNodeRef, conf: CodexConf): RestRouter = var router = RestRouter.init(validate) router.api( @@ -272,8 +245,6 @@ proc initRestApi*(node: CodexNodeRef, conf: CodexConf): RestRouter = node.discovery.dhtRecord.get.toURI else: "", - "enginePeers": formatEnginePeers(node.engine.peers.peers), - "switchPeers": formatSwitchPeers(node.switch.peerStore[AddressBook].book), "codex": { "version": $codexVersion, "revision": $codexRevision diff --git a/docker/debug/buildlocal.bat b/docker/debug/buildlocal.bat deleted file mode 100644 index 647eff42..00000000 --- a/docker/debug/buildlocal.bat +++ /dev/null @@ -1,2 +0,0 @@ -docker build -t thatbenbierens/codexlocal:latest -f codex.Dockerfile .. -docker push thatbenbierens/codexlocal:latest diff --git a/docker/debug/buildsetup.bat b/docker/debug/buildsetup.bat deleted file mode 100644 index d5288108..00000000 --- a/docker/debug/buildsetup.bat +++ /dev/null @@ -1,2 +0,0 @@ -docker build -t thatbenbierens/codexsetup:latest -f setup.Dockerfile .. -docker push thatbenbierens/codexsetup:latest diff --git a/docker/debug/local.Dockerfile b/docker/debug/local.Dockerfile deleted file mode 100644 index 33e160c9..00000000 --- a/docker/debug/local.Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM thatbenbierens/codexsetup:latest AS builder -WORKDIR /src -COPY ./codex ./codex -COPY ./docker ./docker -RUN make NIM_PARAMS="-d:disableMarchNative" - -FROM alpine:3.17.2 -WORKDIR /root/ -RUN apk add --no-cache openssl libstdc++ libgcc libgomp -COPY --from=builder /src/build/codex ./ -COPY --from=builder /src/docker/startCodex.sh ./ -CMD ["sh", "startCodex.sh"] diff --git a/docker/debug/setup.Dockerfile b/docker/debug/setup.Dockerfile deleted file mode 100644 index 7dea95bb..00000000 --- a/docker/debug/setup.Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM nimlang/nim:1.6.10-alpine AS builder -WORKDIR /src -RUN apk update && apk add git cmake curl make git bash linux-headers -COPY . . -RUN make clean -RUN make update