From 02887ba87b66765d5d5b9ba1468db456fc5ac562 Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Tue, 2 Jun 2015 12:08:06 -0300 Subject: [PATCH] add guide for BWS installation --- README.md | 8 +--- installation.md | 100 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+), 7 deletions(-) create mode 100644 installation.md diff --git a/README.md b/README.md index 890f872..604c541 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,7 @@ More about BWS at http://blog.bitpay.com/2015/03/05/bitcore-wallet.html BWS needs mongoDB. You can configure the connection at `config.js` -BWS supports SSL and Clustering. To configure them see [config.js](https://github.com/bitpay/bitcore-wallet-service/blob/master/config.js). - -To use clustering, an external DB server and Lock server need to be configured. The lock server can be started `locker/locker.js`. - -# Migration from LevelDB - -Old versions of BWS uses LevelDB to store data. There is a migration script available at: `scripts/level2mongo.js` +BWS supports SSL and Clustering. For a detailed guide on installing BWS with extra features see [Installing BWS](https://github.com/bitpay/bitcore-wallet-service/blob/master/installation.md). # Security Considerations diff --git a/installation.md b/installation.md new file mode 100644 index 0000000..9dcfdc2 --- /dev/null +++ b/installation.md @@ -0,0 +1,100 @@ +The following document is a step-by-step guide to run BWS in cluster mode. + +Configuration for all required modules can be specified in https://github.com/bitpay/bitcore-wallet-service/blob/master/config.js + + +###Install BWS +```bash +npm install bws +cd bws +```` + +###Start MongoDB +Example configuration for connecting to the MongoDB instance: +```javascript + storageOpts: { + mongoDb: { + uri: 'mongodb://localhost:27017/bws', + }, + } +``` + +###Start Locker server +```bash +node locker/locker.js +```` +Example configuration for connecting to locker server: +```javascript + lockOpts: { + lockerServer: { + host: 'localhost', + port: 3231, + }, + } +``` + +###Start message broker server +```bash +node messagebroker/messagebroker.js +```` +Example configuration for connecting to message broker server: +```javascript + messageBrokerOpts: { + messageBrokerServer: { + url: 'http://localhost:3380', + }, + } +``` + +###Configure blockchain service +Note: this service will be used by blockchain monitor service as well as by BWS itself. +An example of this configuration is: +```javascript + blockchainExplorerOpts: { + livenet: { + provider: 'insight', + url: 'https://insight.bitpay.com:443', + }, + testnet: { + provider: 'insight', + url: 'https://test-insight.bitpay.com:443', + }, + } +``` + + +###Start blockchain monitor service +The monitor service is used to notify instances of BWS of incoming txs. It will connect to all previous services so it is important that those are already running. +```bash +node bcmonitor/bcmonitor.js +```` + + +###Start email service +```bash +node emailservice/emailservice.js +```` +Example configuration for connecting to email service (using postfix): +```javascript + emailOpts: { + host: 'localhost', + port: 25, + ignoreTLS: true, + subjectPrefix: '[Wallet Service]', + from: 'wallet-service@bitcore.io', + } +``` + +###Enable clustering +Change `config.js` file to enable and configure clustering: +```javascript +{ + cluster: true, + clusterInstances: 4, +} +``` + +###Start bws instances +```bash +npm start +````