Merge pull request #265 from braydonf/doc-update
Updates to documentation for bitcore.io website.
This commit is contained in:
commit
caefe5dbd1
|
@ -1,4 +1,8 @@
|
||||||
## Build & Install
|
---
|
||||||
|
title: Build & Install
|
||||||
|
description: Build & installation instructions for Bitcore Node
|
||||||
|
---
|
||||||
|
# Build & Install
|
||||||
|
|
||||||
This includes a detailed instructions for compiling. There are two main parts of the build, compiling Bitcoin Core as a static library and the Node.js bindings.
|
This includes a detailed instructions for compiling. There are two main parts of the build, compiling Bitcoin Core as a static library and the Node.js bindings.
|
||||||
|
|
||||||
|
@ -89,4 +93,4 @@ Once everything is built, you can run bitcore-node via:
|
||||||
npm start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
This will then start the syncing process for Bitcoin Core and the extended capabilities as provided by the built-in Address Module (details below).
|
This will then start the syncing process for Bitcoin Core and the extended capabilities as provided by the built-in Address Module (details below).
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
---
|
||||||
|
title: Bus
|
||||||
|
description: An event emitter for node events
|
||||||
|
---
|
||||||
# Bus
|
# Bus
|
||||||
|
|
||||||
The bus provides a way to subscribe to events from any of the services running. It's implemented abstract from transport specific implementation. The primary use of the bus in Bitcore Node is for subscribing to events via a web socket.
|
The bus provides a way to subscribe to events from any of the services running. It's implemented abstract from transport specific implementation. The primary use of the bus in Bitcore Node is for subscribing to events via a web socket.
|
||||||
|
@ -29,4 +33,3 @@ bus.subscribe('address/transaction', ['13FMwCYz3hUhwPcaWuD2M1U2KzfTtvLM89']);
|
||||||
// unsubscribe
|
// unsubscribe
|
||||||
bus.unsubscribe('transaction');
|
bus.unsubscribe('transaction');
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
---
|
||||||
|
title: Errors
|
||||||
|
description: Errors for Bitcore Node
|
||||||
|
---
|
||||||
# Errors
|
# Errors
|
||||||
|
|
||||||
Many times there are cases where an error condition can be gracefully handled depending on a particular use. To assist in better error handling, errors will have different types so that it's possible to determine the type of error and handle appropriatly.
|
Many times there are cases where an error condition can be gracefully handled depending on a particular use. To assist in better error handling, errors will have different types so that it's possible to determine the type of error and handle appropriatly.
|
||||||
|
@ -14,4 +18,4 @@ node.services.address.getUnspentOutputs('00000000839a8...', function(err, output
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
For more information about different types of errors, please see `lib/errors.js`.
|
For more information about different types of errors, please see `lib/errors.js`.
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
Bitcore Node
|
||||||
|
============
|
||||||
|
|
||||||
|
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 native bindings to Bitcoin Core with the [Bitcoin Service](services/bitcoind.md). Additional services can be enabled to make a node more useful such as exposing new APIs, adding new indexes for addresses with the [Address Service](services/address.md), running a block explorer, wallet service, and other customizations.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install -g bitcore-node@latest
|
||||||
|
bitcore-node 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.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- Node.js v0.12
|
||||||
|
- ~100GB of disk storage
|
||||||
|
- ~1GB of RAM
|
||||||
|
- Mac OS X >= 10.9, Ubuntu >= 12.04 (libc >= 2.15 and libstdc++ >= 6.0.16)
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
Bitcore Node includes a Command Line Interface (CLI) for managing, configuring and interfacing with your Bitcore Node.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bitcore-node create -d <bitcoin-data-dir> mynode "My Node"
|
||||||
|
cd mynode
|
||||||
|
bitcore-node add <service>
|
||||||
|
bitcore-node add 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).
|
||||||
|
|
||||||
|
To start bitcore-node as a daemon:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bitcore-node start --daemon
|
||||||
|
```
|
||||||
|
|
||||||
|
## Add-on Services
|
||||||
|
|
||||||
|
There are several add-on services available to extend the functionality of Bitcore Node:
|
||||||
|
|
||||||
|
- [Insight API](https://github.com/bitpay/insight-api/tree/v0.3.0)
|
||||||
|
- [Insight UI](https://github.com/bitpay/insight/tree/v0.3.0)
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
- [Services](services.md)
|
||||||
|
- [Bitcoind](services/bitcoind.md) - Native bindings to Bitcoin Core
|
||||||
|
- [Database](services/db.md) - The foundation API methods for getting information about blocks and transactions.
|
||||||
|
- [Address](services/address.md) - Adds additional API methods for querying and subscribing to events with bitcoin addresses.
|
||||||
|
- [Web](services/web.md) - Creates an express application over which services can expose their web/API content
|
||||||
|
- [Build & Install](build.md) - How to build and install from source
|
||||||
|
- [Testing & Development](testing.md) - Developer guide for testing
|
||||||
|
- [Node](node.md) - Details on the node constructor
|
||||||
|
- [Bus](bus.md) - Overview of the event bus constructor
|
||||||
|
- [Errors](errors.md) - Reference for error handling and types
|
||||||
|
- [Patch](patch.md) - Information about the patch applied to Bitcoin Core
|
||||||
|
- [Release Process](release.md) - Information about verifying a release and the release process.
|
|
@ -1,3 +1,7 @@
|
||||||
|
---
|
||||||
|
title: Node
|
||||||
|
description: A collection of services run as node.
|
||||||
|
---
|
||||||
# Node
|
# Node
|
||||||
|
|
||||||
A node represents a collection of services that are loaded together. For more information about services, please see the [Services Documentation](services.md).
|
A node represents a collection of services that are loaded together. For more information about services, please see the [Services Documentation](services.md).
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
|
---
|
||||||
|
title: Bitcoin Core Patch
|
||||||
|
description: Description of the patch applied to Bitcoin Core to compile as a static library
|
||||||
|
---
|
||||||
# Static Library Patch
|
# Static Library Patch
|
||||||
|
|
||||||
To provide native bindings to JavaScript *(or any other language for that matter)*, Bitcoin code, itself, must be linkable. Currently, Bitcoin Core provides a JSON RPC interface to bitcoind as well as a shared library for script validation *(and hopefully more)* called libbitcoinconsensus. There is a node module, [node-libbitcoinconsensus](https://github.com/bitpay/node-libbitcoinconsensus), that exposes these methods. While these interfaces are useful for several use cases, there are additional use cases that are not fulfilled, and being able to implement customized interfaces is necessary. To be able to do this a few simple changes need to be made to Bitcoin Core to compile as a static library.
|
To provide native bindings to JavaScript *(or any other language for that matter)*, Bitcoin code, itself, must be linkable. Currently, Bitcoin Core provides a JSON RPC interface to bitcoind as well as a shared library for script validation *(and hopefully more)* called libbitcoinconsensus. There is a node module, [node-libbitcoinconsensus](https://github.com/bitpay/node-libbitcoinconsensus), that exposes these methods. While these interfaces are useful for several use cases, there are additional use cases that are not fulfilled, and being able to implement customized interfaces is necessary. To be able to do this a few simple changes need to be made to Bitcoin Core to compile as a static library.
|
||||||
|
|
||||||
The patch is located at `etc/bitcoin.patch` and adds a configure option `--enable-daemonlib` to compile all object files with `-fPIC` (Position Independent Code - needed to create a shared object), exposes leveldb variables and objects, exposes the threadpool to the bindings, and conditionally includes the main function.
|
The patch is located at `etc/bitcoin.patch` and adds a configure option `--enable-daemonlib` to compile all object files with `-fPIC` (Position Independent Code - needed to create a shared object), exposes leveldb variables and objects, exposes the threadpool to the bindings, and conditionally includes the main function.
|
||||||
|
|
||||||
Every effort will be made to ensure that this patch stays up-to-date with the latest release of Bitcoin. At the very least, this project began supporting Bitcoin Core v0.11.
|
Every effort will be made to ensure that this patch stays up-to-date with the latest release of Bitcoin. At the very least, this project began supporting Bitcoin Core v0.11.
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
---
|
||||||
|
title: Release Process
|
||||||
|
description: Description to verify releases
|
||||||
|
---
|
||||||
# Release Process
|
# Release Process
|
||||||
|
|
||||||
Binaries for the C++ binding file (which includes libbitcoind statically linked in) are distributed for convenience. The binary binding file `bitcoind.node` is signed and published to S3 for later download and installation. Source files can also be built if binaries are not desired.
|
Binaries for the C++ binding file (which includes libbitcoind statically linked in) are distributed for convenience. The binary binding file `bitcoind.node` is signed and published to S3 for later download and installation. Source files can also be built if binaries are not desired.
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
---
|
||||||
|
title: Scaffolding
|
||||||
|
description: Description of functions for Bitcore Node configuration
|
||||||
|
---
|
||||||
# Scaffold
|
# Scaffold
|
||||||
|
|
||||||
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.
|
||||||
|
@ -29,4 +33,3 @@ This function will remove a service from a node by uninstalling the necessary de
|
||||||
## Call Method
|
## Call Method
|
||||||
|
|
||||||
This function will call an API method on a node via the JSON-RPC interface.
|
This function will call an API method on a node via the JSON-RPC interface.
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
|
---
|
||||||
|
title: Services
|
||||||
|
description: Overview of Bitcore Node services architecture.
|
||||||
|
---
|
||||||
# Services
|
# Services
|
||||||
|
|
||||||
## Available Services
|
|
||||||
|
|
||||||
- [Bitcoin Daemon](services/bitcoind.md)
|
|
||||||
- [DB](services/db.md)
|
|
||||||
- [Address](services/address.md)
|
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
Bitcore Node has a service module system that can start up additional services that can include additional:
|
Bitcore Node has a service module system that can start up additional services that can include additional:
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
---
|
||||||
|
title: Address Service
|
||||||
|
description: Overview of the Address Service for Bitcore Node
|
||||||
|
---
|
||||||
# Address Service
|
# Address Service
|
||||||
|
|
||||||
The address service builds on the [Bitcoin Service](bitcoind.md) and the [Database Service](db.md) to add additional functionality for querying and subscribing to information based on bitcoin addresses. This will typically represent the core functionality for wallet applications.
|
The address service builds on the [Bitcoin Service](bitcoind.md) and the [Database Service](db.md) to add additional functionality for querying and subscribing to information based on bitcoin addresses. This will typically represent the core functionality for wallet applications.
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
|
---
|
||||||
|
title: Bitcoin Service
|
||||||
|
description: Overview of the Bitcoin Service for Bitcore Node
|
||||||
|
---
|
||||||
# Bitcoin Service
|
# Bitcoin Service
|
||||||
|
|
||||||
The Bitcoin Service adds a native Node.js interface to Bitcoin Core for querying information about the Bitcoin blockchain. Bindings are linked to Bitcoin Core compiled as a static library.
|
The Bitcoin Service adds a native [Node.js](https://nodejs.org) interface to [Bitcoin Core](https://github.com/bitcoin/bitcoin) for querying information about the Bitcoin blockchain. Bindings are linked to Bitcoin Core compiled as a static library.
|
||||||
|
|
||||||
## API Documentation
|
## API Documentation
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
---
|
||||||
|
title: Database Service
|
||||||
|
description: Overview of the Database Service for Bitcore Node
|
||||||
|
---
|
||||||
# Database Service
|
# Database Service
|
||||||
|
|
||||||
This service synchronizes a leveldb database with the [Bitcoin Service](bitcoind.md) block chain by connecting and disconnecting blocks to build new indexes that can be queried. Other services can extend the data that is indexed by implementing a `blockHandler` method, similar to the built-in [Address Service](address.md).
|
This service synchronizes a leveldb database with the [Bitcoin Service](bitcoind.md) block chain by connecting and disconnecting blocks to build new indexes that can be queried. Other services can extend the data that is indexed by implementing a `blockHandler` method, similar to the built-in [Address Service](address.md).
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
---
|
||||||
|
title: Web Service
|
||||||
|
description: Overview of the Web Service for Bitcore Node
|
||||||
|
---
|
||||||
# Web Service
|
# Web Service
|
||||||
|
|
||||||
The web service creates an express app which can be used by services for setting up web routes for API's, static content, web applications, etc. This allows users to interact with various bitcore node services over one http or https port.
|
The web service creates an express app which can be used by services for setting up web routes for API's, static content, web applications, etc. This allows users to interact with various bitcore node services over one http or https port.
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
## Development & Testing
|
---
|
||||||
|
title: Development & Testing
|
||||||
|
description: Notes for development and debugging Bitcore Node
|
||||||
|
---
|
||||||
|
# Development & Testing
|
||||||
|
|
||||||
To run all of the JavaScript tests:
|
To run all of the JavaScript tests:
|
||||||
|
|
||||||
|
@ -49,4 +53,4 @@ To run the benchmarks:
|
||||||
```bash
|
```bash
|
||||||
$ cd benchmarks
|
$ cd benchmarks
|
||||||
$ node index.js
|
$ node index.js
|
||||||
```
|
```
|
||||||
|
|
|
@ -18,11 +18,13 @@ var errors = require('./errors');
|
||||||
* properties that can be shared across services, such as network settings.
|
* properties that can be shared across services, such as network settings.
|
||||||
*
|
*
|
||||||
* The array of services should have the format:
|
* The array of services should have the format:
|
||||||
|
* ```js
|
||||||
* {
|
* {
|
||||||
* name: 'bitcoind',
|
* name: 'bitcoind',
|
||||||
* config: {}, // options to pass into constructor
|
* config: {}, // options to pass into constructor
|
||||||
* module: <serviceConstructor>
|
* module: ServiceConstructor
|
||||||
* }
|
* }
|
||||||
|
* ```
|
||||||
*
|
*
|
||||||
* @param {Object} config - The configuration of the node
|
* @param {Object} config - The configuration of the node
|
||||||
* @param {Array} config.services - The array of services
|
* @param {Array} config.services - The array of services
|
||||||
|
|
|
@ -22,8 +22,9 @@ var AddressHistory = require('./history');
|
||||||
* functionality for getting information by base58check encoded addresses. This includes getting the
|
* functionality for getting information by base58check encoded addresses. This includes getting the
|
||||||
* balance for an address, the history for a collection of addresses, and unspent outputs for
|
* balance for an address, the history for a collection of addresses, and unspent outputs for
|
||||||
* contstructing transactions. This is typically the core functionality for building a wallet.
|
* contstructing transactions. This is typically the core functionality for building a wallet.
|
||||||
* @param {Node} node - An instance of the node
|
* @param {Object} options
|
||||||
* @param {String} [name] - An optional name of the service
|
* @param {Node} options.node - An instance of the node
|
||||||
|
* @param {String} options.name - An optional name of the service
|
||||||
*/
|
*/
|
||||||
var AddressService = function(options) {
|
var AddressService = function(options) {
|
||||||
BaseService.call(this, options);
|
BaseService.call(this, options);
|
||||||
|
|
|
@ -11,8 +11,8 @@ var log = index.log;
|
||||||
var Service = require('../service');
|
var Service = require('../service');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides an interface to native bindings to Bitcoin Core compiled as a static library.
|
* Provides an interface to native bindings to [Bitcoin Core](https://github.com/bitcoin/bitcoin)
|
||||||
* The C++ bindings can be found at src/libbitcoind.cc
|
* compiled as a static library. The C++ bindings can be found at `src/libbitcoind.cc`
|
||||||
* @param {Object} options
|
* @param {Object} options
|
||||||
* @param {Node} options.node - A reference to the node
|
* @param {Node} options.node - A reference to the node
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue