Skip to content

Commit

Permalink
Dashify
Browse files Browse the repository at this point in the history
- test only v0.10.25
- reenable download script
- update dependencies
- extend node regtest timeouts
- adjust jshint maxstatements
- enable download script for travis
- fix regtest
- fix scaffold tests
- update test coverage
- update readme.md
- dashify cli references
- set bitcore-lib-dash version dependency to 0.13.17
- update readme.md
- remove download script
- dashify console references
- zmq transaction lock notification
- dashify daemon references
  • Loading branch information
snogcel authored and schinzelh committed Sep 15, 2016
1 parent 639fdc9 commit 1f12123
Show file tree
Hide file tree
Showing 48 changed files with 398 additions and 331 deletions.
2 changes: 1 addition & 1 deletion .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
repo_token: DvrDb09a8vhPlVf6DT4cGBjcFOi6DfZN1
repo_token: cE3tYE6ZuuPHFa7OTGpb2wqoqaYJ3SLs3
2 changes: 1 addition & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"undef": true,
"unused": true,
"maxparams": 4,
"maxstatements": 15,
"maxstatements": 16,
"maxcomplexity": 10,
"maxdepth": 3,
"maxlen": 120,
Expand Down
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ addons:
- libzmq3-dev
node_js:
- "v0.10.25"
- "v0.12.7"
- "v4"
script:
- ./scripts/download
- npm run regtest
- npm run test
- npm run jshint
Expand Down
38 changes: 21 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,49 @@
Bitcore Node
Bitcore Node Dash
============

A Bitcoin 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 [Bitcoin Core with additional indexing](https://github.com/bitpay/bitcoin/tree/0.12.1-bitcore) 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.
A Dash 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 [Dash Core with additional indexing](https://github.com/snogcel/dash/tree/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.

## Install

```bash
npm install -g bitcore-node
bitcore-node start
npm install -g bitcore-node-dash
```

Note: For your convenience, we distribute bitcoind binaries for x86_64 Linux and x86_64 Mac OS X. Upon npm install, the binaries for your platform will be downloaded. For more detailed installation instructions, or if you want to compile the project yourself, then please see the Bitcore branch of [Bitcoin Core with additional indexing](https://github.com/bitpay/bitcoin/tree/0.12.1-bitcore).
Installation of bitcore-node-dash can also be performed using a Dockerfile. Please note that this Dockerfile is still under development and should be considered an 'Alpha' version, see [docker-bitcore_insight_dash](https://github.com/moocowmoo/docker-bitcore_insight_dash) for more details.

## Prerequisites

- GNU/Linux x86_32/x86_64, or OSX 64bit *(for bitcoind distributed binaries)*
- Node.js v0.10, v0.12 or v4
- Dash Core (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)*
- ~200GB of disk storage
- ~8GB of RAM
- ~20GB of disk storage
- ~1GB of RAM

## Configuration

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

```bash
bitcore-node create -d <bitcoin-data-dir> mynode
bitcore-node-dash create -d <dash-data-dir> mynode
cd mynode
bitcore-node install <service>
bitcore-node install https://github.com/yourname/helloworld
bitcore-node-dash install <service>
bitcore-node-dash install https://github.com/yourname/helloworld
bitcore-node-dash start
```

This will create a directory with configuration files for your node and install the necessary dependencies. For more information about (and developing) services, please see the [Service Documentation](docs/services.md).
This will create a directory with configuration files for your node and install the necessary dependencies.

Please note that [Dash Core with additional indexing](https://github.com/snogcel/dash/tree/v0.12.1.x) must be compiled seperately. Once completed the dashd binary should be placed into the &lt;dash-data-dir&gt; folder specified during node creation.

For more information about (and developing) services, please see the [Service Documentation](docs/services.md).

## Add-on Services

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

- [Insight API](https://github.com/bitpay/insight-api)
- [Insight UI](https://github.com/bitpay/insight-ui)
- [Bitcore Wallet Service](https://github.com/bitpay/bitcore-wallet-service)
- [Insight API Dash](https://github.com/dashpay/insight-api-dash/tree/master)
- [Insight UI Dash](https://github.com/dashpay/insight-ui-dash/tree/master)
- Bitcore Wallet Service (coming soon)

## Documentation

Expand All @@ -58,7 +62,7 @@ Please send pull requests for bug fixes, code optimization, and ideas for improv

## License

Code released under [the MIT license](https://github.com/bitpay/bitcore-node/blob/master/LICENSE).
Code released under [the MIT license](https://github.com/bitpay/bitcore-node-dash/blob/master/LICENSE).

Copyright 2013-2015 BitPay, Inc.

Expand Down
File renamed without changes.
18 changes: 9 additions & 9 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ nvm install v4

## Fork and Download Repositories

To develop bitcore-node:
To develop bitcore-node-dash:

```bash
cd ~
git clone git@github.com:<yourusername>/bitcore-node.git
git clone git@github.com:<yourusername>/bitcore-node-dash.git
git clone git@github.com:<yourusername>/bitcore-lib.git
```

Expand Down Expand Up @@ -48,13 +48,13 @@ brew install zeromq
```bash
cd bitcore-lib
npm install
cd ../bitcore-node
cd ../bitcore-node-dash
npm install
```
**Note**: If you get a message about not being able to download bitcoin distribution, you'll need to compile bitcoind from source, and setup your configuration to use that version.


We now will setup symlinks in `bitcore-node` *(repeat this for any other modules you're planning on developing)*:
We now will setup symlinks in `bitcore-node-dash` *(repeat this for any other modules you're planning on developing)*:
```bash
cd node_modules
rm -rf bitcore-lib
Expand All @@ -78,7 +78,7 @@ npm install mocha -g

To run all test suites:
```bash
cd bitcore-node
cd bitcore-node-dash
npm run regtest
npm run test
```
Expand All @@ -102,11 +102,11 @@ cd ~
mkdir devnode
cd devnode
mkdir node_modules
touch bitcore-node.json
touch bitcore-node-dash.json
touch package.json
```

Edit `bitcore-node.json` with something similar to:
Edit `bitcore-node-dash.json` with something similar to:
```json
{
"network": "livenet",
Expand Down Expand Up @@ -136,7 +136,7 @@ Setup symlinks for all of the services and dependencies:
```bash
cd node_modules
ln -s ~/bitcore-lib
ln -s ~/bitcore-node
ln -s ~/bitcore-node-dash
ln -s ~/insight-api
ln -s ~/insight-ui
```
Expand All @@ -158,5 +158,5 @@ rpcpassword=local321

From within the `devnode` directory with the configuration file, start the node:
```bash
../bitcore-node/bin/bitcore-node start
../bitcore-node-dash/bin/bitcore-node-dash start
```
2 changes: 1 addition & 1 deletion docs/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A node represents a collection of services that are loaded together. For more in

```js

var index = require('bitcore-node');
var index = require('bitcore-node-dash');
var Bitcoin = index.services.Bitcoin;
var Node = index.Node;

Expand Down
2 changes: 1 addition & 1 deletion docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Binaries for bitcoind are distributed for convenience and built deterministicall

## How to Release

When publishing to npm, the .gitignore file is used to exclude files from the npm publishing process. Be sure that the bitcore-node directory has only the directories and files that you would like to publish to npm. You might need to run the commands below on each platform that you intend to publish (e.g. Mac and Linux).
When publishing to npm, the .gitignore file is used to exclude files from the npm publishing process. Be sure that the bitcore-node-dash directory has only the directories and files that you would like to publish to npm. You might need to run the commands below on each platform that you intend to publish (e.g. Mac and Linux).

To make a release, bump the `version` of the `package.json`:

Expand Down
8 changes: 4 additions & 4 deletions docs/scaffold.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
A collection of functions for creating, managing, starting, stopping and interacting with a Bitcore node.

## Install
This function will add a service to a node by installing the necessary dependencies and modifying the `bitcore-node.json` configuration.
This function will add a service to a node by installing the necessary dependencies and modifying the `bitcore-node-dash.json` configuration.

## Start
This function will load a configuration file `bitcore-node.json` and instantiate and start a node based on the configuration.
This function will load a configuration file `bitcore-node-dash.json` and instantiate and start a node based on the configuration.

## Find Config
This function will recursively find a configuration `bitcore-node.json` file in parent directories and return the result.
This function will recursively find a configuration `bitcore-node-dash.json` file in parent directories and return the result.

## Default Config
This function will return a default configuration with the default services based on environment variables, and will default to using the standard `/home/user/.bitcoin` data directory.

## Uninstall
This function will remove a service from a node by uninstalling the necessary dependencies and modifying the `bitcore-node.json` configuration.
This function will remove a service from a node by uninstalling the necessary dependencies and modifying the `bitcore-node-dash.json` configuration.

## Call Method
This function will call an API method on a node via the JSON-RPC interface.
10 changes: 5 additions & 5 deletions docs/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Bitcore Node has a service module system that can start up additional services t
- HTTP routes
- Event types to publish and subscribe

The `bitcore-node.json` file describes which services will load for a node:
The `bitcore-node-dash.json` file describes which services will load for a node:

```json
{
Expand All @@ -21,20 +21,20 @@ Services correspond with a Node.js module as described in 'package.json', for ex
{
"dependencies": {
"bitcore-lib": "^0.13.7",
"bitcore-node": "^0.2.0",
"bitcore-node-dash": "^0.2.0",
"insight-api": "^3.0.0"
}
}
```

_Note:_ If you already have a bitcore-node database, and you want to query data from previous blocks in the blockchain, you will need to reindex. Reindexing right now means deleting your bitcore-node database and resyncing.
_Note:_ If you already have a bitcore-node-dash database, and you want to query data from previous blocks in the blockchain, you will need to reindex. Reindexing right now means deleting your bitcore-node-dash database and resyncing.

## Using Services Programmatically
If, instead, you would like to run a custom node, you can include services by including them in your configuration object when initializing a new node.

```js
//Require bitcore
var bitcore = require('bitcore-node');
var bitcore = require('bitcore-node-dash');

//Services
var Bitcoin = bitcore.services.Bitcoin;
Expand Down Expand Up @@ -82,7 +82,7 @@ A new service can be created by inheriting from `Node.Service` and implementing
- `Service.prototype.getPublishEvents()` - Describes which events can be subscribed to for this service, useful to subscribe to events over the included web socket API.
- `Service.prototype.setupRoutes()` - A service can extend HTTP routes on an express application by implementing this method.

The `package.json` for the service module can either export the `Node.Service` directly, or specify a specific module to load by including `"bitcoreNode": "lib/bitcore-node.js"`.
The `package.json` for the service module can either export the `Node.Service` directly, or specify a specific module to load by including `"bitcoreNode": "lib/bitcore-node-dash.js"`.

Please take a look at some of the existing services for implementation specifics.

8 changes: 4 additions & 4 deletions docs/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## From Bitcore 3.0.0 to 4.0.0

`bitcore-node@2.1.1` to `bitcore-node@3.0.0`
`bitcore-node-dash@2.1.1` to `bitcore-node-dash@3.0.0`

This major upgrade includes changes to indexes, API methods and services. Please review below details before upgrading.

Expand All @@ -18,7 +18,7 @@ To start reindexing add `reindex=1` during the **first startup only**.
### Configuration Options

- The `bitcoin.conf` file in will need to be updated to include additional indexes *(see below)*.
- The `datadir` option is now a part of `bitcoind` spawn configuration, and there is a new option to connect to multiple bitcoind processes (Please see [Bitcoin Service Docs](services/bitcoind.md) for more details). The services `db` and `address` are now a part of the `bitcoind` service. Here is how to update `bitcore-node.json` configuration options:
- The `datadir` option is now a part of `bitcoind` spawn configuration, and there is a new option to connect to multiple bitcoind processes (Please see [Bitcoin Service Docs](services/bitcoind.md) for more details). The services `db` and `address` are now a part of the `bitcoind` service. Here is how to update `bitcore-node-dash.json` configuration options:

**Before**:
```json
Expand Down Expand Up @@ -48,7 +48,7 @@ To start reindexing add `reindex=1` during the **first startup only**.
"bitcoind": {
"spawn": {
"datadir": "/home/<username>/.bitcoin",
"exec": "/home/<username>/bitcore-node/bin/bitcoind"
"exec": "/home/<username>/bitcore-node-dash/bin/bitcoind"
}
}
}
Expand All @@ -70,7 +70,7 @@ rpcuser=<user>
rpcpassword=<password>
```

**Important**: Once changes have been made you'll also need to add the `reindex=1` option **only for the first startup** to regenerate the indexes. Once this is complete you should be able to remove the `bitcore-node.db` directory with the old indexes.
**Important**: Once changes have been made you'll also need to add the `reindex=1` option **only for the first startup** to regenerate the indexes. Once this is complete you should be able to remove the `bitcore-node-dash.db` directory with the old indexes.

### API and Service Changes
- Many API methods that were a part of the `db` and `address` services are now a part of the `bitcoind` service. Please see [Bitcoin Service Docs](services/bitcoind.md) for more details.
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ module.exports.cli.daemon = require('./lib/cli/daemon');
module.exports.cli.bitcore = require('./lib/cli/bitcore');
module.exports.cli.bitcored = require('./lib/cli/bitcored');

module.exports.lib = require('bitcore-lib');
module.exports.lib = require('bitcore-lib-dash');
4 changes: 2 additions & 2 deletions lib/cli/bitcore.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ function main(parentServicesPath, additionalServices) {

var liftoff = new Liftoff({
name: 'bitcore',
moduleName: 'bitcore-node',
configName: 'bitcore-node',
moduleName: 'bitcore-node-dash',
configName: 'bitcore-node-dash',
processTitle: 'bitcore'
}).on('require', function (name) {
console.log('Loading:', name);
Expand Down
4 changes: 2 additions & 2 deletions lib/cli/bitcored.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ function main(parentServicesPath, additionalServices) {

var liftoff = new Liftoff({
name: 'bitcored',
moduleName: 'bitcore-node',
configName: 'bitcore-node',
moduleName: 'bitcore-node-dash',
configName: 'bitcore-node-dash',
processTitle: 'bitcored'
}).on('require', function (name) {
console.log('Loading:', name);
Expand Down
14 changes: 7 additions & 7 deletions lib/cli/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function main(servicesPath, additionalServices) {
.command('start')
.description('Start the current node')
.option('-c, --config <dir>', 'Specify the directory with Bitcore Node configuration')
.option('-d, --daemon', 'Make bitcore-node a daemon (running in the background)')
.option('-d, --daemon', 'Make bitcore-node-dash a daemon (running in the background)')
.action(function(cmd){
if (cmd.config) {
cmd.config = path.resolve(process.cwd(), cmd.config);
Expand All @@ -76,7 +76,7 @@ function main(servicesPath, additionalServices) {
.action(function(services){
var configInfo = findConfig(process.cwd());
if (!configInfo) {
throw new Error('Could not find configuration, see `bitcore-node create --help`');
throw new Error('Could not find configuration, see `bitcore-node-dash create --help`');
}
var opts = {
path: configInfo.path,
Expand All @@ -91,8 +91,8 @@ function main(servicesPath, additionalServices) {
}).on('--help', function() {
console.log(' Examples:');
console.log();
console.log(' $ bitcore-node add wallet-service');
console.log(' $ bitcore-node add insight-api');
console.log(' $ bitcore-node-dash add wallet-service');
console.log(' $ bitcore-node-dash add insight-api');
console.log();
});

Expand All @@ -102,7 +102,7 @@ function main(servicesPath, additionalServices) {
.action(function(services){
var configInfo = findConfig(process.cwd());
if (!configInfo) {
throw new Error('Could not find configuration, see `bitcore-node create --help`');
throw new Error('Could not find configuration, see `bitcore-node-dash create --help`');
}
var opts = {
path: configInfo.path,
Expand All @@ -117,8 +117,8 @@ function main(servicesPath, additionalServices) {
}).on('--help', function() {
console.log(' Examples:');
console.log();
console.log(' $ bitcore-node remove wallet-service');
console.log(' $ bitcore-node remove insight-api');
console.log(' $ bitcore-node-dash remove wallet-service');
console.log(' $ bitcore-node-dash remove insight-api');
console.log();
});

Expand Down
2 changes: 1 addition & 1 deletion lib/logger.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var bitcore = require('bitcore-lib');
var bitcore = require('bitcore-lib-dash');
var _ = bitcore.deps._;
var colors = require('colors/safe');

Expand Down
Loading

0 comments on commit 1f12123

Please sign in to comment.