2019-04-26 09:54:14 +00:00
|
|
|
---
|
|
|
|
- name: Geth | Create the container
|
|
|
|
docker_container:
|
|
|
|
name: '{{ geth_cont_name }}'
|
|
|
|
image: '{{ geth_cont_image }}'
|
|
|
|
user: root
|
|
|
|
pull: true
|
2019-08-09 18:41:42 +00:00
|
|
|
restart_policy: '{{ cont_restart_policy }}'
|
2019-04-26 09:54:14 +00:00
|
|
|
state: '{{ cont_state }}'
|
|
|
|
recreate: '{{ cont_recreate }}'
|
|
|
|
restart: '{{ cont_restart }}'
|
|
|
|
# some limits due to statusd hogging resources
|
2020-03-16 17:08:18 +00:00
|
|
|
memory: '{{ geth_cont_mem_limit }}m'
|
|
|
|
memory_swap: '{{ geth_cont_swap_limit }}m'
|
2019-04-26 09:54:14 +00:00
|
|
|
ports:
|
2019-04-26 12:04:14 +00:00
|
|
|
- '{{ geth_port }}:{{ geth_port }}/tcp'
|
|
|
|
- '{{ geth_port }}:{{ geth_port }}/udp'
|
2019-04-26 09:54:14 +00:00
|
|
|
- '{{ geth_rpc_addr }}:{{ geth_rpc_port }}:{{ geth_rpc_port }}'
|
2020-06-08 13:50:18 +00:00
|
|
|
labels:
|
|
|
|
# These are just for documentation
|
|
|
|
org.ethereum.geth.network_name: '{{ geth_network_name }}'
|
|
|
|
org.ethereum.geth.network_id: '{{ geth_network_id }}'
|
2019-04-26 09:54:14 +00:00
|
|
|
command: |
|
2020-06-08 13:50:18 +00:00
|
|
|
--networkid={{ geth_network_id }}
|
2019-04-26 09:54:14 +00:00
|
|
|
{% if geth_v5disc_enabled %}
|
|
|
|
--v5disc
|
|
|
|
{% endif %}
|
|
|
|
--syncmode={{ geth_sync_mode }}
|
2019-04-26 10:42:54 +00:00
|
|
|
{% if geth_sync_mode != 'light' %}
|
2019-07-11 19:43:00 +00:00
|
|
|
--light.serve={{ geth_light_serv }}
|
2019-04-26 09:54:14 +00:00
|
|
|
{% endif %}
|
2019-05-07 12:41:27 +00:00
|
|
|
{% if geth_miner_enabled %}
|
|
|
|
--mine
|
|
|
|
--miner.threads="{{ geth_miner_threads }}"
|
|
|
|
--miner.etherbase="{{ geth_miner_account | mandatory }}"
|
|
|
|
{% endif %}
|
|
|
|
{% if geth_whisper_enabled %}
|
|
|
|
--shh
|
|
|
|
--shh.pow={{ geth_whisper_pow }}
|
|
|
|
{% endif %}
|
2019-05-14 17:28:57 +00:00
|
|
|
{% if geth_metrics_enabled %}
|
|
|
|
--metrics
|
|
|
|
{% endif %}
|
2019-08-09 18:23:51 +00:00
|
|
|
--nousb
|
2019-05-28 12:30:44 +00:00
|
|
|
--extradata={{ geth_extra_data }}
|
2019-04-26 10:35:51 +00:00
|
|
|
--verbosity={{ geth_log_level_id }}
|
2020-03-16 17:08:18 +00:00
|
|
|
--cache={{ geth_cache_size }}
|
2019-05-07 08:53:21 +00:00
|
|
|
--maxpeers={{ geth_max_peers }}
|
2019-05-07 12:41:27 +00:00
|
|
|
--maxpendpeers="{{ geth_max_pend_peers }}"
|
2019-04-26 09:54:14 +00:00
|
|
|
--port={{ geth_port }}
|
|
|
|
--nat=extip:{{ geth_public_addr }}
|
2019-04-26 13:24:37 +00:00
|
|
|
--unlock={{ geth_account_addr }}
|
2019-07-11 17:01:11 +00:00
|
|
|
--allow-insecure-unlock
|
2019-04-26 09:54:14 +00:00
|
|
|
--datadir=/data
|
2019-04-26 13:24:37 +00:00
|
|
|
--password=/keys/account.pass
|
2019-04-26 09:54:14 +00:00
|
|
|
--keystore=/keys
|
2020-06-03 10:11:36 +00:00
|
|
|
{% if geth_rpc_enabled %}
|
|
|
|
--http
|
|
|
|
--http.addr=0.0.0.0
|
|
|
|
--http.port={{ geth_rpc_port }}
|
|
|
|
--http.vhosts={{ geth_aliases | join(",") }}
|
|
|
|
--http.api={{ geth_rcp_api }}
|
2019-05-10 14:23:49 +00:00
|
|
|
--ipcpath={{ geth_ipc_path }}
|
2020-06-03 10:11:36 +00:00
|
|
|
{% endif %}
|
2019-04-26 09:54:14 +00:00
|
|
|
volumes:
|
|
|
|
- '{{ geth_cont_vol }}/keys:/keys:rw'
|
|
|
|
# WARNING: This assumes /data is mounted, see bootstrap role
|
|
|
|
- '{{ geth_data_path }}:/data:rw'
|