diff --git a/main.py b/main.py index f956a53..b8a12f1 100644 --- a/main.py +++ b/main.py @@ -12,20 +12,27 @@ from utils.definitions import EventDefinitions def run_nostr_dvm_with_local_config(): from dvm import dvm, DVMConfig + dvmconfig = DVMConfig() + dvmconfig.PRIVATE_KEY = os.getenv(env.NOSTR_PRIVATE_KEY) + + #Spawn two DVMs PDFextactor = TextExtractionPDF("PDF Extractor", env.NOSTR_PRIVATE_KEY) Translator = Translation("Translator", env.NOSTR_PRIVATE_KEY) - dvmconfig = DVMConfig() - dvmconfig.PRIVATE_KEY = os.getenv(env.NOSTR_PRIVATE_KEY) + #Add the 2 DVMS to the config dvmconfig.SUPPORTED_TASKS = [PDFextactor, Translator] - dvmconfig.LNBITS_INVOICE_KEY = os.getenv(env.LNBITS_INVOICE_KEY) - dvmconfig.LNBITS_URL = os.getenv(env.LNBITS_HOST) - # In admin_utils, set rebroadcast_nip89 to true to (re)broadcast your DVM. You can create a valid dtag and the content on vendata.io + # Add NIP89 events for both DVMs (set rebroad_cast = True in admin_utils) # Add the dtag in your .env file so you can update your dvm later and change the content in the module file as needed. + # Get a dtag at vendata.io dvmconfig.NIP89s.append(PDFextactor.NIP89_announcement()) dvmconfig.NIP89s.append(Translator.NIP89_announcement()) + #SET Lnbits Invoice Key and Server if DVM should provide invoices directly, else make sure you have a lnaddress on the profile + dvmconfig.LNBITS_INVOICE_KEY = os.getenv(env.LNBITS_INVOICE_KEY) + dvmconfig.LNBITS_URL = os.getenv(env.LNBITS_HOST) + + #Start the DVM nostr_dvm_thread = Thread(target=dvm, args=[dvmconfig]) nostr_dvm_thread.start() diff --git a/utils/zap_utils.py b/utils/zap_utils.py index 4923761..b81a627 100644 --- a/utils/zap_utils.py +++ b/utils/zap_utils.py @@ -53,7 +53,6 @@ def check_bolt11_ln_bits_is_paid(payment_hash, config): obj = json.loads(res.text) return obj["paid"] except Exception as e: - #print("Exception checking invoice is paid:" + e) return None