-
Notifications
You must be signed in to change notification settings - Fork 133
crash & p2p question #28
Comments
awesome, thanks for creating this issue, Eric! looks like this is a bug I added in a recent release, caused by two nodes on the same machine trying to use the same tendermint home. will fix this now. I'm also just about to push some stuff that'll make your nodes discover and peer with each other automatically, no need to think about 🙌 |
Regarding the auto node discovery / peering stuff, I get the possibly erroneous impression that you want apps to use the same global chain? Though I can guess why you might go there (cosmos), it seems like a controversial engineering decision. From my efficiency minded perspective, it would be nice if there was a way to segment state machines simply. One approach to do this in Tendermint core without introducing deliberate namespaces would be for clusters to agree on a random 1Kb string at the start of a chain. Then if two clusters clash they can easily maintain their respective chains without worrying about a phat bandwidth bill. |
nah, no global chain, just peer discovery for your own chain through the bittorrent DHT and multicast DNS (through this module). you can also specify your own initial seed peers like let app = require('lotion')({ peers: ['localhost:46658'] }) but there's no way to set the p2p port to use at the moment. that'll also be added in the next published version. cosmos is all about independent, application-specific blockchains that can interoperate through common protocols. it's not about forcing your app to use any particular blockchain. you could even use Lotion for a completely private blockchain. |
hey @ericbets, have another look at the example now! should work if you run 😊 |
I got a crash before I was able to start a 3rd peer to see if 2 nodes was buggy. app.js https://gist.github.com/ericbets/18eb514190bc02066a62c1112d087fd8 |
ah, sorry about that, looks like when you ran it, it connected to the node I had running as well as starting a new chain, and since my node uses the same private key as yours for this example, it looks like a double-sign / fork to tendermint. I updated the example so that now your nodes will only peer with each other, should be pretty straight forward to extend the example to include more peers if that's what you're interested in testing! thanks @ericbets! |
I copied the counter.js file to counter2, counter3 and so on to listen on a few different ports. When I started counter.js on port 3000 and then started counter2.js on port 3001 I received this error:
/tmp/lotion/example/counter/node_modules/lotion/lib/tendermint.js:48 throw new Error('Tendermint node crashed') ^ Error: Tendermint node crashed at ChildProcess.tendermintProcess.on /tmp/lotion/example/counter/node_modules/lotion/lib/tendermint.js:48:11) at emitTwo (events.js:125:13) at ChildProcess.emit (events.js:213:7) at maybeClose (internal/child_process.js:927:16) at Socket.stream.socket.on (internal/child_process.js:348:11) at emitOne (events.js:115:13) at Socket.emit (events.js:210:7) at Pipe._handle.close [as _onclose] (net.js:547:12)
Once this issue gets solved, all I need to do is /dial_seeds to get them linked up right?
The text was updated successfully, but these errors were encountered: