alpine-protocol-sdk 0.2.2

High-level SDK on top of the ALPINE protocol layer.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::net::SocketAddr;

use alpine::crypto::identity::NodeCredentials;
use alpine::messages::{CapabilitySet, DeviceIdentity};

use crate::{error::AlpineSdkError, session::AlpineClient};

/// Initiates a handshake and returns a fully established session client.
pub async fn connect(
    local_addr: SocketAddr,
    remote_addr: SocketAddr,
    identity: DeviceIdentity,
    capabilities: CapabilitySet,
    credentials: NodeCredentials,
) -> Result<AlpineClient, AlpineSdkError> {
    AlpineClient::connect(local_addr, remote_addr, identity, capabilities, credentials).await
}