Skip to content

Commit

Permalink
Add Harbour mainnet config for docker compose (#89)
Browse files Browse the repository at this point in the history
* Add Harbour mainnet config for docker compose

* Fix aws harbour region

* Fix harbour mainnet region
  • Loading branch information
tsudmi authored May 27, 2022
1 parent 43a4aa5 commit 39c3a63
Show file tree
Hide file tree
Showing 8 changed files with 309 additions and 12 deletions.
4 changes: 2 additions & 2 deletions deploy/gnosis/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ networks:
services:
oracle:
container_name: oracle_gnosis
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.5.0
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.5.1
restart: always
entrypoint: ["python"]
command: ["oracle/oracle/main.py"]
Expand All @@ -34,7 +34,7 @@ services:

keeper:
container_name: keeper_gnosis
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.5.0
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.5.1
restart: always
entrypoint: ["python"]
command: ["oracle/keeper/main.py"]
Expand Down
4 changes: 2 additions & 2 deletions deploy/goerli/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ networks:
services:
oracle:
container_name: oracle_goerli
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.5.0
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.5.1
restart: always
entrypoint: ["python"]
command: ["oracle/oracle/main.py"]
Expand All @@ -36,7 +36,7 @@ services:

keeper:
container_name: keeper_goerli
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.5.0
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.5.1
restart: always
entrypoint: ["python"]
command: ["oracle/keeper/main.py"]
Expand Down
4 changes: 2 additions & 2 deletions deploy/harbour_goerli/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ networks:
services:
oracle:
container_name: oracle_harbour_goerli
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.5.0
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.5.1
restart: always
entrypoint: ["python"]
command: ["oracle/oracle/main.py"]
Expand All @@ -36,7 +36,7 @@ services:

keeper:
container_name: keeper_harbour_goerli
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.5.0
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.5.1
restart: always
entrypoint: ["python"]
command: ["oracle/keeper/main.py"]
Expand Down
79 changes: 79 additions & 0 deletions deploy/harbour_mainnet/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
##########
# Oracle #
##########
LOG_LEVEL=INFO
ENABLED_NETWORKS=harbour_mainnet
ENABLE_HEALTH_SERVER=true
HEALTH_SERVER_PORT=8080
HEALTH_SERVER_HOST=0.0.0.0

# Remove ",/dns/ipfs/tcp/5001/http" if you don't use "ipfs" profile
IPFS_PIN_ENDPOINTS=/dns/ipfs.infura.io/tcp/5001/https,/dns/ipfs/tcp/5001/http

# Optionally pin merkle proofs to the pinata service for redundancy
IPFS_PINATA_API_KEY=<pinata_api_key>
IPFS_PINATA_SECRET_KEY=<pinata_secret_key>

# Change https://api.thegraph.com to http://graph-node:8000 if running local graph node
HARBOUR_MAINNET_STAKEWISE_SUBGRAPH_URL=https://api.thegraph.com/subgraphs/name/stakewise/stakewise-harbour-mainnet
HARBOUR_MAINNET_ETHEREUM_SUBGRAPH_URL=https://api.thegraph.com/subgraphs/name/stakewise/ethereum-mainnet

# Ethereum private key
# NB! You must use a different private key for every network
HARBOUR_MAINNET_ORACLE_PRIVATE_KEY=0x<private_key>

# ETH2 (consensus) client endpoint
# Change if running an external ETH2 node
HARBOUR_MAINNET_ETH2_ENDPOINT=http://eth2-node:5052

# AWS bucket to publish oracle votes to
HARBOUR_MAINNET_AWS_ACCESS_KEY_ID=<access_id>
HARBOUR_MAINNET_AWS_SECRET_ACCESS_KEY=<secret_key>
HARBOUR_MAINNET_AWS_BUCKET_NAME=oracle-votes-harbour-mainnet
HARBOUR_MAINNET_AWS_REGION=us-east-1

##########
# Keeper #
##########
# Change if running an external ETH1 node
HARBOUR_MAINNET_KEEPER_ETH1_ENDPOINT=http://eth1-node:8545
# Use https://eth-converter.com/ to calculate
HARBOUR_MAINNET_KEEPER_MIN_BALANCE_WEI=100000000000000000
HARBOUR_MAINNET_KEEPER_MAX_FEE_PER_GAS_GWEI=150

########
# IPFS #
########
IPFS_URL=http://ipfs:5001
IPFS_PROFILE=server
IPFS_FD_MAX=8192

#############
# ETH2 Node #
#############
ETH1_ENDPOINT=http://eth1-node:8545

##############
# Graph Node #
##############
GRAPH_LOG=info
GRAPH_NODE_URL=http://graph-node:8020
# Change if running remote IPFS node
ipfs=ipfs:5001
# Change if running an external ETH1 node
# NB! If syncing graph node from scratch archive node must be used.
# It can be switched to fast-sync node once fully synced.
ethereum=mainnet:http://eth1-node:8545
# Postgres DB settings for graph node
postgres_host=postgres
postgres_user=graph
postgres_pass=strong-password
postgres_db=graph-node

############
# Postgres #
############
# postgres is used by local graph node
POSTGRES_DB=graph-node
POSTGRES_USER=graph
POSTGRES_PASSWORD=strong-password
220 changes: 220 additions & 0 deletions deploy/harbour_mainnet/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
version: "3.9"

volumes:
prometheus:
driver: local
alertmanager:
driver: local
postgres:
driver: local
ipfs:
driver: local
geth:
driver: local
erigon:
driver: local
prysm:
driver: local
lighthouse:
driver: local

networks:
harbour_mainnet:
name: harbour_mainnet
driver: bridge

services:
oracle:
container_name: oracle_harbour_mainnet
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.5.1
restart: always
entrypoint: ["python"]
command: ["oracle/oracle/main.py"]
env_file: [".env"]
networks:
- harbour_mainnet

keeper:
container_name: keeper_harbour_mainnet
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.5.1
restart: always
entrypoint: ["python"]
command: ["oracle/keeper/main.py"]
env_file: [".env"]
profiles: ["keeper"]
networks:
- harbour_mainnet

prometheus:
container_name: prometheus_harbour_mainnet
image: bitnami/prometheus:2
restart: always
env_file: [".env"]
volumes:
- prometheus:/opt/bitnami/prometheus/data
- ../configs/prometheus.yml:/opt/bitnami/prometheus/conf/prometheus.yml
- ../configs/rules.yml:/opt/bitnami/prometheus/conf/rules.yml
networks:
- harbour_mainnet

alertmanager:
container_name: alertmanager_harbour_mainnet
image: bitnami/alertmanager:0
restart: always
env_file: [".env"]
volumes:
- alertmanager:/opt/bitnami/alertmanager/data
- ../configs/alertmanager.yml:/opt/bitnami/alertmanager/conf/config.yml
depends_on: ["prometheus"]
networks:
- harbour_mainnet

graph-node:
container_name: graph_node_harbour_mainnet
image: graphprotocol/graph-node:v0.25.2
restart: always
env_file: [".env"]
depends_on: ["postgres","ipfs"]
profiles: ["graph"]
networks:
- harbour_mainnet

postgres:
container_name: postgres_harbour_mainnet
image: postgres:14-alpine
restart: always
command: ["postgres", "-cshared_preload_libraries=pg_stat_statements"]
env_file: [".env"]
volumes: ["postgres:/var/lib/postgresql/data"]
profiles: ["graph"]
networks:
- harbour_mainnet

subgraphs:
container_name: subgraphs_harbour_mainnet
image: europe-west4-docker.pkg.dev/stakewiselabs/public/subgraphs:v1.3.0
command: >
/bin/sh -c "until nc -vz graph-node 8020; do echo 'Waiting graph-node'; sleep 2; done
&& yarn build:harbour_mainnet
&& yarn create:local
&& yarn deploy:local"
env_file: [".env"]
restart: "no"
depends_on: ["graph-node","ipfs"]
profiles: ["graph"]
networks:
- harbour_mainnet

ipfs:
container_name: ipfs_harbour_mainnet
image: ipfs/go-ipfs:v0.12.1
restart: always
env_file: [".env"]
ulimits:
nofile:
soft: 8192
hard: 8192
volumes: ["ipfs:/data/ipfs","../configs/ipfs-entrypoint.sh:/usr/local/bin/start_ipfs"]
profiles: ["ipfs"]
networks:
- harbour_mainnet

geth:
container_name: geth_harbour_mainnet
image: ethereum/client-go:v1.10.16
restart: always
command:
- --mainnet
- --syncmode=full
- --http
- --http.addr=0.0.0.0
- --http.vhosts=*
- --http.api=web3,eth,net
- --datadir=/data/ethereum
- --ethash.dagdir=/data/ethereum/.ethash
- --ipcdisable
volumes: ["geth:/data"]
profiles: ["geth"]
networks:
harbour_mainnet:
aliases:
- eth1-node

erigon:
container_name: erigon_harbour_mainnet
image: thorax/erigon:v2022.03.02
restart: always
command:
- erigon
- --chain=mainnet
- --private.api.addr=0.0.0.0:9090
- --maxpeers=100
- --datadir=/home/erigon/.local/share/erigon
- --batchSize=512M
- --prune.r.before=11184524
- --prune=htc
volumes: ["erigon:/home/erigon/.local/share/erigon"]
profiles: ["erigon"]
networks:
- harbour_mainnet

erigon-rpcdaemon:
container_name: erigon_rpcdaemon_harbour_mainnet
image: thorax/erigon:v2022.03.02
restart: always
command:
- rpcdaemon
- --private.api.addr=erigon:9090
- --http.addr=0.0.0.0
- --http.vhosts=*
- --http.corsdomain=*
- --http.api=eth,erigon,web3,net,txpool
- --ws
depends_on: ["erigon"]
profiles: ["erigon"]
networks:
harbour_mainnet:
aliases:
- eth1-node

prysm:
container_name: prysm_harbour_mainnet
image: gcr.io/prysmaticlabs/prysm/beacon-chain:v2.0.6
restart: always
command:
- --prater
- --genesis-state=/data/genesis.ssz
- --datadir=/data
- --rpc-host=0.0.0.0
- --rpc-port=5052
- --monitoring-host=0.0.0.0
- --http-web3provider=$ETH1_ENDPOINT
- --slots-per-archive-point=64
- --accept-terms-of-use
volumes: ["prysm:/data","../configs/genesis.ssz:/data/gensis.ssz"]
profiles: ["prysm"]
networks:
harbour_mainnet:
aliases:
- eth2-node

lighthouse:
container_name: lighthouse_harbour_mainnet
image: sigp/lighthouse:v2.1.5
restart: always
command:
- lighthouse
- --network
- prater
- beacon
- --http
- --http-address=0.0.0.0
- --http-port=5052
- --eth1-endpoints
- $ETH1_ENDPOINT
volumes: ["lighthouse:/root/.lighthouse"]
profiles: ["lighthouse"]
networks:
harbour_mainnet:
aliases:
- eth2-node
4 changes: 2 additions & 2 deletions deploy/mainnet/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ networks:
services:
oracle:
container_name: oracle_mainnet
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.5.0
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.5.1
restart: always
entrypoint: ["python"]
command: ["oracle/oracle/main.py"]
Expand All @@ -36,7 +36,7 @@ services:

keeper:
container_name: keeper_mainnet
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.5.0
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.5.1
restart: always
entrypoint: ["python"]
command: ["oracle/keeper/main.py"]
Expand Down
4 changes: 1 addition & 3 deletions oracle/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,7 @@
AWS_BUCKET_NAME=config(
f"{HARBOUR_MAINNET_UPPER}_AWS_BUCKET_NAME", default="oracle-votes-mainnet"
),
AWS_REGION=config(
f"{HARBOUR_MAINNET_UPPER}_AWS_REGION", default="eu-central-1"
),
AWS_REGION=config(f"{HARBOUR_MAINNET_UPPER}_AWS_REGION", default="us-east-1"),
AWS_ACCESS_KEY_ID=config(
f"{HARBOUR_MAINNET_UPPER}_AWS_ACCESS_KEY_ID", default=""
),
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "oracle"
version = "2.5.0"
version = "2.5.1"
description = "StakeWise Oracles are responsible for submitting off-chain data."
authors = ["Dmitri Tsumak <[email protected]>"]
license = "AGPL-3.0-only"
Expand Down

0 comments on commit 39c3a63

Please sign in to comment.