From 372a9a6a0124ea7bb18836b46417fe837ba1ef22 Mon Sep 17 00:00:00 2001
From: SHAcollision <127778313+SHAcollision@users.noreply.github.com>
Date: Wed, 22 Jan 2025 06:56:56 -0400
Subject: [PATCH] chore: move create user example to specs crate (#299)

---
 examples/new_homeserver_user.rs | 52 ---------------------------------
 1 file changed, 52 deletions(-)
 delete mode 100644 examples/new_homeserver_user.rs

diff --git a/examples/new_homeserver_user.rs b/examples/new_homeserver_user.rs
deleted file mode 100644
index 52405561..00000000
--- a/examples/new_homeserver_user.rs
+++ /dev/null
@@ -1,52 +0,0 @@
-use anyhow::Result;
-use log::info;
-use pubky::Client;
-use pubky_app_specs::{traits::HasPath, PubkyAppUser, PubkyAppUserLink, PROTOCOL};
-use pubky_common::crypto::{Keypair, PublicKey};
-use pubky_nexus::{setup, Config};
-
-#[tokio::main]
-async fn main() -> Result<()> {
-    let config = Config::from_env();
-    setup(&config).await;
-
-    // Initialize the Client based on configuration
-    let client = match config.testnet {
-        true => Client::testnet()?,
-        false => Client::new()?,
-    };
-
-    // Generate a random keypair
-    let keypair = Keypair::random();
-    let pk = keypair.public_key().to_z32();
-    info!("The pubky id is: {}", pk);
-
-    // Convert the homeserver from the config into a PublicKey
-    let homeserver = PublicKey::try_from(config.homeserver.as_str())?;
-
-    // Perform signup
-    client.signup(&keypair, &homeserver).await?;
-
-    // Create a new profile
-    let user = PubkyAppUser::new(
-        "Satoshi Nakamoto".to_string(),
-        Some("This is an example bio".to_string()),
-        Some("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjiO4O+w8ABL0CPPcYQa4AAAAASUVORK5CYII=".to_string()),
-        Some(vec![PubkyAppUserLink {
-            title: "My Website".to_string(),
-            url: "https://example.com".to_string(),
-        }]),
-        Some("Running Bitcoin".to_string()),
-    );
-
-    // Put some content into the Pubky homeserver
-    let url = format!(
-        "{protocol}{pk}{path}",
-        protocol = PROTOCOL,
-        pk = pk,
-        path = user.create_path()
-    );
-    client.put(url.as_str()).json(&user).send().await?;
-
-    Ok(())
-}