openapi: 3.1.0
info:
  title: 'NEAR Protocol RPC: Get client config'
  description: Queries client node configuration
  version: 1.0.0
servers:
  - url: https://rpc.mainnet.fastnear.com
    description: Mainnet
  - url: https://rpc.testnet.fastnear.com
    description: Testnet
paths:
  /:
    post:
      operationId: client_config
      summary: Get client config
      description: Queries client node configuration
      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'
components:
  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_fetch_horizon:
              type: integer
              description: Horizon at which instead of fetching block, fetch full state.
              format: uint64
              minimum: 0
            block_header_fetch_horizon:
              type: integer
              description: Behind this horizon header fetch kicks in.
              format: uint64
              minimum: 0
            block_production_tracking_delay:
              type: array
              items:
                type: integer
                format: uint64
                minimum: 0
              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.

                This allows nodes to push and pull chunks from a central stream.

                The two benefits of this approach are: (1) less request/response
                traffic

                on 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.
              required:
                - enabled
                - uris
            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: array
              items:
                type: integer
                format: int32
              description: Multiplier for the wait time for all chunks to be received.
            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

                writes chunk-related data based on the tracked shards. This
                config also controls additional archival

                behavior 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.
            doomslug_step_period:
              type: array
              items:
                type: integer
                format: uint64
                minimum: 0
              description: Time between running doomslug timer.
            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.

                This means calculating tentative boundary accounts for splitting
                the tracked shards.
            enable_early_prepare_transactions:
              type: boolean
              description: >-
                If true, transactions for the next chunk will be prepared early,
                right after the previous chunk's

                post-state is ready. This can help produce chunks faster, for
                high-throughput chains.

                The current implementation increases latency on low-load chains,
                which will be fixed in the future.

                The 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:
                disable_epoch_sync_for_bootstrapping:
                  type: boolean
                  description: >-
                    If true, even if the node started from genesis, it will not
                    perform epoch sync.

                    There should be no reason to set this flag in production,
                    because on both mainnet

                    and testnet it would be infeasible to catch up from genesis
                    without epoch sync.
                  default: false
                epoch_sync_horizon:
                  type: integer
                  description: >-
                    This serves as two purposes: (1) the node will not epoch
                    sync and instead resort to

                    header sync, if the genesis block is within this many blocks
                    from the current block;

                    (2) the node will reject an epoch sync proof if the provided
                    proof is for an epoch

                    that is more than this many blocks behind the current block.
                  format: uint64
                  minimum: 0
                ignore_epoch_sync_network_requests:
                  type: boolean
                  description: >-
                    If true, the node will ignore epoch sync requests from the
                    network. It is strongly

                    recommended not to set this flag, because it will prevent
                    other nodes from

                    bootstrapping. This flag is only included as a kill-switch
                    and may be removed in a

                    future release. Please note that epoch sync requests are
                    heavily rate limited and

                    cached, and therefore should not affect the performance of
                    the node or introduce

                    any non-negligible increase in network traffic.
                  default: false
                timeout_for_epoch_sync:
                  type: object
                  description: >-
                    Timeout for epoch sync requests. The node will continue
                    retrying indefinitely even

                    if this timeout is exceeded.
              required:
                - epoch_sync_horizon
                - timeout_for_epoch_sync
              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

                    call.
                  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

                    when 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: array
              items:
                type: integer
                format: uint64
                minimum: 0
              description: Maximum wait for approvals before producing block.
            max_block_wait_delay:
              type: array
              items:
                type: integer
                format: uint64
                minimum: 0
              description: Maximum duration before skipping given height.
            max_gas_burnt_view:
              type:
                - string
                - 'null'
              description: Gas amount
            min_block_production_delay:
              type: array
              items:
                type: integer
                format: uint64
                minimum: 0
              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.
                We keep only orphan witnesses which are smaller than this size.
                This 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

                because the previous block isn't available. The witnesses wait
                in the pool until the

                required 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.

                A node produces a chunk by adding transactions from the
                transaction pool until

                some limit is reached. This time limit ensures that adding
                transactions won't take

                longer 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.
            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.

                Saving invalid witnesses is useful for analysis and debugging.

                This 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.

                Saving the latest witnesses is useful for analysis and
                debugging.

                This option can cause extra load on the database and is not
                recommended for production use.
            save_trie_changes:
              type: boolean
              description: >-
                save_trie_changes should be set to true iff

                - archive if false - non-archival nodes need trie changes to
                perform garbage collection

                - archive is true, cold_store is configured and migration to
                split_storage is finished - node

                working 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.
                Throttling 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_enabled:
              type: boolean
              description: |-
                Whether to use the State Sync mechanism.
                If disabled, the node will do Block Sync instead of State Sync.
            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

                will be unbounded.
              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

                to 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
          required:
            - version
            - chain_id
            - expected_shutdown
            - block_production_tracking_delay
            - min_block_production_delay
            - max_block_production_delay
            - max_block_wait_delay
            - chunk_wait_mult
            - skip_sync_wait
            - sync_check_period
            - sync_step_period
            - sync_height_threshold
            - sync_max_block_requests
            - header_sync_initial_timeout
            - header_sync_progress_timeout
            - header_sync_stall_ban_timeout
            - header_sync_expected_height_per_second
            - state_sync_external_timeout
            - state_sync_p2p_timeout
            - state_sync_retry_backoff
            - state_sync_external_backoff
            - min_num_peers
            - log_summary_period
            - log_summary_style
            - produce_empty_blocks
            - epoch_length
            - num_block_producer_seats
            - ttl_account_id_router
            - block_fetch_horizon
            - catchup_step_period
            - chunk_request_retry_period
            - doomslug_step_period
            - block_header_fetch_horizon
            - gc
            - tracked_shards_config
            - archive
            - save_trie_changes
            - save_tx_outcomes
            - save_untracked_partial_chunks_parts
            - view_client_threads
            - chunk_validation_threads
            - state_request_throttle_period
            - state_requests_per_throttle_period
            - state_request_server_threads
            - enable_statistics_export
            - client_background_migration_threads
            - state_sync_enabled
            - state_sync
            - epoch_sync
            - enable_multiline_logging
            - resharding_config
            - tx_routing_height_horizon
            - produce_chunk_add_transactions_time_limit
            - orphan_state_witness_pool_size
            - orphan_state_witness_max_size
            - save_latest_witnesses
            - save_invalid_witnesses
            - transaction_request_handler_threads
            - protocol_version_check
            - enable_early_prepare_transactions
            - dynamic_resharding_dry_run
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
            data:
              type: object
