ssr1ram / namecoin-rpc

Namecoin JSON-RPC client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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);
});

About

Namecoin JSON-RPC client


Languages

Language:JavaScript 100.0%