From da4ef40dd4910b197a5d642cdb6ff395fa36a21b Mon Sep 17 00:00:00 2001 From: Joshua Fernandes Date: Thu, 9 Sep 2021 16:21:45 +1000 Subject: [PATCH] adding in required blocks param --- README.md | 1 + templates/config.toml.j2 | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 3e54698..24fa0d2 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ All variables which can be overridden are stored in [defaults/main.yml](defaults | `besu_max_peers` | ___unset___ | The maximum number of P2P connections you can establish | | `besu_network` | mainnet | The network that this node will join. Other values are 'ropsten', 'rinkeby', 'goerli', 'classic', 'mordor', 'kotti', 'dev' and 'custom' | | `besu_genesis_path` | ___unset___ | The path to the genesis file, only valid when `besu_network` is `custom` | +| `besu_required_blocks` | [] | Requires a peer with the specified block number to have the specified hash when connecting, or Besu rejects that peer | | `besu_sync_mode` | FAST | Specifies the synchronization mode. Other values are 'FULL' | | `besu_log_level` | INFO | The log level to use. Other log levels are 'OFF', 'FATAL', 'WARN', 'INFO', 'DEBUG', 'TRACE', 'ALL' | | `besu_p2p_port` | 30303 | Specifies the P2P listening ports (UDP and TCP). Ports must be exposed appropriately | diff --git a/templates/config.toml.j2 b/templates/config.toml.j2 index 2719ec2..aec8846 100644 --- a/templates/config.toml.j2 +++ b/templates/config.toml.j2 @@ -7,6 +7,10 @@ logging="{{besu_log_level}}" node-private-key-file="{{besu_node_private_key_file}}" {% endif %} +{% if besu_required_blocks|length > 0 %} +required-blocks=[{{besu_required_blocks|map('to_json')|join(',')}}] +{% endif %} + {% if besu_target_gas_limit is defined %} # target gas limit target-gas-limit="{{ besu_target_gas_limit }}"