Skip to content

Add --check-config option (Version: 3.4.0) #8263

Description

@LionelTrichet

Summary

Add a command-line option to validate an xrpld configuration without starting the server.

For example:

xrpld --conf /etc/xrpld/xrpld.cfg --check-config

The command should exit with 0 if the configuration is valid, and with a non-zero exit code and a useful error message if validation fails.

Motivation

For automated deployments, it would be useful to validate a configuration before restarting a running node.

Right now, a bad setting or a problem with a referenced file may only be discovered during startup. That can turn a configuration change into a failed restart.

A validation-only mode would make it possible to use xrpld itself as a preflight check in CI, Ansible, systemd ExecStartPre, or similar deployment workflows.

Solution

Add a validation-only CLI mode that uses the same configuration parsing and validation logic as normal startup, but exits before starting the server.

Ideally, it should:

  • validate xrpld.cfg and local files referenced by it;
  • return 0 when validation succeeds;
  • return a non-zero exit code with the relevant error when validation fails;
  • avoid opening network ports or connecting to peers;
  • avoid modifying databases or other persistent node state.

For example, it could be used with systemd like this:

ExecStartPre=/usr/bin/xrpld --conf /etc/xrpld/xrpld.cfg --check-config

Paths Not Taken

An external script could validate the config before deployment, but that would duplicate xrpld's configuration logic and could drift from the actual behavior of xrpld.

Another option is to restart xrpld and rely on startup errors, but that makes validation part of the deployment instead of a safe preflight check.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature RequestUsed to indicate requests to add new features

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions