diff --git a/defaults/main.yml b/defaults/main.yml index d5b420b..f26d475 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -73,8 +73,18 @@ geth_lov_level_names: detail: 5 geth_log_level_name: 'info' geth_log_level_id: '{{ geth_lov_level_names[geth_log_level_name | lower] | mandatory }}' -# Available: ropsten/testnet, rinkeby, goerli -geth_network_name: 'ropsten' + +# Mapping of network names to IDs for --networkid flag +geth_network_ids: + frontier: 1 + mainnet: 1 + ropsten: 3 + testnet: 3 + rinkeby: 4 + goerli: 5 +# Available: frontier/mainnet, ropsten/testnet, rinkeby, goerli +geth_network_name: 'mainnet' +geth_network_id: '{{ geth_network_ids[geth_network_name] }}' # Port to listen on geth_port: 30303 diff --git a/tasks/container.yml b/tasks/container.yml index d27d9a2..8eae611 100644 --- a/tasks/container.yml +++ b/tasks/container.yml @@ -16,14 +16,12 @@ - '{{ geth_port }}:{{ geth_port }}/tcp' - '{{ geth_port }}:{{ geth_port }}/udp' - '{{ geth_rpc_addr }}:{{ geth_rpc_port }}:{{ geth_rpc_port }}' + labels: + # These are just for documentation + org.ethereum.geth.network_name: '{{ geth_network_name }}' + org.ethereum.geth.network_id: '{{ geth_network_id }}' command: | - {% if geth_network_name in ("ropsten", "testnet") %} - --testnet - {% elif geth_network_name == "rinkeby" %} - --rinkeby - {% elif geth_network_name == "goerli" %} - --goerli - {% endif %} + --networkid={{ geth_network_id }} {% if geth_v5disc_enabled %} --v5disc {% endif %}