mirror of
https://github.com/n0-computer/iroh.git
synced 2026-11-30 16:03:05 +00:00
34 lines
7.7 KiB
HTML
34 lines
7.7 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Support for handling DNS resource records for dialing by `NodeId`."><title>iroh_relay::node_info - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.34.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module node_<wbr>info</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#constants" title="Constants">Constants</a></li><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate iroh_<wbr>relay</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a></span><h1>Module <span>node_info</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/node_info.rs.html#1-757">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Support for handling DNS resource records for dialing by <a href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId"><code>NodeId</code></a>.</p>
|
|
<p>Dialing by <a href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId"><code>NodeId</code></a> is supported by iroh nodes publishing <a href="https://app.pkarr.org">Pkarr</a> records to DNS
|
|
servers or the Mainline DHT. This module supports creating and parsing these records.</p>
|
|
<p>DNS records are published under the following names:</p>
|
|
<p><code>_iroh.<z32-node-id>.<origin-domain> TXT</code></p>
|
|
<ul>
|
|
<li>
|
|
<p><code>_iroh</code> is the record name as defined by <a href="constant.IROH_TXT_NAME.html" title="constant iroh_relay::node_info::IROH_TXT_NAME"><code>IROH_TXT_NAME</code></a>.</p>
|
|
</li>
|
|
<li>
|
|
<p><code><z32-node-id></code> is the <a href="https://philzimmermann.com/docs/human-oriented-base-32-encoding.txt">z-base-32</a> encoding of the <a href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId"><code>NodeId</code></a>.</p>
|
|
</li>
|
|
<li>
|
|
<p><code><origin-domain></code> is the domain name of the publishing DNS server,
|
|
<a href="../dns/constant.N0_DNS_NODE_ORIGIN_PROD.html" title="constant iroh_relay::dns::N0_DNS_NODE_ORIGIN_PROD"><code>N0_DNS_NODE_ORIGIN_PROD</code></a> is the server operated by number0 for production.
|
|
<a href="../dns/constant.N0_DNS_NODE_ORIGIN_STAGING.html" title="constant iroh_relay::dns::N0_DNS_NODE_ORIGIN_STAGING"><code>N0_DNS_NODE_ORIGIN_STAGING</code></a> is the server operated by number0 for testing.</p>
|
|
</li>
|
|
<li>
|
|
<p><code>TXT</code> is the DNS record type.</p>
|
|
</li>
|
|
</ul>
|
|
<p>The returned TXT records must contain a string value of the form <code>key=value</code> as defined
|
|
in <a href="https://www.rfc-editor.org/rfc/rfc1464">RFC1464</a>. The following attributes are defined:</p>
|
|
<ul>
|
|
<li>
|
|
<p><code>relay=<url></code>: The home <a href="../../iroh_base/relay_url/struct.RelayUrl.html" title="struct iroh_base::relay_url::RelayUrl"><code>RelayUrl</code></a> of this node.</p>
|
|
</li>
|
|
<li>
|
|
<p><code>addr=<addr> <addr></code>: A space-separated list of sockets addresses for this iroh node.
|
|
Each address is an IPv4 or IPv6 address with a port.</p>
|
|
</li>
|
|
</ul>
|
|
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.MaxLengthExceededError.html" title="struct iroh_relay::node_info::MaxLengthExceededError">MaxLength<wbr>Exceeded<wbr>Error</a></div><div class="desc docblock-short">Error returned when an input value is too long for <a href="struct.UserData.html" title="struct iroh_relay::node_info::UserData"><code>UserData</code></a>.</div></li><li><div class="item-name"><a class="struct" href="struct.NodeData.html" title="struct iroh_relay::node_info::NodeData">Node<wbr>Data</a></div><div class="desc docblock-short">Data about a node that may be published to and resolved from discovery services.</div></li><li><div class="item-name"><a class="struct" href="struct.NodeInfo.html" title="struct iroh_relay::node_info::NodeInfo">Node<wbr>Info</a></div><div class="desc docblock-short">Information about a node that may be published to and resolved from discovery services.</div></li><li><div class="item-name"><a class="struct" href="struct.UserData.html" title="struct iroh_relay::node_info::UserData">User<wbr>Data</a></div><div class="desc docblock-short">Under the hood this is a UTF-8 String is no longer than <a href="struct.UserData.html#associatedconstant.MAX_LENGTH" title="associated constant iroh_relay::node_info::UserData::MAX_LENGTH"><code>UserData::MAX_LENGTH</code></a> bytes.</div></li></ul><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="constant" href="constant.IROH_TXT_NAME.html" title="constant iroh_relay::node_info::IROH_TXT_NAME">IROH_<wbr>TXT_<wbr>NAME</a></div><div class="desc docblock-short">The DNS name for the iroh TXT record.</div></li></ul><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="trait" href="trait.NodeIdExt.html" title="trait iroh_relay::node_info::NodeIdExt">Node<wbr>IdExt</a></div><div class="desc docblock-short">Extension methods for <a href="../../iroh_base/key/type.NodeId.html" title="type iroh_base::key::NodeId"><code>NodeId</code></a> to encode to and decode from [<code>z32</code>],
|
|
which is the encoding used in [<code>pkarr</code>] domain names.</div></li></ul></section></div></main></body></html> |