mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-06-20 12:51:04 +02:00
added more instructions
This commit is contained in:
parent
b201384c02
commit
05df069781
17
main.py
17
main.py
@ -12,20 +12,27 @@ from utils.definitions import EventDefinitions
|
|||||||
def run_nostr_dvm_with_local_config():
|
def run_nostr_dvm_with_local_config():
|
||||||
from dvm import dvm, DVMConfig
|
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)
|
PDFextactor = TextExtractionPDF("PDF Extractor", env.NOSTR_PRIVATE_KEY)
|
||||||
Translator = Translation("Translator", env.NOSTR_PRIVATE_KEY)
|
Translator = Translation("Translator", env.NOSTR_PRIVATE_KEY)
|
||||||
|
|
||||||
dvmconfig = DVMConfig()
|
#Add the 2 DVMS to the config
|
||||||
dvmconfig.PRIVATE_KEY = os.getenv(env.NOSTR_PRIVATE_KEY)
|
|
||||||
dvmconfig.SUPPORTED_TASKS = [PDFextactor, Translator]
|
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.
|
# 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(PDFextactor.NIP89_announcement())
|
||||||
dvmconfig.NIP89s.append(Translator.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 = Thread(target=dvm, args=[dvmconfig])
|
||||||
nostr_dvm_thread.start()
|
nostr_dvm_thread.start()
|
||||||
|
|
||||||
|
@ -53,7 +53,6 @@ def check_bolt11_ln_bits_is_paid(payment_hash, config):
|
|||||||
obj = json.loads(res.text)
|
obj = json.loads(res.text)
|
||||||
return obj["paid"]
|
return obj["paid"]
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
#print("Exception checking invoice is paid:" + e)
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user