# BitcoinABC (bitcore patches)

## Introduction

To set up the complete environment the Bitcoind default indexes and RPC calls are not enough to provied all the information that it's needed. So a modified version of the BitcoinABC client is going to be used, this version adds 4 new indexes to the database and new RPC calls.

## Installation

### Requirements:

* Common building tools for the ABC node&#x20;

```bash
sudo apt-get install git build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils
```

* Boost lib:

```bash
 sudo apt-get install libboost-all-dev
```

* BerkeleyDB:

```bash
sudo apt-get install libdb-dev libdb++-dev
```

* ZMQ:

```bash
sudo apt-get install libzmq3-dev
```

### Clone and build:

The last version of BitcoinABC + bitcore patches is here:  <https://github.com/hanchon/bitcoin-abc-insight>&#x20;

```bash
git clone https://github.com/hanchon/bitcoin-abc-insight.git
cd bitcoin-abc
./autogen.sh
./configure
make -j4
```

### Configuration file:

{% hint style="success" %}
The configuration file default location is \~/.bitcoin/bitcoin.conf . To simplify the bitcore configuration, using the default location is recommended.
{% endhint %}

All the configurations set in this example MUST be set for Bitcore to work. All indexes must be ON, the ZMQ announcements must be configured, and also the RPC configuration must be explicit (Only the RPC port is optional).

The **usecashaddr=0** is needed for the **NOMP** (mining pool) to work, the mining pool does not have support for cashaddr so the node must work using the legacy format.

```
txindex=1
addressindex=1
spentindex=1
timestampindex=1
server=1
zmqpubrawtx=tcp://127.0.0.1:28332
zmqpubhashblock=tcp://127.0.0.1:28332
rpcuser=hanchon
rpcpassword=hanchonpass
rpcport=18332
testnet=1
usecashaddr=0
#greatwallactivationtime=1550505000
```

{% hint style="info" %}
&#x20;If you are going to test the HardFork network, the greatwallactivationtime MUST be uncommented and set to the activation time that you want to test.
{% endhint %}

{% hint style="danger" %}
If you are editing your config file using a MS Windows editor make sure you delete the carriage returns (\r) from the file. This will avoid problems when bitcore parses the file.
{% endhint %}

## Initial Blockchain Download (IBD)

After creating the configuration file, it's time to download the blockchain. This version has 4 indexes so BitcoinABC backups are not going to work for this version, the databases are not compatibles, so a complete download is needed.

Inside your **bitcoin-abc** folder run:

```bash
./src/bitcoind
```

*The -printtoconsole parameter can be used to see the log in the terminal. If you are running the node without printtoconsole, the current height can be checked using RPC calls, bitcoin-cli or checking the debug.log file.*

After downloading the complete chain, the node can be shutdown.

## References

* Bitcoin-ABC client: <https://github.com/bitcoin-abc/bitcoin-abc>
* SatoshiLabs bitcore patches: <https://github.com/satoshilabs/bitcoin/tree/0.14.1-bitcore>
