|
@@ -8,6 +8,7 @@ require('gun/sea')
|
|
require('gun/lib/path')
|
|
require('gun/lib/path')
|
|
require('gun/lib/not')
|
|
require('gun/lib/not')
|
|
require('gun/nts')
|
|
require('gun/nts')
|
|
|
|
+require('gun/lib/bye')
|
|
|
|
|
|
config.readConfigFile();
|
|
config.readConfigFile();
|
|
var conf = config.parseConfigOptions();
|
|
var conf = config.parseConfigOptions();
|
|
@@ -22,5 +23,29 @@ if (conf.ssl) {
|
|
config.server = require('http').createServer(Gun.serve(__dirname));
|
|
config.server = require('http').createServer(Gun.serve(__dirname));
|
|
}
|
|
}
|
|
|
|
|
|
-global.gun = Gun({ web: config.server.listen(config.port), axe: false }); //until: 5000, chunk: 10
|
|
|
|
-console.log('Relay peer started on port ' + config.port + ' with /gun');
|
|
|
|
|
|
+global.gun = Gun({ web: config.server.listen(config.port), axe: false}); //until: 5000, chunk: 10
|
|
|
|
+console.log('Relay peer started on port ' + config.port + ' with /gun');
|
|
|
|
+
|
|
|
|
+let tickMsg = {
|
|
|
|
+ parameters: [],
|
|
|
|
+ time: 'tick'//hb
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+global.gun.get('server').get('heartbeat').get('tick').put(JSON.stringify(tickMsg));
|
|
|
|
+
|
|
|
|
+//instance.get('heartbeat').put({ tick: "{}" }).heartbeat(0.0, 1);
|
|
|
|
+
|
|
|
|
+setInterval(function () {
|
|
|
|
+
|
|
|
|
+ let message = {
|
|
|
|
+ parameters: [],
|
|
|
|
+ time: 'tick'//hb
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ global.gun.get('server').get('heartbeat').get('tick').put(JSON.stringify(message),function(ack){
|
|
|
|
+ if(ack.err){
|
|
|
|
+ console.log('ERROR: ' + ack.err)
|
|
|
|
+
|
|
|
|
+ }});
|
|
|
|
+
|
|
|
|
+}, 50); //FIX ERR: syncing c
|