Skip to main content

Crate near_chain_configs

Crate near_chain_configs 

Source

Modules§

genesis_validate

Structs§

ChunkDistributionNetworkConfig
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.
ChunkDistributionUris
URIs for the Chunk Distribution Network feature.
ClientConfig
ClientConfig where some fields can be updated at runtime.
CloudArchivalWriterConfig
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.
DumpConfig
Configures how to dump state to external storage.
EpochSyncConfig
ExternalStorageConfig
GCConfig
Configuration for garbage collection.
Genesis
Genesis has an invariant that total_supply is equal to the supply seen in the records. However, we can’t enforce that invariant. All fields are public, but the clients are expected to use the provided methods for instantiation, serialization and deserialization. Refer to test_loading_localnet_genesis to see an example of serialized Genesis JSON.
GenesisChangeConfig
Config for changes applied to state dump.
GenesisConfig
GenesisRecords
Records in storage at genesis (get split into shards at genesis creation).
InterruptHandle
A handle that allows the main process to interrupt other.
MutableConfigValue
A wrapper for a config value that can be updated while the node is running. When initializing sub-objects (e.g. ShardsManager), please make sure to pass this wrapper instead of passing a value from a single moment in time. See expected_shutdown for an example how to use it.
ProtocolConfig
ProtocolConfigView
ReshardingConfig
Configuration for resharding.
ReshardingHandle
StateSyncConfig
SyncConcurrency
UpdatableClientConfig
A subset of Config that can be updated while the node is running.

Enums§

ExternalStorageLocation
Supported external storage backends and their minimal config.
GenesisContents
GenesisValidationMode
LogSummaryStyle
ProtocolVersionCheckConfig
Configures whether the node checks the next or the next next epoch for network version compatibility.
SyncConfig
Configures how to fetch state parts during state sync.
TrackedShardsConfig
Describes the expected behavior of the node regarding shard tracking. If the node is an active validator, it will also track the shards it is responsible for as a validator.

Constants§

BLOCK_PRODUCER_KICKOUT_THRESHOLD
Criterion for kicking out block producers.
CHUNK_PRODUCER_KICKOUT_THRESHOLD
Criterion for kicking out chunk producers.
CHUNK_VALIDATOR_ONLY_KICKOUT_THRESHOLD
Criterion for kicking out chunk validators.
DEFAULT_GC_NUM_EPOCHS_TO_KEEP
Default number of epochs for which we keep store data
DEFAULT_STATE_PARTS_COMPRESSION_LEVEL
We haven’t observed meaningful gains from higher compression levels. Even -5 produced a result close to levels 1–3. Therefore we keep 1 as the default.
EXPECTED_EPOCH_LENGTH
Expected epoch length.
FAST_EPOCH_LENGTH
FISHERMEN_THRESHOLD
Fishermen stake threshold.
GAS_PRICE_ADJUSTMENT_RATE
The rate at which the gas price can be adjusted (alpha in the formula). The formula is gas_price_t = gas_price_{t-1} * (1 + (gas_used/gas_limit - 1/2) * alpha))
GENESIS_CONFIG_FILENAME
INITIAL_GAS_LIMIT
Initial gas limit.
MAX_INFLATION_RATE
Maximum inflation rate per year
MIN_BLOCK_PRODUCTION_DELAY
Expected block production time in ms.
MIN_GAS_PRICE
Initial and minimum gas price.
MIN_GC_NUM_EPOCHS_TO_KEEP
Minimum number of epochs for which we keep store data
NUM_BLOCKS_PER_YEAR
Expected number of blocks per year
NUM_BLOCK_PRODUCER_SEATS
Number of seats for block producers
PROTOCOL_REWARD_RATE
Protocol treasury reward
PROTOCOL_TREASURY_ACCOUNT
Protocol treasury account
PROTOCOL_UPGRADE_STAKE_THRESHOLD
Protocol upgrade stake threshold.
TRANSACTION_VALIDITY_PERIOD
Number of blocks for which a given transaction is valid

Functions§

default_archival_writer_polling_interval
default_chunk_validation_threads
default_chunk_wait_mult
default_chunks_cache_height_horizon
Returns the default value for chunks_cache_height_horizon. A chunk is out of rear horizon if its height + chunks_cache_height_horizon < largest_seen_height.
default_enable_early_prepare_transactions
Returns the default value for enable_early_prepare_transactions. Enabled on nightly as it remains disabled in production builds, and CI will run both with this enabled and disabled.
default_enable_multiline_logging
default_epoch_sync
default_header_sync_expected_height_per_second
default_header_sync_initial_timeout
default_header_sync_progress_timeout
default_header_sync_stall_ban_timeout
default_log_summary_period
default_orphan_state_witness_max_size
Returns the default value for maximum data-size (bytes) for a state witness to be included in the OrphanStateWitnessPool.
default_orphan_state_witness_pool_size
Returns the default size of the OrphanStateWitnessPool, ie. the maximum number of state-witnesses that can be accommodated in OrphanStateWitnessPool.
default_produce_chunk_add_transactions_time_limit
default_state_request_server_threads
default_state_request_throttle_period
default_state_requests_per_throttle_period
default_state_sync_external_backoff
default_state_sync_external_timeout
default_state_sync_p2p_timeout
default_state_sync_retry_backoff
default_sync_check_period
default_sync_height_threshold
default_sync_max_block_requests
default_sync_step_period
default_transaction_pool_size_limit
default_transaction_pool_strict_nonce_ttl_blocks
default_trie_viewer_state_size_limit
default_tx_routing_height_horizon
default_view_client_threads
get_initial_supply
stream_records_from_file
The file can be a JSON with comments

Type Aliases§

MutableValidatorSigner