mirror of
https://github.com/markqvist/Reticulum
synced 2026-11-22 23:10:32 +00:00
Allow applications to enable stamp generation and stamp enforcement
This commit is contained in:
1 file changed
+13
-1
+13
-1
@@ -214,7 +214,8 @@ class Reticulum:
|
||||
return Reticulum.__instance
|
||||
|
||||
def __init__(self,configdir=None, loglevel=None, logdest=None, verbosity=None,
|
||||
require_shared_instance=False, shared_instance_type=None):
|
||||
require_shared_instance=False, shared_instance_type=None,
|
||||
enable_stamping=False, enforce_stamps=False):
|
||||
"""
|
||||
Initialises and starts a Reticulum instance. This must be
|
||||
done before any other operations, and Reticulum will not
|
||||
@@ -349,6 +350,17 @@ class Reticulum:
|
||||
RNS.log(f"Utilising cryptography backend \"{RNS.Cryptography.Provider.backend()}\"", RNS.LOG_DEBUG)
|
||||
RNS.log(f"Configuration loaded from {self.configpath}", RNS.LOG_VERBOSE)
|
||||
|
||||
if enable_stamping:
|
||||
RNS.log(f"Network stamp generation activated", RNS.LOG_VERBOSE)
|
||||
RNS.Transport.STAMP_DESTINATIONS = True
|
||||
RNS.Transport.STAMP_PRS = True
|
||||
RNS.Transport.STAMP_LRS = True
|
||||
|
||||
if enforce_stamps:
|
||||
RNS.log(f"Network stamp enforcement activated", RNS.LOG_VERBOSE)
|
||||
RNS.Transport.STAMPS_ENFORCED = True
|
||||
RNS.Transport.LR_STAMPS_ENFORCED = True
|
||||
|
||||
RNS.Identity.load_known_destinations()
|
||||
if not self.is_connected_to_shared_instance: RNS.Identity._clean_ratchets()
|
||||
RNS.Transport.start(self)
|
||||
|
||||
Reference in new issue
Block a user