mirror of
https://github.com/bitvora/wot-relay.git
synced 2025-06-06 01:12:02 +00:00
Merge pull request #51 from cr0bar/master
Change to support name and version number for NIP-11
This commit is contained in:
commit
7f35c801b8
@ -3,6 +3,8 @@ RELAY_NAME="utxo WoT relay"
|
||||
RELAY_PUBKEY="e2ccf7cf20403f3f2a4a55b328f0de3be38558a7d5f33632fdaaefc726c1c8eb" # not your npub!
|
||||
RELAY_DESCRIPTION="Only notes in utxo WoT"
|
||||
RELAY_URL="wss://wot.utxo.one"
|
||||
RELAY_ICON="https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg"
|
||||
RELAY_CONTACT="https://utxo.one"
|
||||
|
||||
# where we should store the database
|
||||
DB_PATH="db"
|
||||
@ -18,4 +20,4 @@ REFRESH_INTERVAL_HOURS=1
|
||||
MINIMUM_FOLLOWERS=5
|
||||
|
||||
# archive all notes from everyone in your WoT from other relays
|
||||
ARCHIVAL_SYNC="FALSE"
|
||||
ARCHIVAL_SYNC="FALSE"
|
||||
|
@ -61,7 +61,7 @@ ARCHIVAL_SYNC="FALSE" # set to TRUE to archive every note from every person in t
|
||||
Run the following command to build the relay:
|
||||
|
||||
```bash
|
||||
go build
|
||||
go build -ldflags "-X main.version=$(git describe --tags --always)"
|
||||
```
|
||||
|
||||
### 5. Create a Systemd Service (optional)
|
||||
|
13
main.go
13
main.go
@ -18,6 +18,10 @@ import (
|
||||
"github.com/nbd-wtf/go-nostr"
|
||||
)
|
||||
|
||||
var (
|
||||
version string
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
RelayName string
|
||||
RelayPubkey string
|
||||
@ -29,6 +33,8 @@ type Config struct {
|
||||
RefreshInterval int
|
||||
MinimumFollowers int
|
||||
ArchivalSync bool
|
||||
RelayContact string
|
||||
RelayIcon string
|
||||
}
|
||||
|
||||
var pool *nostr.SimplePool
|
||||
@ -73,7 +79,12 @@ func main() {
|
||||
|
||||
relay.Info.Name = config.RelayName
|
||||
relay.Info.PubKey = config.RelayPubkey
|
||||
relay.Info.Icon = config.RelayIcon
|
||||
relay.Info.Contact = config.RelayContact
|
||||
relay.Info.Description = config.RelayDescription
|
||||
relay.Info.Software = "WoT Relay"
|
||||
relay.Info.Version = version
|
||||
|
||||
appendPubkey(config.RelayPubkey)
|
||||
|
||||
db := getDB()
|
||||
@ -183,6 +194,8 @@ func LoadConfig() Config {
|
||||
RelayName: getEnv("RELAY_NAME"),
|
||||
RelayPubkey: getEnv("RELAY_PUBKEY"),
|
||||
RelayDescription: getEnv("RELAY_DESCRIPTION"),
|
||||
RelayContact: getEnv("RELAY_CONTACT"),
|
||||
RelayIcon: getEnv("RELAY_ICON"),
|
||||
DBPath: getEnv("DB_PATH"),
|
||||
RelayURL: getEnv("RELAY_URL"),
|
||||
IndexPath: getEnv("INDEX_PATH"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user