Skip to content

Commit

Permalink
add engine state to systemd setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Kim Fehrs committed Apr 24, 2024
1 parent cd0adc2 commit 67e404b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion node-runner-cli/config/CoreDockerConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, config_dict: dict):
self.trusted_node: str = ""
self.memory_limit: str = "14000m"
self.validator_address: str = ""
self.engine_state_enabled: str = "false"
self.engine_state_enabled: bool = False
self.engine_state_port: str = "3336"
self.engine_state_address: str = "0.0.0.0"
self.java_opts: str = (
Expand Down
2 changes: 1 addition & 1 deletion node-runner-cli/config/CoreSystemDConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self, config_dict: dict):
self.node_dir: str = "/etc/radixdlt/node"
self.node_secrets_dir: str = "/etc/radixdlt/node/secrets"
self.validator_address: str = ""
self.engine_state_enabled: str = "false"
self.engine_state_enabled: bool = False
self.engine_state_port: str = "3336"
self.engine_state_address: str = "0.0.0.0"
self.java_opts: str = (
Expand Down
2 changes: 2 additions & 0 deletions node-runner-cli/setup/SystemDCommandArguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class SystemDConfigArguments:
networkid: str
hostip: str
validator: str
auto_approve: bool

def __init__(self, args):
validate_ip(args.hostip)
Expand All @@ -44,6 +45,7 @@ def __init__(self, args):
self.config_file = f"{args.configdir}/config.yaml"
self.networkid = args.networkid
self.validator = args.validator
self.auto_approve = args.autoapprove


def validate_ip(hostip: str):
Expand Down
2 changes: 1 addition & 1 deletion node-runner-cli/setup/SystemDSetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def ask_core_node(argument_object: SystemDConfigArguments) -> CoreSystemdConfig:
systemd_config.core_node.keydetails = BaseSetup.ask_keydetails(
argument_object.keystore_password, argument_object.new_keystore
)
# systemd_config.core_node.engine_state_enabled = BaseSetup.ask_engine_state_api(True)
systemd_config.core_node.engine_state_enabled = BaseSetup.ask_engine_state_api(argument_object.auto_approve)
return systemd_config.core_node

@staticmethod
Expand Down
11 changes: 10 additions & 1 deletion node-runner-cli/templates/systemd-default.config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,13 @@ genesis.olympia.node_end_state_api_auth_user={{migration.olympia_node_auth_user}
genesis.olympia.node_end_state_api_auth_password={{migration.olympia_node_auth_password}}
genesis.olympia.node_bech32_address={{migration.olympia_node_bech32_address}}
{% endif %}
{% endif %}
{% endif %}


{% if core_node.engine_state_enabled %}
api.engine_state.port={{core_node.engine_state_port}}
api.engine_state.bind_address={{core_node.engine_state_address}}
db.local_transaction_execution_index.enable={{core_node.engine_state_enabled}}
db.re_node_listing_indices.enable={{core_node.engine_state_enabled}}
db.historical_substate_values.enable=60000
{% endif %}
2 changes: 1 addition & 1 deletion node-runner-cli/tests/userflows/install-systemd-simple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ echo "Checking radixdlt service status again"
sudo systemctl status radixdlt-node.service --no-pager | true

echo "Checking nginx service status again"
sudo systemctl status nginx.service --no-pager| true
sudo systemctl status nginx.service --no-pager | true

echo "Starting systemd service"
./babylonnode systemd start
Expand Down
8 changes: 4 additions & 4 deletions node-runner-cli/utils/Prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,17 +249,17 @@ def ask_keyfile_name() -> str:
return keyfile_name

@staticmethod
def ask_engine_state_api(auto_approve: bool) -> str:
def ask_engine_state_api(auto_approve: bool) -> bool:
if auto_approve:
return 'true'
return False
answer = Helpers.input_guestion(
"Do you want to enable the engine state api? (Y/N) (default: false):",
QuestionKeys.enable_engine_state_api
)
if answer == "":
return 'false'
return False
else:
return 'true'
return True

@staticmethod
def ask_trusted_node() -> str:
Expand Down

0 comments on commit 67e404b

Please sign in to comment.