commit
e9110ad93c
11
README.md
11
README.md
@ -6,7 +6,7 @@ A Bitcoin full node for building applications and services with Node.js. A node
|
|||||||
## Install
|
## Install
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install -g bitcore-node@latest
|
npm install -g bitcore-node
|
||||||
bitcore-node start
|
bitcore-node start
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -16,15 +16,15 @@ Note: For your convenience, we distribute binaries for x86_64 Linux and x86_64 M
|
|||||||
|
|
||||||
- Node.js v0.12
|
- Node.js v0.12
|
||||||
- ~100GB of disk storage
|
- ~100GB of disk storage
|
||||||
- ~1GB of RAM
|
- ~4GB of RAM
|
||||||
- Mac OS X >= 10.9, Ubuntu >= 12.04 (libc >= 2.15 and libstdc++ >= 6.0.16)
|
- Mac OS X >= 10.9, Ubuntu >= 12.04 (libc >= 2.15 and libstdc++ >= 6.0.16)
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Bitcore Node includes a Command Line Interface (CLI) for managing, configuring and interfacing with your Bitcore Node.
|
Bitcore includes a Command Line Interface (CLI) for managing, configuring and interfacing with your Bitcore Node.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bitcore-node create -d <bitcoin-data-dir> mynode "My Node"
|
bitcore-node create -d <bitcoin-data-dir> mynode
|
||||||
cd mynode
|
cd mynode
|
||||||
bitcore-node add <service>
|
bitcore-node add <service>
|
||||||
bitcore-node add https://github.com/yourname/helloworld
|
bitcore-node add https://github.com/yourname/helloworld
|
||||||
@ -40,10 +40,11 @@ bitcore-node start --daemon
|
|||||||
|
|
||||||
## Add-on Services
|
## Add-on Services
|
||||||
|
|
||||||
There are several add-on services available to extend the functionality of Bitcore Node:
|
There are several add-on services available to extend the functionality of Bitcore:
|
||||||
|
|
||||||
- [Insight API](https://github.com/bitpay/insight-api/tree/v0.3.0)
|
- [Insight API](https://github.com/bitpay/insight-api/tree/v0.3.0)
|
||||||
- [Insight UI](https://github.com/bitpay/insight/tree/v0.3.0)
|
- [Insight UI](https://github.com/bitpay/insight/tree/v0.3.0)
|
||||||
|
- [Bitcore Wallet Service](https://github.com/bitpay/bitcore-wallet-service)
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
var benchmark = require('benchmark');
|
var benchmark = require('benchmark');
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var sinon = require('sinon');
|
var sinon = require('sinon');
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore-lib');
|
||||||
var Block = bitcore.Block;
|
var Block = bitcore.Block;
|
||||||
var AddressService = require('../lib/services/address');
|
var AddressService = require('../lib/services/address');
|
||||||
var maxTime = 20;
|
var maxTime = 20;
|
||||||
|
|||||||
5
bin/bitcore-node
Executable file
5
bin/bitcore-node
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
// vi: ft=javascript -*- mode: JavaScript; -*-
|
||||||
|
|
||||||
|
var node = require('..');
|
||||||
|
node.cli.bitcore();
|
||||||
@ -1,44 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var semver = require('semver');
|
|
||||||
var Liftoff = require('liftoff');
|
|
||||||
var cliPackage = require('../package.json');
|
|
||||||
|
|
||||||
var liftoff = new Liftoff({
|
|
||||||
name: 'bitcore-node',
|
|
||||||
moduleName: 'bitcore-node',
|
|
||||||
configName: 'bitcore-node',
|
|
||||||
processTitle: 'bitcore-node'
|
|
||||||
}).on('require', function (name, module) {
|
|
||||||
console.log('Loading:', name);
|
|
||||||
}).on('requireFail', function (name, err) {
|
|
||||||
console.log('Unable to load:', name, err);
|
|
||||||
}).on('respawn', function (flags, child) {
|
|
||||||
console.log('Detected node flags:', flags);
|
|
||||||
console.log('Respawned to PID:', child.pid);
|
|
||||||
});
|
|
||||||
|
|
||||||
liftoff.launch({
|
|
||||||
cwd: process.cwd()
|
|
||||||
}, function(env){
|
|
||||||
|
|
||||||
var bitcorenode;
|
|
||||||
if (env.modulePackage && env.configPath) {
|
|
||||||
// use the local version
|
|
||||||
if (semver.gt(cliPackage.version, env.modulePackage.version)) {
|
|
||||||
throw new Error(
|
|
||||||
'Version mismatch, global bitcore-node is ' + cliPackage.version +
|
|
||||||
' and local bitcore-node is ' + env.modulePackage.version
|
|
||||||
);
|
|
||||||
}
|
|
||||||
bitcorenode = require(env.modulePath);
|
|
||||||
} else {
|
|
||||||
// use the global version
|
|
||||||
bitcorenode = require('..');
|
|
||||||
}
|
|
||||||
|
|
||||||
bitcorenode.cli.main();
|
|
||||||
|
|
||||||
});
|
|
||||||
@ -6,8 +6,8 @@ A Bitcoin full node for building applications and services with Node.js. A node
|
|||||||
## Install
|
## Install
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install -g bitcore-node@latest
|
npm install -g bitcore
|
||||||
bitcore-node start
|
bitcore start
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: For your convenience, we distribute 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 [Build & Install](build.md) documentation to build the project from source.
|
Note: For your convenience, we distribute 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 [Build & Install](build.md) documentation to build the project from source.
|
||||||
@ -16,26 +16,26 @@ Note: For your convenience, we distribute binaries for x86_64 Linux and x86_64 M
|
|||||||
|
|
||||||
- Node.js v0.12
|
- Node.js v0.12
|
||||||
- ~100GB of disk storage
|
- ~100GB of disk storage
|
||||||
- ~1GB of RAM
|
- ~4GB of RAM
|
||||||
- Mac OS X >= 10.9, Ubuntu >= 12.04 (libc >= 2.15 and libstdc++ >= 6.0.16)
|
- Mac OS X >= 10.9, Ubuntu >= 12.04 (libc >= 2.15 and libstdc++ >= 6.0.16)
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Bitcore Node includes a Command Line Interface (CLI) for managing, configuring and interfacing with your Bitcore Node.
|
Bitcore includes a Command Line Interface (CLI) for managing, configuring and interfacing with your Bitcore Node.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bitcore-node create -d <bitcoin-data-dir> mynode "My Node"
|
bitcore create -d <bitcoin-data-dir> mynode
|
||||||
cd mynode
|
cd mynode
|
||||||
bitcore-node add <service>
|
bitcore install <service>
|
||||||
bitcore-node add https://github.com/yourname/helloworld
|
bitcore install https://github.com/yourname/helloworld
|
||||||
```
|
```
|
||||||
|
|
||||||
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](services.md).
|
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](services.md).
|
||||||
|
|
||||||
To start bitcore-node as a daemon:
|
To start bitcore as a daemon:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bitcore-node start --daemon
|
bitcore start --daemon
|
||||||
```
|
```
|
||||||
|
|
||||||
## Add-on Services
|
## Add-on Services
|
||||||
|
|||||||
@ -6,11 +6,7 @@ description: Description of functions for Bitcore Node configuration
|
|||||||
|
|
||||||
A collection of functions for creating, managing, starting, stopping and interacting with a Bitcore Node.
|
A collection of functions for creating, managing, starting, stopping and interacting with a Bitcore Node.
|
||||||
|
|
||||||
## Create
|
## Install
|
||||||
|
|
||||||
This function will create a new directory and the initial configuration files/directories, including 'bitcore-node.json', 'package.json', 'bitcoin.conf', install the necessary Node.js modules, and create a data directory.
|
|
||||||
|
|
||||||
## Add
|
|
||||||
|
|
||||||
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.json` configuration.
|
||||||
|
|
||||||
@ -26,7 +22,7 @@ This function will recursively find a configuration `bitcore-node.json` file in
|
|||||||
|
|
||||||
This function will return a default configuration with the default services based on environment variables, and will default to using the standard `~/.bitcoin` data directory.
|
This function will return a default configuration with the default services based on environment variables, and will default to using the standard `~/.bitcoin` data directory.
|
||||||
|
|
||||||
## Remove
|
## 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.json` configuration.
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@ Services correspond with a Node.js module as described in 'package.json', for ex
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bitcore": "^0.13.1",
|
"bitcore-lib": "^0.13.7",
|
||||||
"bitcore-node": "^0.2.0",
|
"bitcore-node": "^0.2.0",
|
||||||
"insight-api": "^3.0.0"
|
"insight-api": "^3.0.0"
|
||||||
}
|
}
|
||||||
@ -47,8 +47,8 @@ var bitcore = require('bitcore-node');
|
|||||||
//Services
|
//Services
|
||||||
var Address = bitcore.services.Address;
|
var Address = bitcore.services.Address;
|
||||||
var Bitcoin = bitcore.services.Bitcoin;
|
var Bitcoin = bitcore.services.Bitcoin;
|
||||||
var DB = bitcore.services.DB;
|
var DB = bitcore.services.DB;
|
||||||
var Web = bitcore.services.Web;
|
var Web = bitcore.services.Web;
|
||||||
|
|
||||||
var myNode = new bitcore.Node({
|
var myNode = new bitcore.Node({
|
||||||
datadir: '~/.bitcore',
|
datadir: '~/.bitcore',
|
||||||
|
|||||||
5
index.js
5
index.js
@ -22,4 +22,7 @@ module.exports.scaffold.findConfig = require('./lib/scaffold/find-config');
|
|||||||
module.exports.scaffold.defaultConfig = require('./lib/scaffold/default-config');
|
module.exports.scaffold.defaultConfig = require('./lib/scaffold/default-config');
|
||||||
|
|
||||||
module.exports.cli = {};
|
module.exports.cli = {};
|
||||||
module.exports.cli.main = require('./cli/main');
|
module.exports.cli.main = require('./lib/cli/main');
|
||||||
|
module.exports.cli.daemon = require('./lib/cli/daemon');
|
||||||
|
module.exports.cli.bitcore = require('./lib/cli/bitcore');
|
||||||
|
module.exports.cli.bitcored = require('./lib/cli/bitcored');
|
||||||
|
|||||||
@ -11,7 +11,7 @@ var p2p = require('bitcore-p2p');
|
|||||||
var Peer = p2p.Peer;
|
var Peer = p2p.Peer;
|
||||||
var Messages = p2p.Messages;
|
var Messages = p2p.Messages;
|
||||||
var chai = require('chai');
|
var chai = require('chai');
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore-lib');
|
||||||
var Transaction = bitcore.Transaction;
|
var Transaction = bitcore.Transaction;
|
||||||
var BN = bitcore.crypto.BN;
|
var BN = bitcore.crypto.BN;
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
|
|||||||
@ -16,7 +16,7 @@ if (process.env.BITCORENODE_ENV !== 'test') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var chai = require('chai');
|
var chai = require('chai');
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore-lib');
|
||||||
var rimraf = require('rimraf');
|
var rimraf = require('rimraf');
|
||||||
var node;
|
var node;
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@ if (process.env.BITCORENODE_ENV !== 'test') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var chai = require('chai');
|
var chai = require('chai');
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore-lib');
|
||||||
var BN = bitcore.crypto.BN;
|
var BN = bitcore.crypto.BN;
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var rimraf = require('rimraf');
|
var rimraf = require('rimraf');
|
||||||
|
|||||||
40
lib/cli/bitcore.js
Normal file
40
lib/cli/bitcore.js
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var Liftoff = require('liftoff');
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
|
||||||
|
var liftoff = new Liftoff({
|
||||||
|
name: 'bitcore',
|
||||||
|
moduleName: 'bitcore-node',
|
||||||
|
configName: 'bitcore-node',
|
||||||
|
processTitle: 'bitcore'
|
||||||
|
}).on('require', function (name, module) {
|
||||||
|
console.log('Loading:', name);
|
||||||
|
}).on('requireFail', function (name, err) {
|
||||||
|
console.log('Unable to load:', name, err);
|
||||||
|
}).on('respawn', function (flags, child) {
|
||||||
|
console.log('Detected node flags:', flags);
|
||||||
|
console.log('Respawned to PID:', child.pid);
|
||||||
|
});
|
||||||
|
|
||||||
|
liftoff.launch({
|
||||||
|
cwd: process.cwd()
|
||||||
|
}, function(env){
|
||||||
|
|
||||||
|
var node;
|
||||||
|
if (env.modulePackage && env.configPath) {
|
||||||
|
// use the configured version
|
||||||
|
node = require(env.modulePath);
|
||||||
|
} else {
|
||||||
|
// use this version
|
||||||
|
node = require('..');
|
||||||
|
}
|
||||||
|
|
||||||
|
node.cli.main();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = main;
|
||||||
40
lib/cli/bitcored.js
Normal file
40
lib/cli/bitcored.js
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var Liftoff = require('liftoff');
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
|
||||||
|
var liftoff = new Liftoff({
|
||||||
|
name: 'bitcored',
|
||||||
|
moduleName: 'bitcore-node',
|
||||||
|
configName: 'bitcore-node',
|
||||||
|
processTitle: 'bitcored'
|
||||||
|
}).on('require', function (name, module) {
|
||||||
|
console.log('Loading:', name);
|
||||||
|
}).on('requireFail', function (name, err) {
|
||||||
|
console.log('Unable to load:', name, err);
|
||||||
|
}).on('respawn', function (flags, child) {
|
||||||
|
console.log('Detected node flags:', flags);
|
||||||
|
console.log('Respawned to PID:', child.pid);
|
||||||
|
});
|
||||||
|
|
||||||
|
liftoff.launch({
|
||||||
|
cwd: process.cwd()
|
||||||
|
}, function(env){
|
||||||
|
|
||||||
|
var node;
|
||||||
|
if (env.modulePackage && env.configPath) {
|
||||||
|
// use the configured version
|
||||||
|
node = require(env.modulePath);
|
||||||
|
} else {
|
||||||
|
// use this version
|
||||||
|
node = require('..');
|
||||||
|
}
|
||||||
|
|
||||||
|
node.cli.daemon();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = main;
|
||||||
36
lib/cli/daemon.js
Normal file
36
lib/cli/daemon.js
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var program = require('commander');
|
||||||
|
var path = require('path');
|
||||||
|
var bitcore = require('..');
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
/* jshint maxstatements: 100 */
|
||||||
|
|
||||||
|
var version = bitcore.version;
|
||||||
|
var start = bitcore.scaffold.start;
|
||||||
|
var findConfig = bitcore.scaffold.findConfig;
|
||||||
|
var defaultConfig = bitcore.scaffold.defaultConfig;
|
||||||
|
|
||||||
|
program
|
||||||
|
.version(version)
|
||||||
|
.description('Start the current node')
|
||||||
|
.option('-c, --config <dir>', 'Specify the directory with Bitcore Node configuration')
|
||||||
|
.option('-d, --daemon', 'Make bitcore a daemon (running in the background)');
|
||||||
|
|
||||||
|
program.parse(process.argv);
|
||||||
|
|
||||||
|
if (program.config) {
|
||||||
|
program.config = path.resolve(process.cwd(), program.config);
|
||||||
|
}
|
||||||
|
var configInfo = findConfig(program.config || process.cwd());
|
||||||
|
if (!configInfo) {
|
||||||
|
configInfo = defaultConfig();
|
||||||
|
}
|
||||||
|
if(program.daemon) {
|
||||||
|
configInfo.config.daemon = true;
|
||||||
|
}
|
||||||
|
start(configInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = main;
|
||||||
@ -20,17 +20,18 @@ function main() {
|
|||||||
.version(version);
|
.version(version);
|
||||||
|
|
||||||
program
|
program
|
||||||
.command('create <directory> [name]')
|
.command('create <directory>')
|
||||||
.description('Create a new node')
|
.description('Create a new node')
|
||||||
.option('-d, --datadir <dir>', 'Specify the bitcoin database directory')
|
.option('-d, --datadir <dir>', 'Specify the bitcoin database directory')
|
||||||
.action(function(dirname, name, cmd){
|
.action(function(dirname, cmd){
|
||||||
|
console.log('dirname', dirname);
|
||||||
|
console.log('cmd', cmd);
|
||||||
if (cmd.datadir) {
|
if (cmd.datadir) {
|
||||||
cmd.datadir = path.resolve(process.cwd(), cmd.datadir);
|
cmd.datadir = path.resolve(process.cwd(), cmd.datadir);
|
||||||
}
|
}
|
||||||
var opts = {
|
var opts = {
|
||||||
cwd: process.cwd(),
|
cwd: process.cwd(),
|
||||||
dirname: dirname,
|
dirname: dirname,
|
||||||
name: name,
|
|
||||||
datadir: cmd.datadir || './data',
|
datadir: cmd.datadir || './data',
|
||||||
isGlobal: false
|
isGlobal: false
|
||||||
};
|
};
|
||||||
@ -62,8 +63,8 @@ function main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
program
|
program
|
||||||
.command('add <services...>')
|
.command('install <services...>')
|
||||||
.alias('install')
|
.alias('add')
|
||||||
.description('Install a service for the current node')
|
.description('Install a service for the current node')
|
||||||
.action(function(services){
|
.action(function(services){
|
||||||
var configInfo = findConfig(process.cwd());
|
var configInfo = findConfig(process.cwd());
|
||||||
@ -89,8 +90,8 @@ function main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
program
|
program
|
||||||
.command('remove <services...>')
|
.command('uninstall <services...>')
|
||||||
.alias('uninstall')
|
.alias('remove')
|
||||||
.description('Uninstall a service for the current node')
|
.description('Uninstall a service for the current node')
|
||||||
.action(function(services){
|
.action(function(services){
|
||||||
var configInfo = findConfig(process.cwd());
|
var configInfo = findConfig(process.cwd());
|
||||||
@ -3,7 +3,7 @@
|
|||||||
var util = require('util');
|
var util = require('util');
|
||||||
var EventEmitter = require('events').EventEmitter;
|
var EventEmitter = require('events').EventEmitter;
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore-lib');
|
||||||
var Networks = bitcore.Networks;
|
var Networks = bitcore.Networks;
|
||||||
var $ = bitcore.util.preconditions;
|
var $ = bitcore.util.preconditions;
|
||||||
var _ = bitcore.deps._;
|
var _ = bitcore.deps._;
|
||||||
|
|||||||
@ -4,7 +4,7 @@ var async = require('async');
|
|||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var spawn = require('child_process').spawn;
|
var spawn = require('child_process').spawn;
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore-lib');
|
||||||
var $ = bitcore.util.preconditions;
|
var $ = bitcore.util.preconditions;
|
||||||
var _ = bitcore.deps._;
|
var _ = bitcore.deps._;
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var spawn = require('child_process').spawn;
|
var spawn = require('child_process').spawn;
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore-lib');
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var $ = bitcore.util.preconditions;
|
var $ = bitcore.util.preconditions;
|
||||||
var _ = bitcore.deps._;
|
var _ = bitcore.deps._;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore-lib');
|
||||||
var $ = bitcore.util.preconditions;
|
var $ = bitcore.util.preconditions;
|
||||||
var _ = bitcore.deps._;
|
var _ = bitcore.deps._;
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
|
|||||||
@ -5,7 +5,7 @@ var fs = require('fs');
|
|||||||
var npm = require('npm');
|
var npm = require('npm');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var spawn = require('child_process').spawn;
|
var spawn = require('child_process').spawn;
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore-lib');
|
||||||
var $ = bitcore.util.preconditions;
|
var $ = bitcore.util.preconditions;
|
||||||
var _ = bitcore.deps._;
|
var _ = bitcore.deps._;
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
var path = require('path');
|
var path = require('path');
|
||||||
var BitcoreNode = require('../node');
|
var BitcoreNode = require('../node');
|
||||||
var index = require('../');
|
var index = require('../');
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore-lib');
|
||||||
var _ = bitcore.deps._;
|
var _ = bitcore.deps._;
|
||||||
var $ = bitcore.util.preconditions;
|
var $ = bitcore.util.preconditions;
|
||||||
var log = index.log;
|
var log = index.log;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore-lib');
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var _ = bitcore.deps._;
|
var _ = bitcore.deps._;
|
||||||
|
|
||||||
@ -228,7 +228,7 @@ AddressHistory.prototype.getDetailedInfo = function(txInfo, next) {
|
|||||||
height: transaction.__height,
|
height: transaction.__height,
|
||||||
confirmations: self.getConfirmationsDetail(transaction),
|
confirmations: self.getConfirmationsDetail(transaction),
|
||||||
timestamp: transaction.__timestamp,
|
timestamp: transaction.__timestamp,
|
||||||
// TODO bitcore should return null instead of throwing error on coinbase
|
// TODO bitcore-lib should return null instead of throwing error on coinbase
|
||||||
fees: !transaction.isCoinbase() ? transaction.getFee() : null,
|
fees: !transaction.isCoinbase() ? transaction.getFee() : null,
|
||||||
tx: transaction
|
tx: transaction
|
||||||
});
|
});
|
||||||
|
|||||||
@ -7,7 +7,7 @@ var index = require('../../');
|
|||||||
var log = index.log;
|
var log = index.log;
|
||||||
var errors = index.errors;
|
var errors = index.errors;
|
||||||
var Transaction = require('../../transaction');
|
var Transaction = require('../../transaction');
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore-lib');
|
||||||
var levelup = require('levelup');
|
var levelup = require('levelup');
|
||||||
var $ = bitcore.util.preconditions;
|
var $ = bitcore.util.preconditions;
|
||||||
var _ = bitcore.deps._;
|
var _ = bitcore.deps._;
|
||||||
|
|||||||
@ -4,7 +4,7 @@ var fs = require('fs');
|
|||||||
var util = require('util');
|
var util = require('util');
|
||||||
var bindings = require('bindings')('bitcoind.node');
|
var bindings = require('bindings')('bitcoind.node');
|
||||||
var mkdirp = require('mkdirp');
|
var mkdirp = require('mkdirp');
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore-lib');
|
||||||
var $ = bitcore.util.preconditions;
|
var $ = bitcore.util.preconditions;
|
||||||
var index = require('../');
|
var index = require('../');
|
||||||
var log = index.log;
|
var log = index.log;
|
||||||
|
|||||||
@ -6,7 +6,7 @@ var async = require('async');
|
|||||||
var levelup = require('levelup');
|
var levelup = require('levelup');
|
||||||
var leveldown = require('leveldown');
|
var leveldown = require('leveldown');
|
||||||
var mkdirp = require('mkdirp');
|
var mkdirp = require('mkdirp');
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore-lib');
|
||||||
var BufferUtil = bitcore.util.buffer;
|
var BufferUtil = bitcore.util.buffer;
|
||||||
var Networks = bitcore.Networks;
|
var Networks = bitcore.Networks;
|
||||||
var Block = bitcore.Block;
|
var Block = bitcore.Block;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var levelup = require('levelup');
|
var levelup = require('levelup');
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore-lib');
|
||||||
var Transaction = bitcore.Transaction;
|
var Transaction = bitcore.Transaction;
|
||||||
|
|
||||||
Transaction.prototype.populateInputs = function(db, poolTransactions, callback) {
|
Transaction.prototype.populateInputs = function(db, poolTransactions, callback) {
|
||||||
|
|||||||
10
package.json
10
package.json
@ -5,7 +5,6 @@
|
|||||||
"version": "0.2.0-dev",
|
"version": "0.2.0-dev",
|
||||||
"lastBuild": "0.2.0-beta.11",
|
"lastBuild": "0.2.0-beta.11",
|
||||||
"main": "./index.js",
|
"main": "./index.js",
|
||||||
"bin": "./cli/bitcore-node.js",
|
|
||||||
"repository": "git://github.com/bitpay/bitcore-node.git",
|
"repository": "git://github.com/bitpay/bitcore-node.git",
|
||||||
"homepage": "https://github.com/bitpay/bitcore-node.js",
|
"homepage": "https://github.com/bitpay/bitcore-node.js",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
@ -28,6 +27,9 @@
|
|||||||
"email": "patrick@bitpay.com"
|
"email": "patrick@bitpay.com"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"bin": {
|
||||||
|
"bitcore-node": "./bin/bitcore-node"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"install": "./bin/install",
|
"install": "./bin/install",
|
||||||
"build": "./bin/build",
|
"build": "./bin/build",
|
||||||
@ -46,7 +48,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"async": "^1.3.0",
|
"async": "^1.3.0",
|
||||||
"bindings": "^1.2.1",
|
"bindings": "^1.2.1",
|
||||||
"bitcore": "^0.13.0",
|
"bitcore-lib": "^0.13.7",
|
||||||
"body-parser": "^1.13.3",
|
"body-parser": "^1.13.3",
|
||||||
"colors": "^1.1.2",
|
"colors": "^1.1.2",
|
||||||
"commander": "^2.8.1",
|
"commander": "^2.8.1",
|
||||||
@ -54,7 +56,7 @@
|
|||||||
"express": "^4.13.3",
|
"express": "^4.13.3",
|
||||||
"leveldown": "^1.4.1",
|
"leveldown": "^1.4.1",
|
||||||
"levelup": "^1.2.1",
|
"levelup": "^1.2.1",
|
||||||
"liftoff": "^2.1.0",
|
"liftoff": "^2.2.0",
|
||||||
"memdown": "^1.0.0",
|
"memdown": "^1.0.0",
|
||||||
"mkdirp": "0.5.0",
|
"mkdirp": "0.5.0",
|
||||||
"nan": "^2.0.9",
|
"nan": "^2.0.9",
|
||||||
@ -73,7 +75,7 @@
|
|||||||
"proxyquire": "^1.3.1",
|
"proxyquire": "^1.3.1",
|
||||||
"rimraf": "^2.4.2",
|
"rimraf": "^2.4.2",
|
||||||
"sinon": "^1.15.4",
|
"sinon": "^1.15.4",
|
||||||
"bitcore-p2p": "^0.15.1"
|
"bitcore-p2p": "~1.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.12.0"
|
"node": ">=0.12.0"
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
var should = require('chai').should();
|
var should = require('chai').should();
|
||||||
var sinon = require('sinon');
|
var sinon = require('sinon');
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore-lib');
|
||||||
var Networks = bitcore.Networks;
|
var Networks = bitcore.Networks;
|
||||||
var proxyquire = require('proxyquire');
|
var proxyquire = require('proxyquire');
|
||||||
var util = require('util');
|
var util = require('util');
|
||||||
|
|||||||
@ -94,7 +94,7 @@ describe('#add', function() {
|
|||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
var oldPackage = {
|
var oldPackage = {
|
||||||
dependencies: {
|
dependencies: {
|
||||||
'bitcore': '^v0.13.1',
|
'bitcore-lib': '^v0.13.7',
|
||||||
'bitcore-node': '^v0.2.0'
|
'bitcore-node': '^v0.2.0'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -6,7 +6,7 @@ var proxyquire = require('proxyquire');
|
|||||||
var bitcorenode = require('../../../');
|
var bitcorenode = require('../../../');
|
||||||
var AddressService = bitcorenode.services.Address;
|
var AddressService = bitcorenode.services.Address;
|
||||||
var blockData = require('../../data/livenet-345003.json');
|
var blockData = require('../../data/livenet-345003.json');
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore-lib');
|
||||||
var Script = bitcore.Script;
|
var Script = bitcore.Script;
|
||||||
var Address = bitcore.Address;
|
var Address = bitcore.Address;
|
||||||
var Networks = bitcore.Networks;
|
var Networks = bitcore.Networks;
|
||||||
|
|||||||
@ -7,18 +7,17 @@ var proxyquire = require('proxyquire');
|
|||||||
var index = require('../../');
|
var index = require('../../');
|
||||||
var DB = index.services.DB;
|
var DB = index.services.DB;
|
||||||
var blockData = require('../data/livenet-345003.json');
|
var blockData = require('../data/livenet-345003.json');
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore-lib');
|
||||||
var Networks = bitcore.Networks;
|
var Networks = bitcore.Networks;
|
||||||
var Block = bitcore.Block;
|
var Block = bitcore.Block;
|
||||||
var BufferUtil = bitcore.util.buffer;
|
var BufferUtil = bitcore.util.buffer;
|
||||||
|
var Transaction = bitcore.Transaction;
|
||||||
var transactionData = require('../data/bitcoin-transactions.json');
|
var transactionData = require('../data/bitcoin-transactions.json');
|
||||||
var chainHashes = require('../data/hashes.json');
|
var chainHashes = require('../data/hashes.json');
|
||||||
var chainData = require('../data/testnet-blocks.json');
|
var chainData = require('../data/testnet-blocks.json');
|
||||||
var errors = index.errors;
|
var errors = index.errors;
|
||||||
var memdown = require('memdown');
|
var memdown = require('memdown');
|
||||||
var levelup = require('levelup');
|
var levelup = require('levelup');
|
||||||
var bitcore = require('bitcore');
|
|
||||||
var Transaction = bitcore.Transaction;
|
|
||||||
|
|
||||||
describe('DB Service', function() {
|
describe('DB Service', function() {
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user