From 6e06c87cf522ca2e41f7a9f11a6dbefaa7ae594c Mon Sep 17 00:00:00 2001 From: Sergi Delgado Segura Date: Wed, 18 Mar 2020 18:26:37 +0100 Subject: [PATCH] Adds some notes on running bitcoind and how to change networks --- DEPENDENCIES.md | 30 ++++++++++++++++++++++++++++++ README.md | 8 ++++++++ 2 files changed, 38 insertions(+) diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index f8e0443..de59c84 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -54,6 +54,36 @@ And, if it happens to be installed, change the alias to `pip3`, or use `pip3` in You can get Bitcoin Core from [bitcoin.org](https://bitcoin.org/en/download). +Bitcoin needs to be running with the following options enables: + +- `zmq` for rawblockhash notifications +- `txindex` to be able to look for non-wallet transactions +- `server` to run rpc commands + +Here's an example of a `bitcoin.conf` you can use: + +``` +# [debug] +regtest=1 +daemon=1 +debug=1 +logips=1 + +# [rpc] +server=1 +rpcuser=user +rpcpassword=passwd + +# [blockchain] +txindex=1 + +# [ZMQ] +zmqpubhashblock=tcp://127.0.0.1:28332 +zmqpubrawblock=tcp://127.0.0.1:28332 +zmqpubhashtx=tcp://127.0.0.1:28333 +zmqpubrawtx=tcp://127.0.0.1:28333 +``` + ### Installing the dependencies `python3` ca be downloaded from the [Python official website](https://www.python.org/downloads/) or installed using a package manager, depending on your distribution. Examples for both UNIX-like and OSX systems are provided. diff --git a/README.md b/README.md index f0de7c9..4aaf3a0 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,14 @@ TEOS consists in three main modules: Additionally, tests for every module can be found at `tests`. +By default, `teos` will run on `regtest`. In order to run it on another network you need to change your `bitcoin.conf` (to run in the proper network) and your `conf.py` to match the network name and rpc port: + +``` +BTC_RPC_PORT = 18443 +BTC_NETWORK = "regtest" +``` + + ### Running TEOS In order to run `teos` you will need to create a configuration file (follow [INSTALL.md](INSTALL.md)) and run `teosd.py`. Currently you will also need a set of keys (to sign appointments) stored in your data directory.