Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All bootstrap nodes failed #1

Open
spayse opened this issue Feb 1, 2022 · 0 comments
Open

All bootstrap nodes failed #1

spayse opened this issue Feb 1, 2022 · 0 comments

Comments

@spayse
Copy link

spayse commented Feb 1, 2022

you can't imagine how painful it is to ask for help. i'm supposed to be a jedi. unfortunately the stupid light saber broke in the middle of my livestream as i am tooting my own horn. it was mad embarrassing.

so i can no longer connect to the default dht servers like out of the blue. i even ran some of your example code modified slightly and instead of the two (1 local behind firewall router switch etc, one cloud facing internet) passing hello messages, i get this :
at listOnTimeout (node:internal/timers:557:17)
at processTimers (node:internal/timers:500:7)
fully joined...
network capabilities {
bound: true,
boostrapped: false,
bootstrapped: false,
holepunched: false
} Error: All bootstrap nodes failed
at /home/spayse/swarmtest/node_modules/@dwebswarm/discovery/index.js:245:36
at Object.callback (/home/spayse/swarmtest/node_modules/dht-rpc/index.js:199:23)
at IO._finish (/home/spayse/swarmtest/node_modules/dht-rpc/lib/io.js:158:9)
at IO._cancel (/home/spayse/swarmtest/node_modules/dht-rpc/lib/io.js:207:10)
at IO._ontick (/home/spayse/swarmtest/node_modules/dht-rpc/lib/io.js:231:12)
at listOnTimeout (node:internal/timers:557:17)
at processTimers (node:internal/timers:500:7)
All bootstrap nodes failed

its breaking my heart because i am very close to launching decentralized p2p social media blockchain

here is the code

'use strict'
const { inspect } = require('util')
let ma,mb=" "
const dwebswarm1 = require('dwebswarm')
const dwebswarm = require('dwebswarm')
const crypto = require('crypto')
const myName= "Bubba"
let mySock
let sockets
const id=crypto.createHash('sha256')
.update(myName)
.digest()

const swarm1 = dwebswarm({
id:Buffer.from(id),
announceLocalAddress: true,
keepExistingConnections: true,
maxPeers: 120,
ephemeral:true,
requeue: 5000,
lookup: true,
announce: true

})

const swarm2 = dwebswarm1({
id:Buffer.from(id),
announceLocalAddress: true,
keepExistingConnections: true,
maxPeers: 120,
ephemeral:false,
requeue: 5000,
lookup: true,
announce: true
})
function writer(msg){
if (sockets)
sockets.forEach(socket=>{
socket.write(Buffer.from(msg))

})
}

const topica=Buffer.from("BubbleDapp")
//if (!process.argv[2]) { throw Error('node example.js ') }

const bubmain = crypto.createHash('sha256')
.update(topica)
.digest()

function connectSwarm(swarm,key){
swarm.connectivity((err, capabilities) => {
console.log('network capabilities', capabilities, err || '')
})
swarm.setMaxListeners(300)
swarm.join(key, {

announce: true,
lookup: true
}, function () {
console.log('fully joined...')
})

swarm.on('connection', function (socket, info) {
mySock=socket
domsg()
sockets=[]
const {
priority,
status,
retries,
peer,
client
} = info
console.log('new connection!', priority: ${priority} status: ${status} retries: ${retries} client: ${client} peer: ${!peer ? peer :
${inspect(peer, { indentationLvl: 4 }).slice(2, -2)}
} )

if (client) process.stdin.pipe(socket)
else socket.pipe(process.stdout)

socket.on("data",data=>{

    console.log(data.toString())
 
 // ma = data.toString()

})
sockets.push(mySock)

})

}

function domsg(){

let k = "hi"+myName

setTimeout(() => {
writer(k)
}, 5555);

let y = "this msg is new "+myName

setTimeout(() => {
writer(y)
writer(y)
}, 17000);

}
connectSwarm(swarm1,bubmain)
connectSwarm(swarm2,id)

if (mb!==ma){writer(ma)}

i can see how to setup the dht and make some sort of private swarm or something but that gives me a centralized server for my enemies/rivals to exploit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant