feat(vote): restored voting (now working over p2p)

This commit is contained in:
Alexey Kasyanchuk
2018-04-13 15:56:45 +03:00
parent 5407ef8c59
commit c8e37ae4b2
5 changed files with 38 additions and 17 deletions

View File

@ -17,6 +17,12 @@ class p2p {
this.p2pStatus = 0
this.version = '0'
this.info = {}
if(!config.peerId)
{
console.log('generate peerId')
config.peerId = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15)
}
this.peerId = config.peerId;
this.send = send
this.tcpServer = net.createServer();