Skip to main content

NodeConfig

Struct NodeConfig 

Source
pub struct NodeConfig {
Show 15 fields pub network: Network, pub data_directory: PathBuf, pub certificates: Certificates, pub peers: usize, pub seed: Option<String>, pub seeds: Vec<String>, pub storage: Storage, pub min_free: ByteSize, pub min_fee_multiplier: u32, pub listen: Option<Listen>, pub harvesters: Vec<Harvester>, pub beneficiary: Option<String>, pub delegations: Option<Delegations>, pub rest: Vec<Rest>, pub finalization: Option<Finalization>,
}
Expand description

ノードの設定(spec)

Fields§

§network: Network§data_directory: PathBuf

ブロックと状態をしまうフォルダー

§certificates: Certificates

TLS の証明書の鎖と鍵のあるフォルダー

§peers: usize

先端の段階でつないでおくピアの数

§seed: Option<String>

住所録が空か全滅したときに、最初につなぐノード(ホスト:ポート)。1 つだけ書くときの形で、seeds と あわせても使える

§seeds: Vec<String>

seed の並び。どれかが消えても、ほかのノードからつなぎ直せる

§storage: Storage

何を残すか、どれだけメモリに持つか

§min_free: ByteSize

ディスクの空きがこれより少なければ、書く前に止める

§min_fee_multiplier: u32

これより低い手数料の倍率(最大手数料を大きさで割ったもの)のトランザクションは受け付けない。REST の /network/fees/transaction でも下限として答える。catapult の minFeeMultiplier にあたる。既定は 0

§listen: Option<Listen>

接続を受ける。なければ、自分からつなぐだけ

§harvesters: Vec<Harvester>

ハーベストする鍵の組。空ならしない

§beneficiary: Option<String>

作るブロックの受取先のアドレス。なければ、ハーベストした鍵のアドレス

§delegations: Option<Delegations>

ほかの人の委任ハーベストを引き受ける。なければ引き受けない

§rest: Vec<Rest>

REST の口で待ち受ける。空なら立てない。手元用と公開用のように、いくつでも書ける

§finalization: Option<Finalization>

ファイナライズの投票。なければ何もしない

Implementations§

Source§

impl NodeConfig

Source

pub fn seeds(&self) -> Vec<String>

seed と seeds を、書いた順に重なりなく並べたもの

Source

pub fn roles(&self) -> NodeRoles

名乗るロール。listen.roles がなければ、Peer に、REST の口があれば Api を、投票するなら Voting を足す。 メインネットの catapult と同じく IPv4 は立てない(catapult は、IPv4 も IPv6 もなければ IPv4 とみなす。 ノードの一覧を作るクローラーには、IPv4 の立ったロールを読めないものがある)

Trait Implementations§

Source§

impl Clone for NodeConfig

Source§

fn clone(&self) -> NodeConfig

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 Debug for NodeConfig

Source§

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

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

impl<'de> Deserialize<'de> for NodeConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for NodeConfig

Source§

impl PartialEq for NodeConfig

Source§

fn eq(&self, other: &NodeConfig) -> 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 NodeConfig

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.