mirror of
https://github.com/markqvist/Reticulum.git
synced 2026-11-19 14:36:34 -05:00
Allow applications to enable stamp generation and stamp enforcement
This commit is contained in:
parent
e9d82e698d
commit
eb826cde90
1 changed files with 13 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue