pub fn spawn_chain_runtime(
    config: &Config,
    chain_id: &ChainId,
) -> Result<Box<dyn ChainHandle>, Error> {
    let chain_config = config
        .find_chain(chain_id)
        .cloned()
        .ok_or_else(|| format!("missing chain for id ({}) in configuration file", chain_id))
        .map_err(|e| Kind::Config.context(e))?;

    let chain_res =
        ChainRuntime::<CosmosSdkChain>::spawn(chain_config).map_err(|e| Kind::Runtime.context(e));

    let handle = chain_res.map(|(handle, _)| handle)?;

    Ok(handle)
}
/// Spawns a chain runtime from the configuration and given a chain identifier.
/// Returns the corresponding handle if successful.
Spawns a chain runtime from the configuration and given a chain identifier.
Returns the corresponding handle if successful.
Spawns a chain runtime from the configuration and given a chain identifier . Returns the corresponding handle if successful .
pub fn spawn_chain_runtime(
    config: &Config,
    chain_id: &ChainId,
) -> Result<Box<dyn ChainHandle>, Error> {
    let chain_config = config
        .find_chain(chain_id)
        .cloned()
        .ok_or_else(|| format!("missing chain for id ({}) in configuration file", chain_id))
        .map_err(|e| Kind::Config.context(e))?;
    let chain_res =
        ChainRuntime::<CosmosSdkChain>::spawn(chain_config).map_err(|e| Kind::Runtime.context(e));
    let handle = chain_res.map(|(handle, _)| handle)?;
    Ok(handle)
}
pub fn spawn_chain_runtime ( config : & Config , chain_id : & ChainId , ) -> Result < Box < dyn ChainHandle > , Error > { let chain_config = config . find_chain ( chain_id ) . cloned ( ) . ok_or_else ( | | format ! ( " " chain_id ) ) . map_err ( | e | Kind :: Config . context ( e ) ) ? ; let chain_res = ChainRuntime :: < CosmosSdkChain > :: spawn ( chain_config ) . map_err ( | e | Kind :: Runtime . context ( e ) ) ; let handle = chain_res . map ( | ( handle , _ ) | handle ) ? ; Ok ( handle ) }
Spawns a chain runtime from the configuration and given a chain identifier.
Spawns a chain runtime from the configuration and given a chain identifier .
config
&Config
chain_id
&ChainId
config
&Config
chain_id
&ChainId