From ab9e5c57120bc138443ac52a782f5ac9eac10e7b Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 4 May 2022 20:10:39 +0200 Subject: [PATCH] do I get this fucking shit running once? --- backend/src/federation/index.ts | 4 +++- backend/src/server/createServer.ts | 1 - backend/tsconfig.json | 7 ++----- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/backend/src/federation/index.ts b/backend/src/federation/index.ts index cd9747732..e20a7ee91 100644 --- a/backend/src/federation/index.ts +++ b/backend/src/federation/index.ts @@ -8,5 +8,7 @@ const ANNOUNCETIME = 30000 export const startDHT = async (connection: Connection, topic: string): Promise => { console.log('topic', topic, typeof topic) - // const TOPIC = DHT.hash(Buffer.from(topic)) + const buffer = Buffer.from(topic) + + const TOPIC = DHT.hash(buffer) } diff --git a/backend/src/server/createServer.ts b/backend/src/server/createServer.ts index e2ea8ea08..22bee0878 100644 --- a/backend/src/server/createServer.ts +++ b/backend/src/server/createServer.ts @@ -46,7 +46,6 @@ const createServer = async (context: any = serverContext): Promise => // start DHT hyperswarm when DHT_TOPIC is set in .env if (CONFIG.DHT_TOPIC) { - console.log('Starting hyperswarm DHT') await startDHT(con, CONFIG.DHT_TOPIC) } diff --git a/backend/tsconfig.json b/backend/tsconfig.json index d0039646f..a10b9f513 100644 --- a/backend/tsconfig.json +++ b/backend/tsconfig.json @@ -4,7 +4,7 @@ /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ - "target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */ + "target": "es2016", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */ "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ // "lib": [], /* Specify library files to be included in the compilation. */ // "allowJs": true, /* Allow javascript files to be compiled. */ @@ -58,10 +58,7 @@ "@entity/*": ["../database/entity/*", "../../database/build/entity/*"] }, // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - "typeRoots": [ /* List of folders to include type definitions from. */ - "src/federation/@types", - "node_modules/@types" - ], + "typeRoots": ["src/federation/@types"], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */