v0.1.9 - program generates it's own private keys.

This commit is contained in:
Your Name
2025-11-20 07:53:58 -04:00
parent c1b615de32
commit e693fe3caa
36 changed files with 4542 additions and 188 deletions

View File

@@ -5,12 +5,14 @@
set -e # Exit on any error
# Configuration
# Configuration - Using WSB's keys
# SERVER_URL="http://localhost:9001"
SERVER_URL="https://localhost:9443"
UPLOAD_ENDPOINT="${SERVER_URL}/upload"
TEST_FILE="test_blob_$(date +%s).txt"
CLEANUP_FILES=()
NOSTR_PRIVKEY="22cc83aa57928a2800234c939240c9a6f0f44a33ea3838a860ed38930b195afd"
NOSTR_PUBKEY="8ff74724ed641b3c28e5a86d7c5cbc49c37638ace8c6c38935860e7a5eedde0e"
# Colors for output
RED='\033[0;31m'
@@ -128,22 +130,23 @@ calculate_hash() {
# Generate nostr event
generate_nostr_event() {
log_info "Generating kind 24242 nostr event with nak..."
log_info "Generating kind 24242 nostr event with nak using Alice's private key..."
# Calculate expiration time (1 hour from now)
EXPIRATION=$(date -d '+1 hour' +%s)
# Generate the event using nak
# Generate the event using nak with Alice's private key
EVENT_JSON=$(nak event -k 24242 -c "" \
--sec "$NOSTR_PRIVKEY" \
-t "t=upload" \
-t "x=${HASH}" \
-t "expiration=${EXPIRATION}")
if [[ -z "$EVENT_JSON" ]]; then
log_error "Failed to generate nostr event"
exit 1
fi
log_success "Generated nostr event"
echo "Event JSON: $EVENT_JSON"
}