From a4ddcdf51850b23b965ff8d50ab7ca7994ec3ec0 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 23 Jul 2022 02:48:02 -0400 Subject: [PATCH] *Refactor to start the dns up only after the ssl and server instances are ready so we don't announce ourselves on the registry pre-maturely --- src/index.ts | 2 -- src/rpc.ts | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index fa7bf76..b8ec677 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,8 +1,6 @@ -import { start as startDns } from "./dns.js"; import { start as startRpc } from "./rpc.js"; import { start as startRelay } from "./relay.js"; -await startDns(); await startRpc(); await startRelay(); diff --git a/src/rpc.ts b/src/rpc.ts index 9196ac3..f08043a 100644 --- a/src/rpc.ts +++ b/src/rpc.ts @@ -7,6 +7,7 @@ import NodeCache from "node-cache"; import { get as getDHT } from "./dht.js"; import { rpcMethods } from "./rpc/index.js"; import PocketPKG from "@pokt-network/pocket-js"; +import { start as startDns } from "./dns.js"; const { Configuration, HttpRpcProvider, PocketAAT, Pocket } = PocketPKG; import { @@ -245,6 +246,8 @@ export async function start() { jsonServer = new jayson.Server(rpcMethods, { useContext: true }); (await getDHT("server")).on("connection", RPCConnection.handleRequest); + + await startDns(); } class RPCConnection {