Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Commit

Permalink
docker compose with ipld-eth-indexer, ipld-eth-server and dapptools
Browse files Browse the repository at this point in the history
  • Loading branch information
ramilexe committed Sep 11, 2020
1 parent 72facc7 commit 52e6502
Show file tree
Hide file tree
Showing 10 changed files with 145 additions and 175 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.vscode
test_data_dir/
contracts/*
environments/*.toml
#environments/*.toml
Vagrantfile
vagrant*.sh
.vagrant
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ USER $USER

# chown first so dir is writable
COPY --chown=$USER:$USER --from=builder /go/src/github.com/vulcanize/eth-contract-watcher/$CONFIG_FILE config.toml
COPY --chown=$USER:$USER --from=builder /go/src/github.com/vulcanize/eth-contract-watcher/dockerfiles/startup_script.sh .
COPY --chown=$USER:$USER --from=builder /go/src/github.com/vulcanize/eth-contract-watcher/startup_script.sh .

# keep binaries immutable
COPY --from=builder /go/src/github.com/vulcanize/eth-contract-watcher/eth-contract-watcher eth-contract-watcher
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ migrate: $(GOOSE) checkdbvars
## Build docker image
.PHONY: docker-build
docker-build:
docker build -t vulcanize/eth-contract-watcher -f dockerfiles/Dockerfile .
docker build -t vulcanize/eth-contract-watcher -f Dockerfile .
125 changes: 125 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
version: '3.2'

services:
dapptools:
restart: unless-stopped
image: vulcanize/dapptools:v0.29.0-statediff-0.0.2
ports:
- "127.0.0.1:8545:8545"
- "127.0.0.1:8546:8546"

eth-indexer:
restart: unless-stopped
depends_on:
- indexer-db
- dapptools
image: vulcanize/ipld-eth-indexer:v0.3.0-alpha
environment:
DATABASE_NAME: vulcanize_public
DATABASE_HOSTNAME: indexer-db
DATABASE_PORT: 5432
DATABASE_USER: vdbm
DATABASE_PASSWORD: password
ETH_WS_PATH: "dapptools:8546"
ETH_HTTP_PATH: "dapptools:8545"
ETH_CHAIN_ID: 4
ETH_NETWORK_ID: 4
VDB_COMMAND: sync

eth-server:
depends_on:
- indexer-db
- eth-indexer
image: vulcanize/ipld-eth-server:v0.0.13
environment:
VDB_COMMAND: serve
DATABASE_NAME: vulcanize_public
DATABASE_HOSTNAME: indexer-db
DATABASE_PORT: 5432
DATABASE_USER: vdbm
DATABASE_PASSWORD: password
SERVER_WS_PATH: "0.0.0.0:8080"
SERVER_HTTP_PATH: "0.0.0.0:8081"
LOGRUS_LEVEL: debug
ports:
- "127.0.0.1:8080:8080"
- "127.0.0.1:8081:8081"

indexer-db:
restart: unless-stopped
image: postgres:10.12-alpine
environment:
- POSTGRES_USER=vdbm
- POSTGRES_DB=vulcanize_public
- POSTGRES_PASSWORD=password
volumes:
- indexer_db_data:/var/lib/postgresql/data
ports:
- "127.0.0.1:8069:5432"

contact-watcher-db:
restart: unless-stopped
image: postgres:10.12-alpine
environment:
- POSTGRES_USER=vdbm
- POSTGRES_DB=vulcanize_public
- POSTGRES_PASSWORD=password
volumes:
- contact_watcher_db_data:/var/lib/postgresql/data
ports:
- "127.0.0.1:8068:5432"

eth-header-sync:
restart: unless-stopped
depends_on:
- contact-watcher-db
image: vulcanize/eth-header-sync:v0.1.1
volumes:
- ./environments/header_sync.toml:/app/config.toml
environment:
- STARTING_BLOCK_NUMBER=1
- VDB_COMMAND=sync
- DATABASE_NAME=vulcanize_public
- DATABASE_HOSTNAME=contact-watcher-db
- DATABASE_PORT=5432
- DATABASE_USER=vdbm
- DATABASE_PASSWORD=password

eth-contract-watcher:
depends_on:
- contact-watcher-db
build:
context: ""
cache_from:
- alpine:latest
- golang:1.13
dockerfile: Dockerfile
volumes:
- ./geth.ipc:/geth.ipc
- ./environments/example.toml:/app/config.toml
environment:
- VDB_COMMAND=watch
- DATABASE_NAME=vulcanize_public
- DATABASE_HOSTNAME=contact-watcher-db
- DATABASE_PORT=5432
- DATABASE_USER=vdbm
- DATABASE_PASSWORD=password

contract-watcher-graphql:
restart: unless-stopped
depends_on:
- contact-watcher-db
image: vulcanize/postgraphile:v1.0
environment:
- PG_HOST=contact-watcher-db
- PG_PORT=5432
- PG_DATABASE=vulcanize_public
- PG_USER=vdbm
- PG_PASSWORD=password
- SCHEMA=public,header_0xd850942ef8811f2a866692a623011bde52a462c1
ports:
- "127.0.0.1:5000:5000"

volumes:
contact_watcher_db_data:
indexer_db_data:
86 changes: 0 additions & 86 deletions dockerfiles/docker-compose.yml

This file was deleted.

43 changes: 0 additions & 43 deletions dockerfiles/header_sync/Dockerfile

This file was deleted.

42 changes: 0 additions & 42 deletions dockerfiles/header_sync/startup_script.sh

This file was deleted.

2 changes: 1 addition & 1 deletion environments/example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
password = "password"

[client]
rpcPath = "/geth.ipc"
rpcPath = "http://eth-server:8081"

[contract]
network = ""
Expand Down
16 changes: 16 additions & 0 deletions environments/header_sync.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[database]
name = "vulcanize_public"
hostname = "contact-watcher-db"
port = 5432
user = "vdbm"
password = "password"

[client]
rpcPath = "http://eth-server:8081"

[ethereum]
nodeID = "arch1" # $ETH_NODE_ID
clientName = "Geth" # $ETH_CLIENT_NAME
genesisBlock = "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3" # $ETH_GENESIS_BLOCK
networkID = "4" # $ETH_NETWORK_ID
chainID = "4" # $ETH_CHAIN_ID
File renamed without changes.

0 comments on commit 52e6502

Please sign in to comment.