From 6c152fb32ffa38b190c23f32275d20a94deb4301 Mon Sep 17 00:00:00 2001 From: md00ux Date: Tue, 6 Apr 2021 05:55:24 +0000 Subject: [PATCH] blockscout --- compose-files/explorer.yml | 44 +++++++++++++++++++++++++++++++ compose-files/network_volumes.yml | 2 +- start_ocean.sh | 6 +++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 compose-files/explorer.yml diff --git a/compose-files/explorer.yml b/compose-files/explorer.yml new file mode 100644 index 0000000..9c1bf2b --- /dev/null +++ b/compose-files/explorer.yml @@ -0,0 +1,44 @@ +version: '3' +services: + explorer: + image: puppeth/blockscout:latest + restart: on-failure + environment: + ETHEREUM_JSONRPC_HTTP_URL: "http://172.15.0.3:8545" + ETHEREUM_JSONRPC_TRACE_URL: "http://172.15.0.3:8545" + ETHEREUM_JSONRPC_VARIANT: "ganache" + ETHEREUM_JSONRPC_WS_URL: "ws://172.15.0.3:8545" + POSTGRES_USER: "postgres" + POSTGRES_PASSWORD: "let-me-in" + DATABASE_URL: "postgresql://postgres:let-me-in@postgres:5432/explorer?ssl=false" + SECRET_KEY_BASE: "RaWSAyRGSDvieOJ97cqYuIPZq1G26Mui8tz/aDuC10rkPFonGkuT46BVdDx5GYhM" + NETWORK: "development" + NETWORK_PATH: "/" + LINK_TO_OTHER_EXPLORERS: "false" + ports: + - "4000:4000" + networks: + backend: + ipv4_address: 172.15.0.20 + command: bash -c "PGHOST=172.15.0.21 PGUSER=postgres PGDATABASE=postgres PGPASSWORD=let-me-in PGPORT=5432 psql -c 'drop database if exists explorer;' && mix do ecto.create, ecto.migrate && mix phx.server" + depends_on: + - postgres + postgres: + image: postgres + restart: on-failure + user: postgres + ports: + - '5432:5432' + networks: + backend: + ipv4_address: 172.15.0.21 + command: ['postgres', '-cshared_preload_libraries=pg_stat_statements'] + environment: + POSTGRES_USER: "postgres" + POSTGRES_PASSWORD: "let-me-in" + POSTGRES_DB: "explorer" + volumes: + - data:/var/lib/postgresql/data +volumes: + data: + driver: local diff --git a/compose-files/network_volumes.yml b/compose-files/network_volumes.yml index 261f56c..eeb3b85 100644 --- a/compose-files/network_volumes.yml +++ b/compose-files/network_volumes.yml @@ -6,4 +6,4 @@ networks: ipam: driver: default config: - - subnet: 172.15.0.1/24 + - subnet: 172.15.0.0/24 diff --git a/start_ocean.sh b/start_ocean.sh index 0b8e8c9..c8bd339 100755 --- a/start_ocean.sh +++ b/start_ocean.sh @@ -162,6 +162,7 @@ COMPOSE_FILES+=" -f ${COMPOSE_DIR}/aquarius.yml" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/provider.yml" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/ganache.yml" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/ocean_contracts.yml" +COMPOSE_FILES+=" -f ${COMPOSE_DIR}/explorer.yml" DOCKER_COMPOSE_EXTRA_OPTS="${DOCKER_COMPOSE_EXTRA_OPTS:-}" @@ -208,6 +209,11 @@ while :; do export DEPLOY_CONTRACTS=false printf $COLOR_Y'Ocean contracts will not be deployed, the last deployment (if any) will be intact ...\n\n'$COLOR_RESET ;; + --no-explorer) + COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/explorer.yml/}" + printf $COLOR_Y'Starting without Blockscout...\n\n'$COLOR_RESET + ;; + ################################################# # Cleaning switches #################################################