mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
linting, etc.
This commit is contained in:
parent
8aac319895
commit
7efd2ffca3
@ -2,7 +2,7 @@
|
||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
|
||||
import DHT from '@hyperswarm/dht'
|
||||
import { Connection } from '@dbTools/typeorm'
|
||||
// import { Connection } from '@dbTools/typeorm'
|
||||
import { backendLogger as logger } from '@/server/logger'
|
||||
|
||||
function between(min: number, max: number) {
|
||||
@ -22,7 +22,7 @@ const nodeAPI = {
|
||||
}
|
||||
|
||||
export const startDHT = async (
|
||||
connection: Connection,
|
||||
// connection: Connection,
|
||||
topic: string,
|
||||
): Promise<void> => {
|
||||
try {
|
||||
@ -71,9 +71,6 @@ export const startDHT = async (
|
||||
const collectedPubKeys: string[] = []
|
||||
|
||||
for await (const data of result) {
|
||||
/* console.log(
|
||||
`${data.from.host}:${data.from.port}: peers: ${data.peers.length}`
|
||||
); */
|
||||
data.peers.forEach((peer: any) => {
|
||||
const pubKey = peer.publicKey.toString('hex')
|
||||
if (
|
||||
@ -93,13 +90,13 @@ export const startDHT = async (
|
||||
// publicKey here is keyPair.publicKey from above
|
||||
const socket = node.connect(Buffer.from(remotePubKey, 'hex'))
|
||||
|
||||
/* socket.once("connect", function () {
|
||||
console.log("client side emitted connect");
|
||||
}); */
|
||||
// socket.once("connect", function () {
|
||||
// console.log("client side emitted connect");
|
||||
// });
|
||||
|
||||
/* socket.once("end", function () {
|
||||
console.log("client side ended");
|
||||
}); */
|
||||
// socket.once("end", function () {
|
||||
// console.log("client side ended");
|
||||
// });
|
||||
|
||||
socket.once('error', (err: any) => {
|
||||
errorfulRequests.push(remotePubKey)
|
||||
|
||||
@ -7,7 +7,7 @@ import { startDHT } from '@/federation/index'
|
||||
import CONFIG from './config'
|
||||
|
||||
async function main() {
|
||||
const { app, con } = await createServer()
|
||||
const { app } = await createServer()
|
||||
|
||||
app.listen(CONFIG.PORT, () => {
|
||||
// eslint-disable-next-line no-console
|
||||
@ -20,7 +20,7 @@ async function main() {
|
||||
|
||||
// start DHT hyperswarm when DHT_TOPIC is set in .env
|
||||
if (CONFIG.DHT_TOPIC) {
|
||||
await startDHT(con, CONFIG.DHT_TOPIC)
|
||||
await startDHT(CONFIG.DHT_TOPIC) // con,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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": "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. */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user