commit
552f56f9ca
@ -99,7 +99,8 @@ If bitcoind is shutdown, *insight* needs to be stopped and restarted once bitcoi
|
|||||||
### DB storage requirement
|
### DB storage requirement
|
||||||
|
|
||||||
To store the blockchain and address related information, *insight* uses LevelDB. Two DBs are created: txs and blocks. By default these are stored on
|
To store the blockchain and address related information, *insight* uses LevelDB. Two DBs are created: txs and blocks. By default these are stored on
|
||||||
```<insight root>/db```
|
```<user's home>/db```
|
||||||
|
Please note that previous version's of Insight-API store that on `<insight's root>/db`
|
||||||
|
|
||||||
this can be changed on config/config.js. As of February 2014, storing the livenet blockchain takes ~30GB of disk space (2GB for the testnet).
|
this can be changed on config/config.js. As of February 2014, storing the livenet blockchain takes ~30GB of disk space (2GB for the testnet).
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var path = require('path'),
|
var path = require('path'),
|
||||||
|
fs = require('fs'),
|
||||||
rootPath = path.normalize(__dirname + '/..'),
|
rootPath = path.normalize(__dirname + '/..'),
|
||||||
env,
|
env,
|
||||||
db,
|
db,
|
||||||
@ -8,16 +9,23 @@ var path = require('path'),
|
|||||||
b_port,
|
b_port,
|
||||||
p2p_port;
|
p2p_port;
|
||||||
|
|
||||||
|
|
||||||
|
function getUserHome() {
|
||||||
|
return process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'];
|
||||||
|
}
|
||||||
|
|
||||||
|
var home = process.env.INSIGHT_DB || ( getUserHome() + '/.insight' );
|
||||||
|
|
||||||
if (process.env.INSIGHT_NETWORK === 'livenet') {
|
if (process.env.INSIGHT_NETWORK === 'livenet') {
|
||||||
env = 'livenet';
|
env = 'livenet';
|
||||||
db = rootPath + '/db';
|
db = home;
|
||||||
port = '3000';
|
port = '3000';
|
||||||
b_port = '8332';
|
b_port = '8332';
|
||||||
p2p_port = '8333';
|
p2p_port = '8333';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
env = 'testnet';
|
env = 'testnet';
|
||||||
db = rootPath + '/db/testnet';
|
db = home + '/testnet';
|
||||||
port = '3001';
|
port = '3001';
|
||||||
b_port = '18332';
|
b_port = '18332';
|
||||||
p2p_port = '18333';
|
p2p_port = '18333';
|
||||||
@ -48,6 +56,13 @@ if (!dataDir) {
|
|||||||
}
|
}
|
||||||
dataDir += network === 'testnet' ? 'testnet3' : '';
|
dataDir += network === 'testnet' ? 'testnet3' : '';
|
||||||
|
|
||||||
|
|
||||||
|
if (! fs.existsSync(db)){
|
||||||
|
|
||||||
|
console.log('## ERROR ##\n\tDB Directory "%s" not found. \n\tCreate it, move your old DB there or set the INSIGHT_DB environment variable.\n\tNOTE: In older insight-api versions, db was stored at <insight-root>/db', db);
|
||||||
|
process.exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
root: rootPath,
|
root: rootPath,
|
||||||
publicPath: process.env.INSIGHT_PUBLIC_PATH || false,
|
publicPath: process.env.INSIGHT_PUBLIC_PATH || false,
|
||||||
|
|||||||
@ -30,6 +30,8 @@ var Rpc = imports.rpc || require('./Rpc'),
|
|||||||
async = require('async'),
|
async = require('async'),
|
||||||
config = require('../config/config'),
|
config = require('../config/config'),
|
||||||
assert = require('assert');
|
assert = require('assert');
|
||||||
|
|
||||||
|
|
||||||
var db = imports.db || levelup(config.leveldb + '/txs',{maxOpenFiles: MAX_OPEN_FILES} );
|
var db = imports.db || levelup(config.leveldb + '/txs',{maxOpenFiles: MAX_OPEN_FILES} );
|
||||||
var Script = require('bitcore/Script');
|
var Script = require('bitcore/Script');
|
||||||
// This is 0.1.2 = > c++ version of base57-native
|
// This is 0.1.2 = > c++ version of base57-native
|
||||||
|
|||||||
10
package.json
10
package.json
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "insight-bitcore-api",
|
"name": "insight-bitcore-api",
|
||||||
"description": "An open-source bitcoin blockchain API. The Insight API provides you with a convenient, powerful and simple way to query and broadcast data on the bitcoin network and build your own services with it.",
|
"description": "An open-source bitcoin blockchain API. The Insight API provides you with a convenient, powerful and simple way to query and broadcast data on the bitcoin network and build your own services with it.",
|
||||||
"version": "0.1.7",
|
"version": "0.1.8",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Ryan X Charles",
|
"name": "Ryan X Charles",
|
||||||
"email": "ryan@bitpay.com"
|
"email": "ryan@bitpay.com"
|
||||||
@ -50,13 +50,13 @@
|
|||||||
"start": "node node_modules/grunt-cli/bin/grunt"
|
"start": "node node_modules/grunt-cli/bin/grunt"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bitcore": "git://github.com/bitpay/bitcore.git#9ef8b781826eac502783ff74b3dc2949cfc237ed",
|
"bitcore": "=0.1.8",
|
||||||
"base58-native": "0.1.2",
|
"base58-native": "0.1.2",
|
||||||
"async": "*",
|
"async": "*",
|
||||||
"leveldown": "*",
|
"leveldown": "*",
|
||||||
"levelup": "*",
|
"levelup": "*",
|
||||||
"glob": "*",
|
"glob": "*",
|
||||||
"soop": "git://github.com/gasteve/node-soop.git",
|
"soop": "=0.1.3",
|
||||||
"commander": "*",
|
"commander": "*",
|
||||||
"bignum": "*",
|
"bignum": "*",
|
||||||
"express": "~3.4.7",
|
"express": "~3.4.7",
|
||||||
@ -66,8 +66,8 @@
|
|||||||
"moment": "~2.5.0",
|
"moment": "~2.5.0",
|
||||||
"sinon": "~1.7.3",
|
"sinon": "~1.7.3",
|
||||||
"chai": "~1.8.1",
|
"chai": "~1.8.1",
|
||||||
"bufferput": "git://github.com/bitpay/node-bufferput.git",
|
"xmlhttprequest": "~1.6.0",
|
||||||
"xmlhttprequest": "~1.6.0"
|
"bufferput": "git://github.com/bitpay/node-bufferput.git"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"grunt": "~0.4.2",
|
"grunt": "~0.4.2",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user