Skip to content

Instantly share code, notes, and snippets.

@nmarley
Created January 8, 2016 04:56
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 nmarley/4d08d667b0d9b0e9696e to your computer and use it in GitHub Desktop.
Save nmarley/4d08d667b0d9b0e9696e to your computer and use it in GitHub Desktop.
Example usage of node-coind
var util = require('util')
var coind = require('node-coind')
var client = new coind.Client({
host: 'localhost',
port: 9998, // production = 9998
user: process.env.DARKCOINRPC_USER,
pass: process.env.DARKCOINRPC_PASS
})
var cb = function (err, data) {
if (err) throw err;
//console.log(data);
console.log( util.inspect(data, false, null) );
}
var args = process.argv.slice(2)
args.push(cb)
// example usage: node dash.js getinfo
// node dash.js masternode list
client.cmd.apply(client, args)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment