mirror of
https://github.com/ulfgebhardt/poc_federation_dht.git
synced 2025-12-13 02:05:48 +00:00
keep announcing peer to not fall off the list
This commit is contained in:
parent
f40d8f8fbc
commit
53c943ff86
@ -7,6 +7,7 @@ const TOPIC = DHT.hash(Buffer.from('GRADIDO'))
|
|||||||
const POLLTIME = 20000
|
const POLLTIME = 20000
|
||||||
const SUCCESSTIME = 120000
|
const SUCCESSTIME = 120000
|
||||||
const ERRORTIME = 240000
|
const ERRORTIME = 240000
|
||||||
|
const ANNOUNCETIME = 30000
|
||||||
const nodeRand = between(1, 99)
|
const nodeRand = between(1, 99)
|
||||||
const nodeURL = `https://test${nodeRand}.org`
|
const nodeURL = `https://test${nodeRand}.org`
|
||||||
const nodeAPI = {
|
const nodeAPI = {
|
||||||
@ -39,7 +40,10 @@ const main = async () => {
|
|||||||
|
|
||||||
await server.listen()
|
await server.listen()
|
||||||
|
|
||||||
await node.announce(TOPIC, keyPair).finished()
|
setInterval(async () => {
|
||||||
|
console.log('Announcing on topic:', TOPIC.toString('hex'))
|
||||||
|
await node.announce(TOPIC, keyPair).finished()
|
||||||
|
}, ANNOUNCETIME)
|
||||||
|
|
||||||
let successfulRequests: string[] = []
|
let successfulRequests: string[] = []
|
||||||
let errorfulRequests: string[] = []
|
let errorfulRequests: string[] = []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user