mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-11-20 19:10:07 +01:00
a lightning address per DVM, connecting nostdress
This commit is contained in:
@@ -15,7 +15,8 @@ from utils.dvmconfig import DVMConfig
|
||||
from utils.nip89_utils import NIP89Config, check_and_set_d_tag
|
||||
from utils.nostr_utils import check_and_set_private_key
|
||||
from utils.output_utils import upload_media_to_hoster
|
||||
from utils.zap_utils import get_price_per_sat
|
||||
from utils.zap_utils import get_price_per_sat, check_and_set_ln_bits_keys
|
||||
from nostr_sdk import Keys
|
||||
|
||||
"""
|
||||
This File contains a Module to transform Text input on OpenAI's servers with DALLE-3 and receive results back.
|
||||
@@ -127,8 +128,12 @@ class ImageGenerationDALLE(DVMTaskInterface):
|
||||
def build_example(name, identifier, admin_config):
|
||||
dvm_config = DVMConfig()
|
||||
dvm_config.PRIVATE_KEY = check_and_set_private_key(identifier)
|
||||
dvm_config.LNBITS_INVOICE_KEY = os.getenv("LNBITS_INVOICE_KEY")
|
||||
npub = Keys.from_sk_str(dvm_config.PRIVATE_KEY).public_key().to_bech32()
|
||||
invoice_key, admin_key, wallet_id, user_id, lnaddress = check_and_set_ln_bits_keys(identifier, npub)
|
||||
dvm_config.LNBITS_INVOICE_KEY = invoice_key
|
||||
dvm_config.LNBITS_ADMIN_KEY = admin_key # The dvm might pay failed jobs back
|
||||
dvm_config.LNBITS_URL = os.getenv("LNBITS_HOST")
|
||||
admin_config.LUD16 = lnaddress
|
||||
profit_in_sats = 10
|
||||
dvm_config.FIX_COST = int(((4.0 / (get_price_per_sat("USD") * 100)) + profit_in_sats))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user