diff --git a/.env.example b/.env.example index 2638944..750c884 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,9 @@ -# Relay Metadata +# Owner pubkey, used to build the WoT network +OWNER_PUBKEY="e2ccf7cf20403f3f2a4a55b328f0de3be38558a7d5f33632fdaaefc726c1c8eb" # your pubkey, in hex format + +# Relay Metadata, used for NIP-11 info RELAY_NAME="utxo WoT relay" -RELAY_PUBKEY="e2ccf7cf20403f3f2a4a55b328f0de3be38558a7d5f33632fdaaefc726c1c8eb" # not your npub! +RELAY_PUBKEY="" # the relay pubkey, not your one! Can be left empty RELAY_DESCRIPTION="Only notes in utxo WoT" RELAY_URL="wss://wot.utxo.one" RELAY_ICON="https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg" diff --git a/README.md b/README.md index f983c79..dc01a8d 100644 --- a/README.md +++ b/README.md @@ -45,8 +45,9 @@ cp .env.example .env Open the `.env` file and set the necessary environment variables. Example variables include: ```bash +OWNER_PUBKEY="xxxxxxxxxxxxxxxxxxxxxxxxxxx...xxx" # your pubkey, in hex format RELAY_NAME="YourRelayName" -RELAY_PUBKEY="YourPublicKey" +RELAY_PUBKEY="YourPublicKey" # the relay pubkey, in hex format 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 diff --git a/main.go b/main.go index 4834636..f6c36b7 100644 --- a/main.go +++ b/main.go @@ -19,10 +19,11 @@ import ( ) var ( - version string + version string ) type Config struct { + OwnerPubkey string RelayName string RelayPubkey string RelayDescription string @@ -86,6 +87,7 @@ func main() { relay.Info.Version = version appendPubkey(config.RelayPubkey) + appendPubkey(config.OwnerPubkey) db := getDB() if err := db.Init(); err != nil { @@ -191,6 +193,7 @@ func LoadConfig() Config { minimumFollowers, _ := strconv.Atoi(os.Getenv("MINIMUM_FOLLOWERS")) config := Config{ + OwnerPubkey: getEnv("OWNER_PUBKEY"), RelayName: getEnv("RELAY_NAME"), RelayPubkey: getEnv("RELAY_PUBKEY"), RelayDescription: getEnv("RELAY_DESCRIPTION"), @@ -259,7 +262,7 @@ func refreshTrustNetwork(ctx context.Context, relay *khatru.Relay) { defer cancel() filters := []nostr.Filter{{ - Authors: []string{config.RelayPubkey}, + Authors: []string{config.OwnerPubkey}, Kinds: []int{nostr.KindContactList}, }}