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
|
|
|
|
restart_policy: always
|
|
|
|
state: '{{ cont_state }}'
|
|
|
|
recreate: '{{ cont_recreate }}'
|
|
|
|
restart: '{{ cont_restart }}'
|
|
|
|
# some limits due to statusd hogging resources
|
|
|
|
memory: '{{ cont_mem_limit }}m'
|
|
|
|
memory_swap: '{{ cont_swap_limit }}m'
|
|
|
|
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 }}'
|
|
|
|
command: |
|
2019-04-26 12:04:14 +00:00
|
|
|
{% if geth_network_name in ("ropsten", "testnet") %}
|
|
|
|
--testnet
|
|
|
|
{% elif geth_network_name == "rinkeby" %}
|
|
|
|
--rinkeby
|
|
|
|
{% elif geth_network_name == "goerli" %}
|
|
|
|
--goerli
|
|
|
|
{% endif %}
|
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-04-26 09:54:14 +00:00
|
|
|
--lightserv={{ geth_light_serv }}
|
|
|
|
--lightpeers={{ geth_light_peers }}
|
|
|
|
{% endif %}
|
2019-04-26 10:35:51 +00:00
|
|
|
--verbosity={{ geth_log_level_id }}
|
2019-04-26 09:54:14 +00:00
|
|
|
--cache={{ geth_cache }}
|
|
|
|
--port={{ geth_port }}
|
|
|
|
--nat=extip:{{ geth_public_addr }}
|
|
|
|
--unlock={{ geth_account_address }}
|
|
|
|
--datadir=/data
|
|
|
|
--password=/keys/password
|
|
|
|
--keystore=/keys
|
|
|
|
--rpc
|
|
|
|
--rpcaddr=0.0.0.0
|
|
|
|
--rpcport={{ geth_rpc_port }}
|
2019-04-26 11:07:57 +00:00
|
|
|
--rpcvhosts={{ geth_aliases | join(",") }}
|
2019-04-26 09:54:14 +00:00
|
|
|
--rpcapi={{ geth_rcp_api }}
|
|
|
|
volumes:
|
|
|
|
- '{{ geth_cont_vol }}/keys:/keys:rw'
|
|
|
|
# WARNING: This assumes /data is mounted, see bootstrap role
|
|
|
|
- '{{ geth_data_path }}:/data:rw'
|