Merge pull request #223 from maraoz/feature/install-improvements
improvements on install process and README file
This commit is contained in:
commit
8f4736b966
|
@ -33,3 +33,5 @@ db/blocks/*
|
||||||
|
|
||||||
public/js/*
|
public/js/*
|
||||||
public/css/*
|
public/css/*
|
||||||
|
|
||||||
|
README.html
|
||||||
|
|
19
Gruntfile.js
19
Gruntfile.js
|
@ -12,11 +12,16 @@ module.exports = function(grunt) {
|
||||||
grunt.loadNpmTasks('grunt-nodemon');
|
grunt.loadNpmTasks('grunt-nodemon');
|
||||||
grunt.loadNpmTasks('grunt-concurrent');
|
grunt.loadNpmTasks('grunt-concurrent');
|
||||||
grunt.loadNpmTasks('grunt-env');
|
grunt.loadNpmTasks('grunt-env');
|
||||||
|
grunt.loadNpmTasks('grunt-markdown');
|
||||||
|
|
||||||
// Project Configuration
|
// Project Configuration
|
||||||
grunt.initConfig({
|
grunt.initConfig({
|
||||||
pkg: grunt.file.readJSON('package.json'),
|
pkg: grunt.file.readJSON('package.json'),
|
||||||
watch: {
|
watch: {
|
||||||
|
readme: {
|
||||||
|
files: ['README.md'],
|
||||||
|
tasks: ['markdown']
|
||||||
|
},
|
||||||
jade: {
|
jade: {
|
||||||
files: ['app/views/**'],
|
files: ['app/views/**'],
|
||||||
options: {
|
options: {
|
||||||
|
@ -139,6 +144,18 @@ module.exports = function(grunt) {
|
||||||
test: {
|
test: {
|
||||||
NODE_ENV: 'test'
|
NODE_ENV: 'test'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
markdown: {
|
||||||
|
all: {
|
||||||
|
files: [
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
src: 'README.md',
|
||||||
|
dest: '.',
|
||||||
|
ext: '.html'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -146,7 +163,7 @@ module.exports = function(grunt) {
|
||||||
grunt.option('force', true);
|
grunt.option('force', true);
|
||||||
|
|
||||||
//Default task(s).
|
//Default task(s).
|
||||||
grunt.registerTask('default', ['jshint', 'concurrent']);
|
grunt.registerTask('default', ['jshint', 'compile', 'concurrent']);
|
||||||
|
|
||||||
//Compile task (concat + minify)
|
//Compile task (concat + minify)
|
||||||
grunt.registerTask('compile', ['concat', 'uglify', 'cssmin']);
|
grunt.registerTask('compile', ['concat', 'uglify', 'cssmin']);
|
||||||
|
|
102
README.md
102
README.md
|
@ -1,70 +1,75 @@
|
||||||
# Insight
|
# Insight
|
||||||
|
|
||||||
Insight is an opensource bitcoin blockchain explorer with a complete REST and websocket APIs. Insight is coded in nodejs, and use AngularJS for the front-end and LevelDB for storage.
|
Insight is an open-source bitcoin blockchain explorer with complete REST
|
||||||
|
and websocket APIs. Insight runs in NodeJS, and uses AngularJS for the
|
||||||
|
front-end and LevelDB for storage.
|
||||||
|
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
* Node.js v0.10.x - Download and Install [Node.js](http://www.nodejs.org/download/). You can also follow [this gist](https://gist.github.com/isaacs/579814) for a quick and easy way to install Node.js and npm, or the Ubuntu way: git clone git@github.com:joyent/node.git && cd node && git checkout v0.10.24 && ./configure && make && make install`
|
|
||||||
* Bitcoind - Download and Install [Bitcoin](http://bitcoin.org/en/download) - You should make sure to configure RPC security and `txindex`. For an example, see `./etc/bitcoind/bitcoin.conf`
|
|
||||||
|
|
||||||
### Tools Prerequisites
|
* Node.js v0.10.x - Download and Install [Node.js](http://www.nodejs.org/download/).
|
||||||
|
You can also follow [this gist](https://gist.github.com/isaacs/579814)
|
||||||
|
for a quick and easy way to install Node.js and npm. If you use Ubuntu:
|
||||||
|
|
||||||
|
```git clone git@github.com:joyent/node.git && cd node && git checkout v0.10.24 && ./configure && make && make install```
|
||||||
|
|
||||||
|
* Bitcoind - Download and Install [Bitcoin](http://bitcoin.org/en/download)
|
||||||
|
- You should make sure to configure RPC security and `txindex`.
|
||||||
|
The easiest way to do this is copying `./etc/bitcoind/bitcoin.conf` to your
|
||||||
|
bitcoin directory (usually ~/.bitcoin).
|
||||||
|
|
||||||
|
### Tools
|
||||||
* NPM - Node.js package manager, should be installed when you install node.js.
|
* NPM - Node.js package manager, should be installed when you install node.js.
|
||||||
* Grunt - Download and Install [Grunt](http://gruntjs.com).
|
* Grunt - Download and Install [Grunt](http://gruntjs.com). You can do this by running:
|
||||||
|
```
|
||||||
|
npm install -g grunt-cli
|
||||||
|
```
|
||||||
* Bower - Web package manager, installing [Bower](http://bower.io/) is simple when you have npm:
|
* Bower - Web package manager, installing [Bower](http://bower.io/) is simple when you have npm:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ npm install -g bower
|
$ npm install -g bower
|
||||||
```
|
```
|
||||||
|
|
||||||
## Additional Packages
|
|
||||||
* Express - Defined as npm module in the [package.json](package.json) file.
|
|
||||||
* AngularJS - Defined as bower module in the [bower.json](bower.json) file.
|
|
||||||
* Twitter Bootstrap - Defined as bower module in the [bower.json](bower.json) file.
|
|
||||||
* UI Bootstrap - Defined as bower module in the [bower.json](bower.json) file.
|
|
||||||
|
|
||||||
## Quick Install
|
## Quick Install
|
||||||
To install Insight on local, you have to fork the main repository to your
|
To install Insight, clone the main repository:
|
||||||
computer:
|
|
||||||
|
|
||||||
https://github.com/bitpay/insight
|
$ git clone git@github.com:bitpay/insight.git && cd insight
|
||||||
|
|
||||||
Then clone it wherever you want:
|
|
||||||
|
|
||||||
$ git clone git@github.com:<your_username>/insight.git && cd insight
|
|
||||||
|
|
||||||
Install Grunt Command Line Interface:
|
|
||||||
|
|
||||||
$ sudo npm -g install grunt-cli
|
|
||||||
|
|
||||||
Install dependencies:
|
Install dependencies:
|
||||||
|
|
||||||
$ npm install
|
$ npm install
|
||||||
$ bower install
|
$ bower install
|
||||||
|
|
||||||
We use [Grunt](https://github.com/gruntjs/grunt-cli) to start the server:
|
Use [Grunt](https://github.com/gruntjs/grunt-cli) to start the server:
|
||||||
|
|
||||||
$ grunt
|
$ grunt
|
||||||
|
|
||||||
When not using grunt you can use (for example in production or test
|
Then open a browser and go to:
|
||||||
environment):
|
|
||||||
|
|
||||||
$ node server
|
|
||||||
|
|
||||||
Then open a browser and go to (with default port):
|
|
||||||
|
|
||||||
http://localhost:3000
|
http://localhost:3000
|
||||||
|
|
||||||
|
## Other utilities for development
|
||||||
|
To compile and minify the web application's assets:
|
||||||
|
```
|
||||||
|
grunt compile
|
||||||
|
```
|
||||||
|
|
||||||
|
To run the tests
|
||||||
|
```
|
||||||
|
grunt test
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## 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
|
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 (this can be changed on config/config.js).
|
stored on <insight root>/db (this can be changed on config/config.js).
|
||||||
|
|
||||||
As Feb/2014, storing the blockchain take ~ 31Gb of disk space on levelDB, and insight need ~7hrs to complete the syncronization process.
|
As of February 2014, storing the blockchain takes ~31Gb of disk space on levelDB,
|
||||||
|
and Insight needs ~7hrs to complete the syncronization process.
|
||||||
|
|
||||||
## Syncing old blockchain data
|
## Syncing old blockchain data
|
||||||
|
|
||||||
Old blockchain data can by sync manually from insight repository (to save old blocks and transactions in
|
Old blockchain data can be synced manually from Insight (to save blocks and transactions in
|
||||||
LevelDB):
|
LevelDB):
|
||||||
|
|
||||||
Create folders:
|
Create folders:
|
||||||
|
@ -92,7 +97,7 @@ A REST API is provided at /api. The entry points are:
|
||||||
/api/tx/[:txid]
|
/api/tx/[:txid]
|
||||||
/api/tx/525de308971eabd941b139f46c7198b5af9479325c2395db7f2fb5ae8562556c
|
/api/tx/525de308971eabd941b139f46c7198b5af9479325c2395db7f2fb5ae8562556c
|
||||||
```
|
```
|
||||||
### Addresse
|
### Address
|
||||||
```
|
```
|
||||||
/api/addr/[:addr]
|
/api/addr/[:addr]
|
||||||
/api/addr/mmvP3mTe53qxHdPqXEvdu8WdC7GfQ2vmx5
|
/api/addr/mmvP3mTe53qxHdPqXEvdu8WdC7GfQ2vmx5
|
||||||
|
@ -124,11 +129,10 @@ Bitcoin network events published are:
|
||||||
Sample output:
|
Sample output:
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
"__v":0,
|
|
||||||
"txid":"00c1b1acb310b87085c7deaaeba478cef5dc9519fab87a4d943ecbb39bd5b053",
|
"txid":"00c1b1acb310b87085c7deaaeba478cef5dc9519fab87a4d943ecbb39bd5b053",
|
||||||
"_id":"52d68099c3fb4c240d000088",
|
|
||||||
"orphaned":false,
|
"orphaned":false,
|
||||||
"processed":false
|
"processed":false
|
||||||
|
...
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -141,7 +145,6 @@ Sample output:
|
||||||
"hash":"000000004a3d187c430cd6a5e988aca3b19e1f1d1727a50dead6c8ac26899b96",
|
"hash":"000000004a3d187c430cd6a5e988aca3b19e1f1d1727a50dead6c8ac26899b96",
|
||||||
"time":1389789343,
|
"time":1389789343,
|
||||||
"fromP2P":true,
|
"fromP2P":true,
|
||||||
"_id":"52d6809ec3fb4c240d00008c"
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -150,22 +153,17 @@ Sample output:
|
||||||
Sample output:
|
Sample output:
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
blocksToSync: 164141,
|
blocksToSync: 164141,
|
||||||
syncedBlocks: 475,
|
syncedBlocks: 475,
|
||||||
upToExisting: true,
|
upToExisting: true,
|
||||||
scanningBackward: true,
|
scanningBackward: true,
|
||||||
isEndGenesis: true,
|
isEndGenesis: true,
|
||||||
end: "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943",
|
end: "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943",
|
||||||
isStartGenesis: false,
|
isStartGenesis: false,
|
||||||
start: "000000009f929800556a8f3cfdbe57c187f2f679e351b12f7011bfc276c41b6d"
|
start: "000000009f929800556a8f3cfdbe57c187f2f679e351b12f7011bfc276c41b6d"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
If you did not get all library during grunt command, please use the follow command:
|
|
||||||
|
|
||||||
$ bower install
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
All configuration is specified in the [config](config/) folder, particularly the [config.js](config/config.js) file and the [env](config/env/) files. Here you will need to specify your application name and database name.
|
All configuration is specified in the [config](config/) folder, particularly the [config.js](config/config.js) file and the [env](config/env/) files. Here you will need to specify your application name and database name.
|
||||||
|
|
||||||
|
@ -176,15 +174,17 @@ There is a bitcoind configuration sample at:
|
||||||
etc/bitcoind/bitcoin.conf
|
etc/bitcoind/bitcoin.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want to use a external bitcoind server set:
|
If you want to use a external bitcoind server set the following environment variables:
|
||||||
|
```
|
||||||
BITCOIND_HOST
|
BITCOIND_HOST
|
||||||
BITCOIND_PORT # RPC Bitcoind Port
|
BITCOIND_PORT # RPC Bitcoind Port
|
||||||
BITCOIND_P2P_PORT # P2P Bitcoind Port
|
BITCOIND_P2P_PORT # P2P Bitcoind Port
|
||||||
BITCOIND_USER
|
BITCOIND_USER
|
||||||
BITCOIND_PASS
|
BITCOIND_PASS
|
||||||
INSIGHT_NETWORK [= 'livenet' | 'testnet']
|
INSIGHT_NETWORK [= 'livenet' | 'testnet']
|
||||||
|
```
|
||||||
|
|
||||||
enviroment variables. Make sure that bitcoind is configured to accept incomming connections using 'rpcallowip' decribed in https://en.bitcoin.it/wiki/Running_Bitcoin. Alternatively change config/env/$NODE_ENV.js
|
Make sure that bitcoind is configured to accept incomming connections using 'rpcallowip' decribed in https://en.bitcoin.it/wiki/Running_Bitcoin. Alternatively change config/env/$NODE_ENV.js
|
||||||
|
|
||||||
In case the network is changed, mongoDB database need to be deleted. This can be performed running:
|
In case the network is changed, mongoDB database need to be deleted. This can be performed running:
|
||||||
```
|
```
|
||||||
|
|
|
@ -18,7 +18,6 @@ switch(process.env.NODE_ENV) {
|
||||||
env = 'dev';
|
env = 'dev';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
root: rootPath,
|
root: rootPath,
|
||||||
appName: 'Insight ' + env,
|
appName: 'Insight ' + env,
|
||||||
|
@ -31,7 +30,8 @@ module.exports = {
|
||||||
host: process.env.BITCOIND_HOST || '127.0.0.1',
|
host: process.env.BITCOIND_HOST || '127.0.0.1',
|
||||||
port: process.env.BITCOIND_PORT || '18332',
|
port: process.env.BITCOIND_PORT || '18332',
|
||||||
p2pPort: process.env.BITCOIND_P2P_PORT || '18333',
|
p2pPort: process.env.BITCOIND_P2P_PORT || '18333',
|
||||||
dataDir: process.env.BITCOIND_DATADIR || './testnet3',
|
dataDir: process.env.BITCOIND_DATADIR || (process.env.HOME + '/.bitcoin/' +
|
||||||
|
((process.env.INSIGHT_NETWORK || 'testnet')==='testnet'?'testnet3':'')),
|
||||||
|
|
||||||
// DO NOT CHANGE THIS!
|
// DO NOT CHANGE THIS!
|
||||||
disableAgent: true
|
disableAgent: true
|
||||||
|
|
|
@ -90,6 +90,7 @@
|
||||||
"grunt-concurrent": "latest",
|
"grunt-concurrent": "latest",
|
||||||
"grunt-mocha-test": "latest",
|
"grunt-mocha-test": "latest",
|
||||||
"should": "latest",
|
"should": "latest",
|
||||||
"grunt-css": "~0.5.4"
|
"grunt-css": "~0.5.4",
|
||||||
|
"grunt-markdown": "~0.5.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue