diff --git a/backend/src/federation/index.ts b/backend/src/federation/index.ts index e20a7ee91..5dabd3e24 100644 --- a/backend/src/federation/index.ts +++ b/backend/src/federation/index.ts @@ -7,8 +7,12 @@ const ERRORTIME = 240000 const ANNOUNCETIME = 30000 export const startDHT = async (connection: Connection, topic: string): Promise => { - console.log('topic', topic, typeof topic) - const buffer = Buffer.from(topic) + try { + console.log('topic', topic, typeof topic) + const buffer = Buffer.from(topic) - const TOPIC = DHT.hash(buffer) + const TOPIC = DHT.hash(buffer) + } catch (err) { + console.log(err) + } } diff --git a/backend/tsconfig.json b/backend/tsconfig.json index a10b9f513..6a59eb2c0 100644 --- a/backend/tsconfig.json +++ b/backend/tsconfig.json @@ -4,7 +4,7 @@ /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ - "target": "es2016", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */ + "target": "es6", /* 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,7 +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": ["src/federation/@types"], /* List of folders to include type definitions from. */ + "typeRoots": ["src/federation/@types", "node_modules/@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'. */