pub struct GenesisConfig {Show 39 fields
pub avg_hidden_validator_seats_per_shard: Vec<u64>,
pub block_producer_kickout_threshold: u8,
pub chain_id: String,
pub chunk_producer_assignment_changes_limit: u64,
pub chunk_producer_kickout_threshold: u8,
pub chunk_validator_only_kickout_threshold: u8,
pub dynamic_resharding: bool,
pub epoch_length: u64,
pub fishermen_threshold: NearToken,
pub gas_limit: NearGas,
pub gas_price_adjustment_rate: [i32; 2],
pub genesis_height: u64,
pub genesis_time: DateTime<Utc>,
pub max_gas_price: NearToken,
pub max_inflation_rate: [i32; 2],
pub max_kickout_stake_perc: u8,
pub min_gas_price: NearToken,
pub minimum_stake_divisor: u64,
pub minimum_stake_ratio: [i32; 2],
pub minimum_validators_per_shard: u64,
pub num_block_producer_seats: u64,
pub num_block_producer_seats_per_shard: Vec<u64>,
pub num_blocks_per_year: u64,
pub num_chunk_only_producer_seats: u64,
pub num_chunk_producer_seats: u64,
pub num_chunk_validator_seats: u64,
pub online_max_threshold: [i32; 2],
pub online_min_threshold: [i32; 2],
pub protocol_reward_rate: [i32; 2],
pub protocol_treasury_account: AccountId,
pub protocol_upgrade_stake_threshold: [i32; 2],
pub protocol_version: u32,
pub shard_layout: ShardLayout,
pub shuffle_shard_assignment_for_chunk_producers: bool,
pub target_validator_mandates_per_shard: u64,
pub total_supply: NearToken,
pub transaction_validity_period: u64,
pub use_production_config: bool,
pub validators: Vec<AccountInfo>,
}Expand description
GenesisConfig
JSON schema
{
"type": "object",
"required": [
"avg_hidden_validator_seats_per_shard",
"block_producer_kickout_threshold",
"chain_id",
"chunk_producer_kickout_threshold",
"dynamic_resharding",
"epoch_length",
"fishermen_threshold",
"gas_limit",
"gas_price_adjustment_rate",
"genesis_height",
"genesis_time",
"max_gas_price",
"max_inflation_rate",
"min_gas_price",
"num_block_producer_seats",
"num_block_producer_seats_per_shard",
"num_blocks_per_year",
"protocol_reward_rate",
"protocol_treasury_account",
"protocol_version",
"total_supply",
"transaction_validity_period",
"validators"
],
"properties": {
"avg_hidden_validator_seats_per_shard": {
"description": "Expected number of hidden validators per shard.",
"type": "array",
"items": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
},
"block_producer_kickout_threshold": {
"description": "Threshold for kicking out block producers, between 0 and 100.",
"type": "integer",
"format": "uint8",
"maximum": 255.0,
"minimum": 0.0
},
"chain_id": {
"description": "ID of the blockchain. This must be unique for every blockchain.\nIf your testnet blockchains do not have unique chain IDs, you will have a bad time.",
"type": "string"
},
"chunk_producer_assignment_changes_limit": {
"description": "Limits the number of shard changes in chunk producer assignments,\nif algorithm is able to choose assignment with better balance of\nnumber of chunk producers for shards.",
"default": 5,
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"chunk_producer_kickout_threshold": {
"description": "Threshold for kicking out chunk producers, between 0 and 100.",
"type": "integer",
"format": "uint8",
"maximum": 255.0,
"minimum": 0.0
},
"chunk_validator_only_kickout_threshold": {
"description": "Threshold for kicking out nodes which are only chunk validators, between 0 and 100.",
"default": 80,
"type": "integer",
"format": "uint8",
"maximum": 255.0,
"minimum": 0.0
},
"dynamic_resharding": {
"description": "Enable dynamic re-sharding.",
"type": "boolean"
},
"epoch_length": {
"description": "Epoch length counted in block heights.",
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"fishermen_threshold": {
"description": "Fishermen stake threshold.",
"allOf": [
{
"$ref": "#/components/schemas/NearToken"
}
]
},
"gas_limit": {
"description": "Initial gas limit.",
"allOf": [
{
"$ref": "#/components/schemas/NearGas"
}
]
},
"gas_price_adjustment_rate": {
"description": "Gas price adjustment rate",
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"maxItems": 2,
"minItems": 2
},
"genesis_height": {
"description": "Height of genesis block.",
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"genesis_time": {
"description": "Official time of blockchain start.",
"type": "string",
"format": "date-time"
},
"max_gas_price": {
"$ref": "#/components/schemas/NearToken"
},
"max_inflation_rate": {
"description": "Maximum inflation on the total supply every epoch.",
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"maxItems": 2,
"minItems": 2
},
"max_kickout_stake_perc": {
"description": "Max stake percentage of the validators we will kick out.",
"default": 100,
"type": "integer",
"format": "uint8",
"maximum": 255.0,
"minimum": 0.0
},
"min_gas_price": {
"description": "Minimum gas price. It is also the initial gas price.",
"allOf": [
{
"$ref": "#/components/schemas/NearToken"
}
]
},
"minimum_stake_divisor": {
"description": "The minimum stake required for staking is last seat price divided by this number.",
"default": 10,
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"minimum_stake_ratio": {
"description": "The lowest ratio s/s_total any block producer can have.\nSee <https://github.com/near/NEPs/pull/167> for details",
"default": [
1,
6250
],
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"maxItems": 2,
"minItems": 2
},
"minimum_validators_per_shard": {
"description": "The minimum number of validators each shard must have",
"default": 1,
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"num_block_producer_seats": {
"description": "Number of block producer seats at genesis.",
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"num_block_producer_seats_per_shard": {
"description": "Defines number of shards and number of block producer seats per each shard at genesis.\nNote: not used with protocol_feature_chunk_only_producers -- replaced by minimum_validators_per_shard\nNote: not used before as all block producers produce chunks for all shards",
"type": "array",
"items": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
},
"num_blocks_per_year": {
"description": "Expected number of blocks per year",
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"num_chunk_only_producer_seats": {
"description": "Deprecated.",
"default": 300,
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"num_chunk_producer_seats": {
"description": "Number of chunk producers.\nDon't mess it up with chunk-only producers feature which is deprecated.",
"default": 100,
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"num_chunk_validator_seats": {
"default": 300,
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"online_max_threshold": {
"description": "Online maximum threshold above which validator gets full reward.",
"default": [
99,
100
],
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"maxItems": 2,
"minItems": 2
},
"online_min_threshold": {
"description": "Online minimum threshold below which validator doesn't receive reward.",
"default": [
9,
10
],
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"maxItems": 2,
"minItems": 2
},
"protocol_reward_rate": {
"description": "Protocol treasury rate",
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"maxItems": 2,
"minItems": 2
},
"protocol_treasury_account": {
"description": "Protocol treasury account",
"allOf": [
{
"$ref": "#/components/schemas/AccountId"
}
]
},
"protocol_upgrade_stake_threshold": {
"description": "Threshold of stake that needs to indicate that they ready for upgrade.",
"default": [
4,
5
],
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"maxItems": 2,
"minItems": 2
},
"protocol_version": {
"description": "Protocol version that this genesis works with.",
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"shard_layout": {
"description": "Layout information regarding how to split accounts to shards",
"default": {
"V2": {
"boundary_accounts": [],
"id_to_index_map": {
"0": 0
},
"index_to_id_map": {
"0": 0
},
"shard_ids": [
0
],
"version": 0
}
},
"allOf": [
{
"$ref": "#/components/schemas/ShardLayout"
}
]
},
"shuffle_shard_assignment_for_chunk_producers": {
"description": "If true, shuffle the chunk producers across shards. In other words, if\nthe shard assignments were `[S_0, S_1, S_2, S_3]` where `S_i` represents\nthe set of chunk producers for shard `i`, if this flag were true, the\nshard assignments might become, for example, `[S_2, S_0, S_3, S_1]`.",
"default": false,
"type": "boolean"
},
"target_validator_mandates_per_shard": {
"description": "Number of target chunk validator mandates for each shard.",
"default": 68,
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"total_supply": {
"description": "Total supply of tokens at genesis.",
"allOf": [
{
"$ref": "#/components/schemas/NearToken"
}
]
},
"transaction_validity_period": {
"description": "Number of blocks for which a given transaction is valid",
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"use_production_config": {
"description": "This is only for test purposes. We hard code some configs for mainnet and testnet\nin AllEpochConfig, and we want to have a way to test that code path. This flag is for that.\nIf set to true, the node will use the same config override path as mainnet and testnet.",
"default": false,
"type": "boolean"
},
"validators": {
"description": "List of initial validators.",
"type": "array",
"items": {
"$ref": "#/components/schemas/AccountInfo"
}
}
}
}Fields§
Expected number of hidden validators per shard.
block_producer_kickout_threshold: u8Threshold for kicking out block producers, between 0 and 100.
chain_id: StringID of the blockchain. This must be unique for every blockchain. If your testnet blockchains do not have unique chain IDs, you will have a bad time.
chunk_producer_assignment_changes_limit: u64Limits the number of shard changes in chunk producer assignments, if algorithm is able to choose assignment with better balance of number of chunk producers for shards.
chunk_producer_kickout_threshold: u8Threshold for kicking out chunk producers, between 0 and 100.
chunk_validator_only_kickout_threshold: u8Threshold for kicking out nodes which are only chunk validators, between 0 and 100.
dynamic_resharding: boolEnable dynamic re-sharding.
epoch_length: u64Epoch length counted in block heights.
fishermen_threshold: NearTokenFishermen stake threshold.
gas_limit: NearGasInitial gas limit.
gas_price_adjustment_rate: [i32; 2]Gas price adjustment rate
genesis_height: u64Height of genesis block.
genesis_time: DateTime<Utc>Official time of blockchain start.
max_gas_price: NearToken§max_inflation_rate: [i32; 2]Maximum inflation on the total supply every epoch.
max_kickout_stake_perc: u8Max stake percentage of the validators we will kick out.
min_gas_price: NearTokenMinimum gas price. It is also the initial gas price.
minimum_stake_divisor: u64The minimum stake required for staking is last seat price divided by this number.
minimum_stake_ratio: [i32; 2]The lowest ratio s/s_total any block producer can have. See https://github.com/near/NEPs/pull/167 for details
minimum_validators_per_shard: u64The minimum number of validators each shard must have
num_block_producer_seats: u64Number of block producer seats at genesis.
num_block_producer_seats_per_shard: Vec<u64>Defines number of shards and number of block producer seats per each shard at genesis. Note: not used with protocol_feature_chunk_only_producers – replaced by minimum_validators_per_shard Note: not used before as all block producers produce chunks for all shards
num_blocks_per_year: u64Expected number of blocks per year
num_chunk_only_producer_seats: u64Deprecated.
num_chunk_producer_seats: u64Number of chunk producers. Don’t mess it up with chunk-only producers feature which is deprecated.
num_chunk_validator_seats: u64§online_max_threshold: [i32; 2]Online maximum threshold above which validator gets full reward.
online_min_threshold: [i32; 2]Online minimum threshold below which validator doesn’t receive reward.
protocol_reward_rate: [i32; 2]Protocol treasury rate
protocol_treasury_account: AccountIdProtocol treasury account
protocol_upgrade_stake_threshold: [i32; 2]Threshold of stake that needs to indicate that they ready for upgrade.
protocol_version: u32Protocol version that this genesis works with.
shard_layout: ShardLayoutLayout information regarding how to split accounts to shards
shuffle_shard_assignment_for_chunk_producers: boolIf true, shuffle the chunk producers across shards. In other words, if
the shard assignments were [S_0, S_1, S_2, S_3] where S_i represents
the set of chunk producers for shard i, if this flag were true, the
shard assignments might become, for example, [S_2, S_0, S_3, S_1].
target_validator_mandates_per_shard: u64Number of target chunk validator mandates for each shard.
total_supply: NearTokenTotal supply of tokens at genesis.
transaction_validity_period: u64Number of blocks for which a given transaction is valid
use_production_config: boolThis is only for test purposes. We hard code some configs for mainnet and testnet in AllEpochConfig, and we want to have a way to test that code path. This flag is for that. If set to true, the node will use the same config override path as mainnet and testnet.
validators: Vec<AccountInfo>List of initial validators.
Trait Implementations§
Source§impl Clone for GenesisConfig
impl Clone for GenesisConfig
Source§fn clone(&self) -> GenesisConfig
fn clone(&self) -> GenesisConfig
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GenesisConfig
impl Debug for GenesisConfig
Source§impl<'de> Deserialize<'de> for GenesisConfig
impl<'de> Deserialize<'de> for GenesisConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<&GenesisConfig> for GenesisConfig
impl From<&GenesisConfig> for GenesisConfig
Source§fn from(value: &GenesisConfig) -> Self
fn from(value: &GenesisConfig) -> Self
Auto Trait Implementations§
impl Freeze for GenesisConfig
impl RefUnwindSafe for GenesisConfig
impl Send for GenesisConfig
impl Sync for GenesisConfig
impl Unpin for GenesisConfig
impl UnwindSafe for GenesisConfig
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)