mirror of
https://github.com/aljazceru/nostrdvm.git
synced 2025-12-20 15:34:26 +01:00
use database directly
This commit is contained in:
@@ -24,7 +24,22 @@ class Bot:
|
|||||||
job_list: list
|
job_list: list
|
||||||
|
|
||||||
# This is a simple list just to keep track which events we created and manage, so we don't pay for other requests
|
# This is a simple list just to keep track which events we created and manage, so we don't pay for other requests
|
||||||
async def init_bot(self, dvm_config, admin_config=None):
|
|
||||||
|
def __init__(self, dvm_config, admin_config=None):
|
||||||
|
asyncio.run(self.run_bot(dvm_config, admin_config))
|
||||||
|
|
||||||
|
|
||||||
|
# add_sql_table_column(dvm_config.DB)
|
||||||
|
async def run_bot(self, dvm_config, admin_config):
|
||||||
|
self.NAME = "Bot"
|
||||||
|
dvm_config.DB = "db/" + self.NAME + ".db"
|
||||||
|
self.dvm_config = dvm_config
|
||||||
|
nip89config = NIP89Config()
|
||||||
|
nip89config.NAME = self.NAME
|
||||||
|
self.dvm_config.NIP89 = nip89config
|
||||||
|
self.admin_config = admin_config
|
||||||
|
self.keys = Keys.parse(dvm_config.PRIVATE_KEY)
|
||||||
|
|
||||||
wait_for_send = True
|
wait_for_send = True
|
||||||
skip_disconnected_relays = True
|
skip_disconnected_relays = True
|
||||||
opts = (Options().wait_for_send(wait_for_send).send_timeout(timedelta(seconds=self.dvm_config.RELAY_TIMEOUT))
|
opts = (Options().wait_for_send(wait_for_send).send_timeout(timedelta(seconds=self.dvm_config.RELAY_TIMEOUT))
|
||||||
@@ -59,22 +74,7 @@ class Bot:
|
|||||||
create_sql_table(self.dvm_config.DB)
|
create_sql_table(self.dvm_config.DB)
|
||||||
await admin_make_database_updates(adminconfig=self.admin_config, dvmconfig=self.dvm_config, client=self.client)
|
await admin_make_database_updates(adminconfig=self.admin_config, dvmconfig=self.dvm_config, client=self.client)
|
||||||
|
|
||||||
def __init__(self, dvm_config, admin_config=None):
|
|
||||||
self.NAME = "Bot"
|
|
||||||
dvm_config.DB = "db/" + self.NAME + ".db"
|
|
||||||
self.dvm_config = dvm_config
|
|
||||||
nip89config = NIP89Config()
|
|
||||||
nip89config.NAME = self.NAME
|
|
||||||
self.dvm_config.NIP89 = nip89config
|
|
||||||
self.admin_config = admin_config
|
|
||||||
self.keys = Keys.parse(dvm_config.PRIVATE_KEY)
|
|
||||||
|
|
||||||
asyncio.run(self.init_bot(dvm_config, admin_config))
|
|
||||||
asyncio.run(self.run_bot(dvm_config))
|
|
||||||
|
|
||||||
|
|
||||||
# add_sql_table_column(dvm_config.DB)
|
|
||||||
async def run_bot(self, dvm_config):
|
|
||||||
class NotificationHandler(HandleNotification):
|
class NotificationHandler(HandleNotification):
|
||||||
client = self.client
|
client = self.client
|
||||||
dvm_config = self.dvm_config
|
dvm_config = self.dvm_config
|
||||||
|
|||||||
@@ -35,7 +35,13 @@ class DVM:
|
|||||||
job_list: list
|
job_list: list
|
||||||
jobs_on_hold_list: list
|
jobs_on_hold_list: list
|
||||||
|
|
||||||
async def init_dvm(self, dvm_config, admin_config=None):
|
def __init__(self, dvm_config, admin_config=None):
|
||||||
|
asyncio.run(self.run_dvm(dvm_config, admin_config))
|
||||||
|
|
||||||
|
async def run_dvm(self, dvm_config, admin_config):
|
||||||
|
self.dvm_config = dvm_config
|
||||||
|
self.admin_config = admin_config
|
||||||
|
self.keys = Keys.parse(dvm_config.PRIVATE_KEY)
|
||||||
wait_for_send = False
|
wait_for_send = False
|
||||||
skip_disconnected_relays = True
|
skip_disconnected_relays = True
|
||||||
relaylimits = RelayLimits.disable()
|
relaylimits = RelayLimits.disable()
|
||||||
@@ -67,15 +73,7 @@ class DVM:
|
|||||||
await admin_make_database_updates(adminconfig=self.admin_config, dvmconfig=self.dvm_config, client=self.client)
|
await admin_make_database_updates(adminconfig=self.admin_config, dvmconfig=self.dvm_config, client=self.client)
|
||||||
await self.client.subscribe([dvm_filter, zap_filter], None)
|
await self.client.subscribe([dvm_filter, zap_filter], None)
|
||||||
|
|
||||||
def __init__(self, dvm_config, admin_config=None):
|
|
||||||
self.dvm_config = dvm_config
|
|
||||||
self.admin_config = admin_config
|
|
||||||
self.keys = Keys.parse(dvm_config.PRIVATE_KEY)
|
|
||||||
|
|
||||||
asyncio.run(self.init_dvm(dvm_config, admin_config))
|
|
||||||
asyncio.run(self.run_dvm(dvm_config))
|
|
||||||
|
|
||||||
async def run_dvm(self, dvm_config):
|
|
||||||
class NotificationHandler(HandleNotification):
|
class NotificationHandler(HandleNotification):
|
||||||
client = self.client
|
client = self.client
|
||||||
dvm_config = self.dvm_config
|
dvm_config = self.dvm_config
|
||||||
|
|||||||
@@ -25,7 +25,21 @@ from nostr_dvm.utils.zap_utils import create_bolt11_lud16, zaprequest
|
|||||||
class Subscription:
|
class Subscription:
|
||||||
job_list: list
|
job_list: list
|
||||||
|
|
||||||
async def init_subscription(self, dvm_config, admin_config=None):
|
# This is a simple list just to keep track which events we created and manage, so we don't pay for other requests
|
||||||
|
def __init__(self, dvm_config, admin_config=None):
|
||||||
|
asyncio.run(self.run_subscription(dvm_config, admin_config))
|
||||||
|
|
||||||
|
async def run_subscription(self, dvm_config, admin_config):
|
||||||
|
|
||||||
|
self.NAME = "Subscription Handler"
|
||||||
|
dvm_config.DB = "db/" + "subscriptions" + ".db"
|
||||||
|
self.dvm_config = dvm_config
|
||||||
|
nip89config = NIP89Config()
|
||||||
|
nip89config.NAME = self.NAME
|
||||||
|
self.dvm_config.NIP89 = nip89config
|
||||||
|
self.admin_config = admin_config
|
||||||
|
self.keys = Keys.parse(dvm_config.PRIVATE_KEY)
|
||||||
|
|
||||||
wait_for_send = False
|
wait_for_send = False
|
||||||
skip_disconnected_relays = True
|
skip_disconnected_relays = True
|
||||||
opts = (Options().wait_for_send(wait_for_send).send_timeout(timedelta(seconds=self.dvm_config.RELAY_TIMEOUT))
|
opts = (Options().wait_for_send(wait_for_send).send_timeout(timedelta(seconds=self.dvm_config.RELAY_TIMEOUT))
|
||||||
@@ -64,23 +78,6 @@ class Subscription:
|
|||||||
await self.client.subscribe([zap_filter, dvm_filter, cancel_subscription_filter], None)
|
await self.client.subscribe([zap_filter, dvm_filter, cancel_subscription_filter], None)
|
||||||
|
|
||||||
create_subscription_sql_table(dvm_config.DB)
|
create_subscription_sql_table(dvm_config.DB)
|
||||||
|
|
||||||
# This is a simple list just to keep track which events we created and manage, so we don't pay for other requests
|
|
||||||
def __init__(self, dvm_config, admin_config=None):
|
|
||||||
self.NAME = "Subscription Handler"
|
|
||||||
dvm_config.DB = "db/" + "subscriptions" + ".db"
|
|
||||||
self.dvm_config = dvm_config
|
|
||||||
nip89config = NIP89Config()
|
|
||||||
nip89config.NAME = self.NAME
|
|
||||||
self.dvm_config.NIP89 = nip89config
|
|
||||||
self.admin_config = admin_config
|
|
||||||
self.keys = Keys.parse(dvm_config.PRIVATE_KEY)
|
|
||||||
|
|
||||||
asyncio.run(self.init_subscription(dvm_config, admin_config))
|
|
||||||
asyncio.run(self.run_subscription(dvm_config))
|
|
||||||
|
|
||||||
async def run_subscription(self, dvm_config):
|
|
||||||
|
|
||||||
class NotificationHandler(HandleNotification):
|
class NotificationHandler(HandleNotification):
|
||||||
client = self.client
|
client = self.client
|
||||||
dvm_config = self.dvm_config
|
dvm_config = self.dvm_config
|
||||||
|
|||||||
@@ -109,14 +109,14 @@ class DicoverContentCurrentlyPopular(DVMTaskInterface):
|
|||||||
|
|
||||||
options = self.set_options(request_form)
|
options = self.set_options(request_form)
|
||||||
|
|
||||||
opts = (Options().wait_for_send(False).send_timeout(timedelta(seconds=self.dvm_config.RELAY_TIMEOUT)))
|
#opts = (Options().wait_for_send(False).send_timeout(timedelta(seconds=self.dvm_config.RELAY_TIMEOUT)))
|
||||||
sk = SecretKey.from_hex(self.dvm_config.PRIVATE_KEY)
|
#sk = SecretKey.from_hex(self.dvm_config.PRIVATE_KEY)
|
||||||
keys = Keys.parse(sk.to_hex())
|
#keys = Keys.parse(sk.to_hex())
|
||||||
signer = NostrSigner.keys(keys)
|
#signer = NostrSigner.keys(keys)
|
||||||
|
|
||||||
database = await NostrDatabase.sqlite(self.db_name)
|
database = await NostrDatabase.sqlite(self.db_name)
|
||||||
cli = ClientBuilder().database(database).signer(signer).opts(opts).build()
|
#cli = ClientBuilder().database(database).signer(signer).opts(opts).build()
|
||||||
await cli.connect()
|
#await cli.connect()
|
||||||
|
|
||||||
# Negentropy reconciliation
|
# Negentropy reconciliation
|
||||||
# Query events from database
|
# Query events from database
|
||||||
@@ -124,7 +124,7 @@ class DicoverContentCurrentlyPopular(DVMTaskInterface):
|
|||||||
since = Timestamp.from_secs(timestamp_hour_ago)
|
since = Timestamp.from_secs(timestamp_hour_ago)
|
||||||
|
|
||||||
filter1 = Filter().kind(definitions.EventDefinitions.KIND_NOTE).since(since)
|
filter1 = Filter().kind(definitions.EventDefinitions.KIND_NOTE).since(since)
|
||||||
events = await cli.database().query([filter1])
|
events = await database.query([filter1])
|
||||||
print("[" + self.dvm_config.NIP89.NAME + "] Considering " + str(len(events)) + " Events")
|
print("[" + self.dvm_config.NIP89.NAME + "] Considering " + str(len(events)) + " Events")
|
||||||
ns.finallist = {}
|
ns.finallist = {}
|
||||||
for event in events:
|
for event in events:
|
||||||
@@ -132,11 +132,11 @@ class DicoverContentCurrentlyPopular(DVMTaskInterface):
|
|||||||
filt = Filter().kinds([definitions.EventDefinitions.KIND_ZAP, definitions.EventDefinitions.KIND_REPOST,
|
filt = Filter().kinds([definitions.EventDefinitions.KIND_ZAP, definitions.EventDefinitions.KIND_REPOST,
|
||||||
definitions.EventDefinitions.KIND_REACTION,
|
definitions.EventDefinitions.KIND_REACTION,
|
||||||
definitions.EventDefinitions.KIND_NOTE]).event(event.id()).since(since)
|
definitions.EventDefinitions.KIND_NOTE]).event(event.id()).since(since)
|
||||||
reactions = await cli.database().query([filt])
|
reactions = await database.query([filt])
|
||||||
if len(reactions) >= self.min_reactions:
|
if len(reactions) >= self.min_reactions:
|
||||||
ns.finallist[event.id().to_hex()] = len(reactions)
|
ns.finallist[event.id().to_hex()] = len(reactions)
|
||||||
if len(ns.finallist) == 0:
|
if len(ns.finallist) == 0:
|
||||||
await cli.shutdown()
|
#await cli.shutdown()
|
||||||
return self.result
|
return self.result
|
||||||
|
|
||||||
result_list = []
|
result_list = []
|
||||||
@@ -145,7 +145,7 @@ class DicoverContentCurrentlyPopular(DVMTaskInterface):
|
|||||||
# print(EventId.parse(entry[0]).to_bech32() + "/" + EventId.parse(entry[0]).to_hex() + ": " + str(entry[1]))
|
# print(EventId.parse(entry[0]).to_bech32() + "/" + EventId.parse(entry[0]).to_hex() + ": " + str(entry[1]))
|
||||||
e_tag = Tag.parse(["e", entry[0]])
|
e_tag = Tag.parse(["e", entry[0]])
|
||||||
result_list.append(e_tag.as_vec())
|
result_list.append(e_tag.as_vec())
|
||||||
await cli.shutdown()
|
#await cli.shutdown()
|
||||||
print("[" + self.dvm_config.NIP89.NAME + "] Filtered " + str(
|
print("[" + self.dvm_config.NIP89.NAME + "] Filtered " + str(
|
||||||
len(result_list)) + " fitting events.")
|
len(result_list)) + " fitting events.")
|
||||||
return json.dumps(result_list)
|
return json.dumps(result_list)
|
||||||
|
|||||||
@@ -110,15 +110,15 @@ class DicoverContentCurrentlyPopularZaps(DVMTaskInterface):
|
|||||||
|
|
||||||
options = self.set_options(request_form)
|
options = self.set_options(request_form)
|
||||||
|
|
||||||
opts = (Options().wait_for_send(False).send_timeout(timedelta(seconds=self.dvm_config.RELAY_TIMEOUT)))
|
#opts = (Options().wait_for_send(False).send_timeout(timedelta(seconds=self.dvm_config.RELAY_TIMEOUT)))
|
||||||
sk = SecretKey.from_hex(self.dvm_config.PRIVATE_KEY)
|
#sk = SecretKey.from_hex(self.dvm_config.PRIVATE_KEY)
|
||||||
keys = Keys.parse(sk.to_hex())
|
#keys = Keys.parse(sk.to_hex())
|
||||||
signer = NostrSigner.keys(keys)
|
#signer = NostrSigner.keys(keys)
|
||||||
|
|
||||||
database = await NostrDatabase.sqlite(self.db_name)
|
database = await NostrDatabase.sqlite(self.db_name)
|
||||||
cli = ClientBuilder().database(database).signer(signer).opts(opts).build()
|
#cli = ClientBuilder().database(database).signer(signer).opts(opts).build()
|
||||||
|
|
||||||
await cli.connect()
|
#await cli.connect()
|
||||||
|
|
||||||
# Negentropy reconciliation
|
# Negentropy reconciliation
|
||||||
# Query events from database
|
# Query events from database
|
||||||
@@ -126,14 +126,14 @@ class DicoverContentCurrentlyPopularZaps(DVMTaskInterface):
|
|||||||
since = Timestamp.from_secs(timestamp_hour_ago)
|
since = Timestamp.from_secs(timestamp_hour_ago)
|
||||||
|
|
||||||
filter1 = Filter().kind(definitions.EventDefinitions.KIND_NOTE).since(since)
|
filter1 = Filter().kind(definitions.EventDefinitions.KIND_NOTE).since(since)
|
||||||
events = await cli.database().query([filter1])
|
events = await database.query([filter1])
|
||||||
print("[" + self.dvm_config.NIP89.NAME + "] Considering " + str(len(events)) + " Events")
|
print("[" + self.dvm_config.NIP89.NAME + "] Considering " + str(len(events)) + " Events")
|
||||||
|
|
||||||
ns.finallist = {}
|
ns.finallist = {}
|
||||||
for event in events:
|
for event in events:
|
||||||
if event.created_at().as_secs() > timestamp_hour_ago:
|
if event.created_at().as_secs() > timestamp_hour_ago:
|
||||||
filt = Filter().kinds([definitions.EventDefinitions.KIND_ZAP]).event(event.id()).since(since)
|
filt = Filter().kinds([definitions.EventDefinitions.KIND_ZAP]).event(event.id()).since(since)
|
||||||
reactions = await cli.database().query([filt])
|
reactions = await database.query([filt])
|
||||||
invoice_amount = 0
|
invoice_amount = 0
|
||||||
haspreimage = False
|
haspreimage = False
|
||||||
if len(reactions) >= self.min_reactions:
|
if len(reactions) >= self.min_reactions:
|
||||||
@@ -162,8 +162,7 @@ class DicoverContentCurrentlyPopularZaps(DVMTaskInterface):
|
|||||||
print("[" + self.dvm_config.NIP89.NAME + "] Filtered " + str(
|
print("[" + self.dvm_config.NIP89.NAME + "] Filtered " + str(
|
||||||
len(result_list)) + " fitting events.")
|
len(result_list)) + " fitting events.")
|
||||||
|
|
||||||
await cli.disconnect()
|
#await cli.shutdown()
|
||||||
await cli.shutdown()
|
|
||||||
|
|
||||||
return json.dumps(result_list)
|
return json.dumps(result_list)
|
||||||
|
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ class DicoverContentCurrentlyPopularFollowers(DVMTaskInterface):
|
|||||||
# print(EventId.parse(entry[0]).to_bech32() + "/" + EventId.parse(entry[0]).to_hex() + ": " + str(entry[1]))
|
# print(EventId.parse(entry[0]).to_bech32() + "/" + EventId.parse(entry[0]).to_hex() + ": " + str(entry[1]))
|
||||||
e_tag = Tag.parse(["e", entry[0]])
|
e_tag = Tag.parse(["e", entry[0]])
|
||||||
result_list.append(e_tag.as_vec())
|
result_list.append(e_tag.as_vec())
|
||||||
await cli.connect()
|
#await cli.connect()
|
||||||
await cli.shutdown()
|
await cli.shutdown()
|
||||||
print("[" + self.dvm_config.NIP89.NAME + "] Filtered " + str(
|
print("[" + self.dvm_config.NIP89.NAME + "] Filtered " + str(
|
||||||
len(result_list)) + " fitting events.")
|
len(result_list)) + " fitting events.")
|
||||||
|
|||||||
@@ -131,15 +131,15 @@ class DicoverContentCurrentlyPopularbyTopic(DVMTaskInterface):
|
|||||||
|
|
||||||
options = self.set_options(request_form)
|
options = self.set_options(request_form)
|
||||||
|
|
||||||
opts = (Options().wait_for_send(False).send_timeout(timedelta(seconds=self.dvm_config.RELAY_TIMEOUT)))
|
#opts = (Options().wait_for_send(False).send_timeout(timedelta(seconds=self.dvm_config.RELAY_TIMEOUT)))
|
||||||
sk = SecretKey.from_hex(self.dvm_config.PRIVATE_KEY)
|
#sk = SecretKey.from_hex(self.dvm_config.PRIVATE_KEY)
|
||||||
keys = Keys.parse(sk.to_hex())
|
#keys = Keys.parse(sk.to_hex())
|
||||||
signer = NostrSigner.keys(keys)
|
#signer = NostrSigner.keys(keys)
|
||||||
|
|
||||||
database = await NostrDatabase.sqlite(self.db_name)
|
database = await NostrDatabase.sqlite(self.db_name)
|
||||||
cli = ClientBuilder().database(database).signer(signer).opts(opts).build()
|
#cli = ClientBuilder().database(database).signer(signer).opts(opts).build()
|
||||||
|
|
||||||
await cli.connect()
|
#await cli.connect()
|
||||||
|
|
||||||
# Negentropy reconciliation
|
# Negentropy reconciliation
|
||||||
# Query events from database
|
# Query events from database
|
||||||
@@ -148,7 +148,7 @@ class DicoverContentCurrentlyPopularbyTopic(DVMTaskInterface):
|
|||||||
|
|
||||||
filter1 = Filter().kind(definitions.EventDefinitions.KIND_NOTE).since(since)
|
filter1 = Filter().kind(definitions.EventDefinitions.KIND_NOTE).since(since)
|
||||||
|
|
||||||
events = await cli.database().query([filter1])
|
events = await database.query([filter1])
|
||||||
print("[" + self.dvm_config.NIP89.NAME + "] Considering " + str(len(events)) + " Events")
|
print("[" + self.dvm_config.NIP89.NAME + "] Considering " + str(len(events)) + " Events")
|
||||||
ns.finallist = {}
|
ns.finallist = {}
|
||||||
|
|
||||||
@@ -161,7 +161,7 @@ class DicoverContentCurrentlyPopularbyTopic(DVMTaskInterface):
|
|||||||
[definitions.EventDefinitions.KIND_ZAP, definitions.EventDefinitions.KIND_REACTION,
|
[definitions.EventDefinitions.KIND_ZAP, definitions.EventDefinitions.KIND_REACTION,
|
||||||
definitions.EventDefinitions.KIND_REPOST,
|
definitions.EventDefinitions.KIND_REPOST,
|
||||||
definitions.EventDefinitions.KIND_NOTE]).event(event.id()).since(since)
|
definitions.EventDefinitions.KIND_NOTE]).event(event.id()).since(since)
|
||||||
reactions = await cli.database().query([filt])
|
reactions = await database.query([filt])
|
||||||
if len(reactions) >= self.min_reactions:
|
if len(reactions) >= self.min_reactions:
|
||||||
ns.finallist[event.id().to_hex()] = len(reactions)
|
ns.finallist[event.id().to_hex()] = len(reactions)
|
||||||
|
|
||||||
@@ -174,7 +174,7 @@ class DicoverContentCurrentlyPopularbyTopic(DVMTaskInterface):
|
|||||||
|
|
||||||
print("[" + self.dvm_config.NIP89.NAME + "] Filtered " + str(
|
print("[" + self.dvm_config.NIP89.NAME + "] Filtered " + str(
|
||||||
len(result_list)) + " fitting events.")
|
len(result_list)) + " fitting events.")
|
||||||
await cli.shutdown()
|
#await cli.shutdown()
|
||||||
return json.dumps(result_list)
|
return json.dumps(result_list)
|
||||||
|
|
||||||
async def schedule(self, dvm_config):
|
async def schedule(self, dvm_config):
|
||||||
|
|||||||
@@ -31,7 +31,10 @@ class DVMConfig:
|
|||||||
"wss://nostr-pub.semisol.dev", "wss://mostr.pub", "wss://minds.com",
|
"wss://nostr-pub.semisol.dev", "wss://mostr.pub", "wss://minds.com",
|
||||||
"wss://yabu.me", "wss://relay.yozora.world", "wss://filter.nostr.wine/?global=all", "wss://eden.nostr.land",
|
"wss://yabu.me", "wss://relay.yozora.world", "wss://filter.nostr.wine/?global=all", "wss://eden.nostr.land",
|
||||||
"wss://relay.orangepill.ovh", "wss://nostr.jcloud.es", "wss://af.purplerelay.com", "wss://za.purplerelay.com",
|
"wss://relay.orangepill.ovh", "wss://nostr.jcloud.es", "wss://af.purplerelay.com", "wss://za.purplerelay.com",
|
||||||
"wss://relay.nostrich.land", "wss://relay.nostrplebs.com" "wss://relay.nostrich.land",
|
"wss://relay.nostrich.land", "wss://relay.nostrplebs.com", "wss://relay.nostrich.land",
|
||||||
|
"wss://rss.nos.social", "wss://atlas.nostr.land", "wss://puravida.nostr.land", "wss://nostr.inosta.cc",
|
||||||
|
"wss://relay.orangepill.dev", "wss://no.str.cr", "wss://nostr.milou.lol", "wss://relay.nostr.com.au",
|
||||||
|
"wss://puravida.nostr.land", "wss://atlas.nostr.land", "wss://nostr-pub.wellorder.net", "wss://eelay.current.fyi",
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -178,11 +178,10 @@ async def send_event_outbox(event: Event, client, dvm_config) -> EventId:
|
|||||||
keys = Keys.parse(sk.to_hex())
|
keys = Keys.parse(sk.to_hex())
|
||||||
signer = NostrSigner.keys(keys)
|
signer = NostrSigner.keys(keys)
|
||||||
outboxclient = Client.with_opts(signer, opts)
|
outboxclient = Client.with_opts(signer, opts)
|
||||||
|
|
||||||
print("[" + dvm_config.NIP89.NAME + "] Receiver Inbox relays: " + str(relays))
|
print("[" + dvm_config.NIP89.NAME + "] Receiver Inbox relays: " + str(relays))
|
||||||
|
|
||||||
for relay in relays:
|
for relay in relays:
|
||||||
opts = RelayOptions().ping(False)
|
opts = RelayOptions().ping(True)
|
||||||
try:
|
try:
|
||||||
await outboxclient.add_relay_with_opts(relay, opts)
|
await outboxclient.add_relay_with_opts(relay, opts)
|
||||||
except:
|
except:
|
||||||
|
|||||||
@@ -29,23 +29,25 @@ global_update_rate = 120 # set this high on first sync so db can fully sync
|
|||||||
use_logger = True
|
use_logger = True
|
||||||
|
|
||||||
AVOID_PAID_OUTBOX_RELAY_LIST = ["wss://nostrelay.yeghro.site", "wss://nostr.wine", "wss://filter.nostr.wine"
|
AVOID_PAID_OUTBOX_RELAY_LIST = ["wss://nostrelay.yeghro.site", "wss://nostr.wine", "wss://filter.nostr.wine"
|
||||||
"wss://nostr21.com",
|
"wss://nostr21.com", "wss://nostr.bitcoiner.social", "wss://nostr.orangepill.dev",
|
||||||
"wss://nostr.bitcoiner.social", "wss://nostr.orangepill.dev",
|
"wss://relay.lnpay.me", "wss://relay.snort.social", "wss://relay.minds.com/nostr/v1/ws",
|
||||||
"wss://relay.lnpay.me", "wss://relay.snort.social", "wss://relay.minds.com/nostr/v1/ws",
|
"wss://nostr-pub.semisol.dev", "wss://mostr.pub", "wss://minds.com",
|
||||||
"wss://nostr-pub.semisol.dev", "wss://mostr.pub", "wss://minds.com",
|
"wss://yabu.me", "wss://relay.yozora.world", "wss://filter.nostr.wine/?global=all", "wss://eden.nostr.land",
|
||||||
"wss://yabu.me", "wss://relay.yozora.world", "wss://filter.nostr.wine/?global=all",
|
"wss://relay.orangepill.ovh", "wss://nostr.jcloud.es", "wss://af.purplerelay.com", "wss://za.purplerelay.com",
|
||||||
"wss://eden.nostr.land",
|
"wss://relay.nostrich.land", "wss://relay.nostrplebs.com", "wss://relay.nostrich.land",
|
||||||
"wss://relay.orangepill.ovh", "wss://nostr.jcloud.es", "wss://af.purplerelay.com",
|
"wss://rss.nos.social", "wss://atlas.nostr.land", "wss://puravida.nostr.land", "wss://nostr.inosta.cc",
|
||||||
"wss://za.purplerelay.com",
|
"wss://relay.orangepill.dev", "wss://no.str.cr", "wss://nostr.milou.lol", "wss://relay.nostr.com.au",
|
||||||
"wss://relay.nostrich.land", "wss://relay.nostrplebs.com" "wss://relay.nostrich.land",
|
"wss://puravida.nostr.land", "wss://atlas.nostr.land", "wss://nostr-pub.wellorder.net", "wss://eelay.current.fyi",
|
||||||
|
"wss://nostr.thesamecat.io", "wss://nostr.plebchain.org", "wss://relay.noswhere.com"
|
||||||
|
|
||||||
]
|
|
||||||
|
]
|
||||||
|
|
||||||
#git_hash = NostrLibrary().git_hash_version()
|
#git_hash = NostrLibrary().git_hash_version()
|
||||||
#print("GitHash " + git_hash)
|
#print("GitHash " + git_hash)
|
||||||
|
|
||||||
if use_logger:
|
if use_logger:
|
||||||
init_logger(LogLevel.INFO)
|
init_logger(LogLevel.DEBUG)
|
||||||
|
|
||||||
|
|
||||||
def build_db_scheduler(name, identifier, admin_config, options, image, description, update_rate=600, cost=0,
|
def build_db_scheduler(name, identifier, admin_config, options, image, description, update_rate=600, cost=0,
|
||||||
|
|||||||
Reference in New Issue
Block a user