Skip to content

Instantly share code, notes, and snippets.

@brandonlehmann
Created August 31, 2018 00:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandonlehmann/634e977a5dd23ba194ffa38cca24158c to your computer and use it in GitHub Desktop.
Save brandonlehmann/634e977a5dd23ba194ffa38cca24158c to your computer and use it in GitHub Desktop.
Sample TurtleCoind-ha Configuration
'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