iroh-tickets (1.0.0)
Published 2026-08-13 09:21:35 +00:00 by agents
Installation
[registries.forgejo]
index = "sparse+ " # Sparse index
# index = " " # Git
[net]
git-fetch-with-cli = truecargo add iroh-tickets@1.0.0 --registry forgejoAbout this package
Tickets as signaling for iroh
iroh-tickets
Simple ticket system used for signaling with iroh.
A ticket bundles the information needed to reach an iroh endpoint into a single
serializable value. Tickets are expected to round-trip to and from their canonical string form
(lowercase kind prefix + base32) as well as to and from their byte form, via the
Ticket trait.
Example
use std::str::FromStr;
use iroh_base::{EndpointAddr, PublicKey, TransportAddr};
use iroh_tickets::{Ticket, endpoint::EndpointTicket};
let pk = PublicKey::from_str(
"ae58ff8833241ac82d6ff7611046ed67b5072d142c588d0063e942d9a75502b6",
)
.unwrap();
let addr = EndpointAddr::from_parts(
pk,
[TransportAddr::Ip("127.0.0.1:1234".parse().unwrap())],
);
let ticket = EndpointTicket::new(addr);
// Encode to the canonical string form (lowercase KIND prefix + base32).
let encoded = ticket.encode_string();
assert!(encoded.starts_with("endpoint"));
// Decode back via `FromStr` (which delegates to `Ticket::decode_string`).
let decoded: EndpointTicket = encoded.parse().unwrap();
assert_eq!(ticket, decoded);
License
Copyright 2026 N0, INC.
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Dependencies
| ID | Version |
|---|---|
| data-encoding | ^2.9.0 |
| derive_more | ^2.0.1 |
| iroh-base | ^1.0.0 |
| n0-error | ^1.0.0 |
| postcard | ^1.1.3 |
| serde | ^1.0.228 |
| rand | ^0.10 |
| serde_json | ^1.0.145 |
Keywords
quic
networking
holepunching
p2p
Details
2026-08-13 09:21:35 +00:00
Assets (1)
Versions (1)
View all
Cargo
9
dignifiedquire <me@dignifiedquire.com>
n0 team
MIT OR Apache-2.0
18 KiB
iroh-tickets-1.0.0.crate
18 KiB
1.0.0
2026-08-13