Skip to contents

Queries the experimental EXPERIMENTAL_protocol_config RPC method to get the full protocol configuration at a given block — including gas costs, fees, runtime limits, staking parameters, and more. Extremely useful for analytics, tooling, or understanding protocol upgrades over time.

Usage

near_get_protocol_config(finality = c("final", "optimistic"), block_id = NULL)

Arguments

finality

Character. Block finality: "final" (default & safest) or "optimistic" (faster).

block_id

Integer or character. Optional specific block height or hash. Use this for historical queries. Cannot be used together with finality.

Value

A tibble with one row containing:

block_height

Height at which config was fetched

block_hash

Hash of the block

config

Full protocol config as a named list (deeply nested)

runtime_config

Runtime-specific settings (storage costs, WASM limits, etc.)

raw_response

Complete RPC response for debugging

Examples

if (FALSE) { # \dontrun{
# Current (latest final) protocol config
cfg <- near_get_protocol_config()
cfg

# Extract storage cost per byte
cfg$runtime_config$storage_amount_per_byte

# Compare gas prices across time
old <- near_get_protocol_config(block_id = 60000000)
new <- near_get_protocol_config(block_id = 120000000)

list(
  old_gas_price = old$config$min_gas_price,
  new_gas_price = new$config$min_gas_price
)

# How much does it cost to store 1 KB today?
cost_yocto <- 1e3 * cfg$runtime_config$storage_config$storage_amount_per_byte
cost_near  <- cost_yocto / 1e24
cat("Cost to store 1 KB:", cost_near, "NEAR")

# View all fee schedules
cfg$config$fees
} # }