mirror of
https://github.com/bitvora/wot-relay.git
synced 2025-06-06 18:31:05 +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_PUBKEY="e2ccf7cf20403f3f2a4a55b328f0de3be38558a7d5f33632fdaaefc726c1c8eb" # not your npub!
|
||||||
RELAY_DESCRIPTION="Only notes in utxo WoT"
|
RELAY_DESCRIPTION="Only notes in utxo WoT"
|
||||||
RELAY_URL="wss://wot.utxo.one"
|
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
|
# where we should store the database
|
||||||
DB_PATH="db"
|
DB_PATH="db"
|
||||||
|
@ -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:
|
Run the following command to build the relay:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go build
|
go build -ldflags "-X main.version=$(git describe --tags --always)"
|
||||||
```
|
```
|
||||||
|
|
||||||
### 5. Create a Systemd Service (optional)
|
### 5. Create a Systemd Service (optional)
|
||||||
|
13
main.go
13
main.go
@ -18,6 +18,10 @@ import (
|
|||||||
"github.com/nbd-wtf/go-nostr"
|
"github.com/nbd-wtf/go-nostr"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
version string
|
||||||
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
RelayName string
|
RelayName string
|
||||||
RelayPubkey string
|
RelayPubkey string
|
||||||
@ -29,6 +33,8 @@ type Config struct {
|
|||||||
RefreshInterval int
|
RefreshInterval int
|
||||||
MinimumFollowers int
|
MinimumFollowers int
|
||||||
ArchivalSync bool
|
ArchivalSync bool
|
||||||
|
RelayContact string
|
||||||
|
RelayIcon string
|
||||||
}
|
}
|
||||||
|
|
||||||
var pool *nostr.SimplePool
|
var pool *nostr.SimplePool
|
||||||
@ -73,7 +79,12 @@ func main() {
|
|||||||
|
|
||||||
relay.Info.Name = config.RelayName
|
relay.Info.Name = config.RelayName
|
||||||
relay.Info.PubKey = config.RelayPubkey
|
relay.Info.PubKey = config.RelayPubkey
|
||||||
|
relay.Info.Icon = config.RelayIcon
|
||||||
|
relay.Info.Contact = config.RelayContact
|
||||||
relay.Info.Description = config.RelayDescription
|
relay.Info.Description = config.RelayDescription
|
||||||
|
relay.Info.Software = "WoT Relay"
|
||||||
|
relay.Info.Version = version
|
||||||
|
|
||||||
appendPubkey(config.RelayPubkey)
|
appendPubkey(config.RelayPubkey)
|
||||||
|
|
||||||
db := getDB()
|
db := getDB()
|
||||||
@ -183,6 +194,8 @@ func LoadConfig() Config {
|
|||||||
RelayName: getEnv("RELAY_NAME"),
|
RelayName: getEnv("RELAY_NAME"),
|
||||||
RelayPubkey: getEnv("RELAY_PUBKEY"),
|
RelayPubkey: getEnv("RELAY_PUBKEY"),
|
||||||
RelayDescription: getEnv("RELAY_DESCRIPTION"),
|
RelayDescription: getEnv("RELAY_DESCRIPTION"),
|
||||||
|
RelayContact: getEnv("RELAY_CONTACT"),
|
||||||
|
RelayIcon: getEnv("RELAY_ICON"),
|
||||||
DBPath: getEnv("DB_PATH"),
|
DBPath: getEnv("DB_PATH"),
|
||||||
RelayURL: getEnv("RELAY_URL"),
|
RelayURL: getEnv("RELAY_URL"),
|
||||||
IndexPath: getEnv("INDEX_PATH"),
|
IndexPath: getEnv("INDEX_PATH"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user