2022-06-03 02:57:27 +00:00
# Erigon by default is "all in one binary" solution, but it's possible start TxPool as separated processes.
# Same true about: JSON RPC layer (RPCDaemon), p2p layer (Sentry), history download layer (Downloader), consensus.
# Don't start services as separated processes unless you have clear reason for it: resource limiting, scale, replace by your own implementation, security.
# This file is an example: how to start Erigon's services as separated processes.
2022-02-07 09:54:20 +00:00
2022-06-02 04:46:40 +00:00
# Default: --datadir=/home/erigon/.local/share/erigon
2023-03-03 10:11:59 +00:00
# Default UID: 1000
# Default GID: 1000
2022-06-02 04:46:40 +00:00
# Ports: `9090` execution engine (private api), `9091` sentry, `9092` consensus engine, `9093` snapshot downloader, `9094` TxPool
# Ports: `8545` json rpc, `8551` consensus json rpc, `30303` eth p2p protocol, `42069` bittorrent protocol,
# Connections: erigon -> (sentries, downloader), rpcdaemon -> (erigon, txpool), txpool -> erigon
2022-06-04 02:06:04 +00:00
version : '2.2'
2022-06-02 04:46:40 +00:00
# Basic erigon's service
2022-06-30 10:11:37 +00:00
x-erigon-service : &default-erigon-service
2022-06-02 04:46:40 +00:00
image : thorax/erigon:${TAG:-latest}
pid : service:erigon # Use erigon's PID namespace. It's required to open Erigon's DB from another process (RPCDaemon local-mode)
volumes_from : [ erigon ]
restart : unless-stopped
mem_swappiness : 0
2022-07-15 07:39:27 +00:00
user : ${DOCKER_UID:-1000}:${DOCKER_GID:-1000}
2020-08-01 07:39:04 +00:00
services :
2021-05-26 10:35:39 +00:00
erigon :
2022-01-26 15:26:33 +00:00
image : thorax/erigon:${TAG:-latest}
2022-06-30 10:11:37 +00:00
build :
2022-07-13 07:45:00 +00:00
args :
2022-07-15 07:39:27 +00:00
UID : ${DOCKER_UID:-1000}
GID : ${DOCKER_GID:-1000}
2022-07-13 07:45:00 +00:00
context : .
2022-05-31 07:35:10 +00:00
command : |
2023-03-03 10:11:59 +00:00
${ERIGON_FLAGS-} --private.api.addr=0.0.0.0:9090
2022-08-23 07:29:42 +00:00
--sentry.api.addr=sentry:9091 --downloader.api.addr=downloader:9093 --txpool.disable
2022-05-31 07:35:10 +00:00
--metrics --metrics.addr=0.0.0.0 --metrics.port=6060 --pprof --pprof.addr=0.0.0.0 --pprof.port=6061
2022-08-22 12:03:48 +00:00
--authrpc.jwtsecret=/home/erigon/.local/share/erigon/jwt.hex --datadir=/home/erigon/.local/share/erigon
2022-08-04 10:51:01 +00:00
ports : [ "8551:8551" ]
2020-08-01 07:39:04 +00:00
volumes :
2022-06-02 04:46:40 +00:00
# It's ok to mount sub-dirs of "datadir" to different drives
2021-07-24 09:14:46 +00:00
- ${XDG_DATA_HOME:-~/.local/share}/erigon:/home/erigon/.local/share/erigon
2022-05-31 07:35:10 +00:00
restart : unless-stopped
2022-06-02 04:46:40 +00:00
mem_swappiness : 0
2023-08-30 01:47:50 +00:00
user : ${DOCKER_UID:-1000}:${DOCKER_GID:-1000}
2022-05-31 07:35:10 +00:00
2022-06-02 04:46:40 +00:00
sentry :
2022-06-30 10:11:37 +00:00
<< : *default-erigon-service
2023-03-03 10:11:59 +00:00
entrypoint : sentry
command : ${SENTRY_FLAGS-} --sentry.api.addr=0.0.0.0:9091 --datadir=/home/erigon/.local/share/erigon
2022-06-02 04:46:40 +00:00
ports : [ "30303:30303/tcp" , "30303:30303/udp" ]
2022-05-31 07:35:10 +00:00
2022-06-02 04:46:40 +00:00
downloader :
2022-06-30 10:11:37 +00:00
<< : *default-erigon-service
2023-03-03 10:11:59 +00:00
entrypoint : downloader
command : ${DOWNLOADER_FLAGS-} --downloader.api.addr=0.0.0.0:9093 --datadir=/home/erigon/.local/share/erigon
2022-06-02 04:46:40 +00:00
ports : [ "42069:42069/tcp" , "42069:42069/udp" ]
txpool :
2022-06-30 10:11:37 +00:00
<< : *default-erigon-service
2023-03-03 10:11:59 +00:00
entrypoint : txpool
command : ${TXPOOL_FLAGS-} --private.api.addr=erigon:9090 --txpool.api.addr=0.0.0.0:9094 --sentry.api.addr=sentry:9091 --datadir=/home/erigon/.local/share/erigon
2022-06-02 04:46:40 +00:00
rpcdaemon :
2022-06-30 10:11:37 +00:00
<< : *default-erigon-service
2023-03-03 10:11:59 +00:00
entrypoint : rpcdaemon
2022-05-31 07:35:10 +00:00
command : |
2023-06-09 13:12:11 +00:00
${RPCDAEMON_FLAGS-} --http.addr=0.0.0.0 --http.vhosts=any --http.corsdomain=* --ws
2022-08-22 12:03:48 +00:00
--private.api.addr=erigon:9090 --txpool.api.addr=txpool:9094 --datadir=/home/erigon/.local/share/erigon
2022-08-04 10:51:01 +00:00
ports : [ "8545:8545" ]
2022-06-02 04:46:40 +00:00
2020-08-01 07:39:04 +00:00
prometheus :
2023-08-23 05:25:22 +00:00
image : prom/prometheus:v2.46.0
2022-07-15 07:39:27 +00:00
user : ${DOCKER_UID:-1000}:${DOCKER_GID:-1000} # Uses erigon user from Dockerfile
2022-02-12 07:08:20 +00:00
command : --log.level=warn --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/prometheus --storage.tsdb.retention.time=150d --web.console.libraries=/usr/share/prometheus/console_libraries --web.console.templates=/usr/share/prometheus/consoles
2022-05-31 07:35:10 +00:00
ports : [ "9090:9090" ]
2020-08-01 07:39:04 +00:00
volumes :
2021-05-26 10:35:39 +00:00
- ${ERIGON_PROMETHEUS_CONFIG:-./cmd/prometheus/prometheus.yml}:/etc/prometheus/prometheus.yml
- ${XDG_DATA_HOME:-~/.local/share}/erigon-prometheus:/prometheus
2021-07-09 08:37:36 +00:00
restart : unless-stopped
2020-08-01 07:39:04 +00:00
grafana :
2023-09-06 07:43:48 +00:00
image : grafana/grafana:10.0.5
2022-07-25 04:26:42 +00:00
user : "472:0" # required for grafana version >= 7.3
2022-05-31 07:35:10 +00:00
ports : [ "3000:3000" ]
2020-08-01 07:39:04 +00:00
volumes :
2021-05-26 10:35:39 +00:00
- ${ERIGON_GRAFANA_CONFIG:-./cmd/prometheus/grafana.ini}:/etc/grafana/grafana.ini
2020-08-01 07:39:04 +00:00
- ./cmd/prometheus/datasources:/etc/grafana/provisioning/datasources
- ./cmd/prometheus/dashboards:/etc/grafana/provisioning/dashboards
2021-05-26 10:35:39 +00:00
- ${XDG_DATA_HOME:-~/.local/share}/erigon-grafana:/var/lib/grafana
2021-07-09 08:37:36 +00:00
restart : unless-stopped
2022-06-30 10:11:37 +00:00