Implemented ticket exchanges. Implemented stamp generation and validation by tickets.

This commit is contained in:
Mark Qvist 2024-09-07 15:17:48 +02:00
parent 74cbd11473
commit 62f5a9eead
4 changed files with 251 additions and 35 deletions

View file

@ -6,6 +6,7 @@ required_stamp_cost = 8
enforce_stamps = False
def delivery_callback(message):
global my_lxmf_destination, router
time_string = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(message.timestamp))
signature_string = "Signature is invalid, reason undetermined"
if message.signature_validated:
@ -35,6 +36,12 @@ def delivery_callback(message):
RNS.log("\t| Stamp : "+stamp_string)
RNS.log("\t+---------------------------------------------------------------")
# Optionally, send a reply
# source = my_lxmf_destination
# dest = message.source
# lxm = LXMF.LXMessage(dest, source, "Reply", None, desired_method=LXMF.LXMessage.DIRECT, include_ticket=True)
# router.handle_outbound(lxm)
r = RNS.Reticulum()
router = LXMF.LXMRouter(storagepath="./tmp1", enforce_stamps=enforce_stamps)