Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Docs #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 20 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.**
Expand All @@ -10,57 +9,20 @@

- Trusted P2P Peer
- MongoDB Server >= v3.4
- Docker
- nodejs >= 10
- make g++ gcc

### Checkout the repo


```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

<details>
<summary>Example bitcore.config.json</summary>
Expand Down Expand Up @@ -142,6 +104,8 @@ npm run node

</details>

### 2. Setup Bitcoin Node

<details>
<summary>Example Bitcoin Mainnet Config</summary>

Expand Down Expand Up @@ -169,6 +133,23 @@ rpcpassword=password

</details>

### 3. Run Bitcoin node

<details>
<summary>Example Starting a Bitcoin Node</summary>

```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/
```

</details>

### 4. Start Bitcore

```sh
npm run node
```

## Applications

Expand Down
145 changes: 145 additions & 0 deletions packages/bitcore-node/docs/node-setup.md
Original file line number Diff line number Diff line change
@@ -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

<details>
<summary>Example bitcore.config.json</summary>
<br>

```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"
}
}
}
}
}
}
```

</details>

<details>
<summary>Example Bitcoin Mainnet Config</summary>

```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
```

</details>