2.0.2 • Published 5 years ago

matrixbitcore-node v2.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Matrixbitcore Node

A Matrixbit full node for building applications and services with Node.js. A node is extensible and can be configured to run additional services. At the minimum a node has an interface to Matrixbit Core (matrixbitd) v0.12.1.x for more advanced address queries. Additional services can be enabled to make a node more useful such as exposing new APIs, running a block explorer and wallet service.

Usages

As a standalone server

git clone https://github.com/matrix-pay/matrixbitcore-node
cd matrixbitcore-node
./bin/matrixbitcore-node start

When running the start command, it will seek for a .matrixbitcore folder with a matrixbitcore-node.json conf file. If it doesn't exist, it will create it, with basic task to connect to matrixbitd.

Some plugins are available :

  • Insight-API : ./bin/matrixbitcore-node addservice matrixbitcore-insight-api
  • Insight-UI : ./bin/matrixbitcore-node addservice matrixbitcore-insight-ui

You also might want to add these index to your matrixbit.conf file :

-addressindex
-timestampindex
-spentindex

As a library

npm install matrixbitcore-node
const matrixbitcore = require('matrixbitcore-node');
const config = require('./matrixbitcore-node.json');

let node = matrixbitcore.scaffold.start({ path: "", config: config });
node.on('ready', function() {
    //Matrixbit core started
    matrixbitd.on('tx', function(txData) {
        let tx = new matrixbitcore.lib.Transaction(txData);
    });
});

Prerequisites

  • Matrixbit Core (matrixbitd) (v0.12.1.x) with support for additional indexing (see above)
  • Node.js v0.10, v0.12, v4 or v5
  • ZeroMQ (libzmq3-dev for Ubuntu/Debian or zeromq on OSX)
  • ~20GB of disk storage
  • ~1GB of RAM

Configuration

Matrixbitcore includes a Command Line Interface (CLI) for managing, configuring and interfacing with your Matrixbitcore Node.

matrixbitcore-node create -d <matrixbit-data-dir> mynode
cd mynode
matrixbitcore-node install <service>
matrixbitcore-node install https://github.com/yourname/helloworld
matrixbitcore-node start

This will create a directory with configuration files for your node and install the necessary dependencies.

Please note that Matrixbit Core needs to be installed first.

For more information about (and developing) services, please see the Service Documentation.

Add-on Services

There are several add-on services available to extend the functionality of Bitcore:

Documentation

Setting up dev environment (with Insight)

Prerequisite : Having a matrixbitd node already runing matrixbitd --daemon.

Matrixbitcore-node : git clone https://github.com/matrix-pay/matrixbitcore-node -b develop Insight-api (optional) : git clone https://github.com/matrix-pay/matrixbitcore-insight-api -b develop Insight-UI (optional) : git clone https://github.com/matrix-pay/matrixbitcore-insight-ui -b develop

Install them :

cd matrixbitcore-node && npm install \
 && cd ../insight-ui && npm install \
 && cd ../insight-api && npm install && cd ..

Symbolic linking in parent folder :

npm link ../insight-api
npm link ../insight-ui

Start with ./bin/matrixbitcore-node start to first generate a ~/.matrixbitcore/matrixbitcore-node.json file. Append this file with "matrixbitcore-insight-ui" and "matrixbitcore-insight-api" in the services array.

Contributing

Please send pull requests for bug fixes, code optimization, and ideas for improvement. For more information on how to contribute, please refer to our CONTRIBUTING file.

License

Code released under the MIT license.

Copyright 2013-2015 BitPay, Inc.

  • bitcoin: Copyright (c) 2009-2015 Bitcoin Core Developers (MIT License)