Struct avalanche_types::genesis::Genesis
source · [−]pub struct Genesis {
pub network_id: u32,
pub allocations: Option<Vec<Allocation>>,
pub start_time: Option<u64>,
pub initial_stake_duration: Option<u64>,
pub initial_stake_duration_offset: Option<u64>,
pub initial_staked_funds: Option<Vec<String>>,
pub initial_stakers: Option<Vec<Staker>>,
pub c_chain_genesis: Genesis,
pub message: Option<String>,
}
Expand description
Represents Avalanche network genesis configuration. ref. https://pkg.go.dev/github.com/ava-labs/avalanchego/genesis#Config ref. https://serde.rs/container-attrs.html
Fields
network_id: u32
allocations: Option<Vec<Allocation>>
start_time: Option<u64>
Unix time for start time.
initial_stake_duration: Option<u64>
Number of seconds to stake for the initial stakers.
initial_stake_duration_offset: Option<u64>
initial_staked_funds: Option<Vec<String>>
MUST BE come from “initial_stakers”. MUST BE the list of X-chain addresses. Initial staked funds cannot be empty.
initial_stakers: Option<Vec<Staker>>
MUST BE non-empty for an existing network. Non-anchor nodes request “GetAcceptedFrontier” from initial stakers (not from specified anchor nodes).
c_chain_genesis: Genesis
message: Option<String>
Implementations
sourceimpl Genesis
impl Genesis
pub fn default() -> Self
sourcepub fn new<T: ReadOnly>(network_id: u32, seed_keys: &[T]) -> Result<Self>
pub fn new<T: ReadOnly>(network_id: u32, seed_keys: &[T]) -> Result<Self>
Creates a new Genesis object with “keys” number of generated pre-funded keys.
sourcepub fn sync(&self, file_path: &str) -> Result<()>
pub fn sync(&self, file_path: &str) -> Result<()>
Saves the current configuration to disk and overwrites the file.
pub fn load(file_path: &str) -> Result<Self>
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Genesis
impl<'de> Deserialize<'de> for Genesis
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Genesis
impl StructuralEq for Genesis
impl StructuralPartialEq for Genesis
Auto Trait Implementations
impl RefUnwindSafe for Genesis
impl Send for Genesis
impl Sync for Genesis
impl Unpin for Genesis
impl UnwindSafe for Genesis
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more