Skip to content

Commit

Permalink
Use OWNER_PUBKEY to build the WoT network
Browse files Browse the repository at this point in the history
  • Loading branch information
dtonon committed Sep 19, 2024
1 parent 7f35c80 commit 69aca47
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 5 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ import (
)

var (
version string
version string
)

type Config struct {
OwnerPubkey string
RelayName string
RelayPubkey string
RelayDescription string
Expand Down Expand Up @@ -86,6 +87,7 @@ func main() {
relay.Info.Version = version

appendPubkey(config.RelayPubkey)
appendPubkey(config.OwnerPubkey)

db := getDB()
if err := db.Init(); err != nil {
Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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},
}}

Expand Down

0 comments on commit 69aca47

Please sign in to comment.