From 2aab9f3e4955f99c5fc6cfd6ba35bb94a81695d1 Mon Sep 17 00:00:00 2001
From: Barry Deen <barrydeen@protonmail.com>
Date: Mon, 9 Sep 2024 18:37:31 -0400
Subject: [PATCH] update refresh interval on readme, add archiving logging

---
 .env.example | 4 +++-
 README.md    | 2 +-
 main.go      | 1 +
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/.env.example b/.env.example
index f18144d..ca235d5 100644
--- a/.env.example
+++ b/.env.example
@@ -6,6 +6,8 @@ RELAY_URL="wss://wot.utxo.one"
 
 # where we should store the database
 DB_PATH="db"
+# what engine to use for the database: lmdb, badger
+DB_ENGINE="lmdb"
 
 # where we should store the index.html and static files
 INDEX_PATH="templates/index.html"
@@ -14,4 +16,4 @@ STATIC_PATH="templates/static"
 # relay behavior
 
 # how often to refresh the relay's view of the WoT in HOURS
-REFRESH_INTERVAL_HOURS=24
\ No newline at end of file
+REFRESH_INTERVAL_HOURS=1
\ No newline at end of file
diff --git a/README.md b/README.md
index c0dfc2e..6be20e5 100644
--- a/README.md
+++ b/README.md
@@ -37,7 +37,7 @@ RELAY_DESCRIPTION="Your relay description"
 DB_PATH="/home/ubuntu/wot-relay/db" # any path you would like the database to be saved.
 INDEX_PATH="/home/ubuntu/wot-relay/templates/index.html" # path to the index.html file
 STATIC_PATH="/home/ubuntu/wot-relay/templates/static" # path to the static folder
-REFRESH_INTERVAL=24 # interval in hours to refresh the web of trust
+REFRESH_INTERVAL_HOURS=24 # interval in hours to refresh the web of trust
 ```
 
 ### 4. Build the project
diff --git a/main.go b/main.go
index 93d8bb2..0ff9339 100644
--- a/main.go
+++ b/main.go
@@ -325,6 +325,7 @@ func archiveTrustedNotes(relay *khatru.Relay, ctx context.Context) {
 			}
 
 			relay.AddEvent(ctx, ev.Event)
+			log.Println("📦 archived note from", ev.Event.PubKey)
 			trustedNotes++
 		} else {
 			untrustedNotes++