Socket
Book a DemoInstallSign in
Socket

coind-client

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coind-client

JSON-RPC client for crypto-currency bitcoind-based daemons. Adheres to Node.js/JavaScript callback/control-flow conventions/style.

0.0.1
latest
Source
npmnpm
Version published
Weekly downloads
6
Maintainers
1
Weekly downloads
 
Created
Source

coind-client

Client for crypto-currency bitcoind-based daemons.

Code adapted from https://github.com/freewil/node-bitcoin to adhere to the Node.js/JavaScript callback/control-flow conventions/style, and to provide for faster/wrapper-less initialization.

Usage


var coind = require('coind-client');

var client = new coind.Client({
  host: 'localhost',
  port: 8332,
  user: 'username',
  pass: 'password'
});

// single request use:

client.cmd('getbalance', '*', 6, function(err, balance) {
  if(err)
    // handle error; e.g. with laeh2
  console.log('Balance: %d', balance);
});

// batch request use:

var batch = [];
for (var i = 0; i < 10; ++i) {
  batch.push({
    method: 'getnewaddress',
    params: ['myaccount']
  });
}

client.cmd(batch, function(errors, addresses) {
  if(errors)
    // handle errors; e.g. with laeh2
  for(var i = 0; i < addresses.length; i++)
    console.log('Address: %s', addresses[i]);
});

Daemon API reference / Available commands

https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list

How to install litecoind (or equivalent daemon) (taken from cryptoengine)

First, the basic install (for ubuntu) :

$ sudo apt-get update
$ sudo apt-get install build-essential libssl-dev libdb5.1-dev libdb5.1++-dev libboost-all-dev git
$ git clone https://github.com/litecoin-project/litecoin
$ cd litecoin/src
$ make -j4 -f makefile.unix USE_UPNP=
$ ne ~/.litecoind/litecoin.conf # cp what litcoind say
Then to make litecoind synchronized faster with the network (minutes instead of days) :

$ sudo apt-get install transmission-cli
$ mkdir dat
$ transmission-cli http://www.lurkmore.com/litecoin-bootstrap/litecoin-bootstrap.torrent -w dat
$ xz -d litecoin-bootstrap/bootstrap.dat.xz
$ cp bootstrap.dat ~/.litecoin/

How to test locally using Bitcoin-Qt, Litecoin-Qt, etc. (Mac example)

/Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt \
    -server -rpcuser=someusername -rpcpassword=somepasword -rpcport=1234

TODO

More tests!

License

MIT

Keywords

bitcoin

FAQs

Package last updated on 26 Jan 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.