Skip to content

Commit

Permalink
fixes wot option
Browse files Browse the repository at this point in the history
  • Loading branch information
believethehype committed Sep 19, 2024
1 parent 00f24f7 commit 03a2fa1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .idea/dvm.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion nostr_dvm/tasks/content_discovery_update_db_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import networkx as nx
from nostr_sdk import Client, Timestamp, PublicKey, Tag, Keys, Options, SecretKey, NostrSigner, NostrDatabase, \
ClientBuilder, Filter, NegentropyOptions, NegentropyDirection, init_logger, LogLevel, Event, EventId, Kind, \
RelayLimits
RelayLimits, RelayFilteringMode

from nostr_dvm.interfaces.dvmtaskinterface import DVMTaskInterface, process_venv
from nostr_dvm.utils import definitions
Expand Down Expand Up @@ -132,11 +132,14 @@ async def sync_db(self):
try:
relaylimits = RelayLimits.disable()
opts = (Options().wait_for_send(False).send_timeout(timedelta(seconds=self.dvm_config.RELAY_LONG_TIMEOUT))).relay_limits(relaylimits)
if self.dvm_config.WOT_FILTERING:
opts = opts.filtering_mode(RelayFilteringMode.WHITELIST)
sk = SecretKey.from_hex(self.dvm_config.PRIVATE_KEY)
keys = Keys.parse(sk.to_hex())
signer = NostrSigner.keys(keys)
if self.database is None:
self.database = NostrDatabase.lmdb(self.db_name)

cli = ClientBuilder().signer(signer).database(self.database).opts(opts).build()

for relay in self.dvm_config.RECONCILE_DB_RELAY_LIST:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages

VERSION = '0.8.20'
VERSION = '0.8.21'
DESCRIPTION = 'A framework to build and run Nostr NIP90 Data Vending Machines'
LONG_DESCRIPTION = ('A framework to build and run Nostr NIP90 Data Vending Machines. See the github repository for more information')

Expand Down
2 changes: 1 addition & 1 deletion tests/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ def playground():
admin_config_db_scheduler= AdminConfig()
options_animal = {
"db_name": main_db,
"db_since": 48 * 60 * 60, # 48h since gmt,
"db_since": 6 * 60 * 60, # 48h since gmt,
"personalized": False,
"logger": False}
image = ""
Expand Down

0 comments on commit 03a2fa1

Please sign in to comment.