Compare commits

..

11 commits

Author SHA1 Message Date
Mark Qvist
85d8f4f583 Updated requirements 2025-07-13 13:42:01 +02:00
Mark Qvist
5b9f121593 Updated version and RNS dependency version 2025-07-13 13:24:52 +02:00
Mark Qvist
416ccf294f Retry path request on unexpectedly closed link 2025-07-13 13:24:46 +02:00
Mark Qvist
787cd069dc Fixed division by zero. Closes #30. 2025-05-26 20:57:46 +02:00
Mark Qvist
c2207d1eb7 Added funding 2025-05-17 10:27:21 +02:00
Mark Qvist
a9622e3a33 Updated version 2025-05-15 20:30:12 +02:00
Mark Qvist
499fe4cc53 Use no_data_for instead of inactive_for for cleaning links 2025-05-15 20:27:19 +02:00
Mark Qvist
37e99910ec Updated version and RNS dependency version 2025-05-12 11:58:24 +02:00
Mark Qvist
005d71707c Cleanup 2025-04-17 13:31:00 +02:00
Mark Qvist
1bdcf6ad53 Updated license 2025-04-15 20:21:54 +02:00
Mark Qvist
e6021b8fed Updated license 2025-04-15 20:21:16 +02:00
8 changed files with 36 additions and 24 deletions

3
FUNDING.yml Normal file
View file

@ -0,0 +1,3 @@
liberapay: Reticulum
ko_fi: markqvist
custom: "https://unsigned.io/donate"

16
LICENSE
View file

@ -1,6 +1,6 @@
MIT License
Reticulum License
Copyright (c) 2020 Mark Qvist / unsigned.io
Copyright (c) 2020-2025 Mark Qvist
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -9,8 +9,16 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
- The Software shall not be used in any kind of system which includes amongst
its functions the ability to purposefully do harm to human beings.
- The Software shall not be used, directly or indirectly, in the creation of
an artificial intelligence, machine learning or language model training
dataset, including but not limited to any use that contributes to the
training or development of such a model or algorithm.
- The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

View file

@ -1,4 +1,5 @@
import time
import threading
import RNS
import RNS.vendor.umsgpack as msgpack
@ -17,11 +18,12 @@ class LXMFDeliveryAnnounceHandler:
if lxmessage.method == LXMessage.DIRECT or lxmessage.method == LXMessage.OPPORTUNISTIC:
lxmessage.next_delivery_attempt = time.time()
while self.lxmrouter.processing_outbound:
time.sleep(0.1)
def outbound_trigger():
while self.lxmrouter.processing_outbound: time.sleep(0.1)
self.lxmrouter.process_outbound()
threading.Thread(target=outbound_trigger, daemon=True).start()
try:
stamp_cost = stamp_cost_from_app_data(app_data)
self.lxmrouter.update_stamp_cost(destination_hash, stamp_cost)
@ -55,10 +57,8 @@ class LXMFPropagationAnnounceHandler:
pass
if len(data) >= 3:
try:
propagation_transfer_limit = float(data[2])
except:
propagation_transfer_limit = None
try: propagation_transfer_limit = float(data[2])
except: propagation_transfer_limit = None
if destination_hash in self.lxmrouter.static_peers:
self.lxmrouter.peer(destination_hash, node_timebase, propagation_transfer_limit, wanted_inbound_peers)

View file

@ -827,7 +827,7 @@ class LXMRouter:
closed_links = []
for link_hash in self.direct_links:
link = self.direct_links[link_hash]
inactive_time = link.inactive_for()
inactive_time = link.no_data_for()
if inactive_time > LXMRouter.LINK_MAX_INACTIVITY:
link.teardown()
@ -2301,8 +2301,7 @@ class LXMRouter:
else:
RNS.log("Outbound processing for "+str(lxmessage)+" to "+RNS.prettyhexrep(lxmessage.get_destination().hash), RNS.LOG_DEBUG)
if lxmessage.progress == None or lxmessage.progress < 0.01:
lxmessage.progress = 0.01
if lxmessage.progress == None or lxmessage.progress < 0.01: lxmessage.progress = 0.01
# Outbound handling for opportunistic messages
if lxmessage.method == LXMessage.OPPORTUNISTIC:
@ -2369,7 +2368,8 @@ class LXMRouter:
RNS.log("Waiting for proof for "+str(lxmessage)+" sent as link packet", RNS.LOG_DEBUG)
elif direct_link.status == RNS.Link.CLOSED:
if direct_link.activated_at != None:
RNS.log("The link to "+RNS.prettyhexrep(lxmessage.get_destination().hash)+" was closed", RNS.LOG_DEBUG)
RNS.log("The link to "+RNS.prettyhexrep(lxmessage.get_destination().hash)+" was closed unexpectedly, retrying path request...", RNS.LOG_DEBUG)
RNS.Transport.request_path(lxmessage.get_destination().hash)
else:
if not hasattr(lxmessage, "path_request_retried"):
RNS.log("The link to "+RNS.prettyhexrep(lxmessage.get_destination().hash)+" was never activated, retrying path request...", RNS.LOG_DEBUG)

View file

@ -529,14 +529,14 @@ def get_status(configdir = None, rnsconfigdir = None, verbosity = 0, quietness =
peered_outgoing += pm["outgoing"]
peered_rx_bytes += p["rx_bytes"]
peered_tx_bytes += p["tx_bytes"]
if p["alive"]:
available_peers += 1
else:
unreachable_peers += 1
if p["alive"]: available_peers += 1
else: unreachable_peers += 1
total_incoming = peered_incoming+s["unpeered_propagation_incoming"]+s["clients"]["client_propagation_messages_received"]
total_rx_bytes = peered_rx_bytes+s["unpeered_propagation_rx_bytes"]
df = round(peered_outgoing/total_incoming, 2)
if total_incoming != 0: df = round(peered_outgoing/total_incoming, 2)
else: df = 0
dhs = RNS.prettyhexrep(s["destination_hash"]); uts = RNS.prettytime(s["uptime"])
print(f"\nLXMF Propagation Node running on {dhs}, uptime is {uts}")

View file

@ -1 +1 @@
__version__ = "0.6.3"
__version__ = "0.8.0"

View file

@ -1,2 +1,2 @@
qrcode>=7.4.2
rns>=0.9.1
rns>=1.0.0

View file

@ -15,9 +15,10 @@ setuptools.setup(
long_description_content_type="text/markdown",
url="https://github.com/markqvist/lxmf",
packages=["LXMF", "LXMF.Utilities"],
license="Reticulum License",
license_files = ("LICENSE"),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
entry_points= {
@ -25,6 +26,6 @@ setuptools.setup(
'lxmd=LXMF.Utilities.lxmd:main',
]
},
install_requires=["rns>=0.9.3"],
install_requires=["rns>=1.0.0"],
python_requires=">=3.7",
)