Blockchain explorer for Ethereum based network and a tool for inspecting and analyzing EVM based blockchains.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
blockscout/docker-compose
Maxim Filonov 843430cf33 Add rootstock locked widget in stats 1 year ago
..
envs Add rootstock locked widget in stats 1 year ago
proxy Update Nginx proxy to open all frontend paths 1 year ago
services Refactor docker-compose config: add DB healthcheck, run DB via non-root user 1 year ago
README.md New UI through Makefile 1 year ago
docker-compose-no-build-erigon.yml Refactor docker-compose config: add DB healthcheck, run DB via non-root user 1 year ago
docker-compose-no-build-external-backend.yml Refactor docker-compose config: add DB healthcheck, run DB via non-root user 1 year ago
docker-compose-no-build-external-frontend.yml Refactor docker-compose config: add DB healthcheck, run DB via non-root user 1 year ago
docker-compose-no-build-ganache.yml Refactor docker-compose config: add DB healthcheck, run DB via non-root user 1 year ago
docker-compose-no-build-geth-clique-consensus.yml Refactor docker-compose config: add DB healthcheck, run DB via non-root user 1 year ago
docker-compose-no-build-geth.yml Refactor docker-compose config: add DB healthcheck, run DB via non-root user 1 year ago
docker-compose-no-build-hardhat-network.yml Refactor docker-compose config: add DB healthcheck, run DB via non-root user 1 year ago
docker-compose-no-build-nethermind.yml Refactor docker-compose config: add DB healthcheck, run DB via non-root user 1 year ago
docker-compose-no-build-no-db-container.yml Refactor docker-compose config: add DB healthcheck, run DB via non-root user 1 year ago
docker-compose.yml Refactor docker-compose config: add DB healthcheck, run DB via non-root user 1 year ago

README.md

Docker-compose configuration

Runs Blockscout locally in Docker containers with docker-compose.

Prerequisites

  • Docker v20.10+
  • Docker-compose 2.x.x+
  • Running Ethereum JSON RPC client

Building Docker containers from source

cd ./docker-compose
docker-compose up --build

Note: if you don't need to make backend customizations, you can run docker-compose up in order to launch from pre-build backend Docker image. This will be much faster.

This command uses docker-compose.yml by-default, which builds the backend of the explorer into the Docker image and runs 9 Docker containers:

  • Postgres 14.x database, which will be available at port 7432 on the host machine.
  • Redis database of the latest version.
  • Blockscout backend with api at /api path.
  • Nginx proxy to bind backend, frontend and microservices.
  • Blockscout explorer at http://localhost.

and 4 containers for microservices (written in Rust):

Note for Linux users: Linux users need to run the local node on http://0.0.0.0/ rather than http://127.0.0.1/

Configs for different Ethereum clients

The repo contains built-in configs for different JSON RPC clients without need to build the image.

  • Erigon: docker-compose -f docker-compose-no-build-erigon.yml up -d
  • Geth (suitable for Reth as well): docker-compose -f docker-compose-no-build-geth.yml up -d
  • Geth Clique: docker-compose -f docker-compose-no-build-geth-clique-consensus.yml up -d
  • Nethermind, OpenEthereum: docker-compose -f docker-compose-no-build-nethermind up -d
  • Ganache: docker-compose -f docker-compose-no-build-ganache.yml up -d
  • HardHat network: docker-compose -f docker-compose-no-build-hardhat-network.yml up -d
  • Running only explorer without DB: docker-compose -f docker-compose-no-build-no-db-container.yml up -d. In this case, one container is created - for the explorer itself. And it assumes that the DB credentials are provided through DATABASE_URL environment variable.
  • Running explorer with external backend: docker-compose -f docker-compose-no-build-external-backend.yml up -d
  • Running explorer with external frontend: docker-compose -f docker-compose-no-build-external-frontend.yml up -d

All of the configs assume the Ethereum JSON RPC is running at http://localhost:8545.

In order to stop launched containers, run docker-compose -d -f config_file.yml down, replacing config_file.yml with the file name of the config which was previously launched.

You can adjust BlockScout environment variables:

  • for backend in ./envs/common-blockscout.env
  • for frontend in ./envs/common-frontend.env
  • for stats service in ./envs/common-stats.env
  • for visualizer in ./envs/common-visualizer.env

Descriptions of the ENVs are available

Running Docker containers via Makefile

Prerequisites are the same, as for docker-compose setup.

Start all containers:

cd ./docker
make start

Stop all containers:

cd ./docker
make stop

Note: Makefile uses the same .env files since it is running docker-compose services inside.