do I get this fucking shit running once?

This commit is contained in:
Moriz Wahl 2022-05-04 20:10:39 +02:00
parent d514886728
commit ab9e5c5712
3 changed files with 5 additions and 7 deletions

View File

@ -8,5 +8,7 @@ const ANNOUNCETIME = 30000
export const startDHT = async (connection: Connection, topic: string): Promise<void> => {
console.log('topic', topic, typeof topic)
// const TOPIC = DHT.hash(Buffer.from(topic))
const buffer = Buffer.from(topic)
const TOPIC = DHT.hash(buffer)
}

View File

@ -46,7 +46,6 @@ const createServer = async (context: any = serverContext): Promise<ServerDef> =>
// 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)
}

View File

@ -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'. */