commit
a3bb039b80
@ -25,6 +25,7 @@ if(process.env.NODE_ENV === 'production')
|
|||||||
}
|
}
|
||||||
|
|
||||||
var socket = new Socket(process.env.WS_SERVER || 'ws://localhost:3000');
|
var socket = new Socket(process.env.WS_SERVER || 'ws://localhost:3000');
|
||||||
|
var WS_SECRET = process.env.WS_SECRET || "eth-net-stats-has-a-secret";
|
||||||
|
|
||||||
var MAX_BLOCKS_HISTORY = 12;
|
var MAX_BLOCKS_HISTORY = 12;
|
||||||
|
|
||||||
@ -74,7 +75,7 @@ function Node()
|
|||||||
web3.setProvider(new web3.providers.HttpSyncProvider('http://' + (process.env.RPC_HOST || 'localhost') + ':' + (process.env.RPC_PORT || '8080')));
|
web3.setProvider(new web3.providers.HttpSyncProvider('http://' + (process.env.RPC_HOST || 'localhost') + ':' + (process.env.RPC_PORT || '8080')));
|
||||||
|
|
||||||
socket.on('open', function open() {
|
socket.on('open', function open() {
|
||||||
socket.emit('hello', { id: self.id, info: self.info, secret: process.env.WS_SECRET });
|
socket.emit('hello', { id: self.id, info: self.info, secret: WS_SECRET });
|
||||||
console.log('The connection has been opened.');
|
console.log('The connection has been opened.');
|
||||||
}).on('end', function end() {
|
}).on('end', function end() {
|
||||||
self._socket = false;
|
self._socket = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user