mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
19 lines
447 B
TypeScript
19 lines
447 B
TypeScript
import DHT from '@hyperswarm/dht'
|
|
import { Connection } from '@dbTools/typeorm'
|
|
|
|
const POLLTIME = 20000
|
|
const SUCCESSTIME = 120000
|
|
const ERRORTIME = 240000
|
|
const ANNOUNCETIME = 30000
|
|
|
|
export const startDHT = async (connection: Connection, topic: string): Promise<void> => {
|
|
try {
|
|
console.log('topic', topic, typeof topic)
|
|
const buffer = Buffer.from(topic)
|
|
|
|
const TOPIC = DHT.hash(buffer)
|
|
} catch (err) {
|
|
console.log(err)
|
|
}
|
|
}
|