Skip to main content

NetworkParameters

Struct NetworkParameters 

Source
pub struct NetworkParameters {
Show 27 fields pub identifier: NetworkIdentifier, pub generation_hash_seed: GenerationHashSeed, pub epoch_adjustment: Duration, pub currency_mosaic_id: u64, pub block_generation_target_time: Duration, pub block_time_smoothing_factor: u64, pub max_difficulty_blocks: usize, pub total_chain_importance: u64, pub importance_grouping: u64, pub max_transaction_lifetime: Duration, pub max_cosignatures_per_aggregate: usize, pub max_transactions_per_aggregate: usize, pub max_message_size: usize, pub max_hash_lock_duration: Duration, pub max_secret_lock_duration: Duration, pub min_proof_size: usize, pub max_proof_size: usize, pub max_metadata_value_size: usize, pub max_namespace_name_size: usize, pub min_namespace_duration: Duration, pub max_namespace_duration: Duration, pub voting_set_grouping: u64, pub min_voting_key_lifetime: u32, pub max_voting_key_lifetime: u32, pub max_voting_keys_per_account: usize, pub fork_heights: ForkHeights, pub corrupt_aggregate_transaction_hashes: &'static [(Hash256, Hash256)],
}
Expand description

ネットワークごとに決まっている値のうち、heika が使うもの。catapult ではノードの config-network.properties に書かれ、 フィールドの名前の後ろに、そこでの名前を添える。メインネットとテストネットの値は、それぞれのノードの設定から写した。

Fields§

§identifier: NetworkIdentifier

identifier

§generation_hash_seed: GenerationHashSeed

generationHashSeed

§epoch_adjustment: Duration

epochAdjustment。Nemesis の時刻の Unix 時刻で、トランザクションの期限はここからのミリ秒で数える

§currency_mosaic_id: u64

currencyMosaicId

§block_generation_target_time: Duration

blockGenerationTargetTime

§block_time_smoothing_factor: u64

blockTimeSmoothingFactor。ブロックの間隔が目標から外れたときに、ハーベストの的をどれだけ動かすか(1000 で 1 倍)

§max_difficulty_blocks: usize

maxDifficultyBlocks。難易度を決めるのに見る、直前のブロックの数

§total_chain_importance: u64

totalChainImportance。Importance の合計

§importance_grouping: u64

importanceGrouping。この高さの倍数のブロックが、Importance を計算し直すブロックになる

§max_transaction_lifetime: Duration

maxTransactionLifetime

§max_cosignatures_per_aggregate: usize

maxCosignaturesPerAggregate。外側の署名も数える

§max_transactions_per_aggregate: usize

maxTransactionsPerAggregate

§max_message_size: usize

maxMessageSize。転送のメッセージのバイト数の上限

§max_hash_lock_duration: Duration

maxHashLockDuration

§max_secret_lock_duration: Duration

maxSecretLockDuration

§min_proof_size: usize

minProofSize。シークレットプルーフのプルーフのバイト数の下限

§max_proof_size: usize

maxProofSize

§max_metadata_value_size: usize

maxValueSize。メタデータの値のバイト数の上限

§max_namespace_name_size: usize

maxNameSize。ネームスペースの名前のバイト数の上限

§min_namespace_duration: Duration

minNamespaceDuration。ルートのネームスペースを取る期間の下限

§max_namespace_duration: Duration

maxNamespaceDuration

§voting_set_grouping: u64

votingSetGrouping。ファイナライズのエポック1つぶんのブロック数

§min_voting_key_lifetime: u32

minVotingKeyLifetime。投票鍵の期間(エポック数)の下限

§max_voting_key_lifetime: u32

maxVotingKeyLifetime。投票鍵の期間(エポック数)の上限

§max_voting_keys_per_account: usize

maxVotingKeysPerAccount

§fork_heights: ForkHeights

[fork_heights]

§corrupt_aggregate_transaction_hashes: &'static [(Hash256, Hash256)]

[corrupt_aggregate_transaction_hashes]。(アグリゲートのハッシュ、その TransactionsHash)の組。 バージョン 1 のアグリゲートのうち、許されていたどの誤った求め方でも説明できない TransactionsHash を、1件ずつ認めたもの

Implementations§

Source§

impl NetworkParameters

Source

pub const MAINNET: Self

Source

pub const TESTNET: Self

Source

pub fn from_identifier(identifier: NetworkIdentifier) -> Option<&'static Self>

識別子が同じものを、知っているネットワークから探す。

Source

pub fn epoch(&self) -> SystemTime

Nemesis の時刻。

Source

pub fn blocks(&self, duration: Duration) -> u64

期間をブロック数にする。catapult の BlockSpan::blocks と同じく、blockGenerationTargetTime で割って切り捨てる。

Source

pub fn timestamp_at(&self, time: SystemTime) -> Option<NetworkTimestamp>

ふつうの時刻をネットワーク時刻にする。ミリ秒より細かいところは切り捨てる。 エポックより前か、u64 のミリ秒に収まらなければ None。

Source

pub fn time_of(&self, timestamp: NetworkTimestamp) -> Option<SystemTime>

ネットワーク時刻をふつうの時刻にする。OS の時刻で表せなければ None。

Source

pub fn finalization_epoch(&self, height: u64) -> u64

その高さのブロックが入る、ファイナライズのエポック。catapult の CalculateFinalizationEpochForHeight。 エポック 1 は高さ 1 だけで、そのあとは votingSetGrouping ごとに区切り、区切りの高さはその前のエポックに入る。

Source

pub fn vrf_checks(&self, height: u64) -> Checks

その高さのブロックの VRF の証明を、どこまで確かめるか。catapult の BlockchainProcessor の CheckGenerationHash。

Source

pub fn aggregate_version(&self, height: u64) -> u8

その高さのブロックに入れられるアグリゲートのバージョン。 catapult の AggregateTransactionVersionValidator と同じく、1つのバージョンだけが認められる。

Source

pub fn is_known_corrupt_aggregate( &self, aggregate_hash: &Hash256, transactions_hash: &Hash256, ) -> bool

バージョン 1 のアグリゲートの TransactionsHash が、[corrupt_aggregate_transaction_hashes] で認められているか。

Trait Implementations§

Source§

impl Clone for NetworkParameters

Source§

fn clone(&self) -> NetworkParameters

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for NetworkParameters

Source§

impl Debug for NetworkParameters

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for NetworkParameters

Source§

impl PartialEq for NetworkParameters

Source§

fn eq(&self, other: &NetworkParameters) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for NetworkParameters

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.