Fix relay variable name and add bootstrap relays

This commit is contained in:
Fishcake
2023-04-24 17:08:19 +09:00
parent a268ded17a
commit 52ebe4d86a
4 changed files with 16 additions and 6 deletions
+1 -1
View File
@@ -11,4 +11,4 @@ NIP05=true
GET_NOSTR_PROFILE=false
LND_PRIVATE_ONLY=false
DB_DIR="./"
OUR_RELAYS="wss://nostr.mutinywallet.com,wss://blastr.f7z.xyz,wss://relay.damus.io/,wss://relay.utxo.one,wss://relay.nostr.ch,wss://eden.nostr.land,wss://nostr.btcmp.com,wss://nostr.relayer.se,wss://relay.current.fyi,wss://nos.lol,wss://nostr.mom,wss://relay.nostr.info,wss://nostr.zebedee.cloud,wss://nostr-pub.wellorder.net,wss://relay.snort.social/,wss://nostr.oxtr.dev/,wss://nostr.fmt.wiz.biz/,wss://brb.io"
RELAYS="wss://nostr.mutinywallet.com,wss://relay.nostrgraph.net,wss://blastr.f7z.xyz,wss://relay.damus.io/,wss://relay.utxo.one,wss://relay.nostr.ch,wss://eden.nostr.land,wss://nostr.btcmp.com,wss://nostr.relayer.se,wss://relay.current.fyi,wss://nos.lol,wss://nostr.mom,wss://relay.nostr.info,wss://nostr.zebedee.cloud,wss://nostr-pub.wellorder.net,wss://relay.snort.social/,wss://nostr.oxtr.dev/,wss://nostr.fmt.wiz.biz/,wss://brb.io"
+1 -1
View File
@@ -25,7 +25,7 @@ New parameters in this fork:
> (`DB_DIR`) Specify directory to create or access database
> (`OUR_RELAYS`) Specify comma separate list of relays to push zap notes to, in addition to the zapped user relays.
> (`RELAYS`) Specify comma separate list of relays to push zap notes to, in addition to the zapped user relays.
+13 -3
View File
@@ -26,7 +26,7 @@ type Settings struct {
Port string `envconfig:"PORT" required:"true"`
Domain string `envconfig:"DOMAIN" required:"true"`
DBDirectory string `envconfig:"DB_DIR" required:"false" default:""`
OURRelayes string `envconfig:"OUR_RELAYS" required:"false" default:""`
Relayes string `envconfig:"RELAYS" required:"false" default:""`
// GlobalUsers means that user@ part is globally unique across all domains
// WARNING: if you toggle this existing users won't work anymore for safety reasons!
GlobalUsers bool `envconfig:"GLOBAL_USERS" default:"false"`
@@ -53,7 +53,7 @@ var (
)
// array of additional relays
var ourRelays []string
var Relays []string
//go:embed index.html
var indexHTML string
@@ -73,7 +73,17 @@ func main() {
}
// parse our relays
ourRelays = strings.Split(s.OURRelayes, ",")
Relays = strings.Split(s.Relayes, ",")
// Check if relays are not specified and add our bootstrap relays
if len(Relays) == 1 && Relays[0] == "" {
Relays = []string{
"wss://relay.damus.io", // Main Damus Relay
"wss://nostr.mutinywallet.com", // Special broadcast relay
"wss://relay.nostrgraph.net", // Special broadcast relay
"wss://nos.lol", // Large relay
"wss://relay.snort.social", // Large relay for snort Users
}
}
// increase default makeinvoice client timeout because people are using tor
makeinvoice.Client = &http.Client{Timeout: 25 * time.Second}
+1 -1
View File
@@ -197,7 +197,7 @@ func GetNostrProfileMetaData(npub string) (nostr.ProfileMetadata, error) {
func publishNostrEvent(ev nostr.Event, relays []string) {
// more relays
relays = append(relays, ourRelays...)
relays = append(relays, Relays...)
// remove trailing /
relays = cleanUrls(relays)
// unique relays