Skip to content

discv4/bootstrap_peers.hpp

Namespaces

Name
discv4

Types

Name
using ChainPeerCacheRefreshResult BootstrapCacheRefreshResult
using ChainPeerConfig BootstrapChainConfig
using ChainPeerCacheSignatureVerificationResult BootstrapSignatureVerificationResult

Functions

Name
std::filesystem::path bootstrap_cache_json_path(const std::string & argv0)
std::optional< std::filesystem::path > find_bootstrap_peers_json_path(const std::string & argv0, const std::string & override_path)
std::optional< std::string > download_bootstrap_json(const std::string & url)
bool write_bootstrap_cache_json_if_changed(const std::filesystem::path & json_path, const std::string & json_text)
std::optional< BootstrapCacheRefreshResult > refresh_bootstrap_cache_json(const std::filesystem::path & json_path, const std::string & url)
std::vector< ValidatedPeer > load_bootstrap_peers_from_json_text(const std::string & chain_name, const std::string & json_text)
std::vector< ValidatedPeer > load_bootstrap_peers_from_json(const std::string & chain_name, const std::filesystem::path & json_path)
std::optional< std::array< uint8_t, 4 > > load_bootstrap_fork_id_hash_from_json_text(const std::string & chain_name, const std::string & json_text)
std::optional< std::array< uint8_t, 4 > > load_bootstrap_fork_id_hash_from_json(const std::string & chain_name, const std::filesystem::path & json_path)
std::optional< BootstrapChainConfig > load_bootstrap_chain_config_from_json_text(const std::string & chain_name, const std::string & json_text)
std::optional< BootstrapChainConfig > load_bootstrap_chain_config_from_json(const std::string & chain_name, const std::filesystem::path & json_path)
BootstrapSignatureVerificationResult verify_bootstrap_json_signature(const std::string & json_text, const std::string & expected_signer_address)

Types Documentation

using BootstrapCacheRefreshResult

using discv4::BootstrapCacheRefreshResult = ChainPeerCacheRefreshResult;

using BootstrapChainConfig

using discv4::BootstrapChainConfig = ChainPeerConfig;

using BootstrapSignatureVerificationResult

using discv4::BootstrapSignatureVerificationResult = ChainPeerCacheSignatureVerificationResult;

Functions Documentation

function bootstrap_cache_json_path

std::filesystem::path bootstrap_cache_json_path(
    const std::string & argv0
)

function find_bootstrap_peers_json_path

std::optional< std::filesystem::path > find_bootstrap_peers_json_path(
    const std::string & argv0,
    const std::string & override_path
)

function download_bootstrap_json

std::optional< std::string > download_bootstrap_json(
    const std::string & url
)

function write_bootstrap_cache_json_if_changed

bool write_bootstrap_cache_json_if_changed(
    const std::filesystem::path & json_path,
    const std::string & json_text
)

function refresh_bootstrap_cache_json

std::optional< BootstrapCacheRefreshResult > refresh_bootstrap_cache_json(
    const std::filesystem::path & json_path,
    const std::string & url
)

function load_bootstrap_peers_from_json_text

std::vector< ValidatedPeer > load_bootstrap_peers_from_json_text(
    const std::string & chain_name,
    const std::string & json_text
)

function load_bootstrap_peers_from_json

std::vector< ValidatedPeer > load_bootstrap_peers_from_json(
    const std::string & chain_name,
    const std::filesystem::path & json_path
)

function load_bootstrap_fork_id_hash_from_json_text

std::optional< std::array< uint8_t, 4 > > load_bootstrap_fork_id_hash_from_json_text(
    const std::string & chain_name,
    const std::string & json_text
)

function load_bootstrap_fork_id_hash_from_json

std::optional< std::array< uint8_t, 4 > > load_bootstrap_fork_id_hash_from_json(
    const std::string & chain_name,
    const std::filesystem::path & json_path
)

function load_bootstrap_chain_config_from_json_text

std::optional< BootstrapChainConfig > load_bootstrap_chain_config_from_json_text(
    const std::string & chain_name,
    const std::string & json_text
)

function load_bootstrap_chain_config_from_json

std::optional< BootstrapChainConfig > load_bootstrap_chain_config_from_json(
    const std::string & chain_name,
    const std::filesystem::path & json_path
)

function verify_bootstrap_json_signature

BootstrapSignatureVerificationResult verify_bootstrap_json_signature(
    const std::string & json_text,
    const std::string & expected_signer_address
)

Source code

// Copyright 2026 Genius Ventures, Inc.
// SPDX-License-Identifier: MIT

#ifndef EVMRELAY_INCLUDE_DISCV4_BOOTSTRAP_PEERS_HPP
#define EVMRELAY_INCLUDE_DISCV4_BOOTSTRAP_PEERS_HPP

#include <discv4/chain_peers.hpp>

namespace discv4
{

using BootstrapCacheRefreshResult = ChainPeerCacheRefreshResult;
using BootstrapChainConfig = ChainPeerConfig;
using BootstrapSignatureVerificationResult = ChainPeerCacheSignatureVerificationResult;

std::filesystem::path bootstrap_cache_json_path(const std::string& argv0);
std::optional<std::filesystem::path> find_bootstrap_peers_json_path(
    const std::string& argv0,
    const std::string& override_path);
std::optional<std::string> download_bootstrap_json(const std::string& url);
bool write_bootstrap_cache_json_if_changed(
    const std::filesystem::path& json_path,
    const std::string&           json_text);
std::optional<BootstrapCacheRefreshResult> refresh_bootstrap_cache_json(
    const std::filesystem::path& json_path,
    const std::string&           url);
std::vector<ValidatedPeer> load_bootstrap_peers_from_json_text(
    const std::string& chain_name,
    const std::string& json_text);
std::vector<ValidatedPeer> load_bootstrap_peers_from_json(
    const std::string&           chain_name,
    const std::filesystem::path& json_path);
std::optional<std::array<uint8_t, 4>> load_bootstrap_fork_id_hash_from_json_text(
    const std::string& chain_name,
    const std::string& json_text);
std::optional<std::array<uint8_t, 4>> load_bootstrap_fork_id_hash_from_json(
    const std::string&           chain_name,
    const std::filesystem::path& json_path);
std::optional<BootstrapChainConfig> load_bootstrap_chain_config_from_json_text(
    const std::string& chain_name,
    const std::string& json_text);
std::optional<BootstrapChainConfig> load_bootstrap_chain_config_from_json(
    const std::string&           chain_name,
    const std::filesystem::path& json_path);
BootstrapSignatureVerificationResult verify_bootstrap_json_signature(
    const std::string& json_text,
    const std::string& expected_signer_address);

} // namespace discv4

#endif // EVMRELAY_INCLUDE_DISCV4_BOOTSTRAP_PEERS_HPP

Updated on 2026-06-05 at 17:22:18 -0700