update tutorials with framework

This commit is contained in:
dbth
2025-01-02 12:11:23 +01:00
parent 6ceeec556d
commit 20ae96335a
5 changed files with 40 additions and 6 deletions

View File

@@ -8,6 +8,8 @@ import os
from pathlib import Path
import dotenv
from nostr_dvm.framework import DVMFramework
from nostr_dvm.tasks.generic_dvm import GenericDVM
from nostr_sdk import Kind, Keys
from nostr_dvm.utils.admin_utils import AdminConfig
@@ -19,6 +21,9 @@ from nostr_dvm.utils.zap_utils import change_ln_address
# We keep the main code structure almost the same as in tutorial02 and 05.
def run_dvm(identifier, announce):
# Initialize the framework
framework = DVMFramework()
# Remember, with build_default_config(identifier) the framework will either create or load certain information
# such as private nostr keys, wallet information, and d tags.
dvm_config = build_default_config(identifier)
@@ -144,7 +149,9 @@ def run_dvm(identifier, announce):
return result
dvm.process = process
dvm.run()
framework.add(dvm)
framework.run()