Update readme

This commit is contained in:
Jon Staab
2026-02-25 14:11:49 -08:00
parent 1df7b1b37c
commit c58b20ea53
5 changed files with 30 additions and 7 deletions
+3
View File
@@ -13,6 +13,7 @@ pub struct Config {
pub indexer_relays: Vec<String>,
pub platform_name: String,
pub platform_description: String,
pub platform_picture: String,
pub platform_messaging_relays: Vec<String>,
}
@@ -45,6 +46,7 @@ impl Config {
.collect::<Vec<_>>();
let platform_name = env::var("PLATFORM_NAME").unwrap_or_default();
let platform_description = env::var("PLATFORM_DESCRIPTION").unwrap_or_default();
let platform_picture = env::var("PLATFORM_PICTURE").unwrap_or_default();
let platform_messaging_relays = env::var("PLATFORM_MESSAGING_RELAYS")
.unwrap_or_default()
.split(',')
@@ -64,6 +66,7 @@ impl Config {
indexer_relays,
platform_name,
platform_description,
platform_picture,
platform_messaging_relays,
}
}
+1
View File
@@ -42,6 +42,7 @@ async fn main() -> Result<()> {
&config.indexer_relays,
&config.platform_name,
&config.platform_description,
&config.platform_picture,
&config.platform_messaging_relays,
)
.await?;
+4
View File
@@ -6,6 +6,7 @@ pub async fn publish_platform_identity(
indexer_relays: &[String],
name: &str,
description: &str,
picture: &str,
messaging_relays: &[String],
) -> Result<()> {
if indexer_relays.is_empty() {
@@ -32,6 +33,9 @@ pub async fn publish_platform_identity(
if !description.is_empty() {
metadata = metadata.about(description);
}
if !picture.is_empty() {
metadata = metadata.picture(Url::parse(picture)?);
}
let metadata_builder = EventBuilder::metadata(&metadata);
client.send_event_builder(metadata_builder).await?;