From c5b203f943da4cf5ad6b5cd7563c6cb1e78cdcdb Mon Sep 17 00:00:00 2001 From: morphtail Date: Sun, 3 May 2020 15:30:04 +0530 Subject: [PATCH] update docs --- README.md | 59 ++++----- packages/bitcore-node/docs/node-setup.md | 145 +++++++++++++++++++++++ 2 files changed, 165 insertions(+), 39 deletions(-) create mode 100644 packages/bitcore-node/docs/node-setup.md diff --git a/README.md b/README.md index e72daabc6a5..2d4c21c766a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ # Bitcore - ![Circle CI](https://circleci.com/gh/bitpay/bitcore/tree/master.svg?style=shield) **Infrastructure to build Bitcoin and blockchain-based applications for the next generation of financial technology.** @@ -10,8 +9,6 @@ - Trusted P2P Peer - MongoDB Server >= v3.4 -- Docker -- nodejs >= 10 - make g++ gcc ### Checkout the repo @@ -19,48 +16,13 @@ ```sh git clone git@github.com:bitpay/bitcore.git -cd bitcore git checkout master npm install ``` ## Setup Guide -### 1. Setup Docker - -Start Docker by running - -```sh -dockerd -``` - -```sh -docker-compose -f docker-compose.test.yml up -``` - -### 2. Setup Bitcore Node Config - -```sh -docker ps - -# Get IP Addresses of the Dockers - -docker inspect deviceID | grep IPAddress - -# Enter your docker device ID in place of deviceID - -# Replace the hostname with that respective IP address of your docker in Bitcore-test.config.json - -mv Bitcore-test.config.json Bitcore.config.json -``` - -### 3. Start Bitcore - -```sh -npm run node -``` - -## Example Config files +### 1. Setup Bitcore config
Example bitcore.config.json @@ -142,6 +104,8 @@ npm run node
+### 2. Setup Bitcoin Node +
Example Bitcoin Mainnet Config @@ -169,6 +133,23 @@ rpcpassword=password
+### 3. Run Bitcoin node + +
+Example Starting a Bitcoin Node + +```sh +# Path to your bitcoin application and path to the config above +/Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt -datadir=/Users/username/blockchains/bitcoin-core/networks/mainnet/ +``` + +
+ +### 4. Start Bitcore + +```sh +npm run node +``` ## Applications diff --git a/packages/bitcore-node/docs/node-setup.md b/packages/bitcore-node/docs/node-setup.md new file mode 100644 index 00000000000..2e8d5a284b9 --- /dev/null +++ b/packages/bitcore-node/docs/node-setup.md @@ -0,0 +1,145 @@ +## Node Setup Guide + +### 1. Setup Docker + +Start Docker by running + +```sh +dockerd +``` + +```sh +docker-compose -f docker-compose.test.yml up +``` + +### 2. Setup Bitcore Node Config + +```sh +docker ps + +# Get IP Addresses of the Dockers + +docker inspect deviceID | grep IPAddress + +# Enter your docker device ID in place of deviceID + +# Replace the hostname with that respective IP address of your docker in Bitcore-test.config.json + +mv Bitcore-test.config.json Bitcore.config.json +``` + +### 3. Start Bitcore + +```sh +npm run node +``` + +## Example Config files + +
+Example bitcore.config.json +
+ +```json +{ + "bitcoreNode": { + "chains": { + "BTC": { + "mainnet": { + "chainSource": "p2p", + "trustedPeers": [ + { + "host": "127.0.0.1", + "port": 20008 + } + ], + "rpc": { + "host": "127.0.0.1", + "port": 20009, + "username": "username", + "password": "password" + } + }, + "regtest": { + "chainSource": "p2p", + "trustedPeers": [ + { + "host": "127.0.0.1", + "port": 20020 + } + ], + "rpc": { + "host": "127.0.0.1", + "port": 20021, + "username": "username", + "password": "password" + } + } + }, + "BCH": { + "mainnet": { + "parentChain": "BTC", + "forkHeight": 478558, + "trustedPeers": [ + { + "host": "127.0.0.1", + "port": 30008 + } + ], + "rpc": { + "host": "127.0.0.1", + "port": 30009, + "username": "username", + "password": "password" + } + }, + "regtest": { + "chainSource": "p2p", + "trustedPeers": [ + { + "host": "127.0.0.1", + "port": 30020 + } + ], + "rpc": { + "host": "127.0.0.1", + "port": 30021, + "username": "username", + "password": "password" + } + } + } + } + } +} +``` + +
+ +
+Example Bitcoin Mainnet Config + +```sh +whitelist=127.0.0.1 +txindex=0 +listen=1 +server=1 +irc=1 +upnp=1 + +# Make sure port & rpcport matches the +# bitcore.config.json ports for BTC mainnet + +# if using Bitcoin Core v0.17+ prefix +# [main] + +port=20008 +rpcport=20009 +rpcallowip=127.0.0.1 + +rpcuser=username +rpcpassword=password +``` + +
+