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

@@ -7,6 +7,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
@@ -18,6 +20,8 @@ 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()
dvm_config = build_default_config(identifier)
kind = Kind(5050)
@@ -119,7 +123,9 @@ def run_dvm(identifier, announce):
return result
dvm.process = process
dvm.run()
framework.add(dvm)
framework.run()