{
  "openapi": "3.1.0",
  "info": {
    "title": "NEAR Protocol RPC: Get client config",
    "description": "Fetch the node's own local client config — timeouts, retry settings, and operator-chosen parameters.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://rpc.mainnet.fastnear.com",
      "description": "Mainnet"
    },
    {
      "url": "https://rpc.testnet.fastnear.com",
      "description": "Testnet"
    },
    {
      "url": "https://archival-rpc.mainnet.fastnear.com",
      "description": "Mainnet Archival"
    },
    {
      "url": "https://archival-rpc.testnet.fastnear.com",
      "description": "Testnet Archival"
    }
  ],
  "paths": {
    "/": {
      "post": {
        "operationId": "client_config",
        "summary": "Get client config",
        "description": "Fetch the node's own local client config — timeouts, retry settings, and operator-chosen parameters.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "id",
                  "method",
                  "params"
                ],
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "enum": [
                      "2.0"
                    ]
                  },
                  "id": {
                    "type": "string",
                    "example": "fastnear"
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "client_config"
                    ]
                  },
                  "params": {
                    "type": "array",
                    "maxItems": 0,
                    "description": "Empty array as this method takes no parameters",
                    "example": []
                  }
                }
              },
              "examples": {
                "mainnet": {
                  "summary": "Get client config (Mainnet)",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": "fastnear",
                    "method": "client_config",
                    "params": []
                  }
                },
                "testnet": {
                  "summary": "Get client config (Testnet)",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": "fastnear",
                    "method": "client_config",
                    "params": []
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonRpcResponse"
                }
              }
            }
          },
          "403": {
            "description": "The supplied API key was not recognized.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "Invalid API key"
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {},
    {
      "BearerAuth": []
    },
    {
      "ApiKeyAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "FastNEAR API key as an `Authorization: Bearer` header. Preferred for backends, workers, and proxies because it keeps the key out of URLs and logs."
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "query",
        "name": "apiKey",
        "description": "FastNEAR API key as the `apiKey` query parameter. Handy for curl or clients that cannot set headers, but the key can end up in URLs, logs, and shell history."
      }
    },
    "schemas": {
      "JsonRpcResponse": {
        "type": "object",
        "required": [
          "jsonrpc",
          "id"
        ],
        "properties": {
          "jsonrpc": {
            "type": "string",
            "enum": [
              "2.0"
            ]
          },
          "id": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          },
          "result": {
            "type": "object",
            "description": "ClientConfig where some fields can be updated at runtime.",
            "properties": {
              "archive": {
                "type": "boolean",
                "description": "Not clear old data, set `true` for archive nodes."
              },
              "block_header_fetch_horizon": {
                "type": "integer",
                "description": "Behind this horizon header fetch kicks in.",
                "format": "uint64",
                "minimum": 0
              },
              "block_production_tracking_delay": {
                "type": "string",
                "description": "Duration to check for producing / skipping block."
              },
              "catchup_step_period": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0
                },
                "description": "Time between check to perform catchup."
              },
              "chain_id": {
                "type": "string",
                "description": "Chain id for status."
              },
              "chunk_distribution_network": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "Config for the Chunk Distribution Network feature.\nThis allows nodes to push and pull chunks from a central stream.\nThe two benefits of this approach are: (1) less request/response traffic\non the peer-to-peer network and (2) lower latency for RPC nodes indexing the chain.",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "uris": {
                    "type": "object",
                    "description": "URIs for the Chunk Distribution Network feature."
                  }
                }
              },
              "chunk_request_retry_period": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0
                },
                "description": "Time between checking to re-request chunks."
              },
              "chunk_validation_threads": {
                "type": "integer",
                "description": "Number of threads for ChunkValidationActor pool.",
                "format": "uint",
                "minimum": 0
              },
              "chunk_wait_mult": {
                "type": "string",
                "description": "Multiplier for the wait time for all chunks to be received."
              },
              "chunks_cache_height_horizon": {
                "type": "integer",
                "description": "Height horizon for the chunk cache. A chunk is removed from the cache\nif its height + chunks_cache_height_horizon < largest_seen_height.\nThe default value is given by default_chunks_cache_height_horizon().",
                "format": "uint64",
                "minimum": 0
              },
              "client_background_migration_threads": {
                "type": "integer",
                "description": "Number of threads to execute background migration work in client.",
                "format": "uint",
                "minimum": 0
              },
              "cloud_archival_writer": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "Configuration for a cloud-based archival writer. If this config is present, the writer is enabled and\nwrites chunk-related data based on the tracked shards. This config also controls additional archival\nbehavior such as block data and polling interval.",
                "properties": {
                  "archive_block_data": {
                    "type": "boolean",
                    "description": "Determines whether block-related data should be written to cloud storage.",
                    "default": false
                  },
                  "polling_interval": {
                    "type": "object",
                    "default": {
                      "nanos": 0,
                      "secs": 1
                    },
                    "description": "Interval at which the system checks for new blocks or chunks to archive."
                  },
                  "snapshot_every_n_epochs": {
                    "type": "integer",
                    "description": "Cadence of state snapshots, in epochs. Higher values reduce bucket cost at\nthe expense of potentially longer delta replay during reader bootstrap.",
                    "format": "uint64",
                    "default": 10,
                    "minimum": 0
                  }
                }
              },
              "disable_tx_routing": {
                "type": "boolean",
                "description": "If true, the node won't forward transactions to next the chunk producers."
              },
              "doomslug_step_period": {
                "type": "string",
                "description": "Time between running doomslug timer."
              },
              "enable_early_prepare_transactions": {
                "type": "boolean",
                "description": "If true, transactions for the next chunk will be prepared early, right after the previous chunk's\npost-state is ready. This can help produce chunks faster, for high-throughput chains.\nThe current implementation increases latency on low-load chains, which will be fixed in the future.\nThe default is disabled."
              },
              "enable_multiline_logging": {
                "type": "boolean"
              },
              "enable_statistics_export": {
                "type": "boolean",
                "description": "Re-export storage layer statistics as prometheus metrics."
              },
              "epoch_length": {
                "type": "integer",
                "description": "Epoch length.",
                "format": "uint64",
                "minimum": 0
              },
              "epoch_sync": {
                "type": "object",
                "properties": {
                  "epoch_sync_horizon_num_epochs": {
                    "type": "integer",
                    "description": "Number of epochs behind the network head beyond which the node will use\nepoch sync instead of header sync. At the consumption site, this is\nmultiplied by epoch_length to get the horizon in blocks.",
                    "format": "uint64",
                    "default": 2,
                    "minimum": 0
                  },
                  "timeout_for_epoch_sync": {
                    "type": "object",
                    "description": "Timeout for epoch sync requests. The node will continue retrying indefinitely even\nif this timeout is exceeded."
                  }
                },
                "description": "Options for epoch sync."
              },
              "expected_shutdown": {
                "type": "string",
                "description": "Graceful shutdown at expected block height."
              },
              "gc": {
                "type": "object",
                "description": "Configuration for garbage collection.",
                "properties": {
                  "gc_blocks_limit": {
                    "type": "integer",
                    "description": "Maximum number of blocks to garbage collect at every garbage collection\ncall.",
                    "format": "uint64",
                    "default": 2,
                    "minimum": 0
                  },
                  "gc_fork_clean_step": {
                    "type": "integer",
                    "description": "Maximum number of height to go through at each garbage collection step\nwhen cleaning forks during garbage collection.",
                    "format": "uint64",
                    "default": 100,
                    "minimum": 0
                  },
                  "gc_num_epochs_to_keep": {
                    "type": "integer",
                    "description": "Number of epochs for which we keep store data.",
                    "format": "uint64",
                    "default": 5,
                    "minimum": 0
                  },
                  "gc_step_period": {
                    "type": "object",
                    "default": {
                      "nanos": 500000000,
                      "secs": 0
                    },
                    "description": "How often gc should be run"
                  }
                }
              },
              "header_sync_expected_height_per_second": {
                "type": "integer",
                "description": "Expected increase of header head height per second during header sync",
                "format": "uint64",
                "minimum": 0
              },
              "header_sync_initial_timeout": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0
                },
                "description": "How much time to wait after initial header sync"
              },
              "header_sync_progress_timeout": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0
                },
                "description": "How much time to wait after some progress is made in header sync"
              },
              "header_sync_stall_ban_timeout": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0
                },
                "description": "How much time to wait before banning a peer in header sync if sync is too slow"
              },
              "log_summary_period": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0
                },
                "description": "Period between logging summary information."
              },
              "log_summary_style": {
                "type": "string",
                "enum": [
                  "plain",
                  "colored"
                ],
                "description": "Enable coloring of the logs"
              },
              "max_block_production_delay": {
                "type": "string",
                "description": "Maximum wait for approvals before producing block."
              },
              "max_block_wait_delay": {
                "type": "string",
                "description": "Maximum duration before skipping given height."
              },
              "max_gas_burnt_view": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Gas amount"
              },
              "min_block_production_delay": {
                "type": "string",
                "description": "Minimum duration before producing block."
              },
              "min_num_peers": {
                "type": "integer",
                "description": "Minimum number of peers to start syncing.",
                "format": "uint",
                "minimum": 0
              },
              "num_block_producer_seats": {
                "type": "integer",
                "description": "Number of block producer seats",
                "format": "uint64",
                "minimum": 0
              },
              "orphan_state_witness_max_size": {
                "type": "integer",
                "description": "Maximum size of state witnesses in the OrphanStateWitnessPool.\nWe keep only orphan witnesses which are smaller than this size.\nThis limits the maximum memory usage of OrphanStateWitnessPool.",
                "format": "uint64",
                "minimum": 0
              },
              "orphan_state_witness_pool_size": {
                "type": "integer",
                "description": "OrphanStateWitnessPool keeps instances of ChunkStateWitness which can't be processed\nbecause the previous block isn't available. The witnesses wait in the pool until the\nrequired block appears. This variable controls how many witnesses can be stored in the pool.",
                "format": "uint",
                "minimum": 0
              },
              "produce_chunk_add_transactions_time_limit": {
                "type": "string",
                "description": "Limit the time of adding transactions to a chunk.\nA node produces a chunk by adding transactions from the transaction pool until\nsome limit is reached. This time limit ensures that adding transactions won't take\nlonger than the specified duration, which helps to produce the chunk quickly."
              },
              "produce_empty_blocks": {
                "type": "boolean",
                "description": "Produce empty blocks, use `false` for testing."
              },
              "protocol_version_check": {
                "type": "string",
                "enum": [
                  "Next",
                  "NextNext"
                ],
                "description": "Configures whether the node checks the next or the next next epoch for network version compatibility."
              },
              "receipt_to_tx_max_hint_window": {
                "type": "integer",
                "description": "Max `±window` accepted on `EXPERIMENTAL_receipt_to_tx` requests.\nCaps caller's `window`. Applies to pre-first-scan `CenterOut`\nagainst caller's literal hint; ancestor scans use\n`receipt_to_tx_max_hop_distance` instead. Operators raising this\nshould also raise `receipt_to_tx_max_hop_distance` so backward reach\nmatches caller's wider hint scope. Requests with `window` over this\nrejected with `WindowTooLarge`.",
                "format": "uint64",
                "minimum": 0
              },
              "receipt_to_tx_max_hop_distance": {
                "type": "integer",
                "description": "Max block-distance ancestor scan walks per hop once any scan in\nwalk refreshed `current_height`. Subsequent column-miss scans visit\n`h, h-1, ..., h-max_hop_distance` from most-recent scan-refreshed\nanchor, regardless of column hits between. Anchor included —\nsame-shard local receipts execute in same block as producing\noutcome. Raise if cold archival traffic shows ancestor misses —\ngap = scan-refreshed anchor to producer-outcome height of receipt\nwith missing column row (column hits don't reset anchor). Default\n20 (matches `receipt_to_tx_max_hint_window`).",
                "format": "uint64",
                "minimum": 0
              },
              "receipt_to_tx_max_outcomes_per_request": {
                "type": "integer",
                "description": "Per-request ceiling on outcome rows the `EXPERIMENTAL_receipt_to_tx`\nhint-fallback scanner reads across hops + shards. Caps cold-RocksDB\nworst case on unauthenticated public endpoint. Default 20_000.\nOperators serving cold archival traffic with deep walks or sparse\noutcomes may raise; benchmark first (see TODO in\n`view_client_actor.rs`). Mid-scan exhaustion fails with\n`BudgetExceeded { scanned, limit }`.",
                "format": "uint64",
                "minimum": 0
              },
              "resharding_config": {
                "type": "string"
              },
              "rpc_addr": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Listening rpc port for status."
              },
              "save_invalid_witnesses": {
                "type": "boolean",
                "description": "Save observed instances of invalid ChunkStateWitness to the database in DBCol::InvalidChunkStateWitnesses.\nSaving invalid witnesses is useful for analysis and debugging.\nThis option can cause extra load on the database and is not recommended for production use."
              },
              "save_latest_witnesses": {
                "type": "boolean",
                "description": "Save observed instances of ChunkStateWitness to the database in DBCol::LatestChunkStateWitnesses.\nSaving the latest witnesses is useful for analysis and debugging.\nThis option can cause extra load on the database and is not recommended for production use."
              },
              "save_receipt_to_tx": {
                "type": "boolean",
                "description": "Whether to persist receipt-to-tx origin mappings to disk or not."
              },
              "save_state_changes": {
                "type": "boolean",
                "description": "Whether to persist state changes on disk or not."
              },
              "save_trie_changes": {
                "type": "boolean",
                "description": "save_trie_changes should be set to true iff\n- archive if false - non-archival nodes need trie changes to perform garbage collection\n- archive is true, cold_store is configured and migration to split_storage is finished - node\nworking in split storage mode needs trie changes in order to do garbage collection on hot."
              },
              "save_tx_outcomes": {
                "type": "boolean",
                "description": "Whether to persist transaction outcomes to disk or not."
              },
              "save_untracked_partial_chunks_parts": {
                "type": "boolean",
                "description": "Whether to persist partial chunk parts for untracked shards or not."
              },
              "skip_sync_wait": {
                "type": "boolean",
                "description": "Skip waiting for sync (for testing or single node testnet)."
              },
              "state_request_server_threads": {
                "type": "integer",
                "description": "Number of threads for StateRequestActor pool.",
                "format": "uint",
                "minimum": 0
              },
              "state_request_throttle_period": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0
                },
                "description": "Number of seconds between state requests for view client.\nThrottling window for state requests (headers and parts)."
              },
              "state_requests_per_throttle_period": {
                "type": "integer",
                "description": "Maximum number of state requests served per throttle period",
                "format": "uint",
                "minimum": 0
              },
              "state_sync": {
                "type": "object",
                "properties": {
                  "concurrency": {
                    "type": "object"
                  },
                  "dump": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "description": "Configures how to dump state to external storage."
                  },
                  "parts_compression_lvl": {
                    "type": "integer",
                    "description": "Zstd compression level for state parts.",
                    "format": "int32",
                    "default": 1
                  },
                  "sync": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "Peers"
                    ],
                    "description": "Syncs state from the peers without reading anything from external storage."
                  }
                },
                "description": "Options for syncing state."
              },
              "state_sync_external_backoff": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0
                },
                "description": "Additional waiting period after a failed request to external storage"
              },
              "state_sync_external_timeout": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0
                },
                "description": "How long to wait for a response from centralized state sync"
              },
              "state_sync_p2p_timeout": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0
                },
                "description": "How long to wait for a response from p2p state sync"
              },
              "state_sync_retry_backoff": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0
                },
                "description": "How long to wait after a failed state sync request"
              },
              "sync_check_period": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0
                },
                "description": "How often to check that we are not out of sync."
              },
              "sync_height_threshold": {
                "type": "integer",
                "description": "Sync height threshold: below this difference in height don't start syncing.",
                "format": "uint64",
                "minimum": 0
              },
              "sync_max_block_requests": {
                "type": "integer",
                "description": "Maximum number of block requests to send to peers to sync",
                "format": "uint",
                "minimum": 0
              },
              "sync_step_period": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0
                },
                "description": "While syncing, how long to check for each step."
              },
              "tracked_shards_config": {
                "type": "object",
                "description": "One of multiple possible types"
              },
              "transaction_pool_size_limit": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Limit of the size of per-shard transaction pool measured in bytes. If not set, the size\nwill be unbounded.",
                "format": "uint64",
                "minimum": 0
              },
              "transaction_pool_strict_nonce_ttl_blocks": {
                "type": "integer",
                "description": "TTL in blocks for gapped strict-nonce transactions in the pool. Transactions with a\nnonce gap whose block_hash is older than this many blocks are evicted during\nprepare_transactions.",
                "format": "uint64",
                "minimum": 0
              },
              "transaction_request_handler_threads": {
                "type": "integer",
                "format": "uint",
                "minimum": 0
              },
              "trie_viewer_state_size_limit": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Upper bound of the byte size of contract state that is still viewable. None is no limit",
                "format": "uint64",
                "minimum": 0
              },
              "ttl_account_id_router": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "uint64",
                  "minimum": 0
                },
                "description": "Time to persist Accounts Id in the router without removing them."
              },
              "tx_routing_height_horizon": {
                "type": "integer",
                "description": "If the node is not a chunk producer within that many blocks, then route\nto upcoming chunk producers.",
                "format": "uint64",
                "minimum": 0
              },
              "version": {
                "type": "object",
                "description": "Data structure for semver version and github tag or commit.",
                "properties": {
                  "build": {
                    "type": "string"
                  },
                  "commit": {
                    "type": "string"
                  },
                  "rustc_version": {
                    "type": "string",
                    "default": ""
                  },
                  "version": {
                    "type": "string"
                  }
                },
                "required": [
                  "version",
                  "build",
                  "commit"
                ]
              },
              "view_client_threads": {
                "type": "integer",
                "description": "Number of threads for ViewClientActor pool.",
                "format": "uint",
                "minimum": 0
              },
              "block_fetch_horizon": {
                "type": "integer",
                "description": "Horizon at which instead of fetching block, fetch full state.",
                "format": "uint64",
                "minimum": 0
              },
              "state_sync_enabled": {
                "type": "boolean",
                "description": "Whether to use the State Sync mechanism.\nIf disabled, the node will do Block Sync instead of State Sync."
              },
              "dynamic_resharding_dry_run": {
                "type": "boolean",
                "description": "If true, the runtime will do a dynamic resharding 'dry run' at the last block of each epoch.\nThis means calculating tentative boundary accounts for splitting the tracked shards."
              }
            }
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "integer"
              },
              "message": {
                "type": "string"
              },
              "data": {
                "type": "object"
              }
            }
          }
        }
      }
    }
  }
}
