revert connect fn to init

This commit is contained in:
glyph 2022-02-08 14:17:46 +02:00
parent 81e329b40e
commit d2a0c38f68
1 changed files with 5 additions and 7 deletions

View File

@ -39,13 +39,7 @@ impl Sbot {
/// Initiate a connection with an sbot instance. Define the IP address,
/// port and network key for the sbot, then retrieve the public key,
/// private key (secret) and identity from the `.ssb-go/secret` file.
/// Open a TCP stream to the sbot and perform the secret handshake. If
/// successful, create a box stream and split it into a writer and reader.
/// Return RPC handles to the sbot as part of the `struct` output.
pub async fn connect(
ip_port: Option<String>,
net_id: Option<String>,
) -> Result<Sbot, GolgiError> {
pub async fn init(ip_port: Option<String>, net_id: Option<String>) -> Result<Sbot, GolgiError> {
let address = if ip_port.is_none() {
"127.0.0.1:8008".to_string()
} else {
@ -85,6 +79,10 @@ impl Sbot {
/// Private helper function which creates a new connection with sbot,
/// but with all variables passed as arguments.
///
/// Open a TCP stream to the sbot and perform the secret handshake. If
/// successful, create a box stream and split it into a writer and reader.
/// Return RPC handles to the sbot as part of the `struct` output.
async fn _get_sbot_connection_helper(
address: String,
network_id: auth::Key,