Updated docs
parent
954567c581
commit
49918c7e1d
|
|
@ -140,6 +140,9 @@ class Reticulum:
|
|||
# TODO: Let Reticulum somehow continously build a map of per-hop
|
||||
# latencies and use this map for global timeout calculation.
|
||||
DEFAULT_PER_HOP_TIMEOUT = 6
|
||||
"""
|
||||
The default per-hop timeout value used in various timeout calculations.
|
||||
"""
|
||||
|
||||
# Length of truncated hashes in bits.
|
||||
TRUNCATED_HASHLENGTH = 128
|
||||
|
|
@ -207,7 +210,7 @@ class Reticulum:
|
|||
@staticmethod
|
||||
def get_instance():
|
||||
"""
|
||||
Return the currently running Reticulum instance
|
||||
Returns the currently running Reticulum instance.
|
||||
"""
|
||||
return Reticulum.__instance
|
||||
|
||||
|
|
@ -1655,6 +1658,16 @@ class Reticulum:
|
|||
return str(RNS.Transport.next_hop_interface(destination))
|
||||
|
||||
def get_first_hop_timeout(self, destination):
|
||||
"""
|
||||
Returns a best-effort estimate of a reasonable minimum
|
||||
*first-hop* timeout value for a given destination hash.
|
||||
If a path is known, this calculation takes the next-hop
|
||||
interface's bitrate into account. If no path is currently
|
||||
known, returns ``DEFAULT_PER_HOP_TIMEOUT``.
|
||||
|
||||
:param destination: A destination hash, as *bytes*.
|
||||
:returns: First-hop timeout, in seconds.
|
||||
"""
|
||||
if self.is_connected_to_shared_instance:
|
||||
try:
|
||||
rpc_connection = self.get_rpc_client()
|
||||
|
|
|
|||
|
|
@ -365,10 +365,12 @@
|
|||
<li><a href="reference.html#RNS.Identity.decrypt">(RNS.Identity method)</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
<li><a href="reference.html#RNS.Transport.deregister_announce_handler">deregister_announce_handler() (RNS.Transport static method)</a>
|
||||
<li><a href="reference.html#RNS.Reticulum.DEFAULT_PER_HOP_TIMEOUT">DEFAULT_PER_HOP_TIMEOUT (RNS.Reticulum attribute)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="reference.html#RNS.Transport.deregister_announce_handler">deregister_announce_handler() (RNS.Transport static method)</a>
|
||||
</li>
|
||||
<li><a href="reference.html#RNS.Destination.deregister_request_handler">deregister_request_handler() (RNS.Destination method)</a>
|
||||
</li>
|
||||
<li><a href="reference.html#RNS.Destination">Destination (class in RNS)</a>
|
||||
|
|
@ -434,6 +436,8 @@
|
|||
<li><a href="reference.html#RNS.Link.get_establishment_rate">get_establishment_rate() (RNS.Link method)</a>
|
||||
</li>
|
||||
<li><a href="reference.html#RNS.Link.get_expected_rate">get_expected_rate() (RNS.Link method)</a>
|
||||
</li>
|
||||
<li><a href="reference.html#RNS.Reticulum.get_first_hop_timeout">get_first_hop_timeout() (RNS.Reticulum method)</a>
|
||||
</li>
|
||||
<li><a href="reference.html#RNS.Resource.get_hash">get_hash() (RNS.Resource method)</a>
|
||||
</li>
|
||||
|
|
@ -459,10 +463,10 @@
|
|||
<li><a href="reference.html#RNS.Resource.get_progress">(RNS.Resource method)</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
<li><a href="reference.html#RNS.Identity.get_public_key">get_public_key() (RNS.Identity method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="reference.html#RNS.Identity.get_public_key">get_public_key() (RNS.Identity method)</a>
|
||||
</li>
|
||||
<li><a href="reference.html#RNS.Link.get_q">get_q() (RNS.Link method)</a>
|
||||
|
||||
<ul>
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -335,10 +335,34 @@ alterations should be made on a per-interface basis instead.</p>
|
|||
to successfully establish links. Currently 5 bits per second.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
<dt class="sig sig-object py" id="RNS.Reticulum.DEFAULT_PER_HOP_TIMEOUT">
|
||||
<span class="sig-name descname"><span class="pre">DEFAULT_PER_HOP_TIMEOUT</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">6</span></em><a class="headerlink" href="#RNS.Reticulum.DEFAULT_PER_HOP_TIMEOUT" title="Link to this definition">¶</a></dt>
|
||||
<dd><p>The default per-hop timeout value used in various timeout calculations.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt class="sig sig-object py" id="RNS.Reticulum.get_instance">
|
||||
<em class="property"><span class="k"><span class="pre">static</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">get_instance</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#RNS.Reticulum.get_instance" title="Link to this definition">¶</a></dt>
|
||||
<dd><p>Return the currently running Reticulum instance</p>
|
||||
<dd><p>Returns the currently running Reticulum instance.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt class="sig sig-object py" id="RNS.Reticulum.get_first_hop_timeout">
|
||||
<span class="sig-name descname"><span class="pre">get_first_hop_timeout</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">destination</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#RNS.Reticulum.get_first_hop_timeout" title="Link to this definition">¶</a></dt>
|
||||
<dd><p>Returns a best-effort estimate of a reasonable minimum
|
||||
<em>first-hop</em> timeout value for a given destination hash.
|
||||
If a path is known, this calculation takes the next-hop
|
||||
interface’s bitrate into account. If no path is currently
|
||||
known, returns <code class="docutils literal notranslate"><span class="pre">DEFAULT_PER_HOP_TIMEOUT</span></code>.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
||||
<dd class="field-odd"><p><strong>destination</strong> – A destination hash, as <em>bytes</em>.</p>
|
||||
</dd>
|
||||
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
||||
<dd class="field-even"><p>First-hop timeout, in seconds.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
|
|
@ -2337,7 +2361,9 @@ will announce it.</p>
|
|||
<li><a class="reference internal" href="#RNS.Reticulum.LINK_MTU_DISCOVERY"><code class="docutils literal notranslate"><span class="pre">LINK_MTU_DISCOVERY</span></code></a></li>
|
||||
<li><a class="reference internal" href="#RNS.Reticulum.ANNOUNCE_CAP"><code class="docutils literal notranslate"><span class="pre">ANNOUNCE_CAP</span></code></a></li>
|
||||
<li><a class="reference internal" href="#RNS.Reticulum.MINIMUM_BITRATE"><code class="docutils literal notranslate"><span class="pre">MINIMUM_BITRATE</span></code></a></li>
|
||||
<li><a class="reference internal" href="#RNS.Reticulum.DEFAULT_PER_HOP_TIMEOUT"><code class="docutils literal notranslate"><span class="pre">DEFAULT_PER_HOP_TIMEOUT</span></code></a></li>
|
||||
<li><a class="reference internal" href="#RNS.Reticulum.get_instance"><code class="docutils literal notranslate"><span class="pre">get_instance()</span></code></a></li>
|
||||
<li><a class="reference internal" href="#RNS.Reticulum.get_first_hop_timeout"><code class="docutils literal notranslate"><span class="pre">get_first_hop_timeout()</span></code></a></li>
|
||||
<li><a class="reference internal" href="#RNS.Reticulum.should_use_implicit_proof"><code class="docutils literal notranslate"><span class="pre">should_use_implicit_proof()</span></code></a></li>
|
||||
<li><a class="reference internal" href="#RNS.Reticulum.transport_enabled"><code class="docutils literal notranslate"><span class="pre">transport_enabled()</span></code></a></li>
|
||||
<li><a class="reference internal" href="#RNS.Reticulum.link_mtu_discovery"><code class="docutils literal notranslate"><span class="pre">link_mtu_discovery()</span></code></a></li>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -69,9 +69,27 @@ alterations should be made on a per-interface basis instead.
|
|||
Minimum bitrate required across a medium for Reticulum to be able
|
||||
to successfully establish links. Currently 5 bits per second.
|
||||
|
||||
#### `DEFAULT_PER_HOP_TIMEOUT = 6`
|
||||
|
||||
The default per-hop timeout value used in various timeout calculations.
|
||||
|
||||
#### `static get_instance()`
|
||||
|
||||
Return the currently running Reticulum instance
|
||||
Returns the currently running Reticulum instance.
|
||||
|
||||
#### `get_first_hop_timeout(destination)`
|
||||
|
||||
Returns a best-effort estimate of a reasonable minimum
|
||||
*first-hop* timeout value for a given destination hash.
|
||||
If a path is known, this calculation takes the next-hop
|
||||
interface’s bitrate into account. If no path is currently
|
||||
known, returns `DEFAULT_PER_HOP_TIMEOUT`.
|
||||
|
||||
* **Parameters:**
|
||||
**destination** – A destination hash, as *bytes*.
|
||||
|
||||
* **Returns:**
|
||||
First-hop timeout, in seconds.
|
||||
|
||||
#### `static should_use_implicit_proof()`
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue