pub async fn add(&self, config: &ChainConfig, public_key: &str) -> Result<ChainId> {
        let tendermint_client = HttpClient::new(config.rpc_addr.as_str())?;
        let status = tendermint_client.status().await?;

        let chain_id: ChainId = status.node_info.network.to_string().parse()?;
        let node_id: NodeId = status.node_info.id;

        let mut transaction = self
            .db_pool
            .begin()
            .await
            .context("unable to begin database transaction")?;

        chain::add_chain(&mut transaction, &chain_id, &node_id, config).await?;
        chain_keys::add_chain_key(&mut transaction, &chain_id, public_key).await?;

        transaction
            .commit()
            .await
            .context("unable to commit transaction for adding IBC chain")?;

        notify_event(
            &self.notifier,
            Event::ChainAdded {
                chain_id: chain_id.clone(),
            },
        )?;

        Ok(chain_id)
    }
/// Add details of an IBC enabled chain
Add details of an IBC enabled chain
Add details of an IBC enabled chain
pub async fn add(&self, config: &ChainConfig, public_key: &str) -> Result<ChainId> {
        let tendermint_client = HttpClient::new(config.rpc_addr.as_str())?;
        let status = tendermint_client.status().await?;
        let chain_id: ChainId = status.node_info.network.to_string().parse()?;
        let node_id: NodeId = status.node_info.id;
        let mut transaction = self
            .db_pool
            .begin()
            .await
            .context("unable to begin database transaction")?;
        chain::add_chain(&mut transaction, &chain_id, &node_id, config).await?;
        chain_keys::add_chain_key(&mut transaction, &chain_id, public_key).await?;
        transaction
            .commit()
            .await
            .context("unable to commit transaction for adding IBC chain")?;
        notify_event(
            &self.notifier,
            Event::ChainAdded {
                chain_id: chain_id.clone(),
            },
        )?;
        Ok(chain_id)
    }
pub async fn add ( & self , config : & ChainConfig , public_key : & str ) -> Result < ChainId > { let tendermint_client = HttpClient :: new ( config . rpc_addr . as_str ( ) ) ? ; let status = tendermint_client . status ( ) . await ? ; let chain_id : ChainId = status . node_info . network . to_string ( ) . parse ( ) ? ; let node_id : NodeId = status . node_info . id ; let mut transaction = self . db_pool . begin ( ) . await . context ( " " ) ? ; chain :: add_chain ( & mut transaction , & chain_id , & node_id , config ) . await ? ; chain_keys :: add_chain_key ( & mut transaction , & chain_id , public_key ) . await ? ; transaction . commit ( ) . await . context ( " " ) ? ; notify_event ( & self . notifier , Event :: ChainAdded { chain_id : chain_id . clone ( ) , } , ) ? ; Ok ( chain_id ) }
Add details of an IBC enabled chain
Add details of an IBC enabled chain
&self
config
&ChainConfig
public_key
&str
&self
config
&ChainConfig
public_key
&str