zebra_state::config

Function database_format_version_on_disk

source
pub fn database_format_version_on_disk(
    config: &Config,
    db_kind: impl AsRef<str>,
    major_version: u64,
    network: &Network,
) -> Result<Option<Version>, BoxError>
Expand description

Returns the full semantic version of the on-disk database, based on its config, kind, major version, and network.

Typically, the version is read from a version text file.

If there is an existing on-disk database, but no version file, returns Ok(Some(major_version.0.0)). (This happens even if the database directory was just newly created.)

If there is no existing on-disk database, returns Ok(None).

This is the format of the data on disk, the minor and patch versions implemented by the running Zebra code can be different.