Skip to content

Commit fc295d5

Browse files
committed
update
1 parent 7565ebd commit fc295d5

File tree

5 files changed

+37
-19
lines changed

5 files changed

+37
-19
lines changed

concepts/endpoints.mdx

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,35 @@ title: "Endpoints"
44

55
An _endpoint_ is the main API interface to create connections to, and accept
66
connections from other iroh endpoints. The connections are peer-to-peer and
7-
encrypted, a [Relay](/concepts/relays) server is used to make the
8-
connections reliable. Endpoints have a `EndpointID` (the public half of an
7+
end-to-end encrypted. Endpoints have a `EndpointID` (the public half of an
98
Ed25519 keypair) and the private key used to sign and decrypt messages.
109

11-
Generally, an application will have a single endpoint instance. This ensures all the connections made share the same peer-to-peer connections to other iroh endpoints, while still remaining independent connections. This will result in more optimal network behaviour.
10+
Generally, an application will have a single endpoint instance. This ensures all
11+
the connections made share the same peer-to-peer connections to other iroh
12+
endpoints, while still remaining independent connections. This will result in
13+
more optimal network behaviour.
1214

1315

1416
## Endpoint Identifiers
1517

16-
Each endpoint in iroh has a unique identifier (`EndpointID`) created as a cryptographic key. This can be used to globally identify an endpoint. Because `EndpointIDs` are cryptographic keys, they are also the mechanism by which all traffic is always encrypted for a specific endpoint only.
18+
Each endpoint in iroh has a unique identifier (`EndpointID`) created as a
19+
cryptographic key. This can be used to globally identify an endpoint. Because
20+
`EndpointIDs` are cryptographic keys, they are also the mechanism by which all
21+
traffic is always encrypted for a specific endpoint only.
1722

18-
See the [EndpointID](https://docs.rs/iroh/latest/iroh/type.EndpointId.html) documentation for more info.
23+
See the [EndpointID](https://docs.rs/iroh/latest/iroh/type.EndpointId.html) documentation for more information.
1924

2025
## Connections
2126

22-
Because we're in a peer-2-peer context, either endpoint might be operating as the "server", so we use `connect` and `accept` to distinguish between the two. The `connect` method is used to create a new connection to a remote endpoint, while `accept` is used to accept incoming connections from a remote endpoint.
27+
Because we're in a peer-2-peer context, either endpoint might be operating as
28+
the "server", so we use `connect` and `accept` to distinguish between the two.
29+
The `connect` method is used to create a new connection to a remote endpoint,
30+
while `accept` is used to accept incoming connections from a remote endpoint.
2331

24-
Connections are full-fledged QUIC connections, giving you access to most features of QUIC / HTTP3, including bidirectional and unidirectional streams.
32+
Connections are full-fledged QUIC connections, giving you access to most
33+
features of QUIC / HTTP3, including bidirectional and unidirectional streams.
34+
35+
A [Relay](/concepts/relays) server can be used to make the connections reliable.
2536

2637
<Note>
2738
Due to the light-weight properties of QUIC streams a stream can only be accepted once the initiating peer has sent some data on it.
@@ -32,6 +43,6 @@ Due to the light-weight properties of QUIC streams a stream can only be accepted
3243
Endpoints are a low-level primitive that iroh exposes on purpose. For some
3344
projects like [dumbpipe](https://dumbpipe.dev), endpoints are 95% of what you
3445
need to connect any two devices on the planet. For others, like
35-
[iroh-blobs](/proto/iroh-blobs), endpoints are the foundation that higher-level
46+
[Blobs](/protocols/blobs), endpoints are the foundation that higher-level
3647
protocols are built on. Most projects will not work with endpoints beyond
3748
constructing one and feeding it to one or more [protocols](/concepts/protocols).

concepts/protocols.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ to quickly add functionality, work directly with QUIC streams & build a fully
6969
custom protocol that does exactly what you want, or fork an existing protocol to
7070
get what you need.
7171

72-
- [iroh-gossip](/connecting/gossip): creating swarms of peers for broadcasting messages on topics.
73-
- [iroh-blobs](/protocols/blobs): storing and transferring large binary blobs of data.
74-
- [iroh-docs](/protocols/docs): collaborative key-value store.
72+
- [Gossip Broadcast](/connecting/gossip): creating swarms of peers for broadcasting messages on topics.
73+
- [Blobs](/protocols/blobs): storing and transferring large binary blobs of data.
74+
- [Key-value CRDTs](/protocols/kv-crdts): collaborative key-value store.
7575
- [Writing Custom Protocols](/protocols/writing-a-protocol): guide on building your own protocols on top of iroh.

connecting/creating-endpoint.mdx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,26 @@ An endpoint is the core building block of an iroh node. It manages network
66
connections, handles incoming and outgoing traffic, and provides the necessary
77
infrastructure for implementing protocols.
88

9-
To create an endpoint in Iroh, you can use the `Endpoint::bind` method. This
10-
method initializes a new endpoint and binds it to a local address, allowing it
9+
Once you have an Endpoint, you can use it to create connections or accept incoming connections from other endpoints.
10+
11+
Unlike HTTP servers, which listen on specific ports, iroh Endpoints use a peer-to-peer
12+
model to establish connections. This means that endpoints can connect directly
13+
to each other without relying on a central server.
14+
15+
This means that endpoints can be more resilient to network issues and can operate in
16+
a wider range of network environments.
17+
18+
## Creating an Endpoint
19+
20+
This method initializes a new endpoint and binds it to a local address, allowing it
1121
to listen for incoming connections.
1222

1323
```rust
1424
use iroh::Endpoint;
1525

1626
#[tokio::main]
1727
async fn main() {
18-
let endpoint = Endpoint::bind().await.unwrap();
28+
let endpoint = Endpoint::builder().bind().await?;
1929
// ...
2030
}
2131
```
@@ -25,5 +35,3 @@ async fn main() {
2535
incoming connections
2636
2. `await` keyword is used to wait for the endpoint
2737
to be created in an asynchronous context.
28-
3. Once you have an endpoint, you can use it to create connections to other
29-
endpoints, or accept incoming connections from other endpoints.

deployment/security-privacy.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ abuse, we reserve the right to block offending IP addresses or users from
3838
accessing the public relays.
3939

4040
To learn more about deploying and managing your own relays, see the
41-
[n0des](//managing-relays) documentation.
41+
[n0des documentation](/managing-relays).
4242

docs.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
"quickstart",
2121
"examples",
2222
{
23-
"group": "Concepts",
24-
"expanded": true,
23+
"group": "How it works",
2524
"pages": [
2625
"concepts/endpoints",
2726
"concepts/discovery",

0 commit comments

Comments
 (0)