Renamed has_path method
This commit is contained in:
parent
0c76d6a15c
commit
a60e4fc5f1
|
@ -111,7 +111,7 @@ def client(destination_hexhash, configpath, timeout=None):
|
||||||
|
|
||||||
# Let's first check if RNS knows a path to the destination.
|
# Let's first check if RNS knows a path to the destination.
|
||||||
# If it does, we'll load the server identity and create a packet
|
# If it does, we'll load the server identity and create a packet
|
||||||
if RNS.Transport.hasPath(destination_hash):
|
if RNS.Transport.has_path(destination_hash):
|
||||||
|
|
||||||
# To address the server, we need to know it's public
|
# To address the server, we need to know it's public
|
||||||
# key, so we check if Reticulum knows this destination.
|
# key, so we check if Reticulum knows this destination.
|
||||||
|
|
|
@ -209,10 +209,10 @@ def client(destination_hexhash, configpath):
|
||||||
|
|
||||||
|
|
||||||
# Check if we know a path to the destination
|
# Check if we know a path to the destination
|
||||||
if not RNS.Transport.hasPath(destination_hash):
|
if not RNS.Transport.has_path(destination_hash):
|
||||||
RNS.log("Destination is not yet known. Requesting path and waiting for announce to arrive...")
|
RNS.log("Destination is not yet known. Requesting path and waiting for announce to arrive...")
|
||||||
RNS.Transport.requestPath(destination_hash)
|
RNS.Transport.requestPath(destination_hash)
|
||||||
while not RNS.Transport.hasPath(destination_hash):
|
while not RNS.Transport.has_path(destination_hash):
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
# Recall the server identity
|
# Recall the server identity
|
||||||
|
|
|
@ -110,10 +110,10 @@ def client(destination_hexhash, configpath):
|
||||||
reticulum = RNS.Reticulum(configpath)
|
reticulum = RNS.Reticulum(configpath)
|
||||||
|
|
||||||
# Check if we know a path to the destination
|
# Check if we know a path to the destination
|
||||||
if not RNS.Transport.hasPath(destination_hash):
|
if not RNS.Transport.has_path(destination_hash):
|
||||||
RNS.log("Destination is not yet known. Requesting path and waiting for announce to arrive...")
|
RNS.log("Destination is not yet known. Requesting path and waiting for announce to arrive...")
|
||||||
RNS.Transport.requestPath(destination_hash)
|
RNS.Transport.requestPath(destination_hash)
|
||||||
while not RNS.Transport.hasPath(destination_hash):
|
while not RNS.Transport.has_path(destination_hash):
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
# Recall the server identity
|
# Recall the server identity
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
Reticulum Network Stack α
|
Reticulum Network Stack β
|
||||||
==========
|
==========
|
||||||
|
|
||||||
Reticulum is a cryptography-based networking stack for wide-area networks built on readily available hardware, and can operate even with very high latency and extremely low bandwidth. Reticulum allows you to build very wide-area networks with off-the-shelf tools, and offers end-to-end encryption, autoconfiguring cryptographically backed multi-hop transport, efficient addressing, unforgeable packet acknowledgements and more.
|
Reticulum is a cryptography-based networking stack for wide-area networks built on readily available hardware, and can operate even with very high latency and extremely low bandwidth. Reticulum allows you to build very wide-area networks with off-the-shelf tools, and offers end-to-end encryption, autoconfiguring cryptographically backed multi-hop transport, efficient addressing, unforgeable packet acknowledgements and more.
|
||||||
|
|
|
@ -970,7 +970,7 @@ class Transport:
|
||||||
RNS.Packet(destination, packet_hash, context = RNS.Packet.CACHE_REQUEST).send()
|
RNS.Packet(destination, packet_hash, context = RNS.Packet.CACHE_REQUEST).send()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def hasPath(destination_hash):
|
def has_path(destination_hash):
|
||||||
if destination_hash in Transport.destination_table:
|
if destination_hash in Transport.destination_table:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
@ -1130,6 +1130,6 @@ class Transport:
|
||||||
file = open(destination_table_path, "wb")
|
file = open(destination_table_path, "wb")
|
||||||
file.write(umsgpack.packb(serialised_destinations))
|
file.write(umsgpack.packb(serialised_destinations))
|
||||||
file.close()
|
file.close()
|
||||||
RNS.log("Done saving path table to storage", RNS.LOG_VERBOSE)
|
RNS.log("Done saving "+str(len(serialised_destinations))+" path table entries to storage", RNS.LOG_VERBOSE)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
RNS.log("Could not save path table to storage, the contained exception was: "+str(e), RNS.LOG_ERROR)
|
RNS.log("Could not save path table to storage, the contained exception was: "+str(e), RNS.LOG_ERROR)
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="rns",
|
name="rns",
|
||||||
version="0.1.9",
|
version="0.2.0",
|
||||||
author="Mark Qvist",
|
author="Mark Qvist",
|
||||||
author_email="mark@unsigned.io",
|
author_email="mark@unsigned.io",
|
||||||
description="Self-configuring, encrypted and resilient mesh networking stack for LoRa, packet radio, WiFi and everything in between",
|
description="Self-configuring, encrypted and resilient mesh networking stack for LoRa, packet radio, WiFi and everything in between",
|
||||||
|
|
Loading…
Reference in New Issue