pd::network::join

Function unpack_state_archive

Source
pub async fn unpack_state_archive(
    archive_url: Url,
    output_dir: PathBuf,
    leave_archive: bool,
) -> Result<()>
Expand description

Download a gzipped tarball from a URL, and extract its contents as the starting state config for the fullnode. Allows bootstrapping from archived state, which is useful for nodes joining after a chain upgrade has been performed.

Supports archive files generated via pd export, which contain only the rocksdb dir, and via pd migrate, which contain the rocksdb dir, new genesis content, and a private validator state file.

The output_dir should be the same argument as passed to pd network --network-dir <dir> join; relative paths for pd and cometbft will be created from this base path.

The leave_archive argument allows you to keep the downloaded archive file after unpacking.