pub trait ChainBootstrapMethodsExt {
    // Required methods
    fn read_file(&self, file_path: &str) -> Result<String, Error>;
    fn write_file(&self, file_path: &str, content: &str) -> Result<(), Error>;
    fn update_chain_config(
        &self,
        file: &str,
        cont: impl FnOnce(&mut Value) -> Result<(), Error>
    ) -> Result<(), Error>;
    fn initialize(&self) -> Result<(), Error>;
    fn update_genesis_file(
        &self,
        file: &str,
        cont: impl FnOnce(&mut Value) -> Result<(), Error>
    ) -> Result<(), Error>;
    fn add_wallet(&self, wallet_id: &str) -> Result<Wallet, Error>;
    fn add_genesis_account(
        &self,
        wallet: &WalletAddress,
        amounts: &[&Token]
    ) -> Result<(), Error>;
    fn add_genesis_validator(
        &self,
        wallet_id: &WalletId,
        token: &Token
    ) -> Result<(), Error>;
    fn collect_gen_txs(&self) -> Result<(), Error>;
    fn start(&self) -> Result<ChildProcess, Error>;
}

Required Methods§

source

fn read_file(&self, file_path: &str) -> Result<String, Error>

Read the content at a file path relative to the chain home directory, and return the result as a string.

This is not efficient but is sufficient for testing purposes.

source

fn write_file(&self, file_path: &str, content: &str) -> Result<(), Error>

Write the string content to a file path relative to the chain home directory.

This is not efficient but is sufficient for testing purposes.

source

fn update_chain_config( &self, file: &str, cont: impl FnOnce(&mut Value) -> Result<(), Error> ) -> Result<(), Error>

Modify the Gaia chain config which is saved in toml format.

source

fn initialize(&self) -> Result<(), Error>

Initialized the chain data stores.

This is used by bootstrap_single_node.

source

fn update_genesis_file( &self, file: &str, cont: impl FnOnce(&mut Value) -> Result<(), Error> ) -> Result<(), Error>

Modify the Gaia genesis file.

source

fn add_wallet(&self, wallet_id: &str) -> Result<Wallet, Error>

Add a wallet with the given ID to the full node’s keyring.

source

fn add_genesis_account( &self, wallet: &WalletAddress, amounts: &[&Token] ) -> Result<(), Error>

Add a wallet address to the genesis account list for an uninitialized full node.

source

fn add_genesis_validator( &self, wallet_id: &WalletId, token: &Token ) -> Result<(), Error>

Add a wallet ID with the given stake amount to be the genesis validator for an uninitialized chain.

source

fn collect_gen_txs(&self) -> Result<(), Error>

Call gaiad collect-gentxs to generate the genesis transactions.

source

fn start(&self) -> Result<ChildProcess, Error>

Start a full node by running in the background gaiad start.

Returns a ChildProcess that stops the full node process when the value is dropped.

Implementors§