added more instructions

This commit is contained in:
Believethehype 2023-11-19 21:21:55 +01:00
parent b201384c02
commit 05df069781
2 changed files with 12 additions and 6 deletions

17
main.py
View File

@ -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()

View File

@ -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