pub fn connect_tcp(
        chain_id: chain::Id,
        host: &str,
        port: u16,
        secret_connection_key: &ed25519::Seed,
    ) -> Result<Self, KmsError> {
        debug!("{}: Connecting to {}:{}...", chain_id, host, port);

        let socket = TcpStream::connect(format!("{}:{}", host, port))?;
        let signer = Ed25519Signer::from(secret_connection_key);
        let public_key = SecretConnectionKey::from(ed25519::public_key(&signer)?);
        let connection = SecretConnection::new(socket, &public_key, &signer)?;

        Ok(Self {
            chain_id,
            connection,
        })
    }
/// Create a new session with the validator at the given address/port
Create a new session with the validator at the given address/port
Create a new session with the validator at the given address / port
pub fn connect_tcp(
        chain_id: chain::Id,
        host: &str,
        port: u16,
        secret_connection_key: &ed25519::Seed,
    ) -> Result<Self, KmsError> {
        debug!("{}: Connecting to {}:{}...", chain_id, host, port);
        let socket = TcpStream::connect(format!("{}:{}", host, port))?;
        let signer = Ed25519Signer::from(secret_connection_key);
        let public_key = SecretConnectionKey::from(ed25519::public_key(&signer)?);
        let connection = SecretConnection::new(socket, &public_key, &signer)?;
        Ok(Self {
            chain_id,
            connection,
        })
    }
pub fn connect_tcp ( chain_id : chain :: Id , host : & str , port : u16 , secret_connection_key : & ed25519 :: Seed , ) -> Result < Self , KmsError > { debug ! ( " " chain_id host port ) ; let socket = TcpStream :: connect ( format ! ( " " host port ) ) ? ; let signer = Ed25519Signer :: from ( secret_connection_key ) ; let public_key = SecretConnectionKey :: from ( ed25519 :: public_key ( & signer ) ? ) ; let connection = SecretConnection :: new ( socket , & public_key , & signer ) ? ; Ok ( Self { chain_id , connection , } ) }
Create a new session with the validator at the given address/port
Create a new session with the validator at the given address / port
chain_id
chain::Id
host
&str
port
u16
secret_connection_key
&ed25519::Seed
chain_id
chain::Id
host
&str
port
u16
secret_connection_key
&ed25519::Seed