Created
August 31, 2018 00:20
-
-
Save brandonlehmann/634e977a5dd23ba194ffa38cca24158c to your computer and use it in GitHub Desktop.
Sample TurtleCoind-ha Configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const TurtleCoind = require('turtlecoind-ha') | |
const util = require('util') | |
var daemon = new TurtleCoind({ | |
loadCheckpoints: './checkpoints.csv', | |
feeAddress: 'someturtleaddress', | |
feeAmount: 5000, | |
}) | |
function log (message) { | |
console.log(util.format('%s: %s', (new Date()).toUTCString(), message)) | |
} | |
daemon.on('start', (args) => { | |
log(util.format('TurtleCoind has started... %s', args)) | |
}) | |
daemon.on('started', () => { | |
log('TurtleCoind is attempting to synchronize with the network...') | |
}) | |
daemon.on('syncing', (info) => { | |
log(util.format('TurtleCoind has syncronized %s out of %s blocks [%s%]', info.height, info.network_height, info.percent)) | |
}) | |
daemon.on('synced', () => { | |
log('TurtleCoind is synchronized with the network...') | |
}) | |
daemon.on('ready', (info) => { | |
log(util.format('TurtleCoind is waiting for connections at %s @ %s - %s H/s', info.height, info.difficulty, info.globalHashRate)) | |
}) | |
daemon.on('desync', (daemon, network, deviance) => { | |
log(util.format('TurtleCoind is currently off the blockchain by %s blocks. Network: %s Daemon: %s', deviance, network, daemon)) | |
}) | |
daemon.on('down', () => { | |
log('TurtleCoind is not responding... stopping process...') | |
daemon.stop() | |
}) | |
daemon.on('stopped', (exitcode) => { | |
log(util.format('TurtleCoind has closed (exitcode: %s)... restarting process...', exitcode)) | |
daemon.start() | |
}) | |
daemon.on('info', (info) => { | |
log(info) | |
}) | |
daemon.on('error', (err) => { | |
log(err) | |
}) | |
daemon.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment