2021-03-25 11:16:43 +00:00
|
|
|
---
|
|
|
|
services:
|
|
|
|
geth:
|
|
|
|
container_name: '{{ geth_cont_name }}'
|
|
|
|
image: '{{ geth_cont_image }}'
|
|
|
|
user: root
|
|
|
|
restart: 'always'
|
2022-10-24 20:10:13 +00:00
|
|
|
stop_grace_period: '{{ geth_cont_stop_grace_period }}'
|
2021-03-25 19:47:27 +00:00
|
|
|
deploy:
|
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
memory: '{{ geth_cont_mem_limit }}m'
|
2021-03-25 11:16:43 +00:00
|
|
|
ports:
|
|
|
|
- '{{ geth_port }}:{{ geth_port }}/tcp'
|
|
|
|
- '{{ geth_port }}:{{ geth_port }}/udp'
|
2023-03-20 21:02:15 +00:00
|
|
|
{% if geth_metrics_enabled %}
|
2021-03-25 11:16:43 +00:00
|
|
|
- '{{ geth_metrics_port }}:{{ geth_metrics_port }}/tcp'
|
2023-03-20 21:02:15 +00:00
|
|
|
{% endif %}
|
|
|
|
{% if geth_websocket_enabled %}
|
2021-08-25 13:20:41 +00:00
|
|
|
- '{{ geth_websocket_addr }}:{{ geth_websocket_port }}:{{ geth_websocket_port }}/tcp'
|
2023-03-20 21:02:15 +00:00
|
|
|
{% endif %}
|
|
|
|
{% if geth_rpc_enabled %}
|
2021-08-25 13:20:41 +00:00
|
|
|
- '{{ geth_rpc_addr }}:{{ geth_rpc_port }}:{{ geth_rpc_port }}/tcp'
|
2023-03-20 21:02:15 +00:00
|
|
|
{% endif %}
|
|
|
|
{% if geth_authrpc_enabled %}
|
2022-08-11 09:42:02 +00:00
|
|
|
- '{{ geth_authrpc_addr }}:{{ geth_authrpc_port }}:{{ geth_authrpc_port }}/tcp'
|
2023-03-20 21:02:15 +00:00
|
|
|
{% endif %}
|
2021-03-25 11:16:43 +00:00
|
|
|
labels:
|
|
|
|
# These are just for documentation
|
|
|
|
org.ethereum.geth.network_name: '{{ geth_network_name }}'
|
|
|
|
volumes:
|
|
|
|
- '{{ geth_cont_vol }}/keys:/keys:rw'
|
|
|
|
- '{{ geth_cont_vol }}/data:/data:rw'
|
|
|
|
command: |
|
2022-03-11 10:37:08 +00:00
|
|
|
{% if geth_network_id is defined %}
|
|
|
|
--networkid={{ geth_network_id }}
|
|
|
|
{% elif geth_network_name != "mainnet" %}
|
2021-03-25 11:16:43 +00:00
|
|
|
--{{ geth_network_name }}
|
|
|
|
{% endif %}
|
|
|
|
{% if not geth_discovery_enabled %}
|
|
|
|
--nodiscover
|
|
|
|
{% endif %}
|
|
|
|
{% if geth_v5disc_enabled %}
|
|
|
|
--v5disc
|
|
|
|
{% endif %}
|
|
|
|
--syncmode={{ geth_sync_mode }}
|
|
|
|
{% if geth_sync_mode != 'light' %}
|
|
|
|
--light.serve={{ geth_light_serv }}
|
|
|
|
{% endif %}
|
|
|
|
{% if geth_miner_enabled %}
|
|
|
|
--mine
|
|
|
|
--miner.etherbase="{{ geth_miner_account | mandatory }}"
|
|
|
|
{% endif %}
|
|
|
|
{% if geth_whisper_enabled %}
|
|
|
|
--shh
|
|
|
|
--shh.pow={{ geth_whisper_pow }}
|
|
|
|
{% endif %}
|
|
|
|
{% if geth_metrics_enabled %}
|
|
|
|
--metrics
|
|
|
|
--metrics.addr=0.0.0.0
|
|
|
|
--metrics.port={{ geth_metrics_port }}
|
|
|
|
{% endif %}
|
|
|
|
{% if geth_cache_size %}
|
|
|
|
--cache={{ geth_cache_size }}
|
|
|
|
{% endif %}
|
|
|
|
{% if geth_rpc_enabled %}
|
|
|
|
--http
|
|
|
|
--http.addr=0.0.0.0
|
|
|
|
--http.port={{ geth_rpc_port }}
|
2022-09-07 11:22:49 +00:00
|
|
|
--http.vhosts={{ geth_rpc_vhosts | sort | join(",") }}
|
2021-03-25 11:16:43 +00:00
|
|
|
--http.api={{ geth_rcp_api }}
|
|
|
|
--ipcpath=/data/geth.ipc
|
|
|
|
{% endif %}
|
|
|
|
{% if geth_websocket_enabled %}
|
|
|
|
--ws
|
|
|
|
--ws.addr=0.0.0.0
|
|
|
|
--ws.port={{ geth_websocket_port }}
|
|
|
|
--ws.api={{ geth_websocket_api }}
|
2022-10-17 17:15:23 +00:00
|
|
|
--ws.origins={{ geth_websocket_origins | sort | join(",") }}
|
2021-03-25 11:16:43 +00:00
|
|
|
{% endif %}
|
2022-08-11 09:42:02 +00:00
|
|
|
{% if geth_authrpc_enabled %}
|
|
|
|
--authrpc.addr=0.0.0.0
|
|
|
|
--authrpc.port={{ geth_authrpc_port }}
|
2022-09-07 11:22:49 +00:00
|
|
|
--authrpc.vhosts={{ geth_authrpc_vhosts | sort | join(",") }}
|
2022-08-11 09:42:02 +00:00
|
|
|
--authrpc.jwtsecret=/keys/jwtsecret
|
|
|
|
{% endif %}
|
2021-03-25 11:16:43 +00:00
|
|
|
{% if (geth_bootnodes|length) > 0 %}
|
2022-09-07 11:22:49 +00:00
|
|
|
--bootnodes="{{ geth_bootnodes | sort | join(',') }}"
|
2021-03-25 11:16:43 +00:00
|
|
|
{% endif %}
|
2021-03-25 11:53:33 +00:00
|
|
|
--verbosity={{ geth_log_level_id }}
|
2021-03-25 11:16:43 +00:00
|
|
|
--maxpeers={{ geth_max_peers }}
|
|
|
|
--maxpendpeers="{{ geth_max_pend_peers }}"
|
|
|
|
--port={{ geth_port }}
|
|
|
|
--nat=extip:{{ geth_public_addr }}
|
|
|
|
--unlock={{ geth_account_addr }}
|
|
|
|
--allow-insecure-unlock
|
|
|
|
--datadir=/data
|
|
|
|
--password=/keys/account.pass
|
|
|
|
--keystore=/keys
|
2021-04-29 10:45:44 +00:00
|
|
|
{% for extra_flag in geth_extra_flags %}
|
|
|
|
{{ extra_flag }}
|
|
|
|
{% endfor %}
|