From 5ceb2517248bb1fdac79dd6328add612dd900063 Mon Sep 17 00:00:00 2001 From: rllola Date: Thu, 1 Jan 2026 12:09:25 +0100 Subject: [PATCH] improved docker-compose.yml file; Update README; --- README.md | 37 ++++++++++++++++++++++++++++++++++++- contrib/docker-compose.yml | 31 +++++++++++++++++++++++-------- 2 files changed, 59 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 578821d..920f6e3 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,38 @@ # Bitcoin P2P indexer -This project is an indexer for Bitcoin and Bitcoin forks. It takes advantage of the P2P protocol in Bitcoin to fetch blocks and transactions \ No newline at end of file +This project is an indexer for Bitcoin and Bitcoin forks. It takes advantage of the P2P protocol in Bitcoin to fetch blocks and transactions. + +## Run + +### Config + +The indexer need a couple of information to be specified in a `config.toml` file : database info and one peer to the network. To create a config file copy `config.example.toml` into `config.toml`. + +`config.toml` example +``` +[database] +host = "localhost" +user = "postgres" +password = "wow" +dbname = "blockchains" + +[peer] +ip = "127.0.0.1" +port = 8333 +``` + +To find a peer we can do a `nslookup` on the dns seed of the network we wnat to index. For the port it is the p2p port used by this specific network (e.g bitcoin mainnet is `8333` and fordogecoin testnet it is `44556`). + +### Docker compose + +In the `contrib/` folder there is a `docker-compose.yml` file to start any indexer. First we need to create a config file matching the network we want to index (e.g `config.dogecoin-mainnet.toml`). + +Then run the docker compose command. +``` +$ docker compose up postgres indexer_dogecoin_mainnet +``` + +or to start them all +``` +$ docker compose up +``` \ No newline at end of file diff --git a/contrib/docker-compose.yml b/contrib/docker-compose.yml index 11d7eb2..304fbe1 100644 --- a/contrib/docker-compose.yml +++ b/contrib/docker-compose.yml @@ -1,9 +1,12 @@ -version: "3.9" +# Docker-compose.yml file to index all the blockchains +# The config.*.yml files mathing the network has to be created first services: # Bitcoin Mainnet indexer_bitcoin_mainnet: - build: ../. + image: rllola/prototype + build: https://github.com/cyber-coop/prototype.git + container_name: indexer-bitcoin-mainnet depends_on: - postgres environment: @@ -17,7 +20,9 @@ services: # Bitcoin testnet indexer_bitcoin_testnet: - build: ../. + image: rllola/prototype + build: https://github.com/cyber-coop/prototype.git + container_name: indexer-bitcoin-testnet depends_on: - postgres environment: @@ -31,7 +36,9 @@ services: # Dogecoin Mainnet indexer_dogecoin_mainnet: - build: ../. + image: rllola/prototype + build: https://github.com/cyber-coop/prototype.git + container_name: indexer-dogecoin-mainnet depends_on: - postgres environment: @@ -45,7 +52,9 @@ services: # Dogecoin testnet indexer_dogecoin_testnet: - build: ../. + image: rllola/prototype + build: https://github.com/cyber-coop/prototype.git + container_name: indexer-dogecoin-testnet depends_on: - postgres environment: @@ -59,7 +68,9 @@ services: # Litecoin Mainnet indexer_litecoin_mainnet: - build: ../. + image: rllola/prototype + build: https://github.com/cyber-coop/prototype.git + container_name: indexer-litecoin-mainnet depends_on: - postgres environment: @@ -73,7 +84,9 @@ services: # Litecoin Testnet indexer_litecoin_testnet: - build: ../. + image: rllola/prototype + build: https://github.com/cyber-coop/prototype.git + container_name: indexer-litecoin-testnet depends_on: - postgres environment: @@ -87,7 +100,9 @@ services: # Namecoin Mainnet indexer_namecoin_mainnet: - build: ../. + image: rllola/prototype + build: https://github.com/cyber-coop/prototype.git + container_name: indexer-namecoin-mainnet depends_on: - postgres environment: