eth/rpc_manager_config.hpp¶
Namespaces¶
| Name |
|---|
| eth |
| eth::rpc |
Classes¶
| Name | |
|---|---|
| struct | eth::rpc::RpcEndpointConfig One configured RPC endpoint for a chain. |
| struct | eth::rpc::RpcManagerConfig Top-level RPC manager configuration. |
Functions¶
| Name | |
|---|---|
| json::JsonResult< RpcManagerConfig > | load_rpc_manager_config_result_from_json_text(const std::string & json_text) Load RPC manager configuration from JSON text. |
| json::JsonResult< RpcManagerConfig > | load_rpc_manager_config_result_from_json(const std::filesystem::path & json_path) Load RPC manager configuration from a JSON file. |
| std::optional< RpcManagerConfig > | load_rpc_manager_config_from_json_text(const std::string & json_text) Load RPC manager configuration from JSON text. |
| std::optional< RpcManagerConfig > | load_rpc_manager_config_from_json(const std::filesystem::path & json_path) Load RPC manager configuration from a JSON file. |
Functions Documentation¶
function load_rpc_manager_config_result_from_json_text¶
json::JsonResult< RpcManagerConfig > load_rpc_manager_config_result_from_json_text(
const std::string & json_text
)
Load RPC manager configuration from JSON text.
Parameters:
- json_text JSON document contents.
Return: Parsed configuration, or JSON field error.
function load_rpc_manager_config_result_from_json¶
json::JsonResult< RpcManagerConfig > load_rpc_manager_config_result_from_json(
const std::filesystem::path & json_path
)
Load RPC manager configuration from a JSON file.
Parameters:
- json_path JSON file path.
Return: Parsed configuration, or JSON field error.
function load_rpc_manager_config_from_json_text¶
std::optional< RpcManagerConfig > load_rpc_manager_config_from_json_text(
const std::string & json_text
)
Load RPC manager configuration from JSON text.
Parameters:
- json_text JSON document contents.
Return: Parsed configuration, or std::nullopt when missing or invalid.
function load_rpc_manager_config_from_json¶
std::optional< RpcManagerConfig > load_rpc_manager_config_from_json(
const std::filesystem::path & json_path
)
Load RPC manager configuration from a JSON file.
Parameters:
- json_path JSON file path.
Return: Parsed configuration, or std::nullopt when missing or invalid.
Source code¶
// Copyright 2026 Genius Ventures, Inc.
// SPDX-License-Identifier: MIT
#ifndef EVMRELAY_INCLUDE_ETH_RPC_MANAGER_CONFIG_HPP
#define EVMRELAY_INCLUDE_ETH_RPC_MANAGER_CONFIG_HPP
#include <base/json_utility.hpp>
#include <filesystem>
#include <optional>
#include <string>
#include <vector>
namespace eth::rpc {
struct RpcEndpointConfig
{
std::string chain_name;
uint64_t chain_id = 0;
std::string url_template;
std::optional<std::string> api_key_env_var;
std::optional<std::string> api_key_literal;
uint32_t priority = 0;
uint32_t weight = 0;
uint32_t rate_limit_per_second = 0;
bool is_paid = false;
bool is_public = true;
bool verified = false;
};
struct RpcManagerConfig
{
size_t max_endpoints_per_chain = 0;
std::vector<RpcEndpointConfig> endpoints;
};
[[nodiscard]] rlp::base::json::JsonResult<RpcManagerConfig> load_rpc_manager_config_result_from_json_text(
const std::string& json_text);
[[nodiscard]] rlp::base::json::JsonResult<RpcManagerConfig> load_rpc_manager_config_result_from_json(
const std::filesystem::path& json_path);
[[nodiscard]] std::optional<RpcManagerConfig> load_rpc_manager_config_from_json_text(
const std::string& json_text);
[[nodiscard]] std::optional<RpcManagerConfig> load_rpc_manager_config_from_json(
const std::filesystem::path& json_path);
} // namespace eth::rpc
#endif // EVMRELAY_INCLUDE_ETH_RPC_MANAGER_CONFIG_HPP
Updated on 2026-06-05 at 17:22:19 -0700