namecoin-rpc

Communicate with namecoind via JSON-RPC


Keywords
namecoin, rpc
Install
npm install namecoin-rpc@2.1.2

Documentation

namecoin-rpc

namecoin-rpc is a simple wrapper for the namecoind client's JSON-RPC API.

This is a fork of the [node-bitcoin])https://github.com/freewil/node-bitcoin) repo and has been adapted for namecoin

The methods are exposed as lower camelcase methods on the rpc.Client object, or you may call the API directly using the cmd method.

Install

npm install namecoin-rpc

Examples

Create client

// all config options are optional
var rpc = require('namecoin-rpc');
var client = new rpc.Client({
  host: 'localhost',
  port: 8336,
  user: 'username',
  pass: 'password',
  timeout: 30000
});

GetInfo

client.getInfo( [], function(err, result, resHeaders) {
  if (err) return console.log(err);
  console.log(result);
});

GetIno directly using cmd

client.cmd('getinfo', [], function(err, result, resHeaders){
  if (err) return console.log(err);
  console.log(result);
});