eth::rpc¶
Classes¶
| Name | |
|---|---|
| struct | eth::rpc::RpcLog |
| struct | eth::rpc::AuditFinding |
| struct | eth::rpc::AuditSummary |
| struct | eth::rpc::RpcHttpTransportOptions |
| class | eth::rpc::RpcHttpTransport |
| struct | eth::rpc::RpcEndpointError |
| struct | eth::rpc::RpcEndpoint |
| struct | eth::rpc::RpcEndpointGroup |
| class | eth::rpc::RpcEndpointPool |
| class | eth::rpc::RpcManager |
| struct | eth::rpc::RpcReceiptSourceHandle |
| struct | eth::rpc::RpcEndpointConfig One configured RPC endpoint for a chain. |
| struct | eth::rpc::RpcManagerConfig Top-level RPC manager configuration. |
| struct | eth::rpc::ProbeResult |
| class | eth::rpc::JsonRpcTransport |
| class | eth::rpc::RpcReceiptSource |
Types¶
| Name | |
|---|---|
| enum class | RpcBlockTag |
| enum class | AuditSeverity |
| enum class | RpcEndpointState |
| enum class | RpcEndpointErrorCode |
| enum class | ProbeStatus |
| template <typename T > using outcome::result< T, RpcEndpointError, outcome::policy::all_narrow > |
RpcResult |
| using std::function< std::optional< std::string >(std::string_view)> | RpcEnvLookup |
Functions¶
| Name | |
|---|---|
| json::JsonResult< std::vector< RpcEndpointConfig > > | load_chainlist_from_json_text(std::string_view json_text) Parse chainid.network chains.json into normalized RPC endpoint configs. |
| std::vector< RpcEndpointConfig > | filter_to_configured_chains(std::vector< RpcEndpointConfig > endpoints, const std::vector< uint64_t > & configured_chain_ids) Filter endpoint configs to only those matching configured chain IDs. |
| std::string_view | block_tag_name(RpcBlockTag tag) |
| boost::json::object | make_json_rpc_request(std::string_view method, boost::json::array params, uint64_t id) |
| boost::json::object | make_eth_chain_id_request(uint64_t id) |
| std::optional< uint64_t > | parse_chain_id_response(std::string_view json_text) |
| boost::json::object | make_get_block_by_number_request(RpcBlockTag tag, uint64_t id) |
| boost::json::object | make_get_logs_request(const EventFilter & filter, uint64_t from_block, uint64_t to_block, uint64_t id) |
| boost::json::object | make_get_transaction_receipt_request(const Hash256 & tx_hash, uint64_t id) |
| std::optional< uint64_t > | parse_block_number_response(std::string_view json_text) |
| std::optional< std::vector< RpcLog > > | parse_get_logs_response(std::string_view json_text) |
| std::optional< ReceiptResult > | parse_transaction_receipt_response(std::string_view json_text) |
| AuditSummary | audit_rpc_config(const RpcManagerConfig & config, const FinalityPolicy & finality_policy) |
| const char * | to_string(RpcEndpointErrorCode code) |
| const char * | to_string(RpcEndpointState state) |
| RpcResult< std::string > | render_rpc_endpoint_url(const RpcEndpointConfig & config, RpcEnvLookup env_lookup ={}) Resolve a URL template into a concrete endpoint URL. |
| RpcResult< RpcEndpoint > | build_rpc_endpoint(const RpcEndpointConfig & config, RpcEnvLookup env_lookup) Materialize a runtime endpoint from configuration. |
| std::vector< RpcEndpointGroup > | group_rpc_endpoints(const RpcManagerConfig & config, RpcEnvLookup env_lookup) Group endpoints by chain name and chain id with deterministic ordering. |
| std::optional< RpcReceiptSourceHandle > | make_receipt_source(RpcManager & manager, std::string chain_name, uint64_t chain_id, FinalityPolicy finality_policy) |
| 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. |
| const char * | to_string(ProbeStatus status) |
| ProbeResult | probe_endpoint_chain_id(std::string_view url, uint64_t expected_chain_id, std::chrono::seconds timeout) |
| std::vector< ProbeResult > | probe_endpoint_pool(RpcEndpointPool & pool, uint64_t expected_chain_id, std::chrono::seconds timeout) |
| std::string | to_string(AuditSeverity severity) |
Types Documentation¶
enum RpcBlockTag¶
| Enumerator | Value | Description |
|---|---|---|
| kLatest | ||
| kSafe | ||
| kFinalized |
enum AuditSeverity¶
| Enumerator | Value | Description |
|---|---|---|
| kInfo | ||
| kWarning | ||
| kError |
enum RpcEndpointState¶
| Enumerator | Value | Description |
|---|---|---|
| kAvailable | ||
| kTemporarilyFailed | ||
| kDisabled |
enum RpcEndpointErrorCode¶
| Enumerator | Value | Description |
|---|---|---|
| kMissingApiKey | ||
| kInvalidTemplate |
enum ProbeStatus¶
| Enumerator | Value | Description |
|---|---|---|
| kSuccess | ||
| kChainIdMismatch | ||
| kTransportError | ||
| kParseError |
using RpcResult¶
template <typename T >
using eth::rpc::RpcResult = outcome::result<T, RpcEndpointError, outcome::policy::all_narrow>;
using RpcEnvLookup¶
Functions Documentation¶
function load_chainlist_from_json_text¶
json::JsonResult< std::vector< RpcEndpointConfig > > load_chainlist_from_json_text(
std::string_view json_text
)
Parse chainid.network chains.json into normalized RPC endpoint configs.
Parameters:
- json_text Raw chains.json array text.
Return: Vector of RpcEndpointConfig, or JSON parse error.
Filters deprecated chains, wss:// URLs, and API-key placeholder URLs. Deduplicates by chainId + URL.
function filter_to_configured_chains¶
std::vector< RpcEndpointConfig > filter_to_configured_chains(
std::vector< RpcEndpointConfig > endpoints,
const std::vector< uint64_t > & configured_chain_ids
)
Filter endpoint configs to only those matching configured chain IDs.
Parameters:
- endpoints Endpoints to filter (consumed by move).
- configured_chain_ids Set of chain IDs that are configured/provisioned.
Return: Filtered endpoints (only configured chains remain).
function block_tag_name¶
function make_json_rpc_request¶
boost::json::object make_json_rpc_request(
std::string_view method,
boost::json::array params,
uint64_t id
)
function make_eth_chain_id_request¶
function parse_chain_id_response¶
function make_get_block_by_number_request¶
function make_get_logs_request¶
boost::json::object make_get_logs_request(
const EventFilter & filter,
uint64_t from_block,
uint64_t to_block,
uint64_t id
)
function make_get_transaction_receipt_request¶
function parse_block_number_response¶
function parse_get_logs_response¶
function parse_transaction_receipt_response¶
function audit_rpc_config¶
AuditSummary audit_rpc_config(
const RpcManagerConfig & config,
const FinalityPolicy & finality_policy
)
function to_string¶
function to_string¶
function render_rpc_endpoint_url¶
RpcResult< std::string > render_rpc_endpoint_url(
const RpcEndpointConfig & config,
RpcEnvLookup env_lookup ={}
)
Resolve a URL template into a concrete endpoint URL.
The only supported placeholder is {key}.
function build_rpc_endpoint¶
RpcResult< RpcEndpoint > build_rpc_endpoint(
const RpcEndpointConfig & config,
RpcEnvLookup env_lookup
)
Materialize a runtime endpoint from configuration.
function group_rpc_endpoints¶
std::vector< RpcEndpointGroup > group_rpc_endpoints(
const RpcManagerConfig & config,
RpcEnvLookup env_lookup
)
Group endpoints by chain name and chain id with deterministic ordering.
function make_receipt_source¶
std::optional< RpcReceiptSourceHandle > make_receipt_source(
RpcManager & manager,
std::string chain_name,
uint64_t chain_id,
FinalityPolicy finality_policy
)
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.
function to_string¶
function probe_endpoint_chain_id¶
ProbeResult probe_endpoint_chain_id(
std::string_view url,
uint64_t expected_chain_id,
std::chrono::seconds timeout
)
function probe_endpoint_pool¶
std::vector< ProbeResult > probe_endpoint_pool(
RpcEndpointPool & pool,
uint64_t expected_chain_id,
std::chrono::seconds timeout
)
function to_string¶
Updated on 2026-06-05 at 17:22:18 -0700