Update discovery.py

This commit is contained in:
Believethehype
2024-11-14 12:51:38 +01:00
parent 398917522f
commit 4e03a774ba

View File

@@ -7,20 +7,19 @@ from pathlib import Path
import dotenv import dotenv
from nostr_sdk import init_logger, LogLevel, Keys, NostrDatabase from nostr_sdk import init_logger, LogLevel, Keys, NostrDatabase
# os.environ["RUST_BACKTRACE"] = "full"
from nostr_dvm.subscription import Subscription
from nostr_dvm.tasks.content_discovery_currently_latest_longform import DicoverContentLatestLongForm from nostr_dvm.tasks.content_discovery_currently_latest_longform import DicoverContentLatestLongForm
from nostr_dvm.tasks.content_discovery_currently_latest_wiki import DicoverContentLatestWiki from nostr_dvm.tasks.content_discovery_currently_latest_wiki import DicoverContentLatestWiki
from nostr_dvm.tasks.content_discovery_currently_popular_gallery import DicoverContentCurrentlyPopularGallery
from nostr_dvm.tasks.content_discovery_currently_popular_mostr import DicoverContentCurrentlyPopularMostr
from nostr_dvm.tasks.content_discovery_currently_popular_nonfollowers import DicoverContentCurrentlyPopularNonFollowers
from nostr_dvm.tasks.content_discovery_latest_one_per_follower import Discoverlatestperfollower
from nostr_dvm.tasks.content_discovery_update_db_only import DicoverContentDBUpdateScheduler
#os.environ["RUST_BACKTRACE"] = "full"
from nostr_dvm.subscription import Subscription
from nostr_dvm.tasks.content_discovery_currently_popular import DicoverContentCurrentlyPopular from nostr_dvm.tasks.content_discovery_currently_popular import DicoverContentCurrentlyPopular
from nostr_dvm.tasks.content_discovery_currently_popular_by_top_zaps import DicoverContentCurrentlyPopularZaps from nostr_dvm.tasks.content_discovery_currently_popular_by_top_zaps import DicoverContentCurrentlyPopularZaps
from nostr_dvm.tasks.content_discovery_currently_popular_followers import DicoverContentCurrentlyPopularFollowers from nostr_dvm.tasks.content_discovery_currently_popular_followers import DicoverContentCurrentlyPopularFollowers
from nostr_dvm.tasks.content_discovery_currently_popular_gallery import DicoverContentCurrentlyPopularGallery
from nostr_dvm.tasks.content_discovery_currently_popular_mostr import DicoverContentCurrentlyPopularMostr
from nostr_dvm.tasks.content_discovery_currently_popular_nonfollowers import DicoverContentCurrentlyPopularNonFollowers
from nostr_dvm.tasks.content_discovery_currently_popular_topic import DicoverContentCurrentlyPopularbyTopic from nostr_dvm.tasks.content_discovery_currently_popular_topic import DicoverContentCurrentlyPopularbyTopic
from nostr_dvm.tasks.content_discovery_latest_one_per_follower import Discoverlatestperfollower
from nostr_dvm.tasks.content_discovery_update_db_only import DicoverContentDBUpdateScheduler
from nostr_dvm.tasks.discovery_trending_notes_nostrband import TrendingNotesNostrBand from nostr_dvm.tasks.discovery_trending_notes_nostrband import TrendingNotesNostrBand
from nostr_dvm.utils.admin_utils import AdminConfig from nostr_dvm.utils.admin_utils import AdminConfig
from nostr_dvm.utils.dvmconfig import build_default_config, DVMConfig from nostr_dvm.utils.dvmconfig import build_default_config, DVMConfig
@@ -30,7 +29,6 @@ from nostr_dvm.utils.nostr_utils import check_and_set_private_key
from nostr_dvm.utils.outbox_utils import AVOID_OUTBOX_RELAY_LIST from nostr_dvm.utils.outbox_utils import AVOID_OUTBOX_RELAY_LIST
from nostr_dvm.utils.zap_utils import check_and_set_ln_bits_keys from nostr_dvm.utils.zap_utils import check_and_set_ln_bits_keys
rebroadcast_NIP89 = False # Announce NIP89 on startup Only do this if you know what you're doing. rebroadcast_NIP89 = False # Announce NIP89 on startup Only do this if you know what you're doing.
rebroadcast_NIP65_Relay_List = True rebroadcast_NIP65_Relay_List = True
update_profile = False update_profile = False
@@ -40,13 +38,12 @@ use_logger = True
log_level = LogLevel.ERROR log_level = LogLevel.ERROR
max_sync_duration_in_h = 48 max_sync_duration_in_h = 48
SYNC_DB_RELAY_LIST = ["wss://relay.damus.io",
SYNC_DB_RELAY_LIST = [ "wss://relay.damus.io", #"wss://relay.primal.net",
"wss://relay.primal.net",
"wss://nostr.oxtr.dev"] "wss://nostr.oxtr.dev"]
RELAY_LIST = ["wss://relay.primal.net", RELAY_LIST = ["wss://nostr.mom",
"wss://nostr.mom", #"wss://relay.primal.net",
"wss://nostr.oxtr.dev", "wss://nostr.oxtr.dev",
"wss://relay.nostr.net" "wss://relay.nostr.net"
] ]
@@ -144,7 +141,6 @@ def build_example_gallery(name, identifier, admin_config, options, image, cost=0
admin_config=admin_config, options=options) admin_config=admin_config, options=options)
def build_example_nostrband(name, identifier, admin_config, image, about, custom_processing_msg): def build_example_nostrband(name, identifier, admin_config, image, about, custom_processing_msg):
dvm_config: DVMConfig = build_default_config(identifier) dvm_config: DVMConfig = build_default_config(identifier)
dvm_config.USE_OWN_VENV = False dvm_config.USE_OWN_VENV = False
@@ -406,10 +402,9 @@ def build_example_popular_followers(name, identifier, admin_config, options, ima
options=options, options=options,
admin_config=admin_config) admin_config=admin_config)
def build_example_popular_non_followers(name, identifier, admin_config, options, image, cost=0, update_rate=300, def build_example_popular_non_followers(name, identifier, admin_config, options, image, cost=0, update_rate=300,
processing_msg=None, update_db=True, database=None): processing_msg=None, update_db=True, database=None):
dvm_config = build_default_config(identifier) dvm_config = build_default_config(identifier)
dvm_config.USE_OWN_VENV = False dvm_config.USE_OWN_VENV = False
dvm_config.SHOWLOG = True dvm_config.SHOWLOG = True
@@ -426,7 +421,7 @@ def build_example_popular_non_followers(name, identifier, admin_config, options,
dvm_config.SUBSCRIPTION_REQUIRED = False dvm_config.SUBSCRIPTION_REQUIRED = False
admin_config.LUD16 = dvm_config.LN_ADDRESS admin_config.LUD16 = dvm_config.LN_ADDRESS
admin_config.REBROADCAST_NIP88 = False admin_config.REBROADCAST_NIP88 = False
#admin_config.REBROADCAST_NIP89 = True # admin_config.REBROADCAST_NIP89 = True
admin_config.UPDATE_PROFILE = False admin_config.UPDATE_PROFILE = False
# Add NIP89 # Add NIP89
@@ -466,12 +461,12 @@ def build_example_popular_non_followers(name, identifier, admin_config, options,
nip88config.PERK2DESC = "Support NostrDVM & NostrSDK development" nip88config.PERK2DESC = "Support NostrDVM & NostrSDK development"
nip88config.PAYMENT_VERIFIER_PUBKEY = "5b5c045ecdf66fb540bdf2049fe0ef7f1a566fa427a4fe50d400a011b65a3a7e" nip88config.PAYMENT_VERIFIER_PUBKEY = "5b5c045ecdf66fb540bdf2049fe0ef7f1a566fa427a4fe50d400a011b65a3a7e"
#admin_config.FETCH_NIP88 = True # admin_config.FETCH_NIP88 = True
#admin_config.EVENTID = "63a791cdc7bf78c14031616963105fce5793f532bb231687665b14fb6d805fdb" # admin_config.EVENTID = "63a791cdc7bf78c14031616963105fce5793f532bb231687665b14fb6d805fdb"
admin_config.PRIVKEY = dvm_config.PRIVATE_KEY admin_config.PRIVKEY = dvm_config.PRIVATE_KEY
return DicoverContentCurrentlyPopularNonFollowers(name=name, dvm_config=dvm_config, nip89config=nip89config, return DicoverContentCurrentlyPopularNonFollowers(name=name, dvm_config=dvm_config, nip89config=nip89config,
#nip88config=nip88config, # nip88config=nip88config,
admin_config=admin_config, admin_config=admin_config,
options=options) options=options)
@@ -482,7 +477,7 @@ def build_example_top_zapped(name, identifier, admin_config, options, image, cos
dvm_config = build_default_config(identifier) dvm_config = build_default_config(identifier)
dvm_config.USE_OWN_VENV = False dvm_config.USE_OWN_VENV = False
dvm_config.SHOWLOG = True dvm_config.SHOWLOG = True
#dvm_config.ENABLE_NUTZAP = True # dvm_config.ENABLE_NUTZAP = True
dvm_config.LOGLEVEL = LogLevel.INFO dvm_config.LOGLEVEL = LogLevel.INFO
dvm_config.SCHEDULE_UPDATES_SECONDS = update_rate # Every 10 minutes dvm_config.SCHEDULE_UPDATES_SECONDS = update_rate # Every 10 minutes
dvm_config.UPDATE_DATABASE = update_db dvm_config.UPDATE_DATABASE = update_db
@@ -527,7 +522,6 @@ def build_example_top_zapped(name, identifier, admin_config, options, image, cos
def build_example_mostr(name, identifier, admin_config, options, image, cost=0, update_rate=180, processing_msg=None, def build_example_mostr(name, identifier, admin_config, options, image, cost=0, update_rate=180, processing_msg=None,
update_db=True): update_db=True):
dvm_config = build_default_config(identifier) dvm_config = build_default_config(identifier)
dvm_config.USE_OWN_VENV = False dvm_config.USE_OWN_VENV = False
dvm_config.LOGLEVEL = LogLevel.INFO dvm_config.LOGLEVEL = LogLevel.INFO
@@ -537,7 +531,7 @@ def build_example_mostr(name, identifier, admin_config, options, image, cost=0,
dvm_config.AVOID_OUTBOX_RELAY_LIST = AVOID_OUTBOX_RELAY_LIST dvm_config.AVOID_OUTBOX_RELAY_LIST = AVOID_OUTBOX_RELAY_LIST
dvm_config.RELAY_LIST = RELAY_LIST dvm_config.RELAY_LIST = RELAY_LIST
dvm_config.SYNC_DB_RELAY_LIST = ["wss://nfrelay.app/?user=activitypub"] dvm_config.SYNC_DB_RELAY_LIST = ["wss://nfrelay.app/?user=activitypub"]
#dvm_config.SYNC_DB_RELAY_LIST = ["wss://relay.mostr.pub/"] # dvm_config.SYNC_DB_RELAY_LIST = ["wss://relay.mostr.pub/"]
dvm_config.FIX_COST = cost dvm_config.FIX_COST = cost
dvm_config.CUSTOM_PROCESSING_MESSAGE = processing_msg dvm_config.CUSTOM_PROCESSING_MESSAGE = processing_msg
@@ -570,7 +564,8 @@ def build_example_mostr(name, identifier, admin_config, options, image, cost=0,
admin_config=admin_config, options=options) admin_config=admin_config, options=options)
def build_example_oneperfollow(name, identifier, admin_config, options, image, cost=0, update_rate=180, processing_msg=None, def build_example_oneperfollow(name, identifier, admin_config, options, image, cost=0, update_rate=180,
processing_msg=None,
update_db=True): update_db=True):
dvm_config = build_default_config(identifier) dvm_config = build_default_config(identifier)
dvm_config.USE_OWN_VENV = False dvm_config.USE_OWN_VENV = False
@@ -615,12 +610,12 @@ def build_example_oneperfollow(name, identifier, admin_config, options, image, c
async def init_db(database): async def init_db(database):
return NostrDatabase.lmdb(database) return NostrDatabase.lmdb(database)
def playground():
def playground():
main_db = "db/nostr_recent_notes.db" main_db = "db/nostr_recent_notes.db"
DATABASE = asyncio.run(init_db(main_db)) DATABASE = asyncio.run(init_db(main_db))
#DB Scheduler, do not announce, just use it to update the DB for the other DVMs. # DB Scheduler, do not announce, just use it to update the DB for the other DVMs.
admin_config_db_scheduler= AdminConfig() admin_config_db_scheduler = AdminConfig()
options_animal = { options_animal = {
"db_name": main_db, "db_name": main_db,
"db_since": max_sync_duration_in_h * 60 * 60, # 48h since gmt, "db_since": max_sync_duration_in_h * 60 * 60, # 48h since gmt,
@@ -639,8 +634,6 @@ def playground():
database=DATABASE) database=DATABASE)
db_scheduler.run() db_scheduler.run()
admin_config_gallery = AdminConfig() admin_config_gallery = AdminConfig()
admin_config_gallery.REBROADCAST_NIP89 = rebroadcast_NIP89 admin_config_gallery.REBROADCAST_NIP89 = rebroadcast_NIP89
admin_config_gallery.REBROADCAST_NIP65_RELAY_LIST = rebroadcast_NIP65_Relay_List admin_config_gallery.REBROADCAST_NIP65_RELAY_LIST = rebroadcast_NIP65_Relay_List
@@ -672,7 +665,6 @@ def playground():
# discover_gallery.run() # discover_gallery.run()
# #
# Latest Longform # Latest Longform
admin_config_longform = AdminConfig() admin_config_longform = AdminConfig()
admin_config_longform.REBROADCAST_NIP89 = rebroadcast_NIP89 admin_config_longform.REBROADCAST_NIP89 = rebroadcast_NIP89
@@ -701,8 +693,6 @@ def playground():
latest_longform.run() latest_longform.run()
# Latest Wiki # Latest Wiki
admin_config_wiki = AdminConfig() admin_config_wiki = AdminConfig()
admin_config_wiki.REBROADCAST_NIP89 = rebroadcast_NIP89 admin_config_wiki.REBROADCAST_NIP89 = rebroadcast_NIP89
@@ -720,7 +710,7 @@ def playground():
"db_since": 60 * 60 * 24 * 21, # 3 Weeks since gmt, "db_since": 60 * 60 * 24 * 21, # 3 Weeks since gmt,
} }
cost = 0 cost = 0
latest_wiki= build_wiki("Latest Wikifreedia Notes", latest_wiki = build_wiki("Latest Wikifreedia Notes",
"discovery_content_wiki", "discovery_content_wiki",
admin_config=admin_config_wiki, admin_config=admin_config_wiki,
options=options_longform, options=options_longform,
@@ -731,8 +721,6 @@ def playground():
latest_wiki.run() latest_wiki.run()
# Popular top zapped # Popular top zapped
admin_config_top_zaps = AdminConfig() admin_config_top_zaps = AdminConfig()
admin_config_top_zaps.REBROADCAST_NIP89 = rebroadcast_NIP89 admin_config_top_zaps.REBROADCAST_NIP89 = rebroadcast_NIP89
@@ -751,7 +739,7 @@ def playground():
"db_since": 60 * 60 * 2, # 8h since gmt, "db_since": 60 * 60 * 2, # 8h since gmt,
} }
cost = 0 cost = 0
#image = "https://image.nostr.build/c6879f458252641d04d0aa65fd7f1e005a4f7362fd407467306edc2f4acdb113.jpg" # image = "https://image.nostr.build/c6879f458252641d04d0aa65fd7f1e005a4f7362fd407467306edc2f4acdb113.jpg"
image = "https://i.nostr.build/U5AO3vUMy47NWSQG.png" image = "https://i.nostr.build/U5AO3vUMy47NWSQG.png"
discovery_topzaps = build_example_top_zapped("Top Zapped notes", discovery_topzaps = build_example_top_zapped("Top Zapped notes",
"discovery_content_top_zaps", "discovery_content_top_zaps",
@@ -766,16 +754,15 @@ def playground():
discovery_topzaps.run() discovery_topzaps.run()
# Popular NOSTR.band # Popular NOSTR.band
admin_config_trending_nostr_band = AdminConfig() admin_config_trending_nostr_band = AdminConfig()
admin_config_trending_nostr_band.REBROADCAST_NIP89 = rebroadcast_NIP89 admin_config_trending_nostr_band.REBROADCAST_NIP89 = rebroadcast_NIP89
admin_config_trending_nostr_band.REBROADCAST_NIP65_RELAY_LIST = rebroadcast_NIP65_Relay_List admin_config_trending_nostr_band.REBROADCAST_NIP65_RELAY_LIST = rebroadcast_NIP65_Relay_List
admin_config_trending_nostr_band.UPDATE_PROFILE = update_profile admin_config_trending_nostr_band.UPDATE_PROFILE = update_profile
#admin_config_trending_nostr_band.DELETE_NIP89 = True # admin_config_trending_nostr_band.DELETE_NIP89 = True
#admin_config_trending_nostr_band.PRIVKEY = "" # admin_config_trending_nostr_band.PRIVKEY = ""
#admin_config_trending_nostr_band.EVENTID = "e7a7aaa7113f17af94ccbfe86c06e04c27ffce3d2f654d613ce249b68414bdae" # admin_config_trending_nostr_band.EVENTID = "e7a7aaa7113f17af94ccbfe86c06e04c27ffce3d2f654d613ce249b68414bdae"
#admin_config_trending_nostr_band.POW = True # admin_config_trending_nostr_band.POW = True
custom_processing_msg = "Looking for trending notes on nostr.band.." custom_processing_msg = "Looking for trending notes on nostr.band.."
image = "https://nostr.band/android-chrome-192x192.png" image = "https://nostr.band/android-chrome-192x192.png"
about = "I show trending notes from nostr.band" about = "I show trending notes from nostr.band"
@@ -791,10 +778,10 @@ def playground():
admin_config_mostr.REBROADCAST_NIP89 = rebroadcast_NIP89 admin_config_mostr.REBROADCAST_NIP89 = rebroadcast_NIP89
admin_config_mostr.REBROADCAST_NIP65_RELAY_LIST = rebroadcast_NIP65_Relay_List admin_config_mostr.REBROADCAST_NIP65_RELAY_LIST = rebroadcast_NIP65_Relay_List
admin_config_mostr.UPDATE_PROFILE = update_profile admin_config_mostr.UPDATE_PROFILE = update_profile
#admin_config_mostr.DELETE_NIP89 = True # admin_config_mostr.DELETE_NIP89 = True
#admin_config_mostr.PRIVKEY = "" # admin_config_mostr.PRIVKEY = ""
#admin_config_mostr.EVENTID = "59d0ebe2966426ac359dcb8da214efe34fb735c69099361eae87a426bacf4de2" # admin_config_mostr.EVENTID = "59d0ebe2966426ac359dcb8da214efe34fb735c69099361eae87a426bacf4de2"
#admin_config_mostr.POW = True # admin_config_mostr.POW = True
custom_processing_msg = ["Looking for popular Content on Mostr"] custom_processing_msg = ["Looking for popular Content on Mostr"]
options_mostr = { options_mostr = {
@@ -803,7 +790,7 @@ def playground():
} }
cost = 0 cost = 0
image = "https://i.nostr.build/mtkNd3J8m0mqj9nq.jpg" image = "https://i.nostr.build/mtkNd3J8m0mqj9nq.jpg"
#discovery_mostr = build_example_mostr("Trending on Mostr", # discovery_mostr = build_example_mostr("Trending on Mostr",
# "discovery_mostr", # "discovery_mostr",
# #
# admin_config=admin_config_mostr, # admin_config=admin_config_mostr,
@@ -813,11 +800,11 @@ def playground():
# update_rate=180, # update_rate=180,
# processing_msg=custom_processing_msg, # processing_msg=custom_processing_msg,
# update_db=True) # update_db=True)
#discovery_mostr.run() # discovery_mostr.run()
# Popular Garden&Plants # Popular Garden&Plants
admin_config_asknostr = AdminConfig() admin_config_asknostr = AdminConfig()
admin_config_asknostr.REBROADCAST_NIP89 =rebroadcast_NIP89 admin_config_asknostr.REBROADCAST_NIP89 = rebroadcast_NIP89
admin_config_asknostr.REBROADCAST_NIP65_RELAY_LIST = rebroadcast_NIP65_Relay_List admin_config_asknostr.REBROADCAST_NIP65_RELAY_LIST = rebroadcast_NIP65_Relay_List
admin_config_asknostr.UPDATE_PROFILE = update_profile admin_config_asknostr.UPDATE_PROFILE = update_profile
options_plants = { options_plants = {
@@ -877,19 +864,15 @@ def playground():
database=DATABASE) database=DATABASE)
discovery_mining.run() discovery_mining.run()
# Popular Animals (Fluffy frens) # Popular Animals (Fluffy frens)
admin_config_animals = AdminConfig() admin_config_animals = AdminConfig()
admin_config_animals.REBROADCAST_NIP89 = rebroadcast_NIP89 admin_config_animals.REBROADCAST_NIP89 = rebroadcast_NIP89
admin_config_animals.REBROADCAST_NIP65_RELAY_LIST = rebroadcast_NIP65_Relay_List admin_config_animals.REBROADCAST_NIP65_RELAY_LIST = rebroadcast_NIP65_Relay_List
admin_config_animals.UPDATE_PROFILE = update_profile admin_config_animals.UPDATE_PROFILE = update_profile
#admin_config_animals.DELETE_NIP89 = True # admin_config_animals.DELETE_NIP89 = True
#admin_config_animals.PRIVKEY = "" # admin_config_animals.PRIVKEY = ""
#admin_config_animals.EVENTID = "79c613b5f0e71718628bd0c782a5b6b495dac491f36c326ccf416ada80fd8fdc" # admin_config_animals.EVENTID = "79c613b5f0e71718628bd0c782a5b6b495dac491f36c326ccf416ada80fd8fdc"
#admin_config_animals.POW = True # admin_config_animals.POW = True
options_animal = { options_animal = {
"search_list": ["catstr", "pawstr", "dogstr", "pugstr", " cat ", " cats ", "doggo", " deer ", " dog ", " dogs ", "search_list": ["catstr", "pawstr", "dogstr", "pugstr", " cat ", " cats ", "doggo", " deer ", " dog ", " dogs ",
@@ -936,7 +919,7 @@ def playground():
cost=cost, cost=cost,
processing_msg=custom_processing_msg, processing_msg=custom_processing_msg,
update_db=update_db, update_db=update_db,
database = DATABASE) database=DATABASE)
discovery_animals.run() discovery_animals.run()
@@ -1007,7 +990,7 @@ def playground():
} }
cost = 0 cost = 0
#image = "https://image.nostr.build/d92652a6a07677e051d647dcf9f0f59e265299b3335a939d008183a911513f4a.jpg" # image = "https://image.nostr.build/d92652a6a07677e051d647dcf9f0f59e265299b3335a939d008183a911513f4a.jpg"
image = "https://i.nostr.build/ZJqko0W9ApEVZAPt.png" image = "https://i.nostr.build/ZJqko0W9ApEVZAPt.png"
discovery_followers = build_example_popular_followers( discovery_followers = build_example_popular_followers(
"Popular from npubs you follow", "Popular from npubs you follow",
@@ -1070,7 +1053,7 @@ def playground():
"db_since": 60 * 60 * 2, # 1h since gmt, "db_since": 60 * 60 * 2, # 1h since gmt,
} }
cost = 0 cost = 0
#image = "https://i.nostr.build/H6SMmCl7eRDvkbAn.jpg" # image = "https://i.nostr.build/H6SMmCl7eRDvkbAn.jpg"
image = "https://i.nostr.build/fsGWicUhyRrfy85d.jpg" image = "https://i.nostr.build/fsGWicUhyRrfy85d.jpg"
discovery_one_per_follow = build_example_oneperfollow("One per follow", discovery_one_per_follow = build_example_oneperfollow("One per follow",
"discovery_latest_per_follow", "discovery_latest_per_follow",
@@ -1101,7 +1084,7 @@ def playground():
"db_since": 60 * 60 * 1, # 1h since gmt, "db_since": 60 * 60 * 1, # 1h since gmt,
} }
cost = 0 cost = 0
#image = "https://image.nostr.build/b29b6ec4bf9b6184f69d33cb44862db0d90a2dd9a506532e7ba5698af7d36210.jpg" # image = "https://image.nostr.build/b29b6ec4bf9b6184f69d33cb44862db0d90a2dd9a506532e7ba5698af7d36210.jpg"
image = "https://i.nostr.build/AnBKrfAIRMhWm0h3.jpg" image = "https://i.nostr.build/AnBKrfAIRMhWm0h3.jpg"
discovery_global = build_example_popular("Currently Popular Notes DVM", discovery_global = build_example_popular("Currently Popular Notes DVM",
"discovery_content_test", "discovery_content_test",
@@ -1118,17 +1101,16 @@ def playground():
# discovery_test_sub = content_discovery_currently_popular.build_example_subscription("Currently Popular Notes DVM (with Subscriptions)", "discovery_content_test", admin_config) # discovery_test_sub = content_discovery_currently_popular.build_example_subscription("Currently Popular Notes DVM (with Subscriptions)", "discovery_content_test", admin_config)
# discovery_test_sub.run() # discovery_test_sub.run()
admin_config_nostriga = AdminConfig() admin_config_nostriga = AdminConfig()
admin_config_nostriga.REBROADCAST_NIP89 = False #rebroadcast_NIP89 admin_config_nostriga.REBROADCAST_NIP89 = False # rebroadcast_NIP89
admin_config_nostriga.REBROADCAST_NIP65_RELAY_LIST = False #rebroadcast_NIP65_Relay_List admin_config_nostriga.REBROADCAST_NIP65_RELAY_LIST = False # rebroadcast_NIP65_Relay_List
admin_config_nostriga.UPDATE_PROFILE = update_profile admin_config_nostriga.UPDATE_PROFILE = update_profile
admin_config_nostriga.DELETE_NIP89 = True admin_config_nostriga.DELETE_NIP89 = True
#admin_config_nostriga.PRIVKEY = "6221e31813df07037dd90a608fc4cf29222c59da130f76c7f8d0d19c3a876d8e" # admin_config_nostriga.PRIVKEY = "6221e31813df07037dd90a608fc4cf29222c59da130f76c7f8d0d19c3a876d8e"
#admin_config_nostriga.EVENTID = "24ac21fb32993744232356bafcabd821e4afed4b18aac8d7e670d1071f6ad77a" # admin_config_nostriga.EVENTID = "24ac21fb32993744232356bafcabd821e4afed4b18aac8d7e670d1071f6ad77a"
#admin_config_nostriga.POW = True # admin_config_nostriga.POW = True
options_nostriga = { options_nostriga = {
"search_list": ["nostriga", "#nostriga", "#noobday" ], "search_list": ["nostriga", "#nostriga", "#noobday"],
"avoid_list": ["porn", "smoke", "nsfw", "avoid_list": ["porn", "smoke", "nsfw",
"encryption", "government", "airpod", "ipad", "iphone", "android", "warren", "encryption", "government", "airpod", "ipad", "iphone", "android", "warren",
"moderna", "pfizer", "corona", "socialism", "critical theory", "murder", "tax", "engagement", "moderna", "pfizer", "corona", "socialism", "critical theory", "murder", "tax", "engagement",
@@ -1151,7 +1133,7 @@ def playground():
update_db = False update_db = False
cost = 0 cost = 0
#discovery_nostriga = build_example_topic("Nostriga", "discovery_content_nostriga", # discovery_nostriga = build_example_topic("Nostriga", "discovery_content_nostriga",
# admin_config_nostriga, options_nostriga, # admin_config_nostriga, options_nostriga,
# image=image, # image=image,
# description=description, # description=description,
@@ -1159,10 +1141,7 @@ def playground():
# cost=cost, # cost=cost,
# processing_msg=custom_processing_msg, # processing_msg=custom_processing_msg,
# update_db=update_db) # update_db=update_db)
#discovery_nostriga.run() # discovery_nostriga.run()
# Subscription Manager DVM # Subscription Manager DVM
subscription_config = DVMConfig() subscription_config = DVMConfig()
@@ -1175,17 +1154,16 @@ def playground():
subscription_config.LNBITS_ADMIN_KEY = admin_key # The dvm might pay failed jobs back subscription_config.LNBITS_ADMIN_KEY = admin_key # The dvm might pay failed jobs back
subscription_config.LNBITS_URL = os.getenv("LNBITS_HOST") subscription_config.LNBITS_URL = os.getenv("LNBITS_HOST")
sub_admin_config = AdminConfig() sub_admin_config = AdminConfig()
#sub_admin_config.USERNPUBS = ["7782f93c5762538e1f7ccc5af83cd8018a528b9cd965048386ca1b75335f24c6"] #Add npubs of services that can contact the subscription handler # sub_admin_config.USERNPUBS = ["7782f93c5762538e1f7ccc5af83cd8018a528b9cd965048386ca1b75335f24c6"] #Add npubs of services that can contact the subscription handler
x = threading.Thread(target=Subscription, args=(Subscription(subscription_config, sub_admin_config),)) x = threading.Thread(target=Subscription, args=(Subscription(subscription_config, sub_admin_config),))
x.start() x.start()
#make sure the last thing joins, either here by calling x.join() or in a call a dvm with .run(True) # make sure the last thing joins, either here by calling x.join() or in a call a dvm with .run(True)
x.join() x.join()
# keep_alive() # keep_alive()
if __name__ == '__main__': if __name__ == '__main__':
env_path = Path('.env') env_path = Path('.env')
if not env_path.is_file(): if not env_path.is_file():