From 58ff8f2f9289640818c3e0ba18f599d35076d41a Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 15 Dec 2022 13:44:50 -0500 Subject: [PATCH] *Add methods get_bootstrap_info and get_connected_peers to debug --- src/modules/plugins/rpc.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/modules/plugins/rpc.ts b/src/modules/plugins/rpc.ts index 400a3cb..8b187ea 100644 --- a/src/modules/plugins/rpc.ts +++ b/src/modules/plugins/rpc.ts @@ -162,6 +162,21 @@ const plugin: Plugin = { .filter((item: any) => online.has(item)); }, }); + api.registerMethod("get_bootstrap_info", { + cacheable: false, + async handler(): Promise { + // @ts-ignore + return getRpcServer().cache.dhtCache._getBootstrapInfo(); + }, + }); + + api.registerMethod("get_connected_peers", { + cacheable: false, + async handler(): Promise { + // @ts-ignore + return [...getRpcServer().cache.dhtCache.connectedTo]; + }, + }); }, };