Skip to content

Commit 0ff9c11

Browse files
authored
A slew of cleanups (#198)
* fix a bunch of broken links * We have docker images now * Gossip section in the API * Gossip component in more places * Correct Layer / Component terminology in a few places
1 parent 12a0ad3 commit 0ff9c11

File tree

11 files changed

+123
-39
lines changed

11 files changed

+123
-39
lines changed

api-code-examples/api.mjs

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
const docs = [
32
{
43
name: 'docs delete',
@@ -247,7 +246,7 @@ gjfmivyaycuads6ek4asma3qacdtvs6waaaaaaaaaanctrkxaetag4aaq45mprsyystlwe66csxvqmru
247246
description: 'Set the active document (only works within the Iroh console).',
248247
slug: 'docs-switch',
249248
arguments: [
250-
{ name: 'id', necessity: 'required', description: 'The [identifier](/docs/layers/documents#document-identifiers) of the document to switch to.' },
249+
{ name: 'id', necessity: 'required', description: 'The [document identifier](/docs/components/documents#document-identifiers) of the document to switch to.' },
251250
],
252251
examples: {
253252
console: `> docs create
@@ -409,6 +408,29 @@ author:2ziftxhhind7atie
409408
}
410409
]
411410

411+
const gossip = [
412+
{
413+
name: 'gossip subscribe',
414+
description: 'Subscribe to a gossip topic',
415+
slug: 'gossip-subscribe',
416+
arguments: [
417+
{
418+
name: 'topic',
419+
necessity: 'required',
420+
description: 'The topic to subscribe to'
421+
},
422+
{
423+
name: 'bootstrap',
424+
necessity: '',
425+
description: 'one or more nodeIDs to bootstrap the subscription (nodes already hosting the topic)'
426+
}
427+
],
428+
examples: {
429+
console: `> gossip subscribe --topic your-topic-name-here`
430+
}
431+
},
432+
]
433+
412434
const tags = [
413435
{
414436
name: 'tags list',
@@ -804,6 +826,7 @@ const api = {
804826
docs,
805827
authors,
806828
tags,
829+
gossip,
807830
blobs
808831
};
809832

src/app/blog/why-we-forked-quinn/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default (props) => <BlogPostLayout article={post} {...props} />
3333

3434
We chose QUIC as the transport protocol to underpin iroh on the network because it offers desirable user-facing features, such as multiple-ordered streams that do not block each other. However, we also chose QUIC for no small part because it sends UDP packets over the network. Leveraging UDP is instrumental in allowing us to do reliable hole-punching through firewalls and NAT routers to establish direct connections.
3535

36-
We opted to use [Quinn](https://github.com/quinn-rs/quinn), a solid open-source implementation with all the features we needed for iroh. It allowed us to plug in our custom [MagicSocket](https://iroh.computer/docs/layers/networking#magic-sockets), which selects the best network path among multiple paths between iroh endpoints with the help of a relay server.
36+
We opted to use [Quinn](https://github.com/quinn-rs/quinn), a solid open-source implementation with all the features we needed for iroh. It allowed us to plug in our custom [MagicSocket](https://iroh.computer/docs/components/net#magic-sockets), which selects the best network path among multiple paths between iroh endpoints with the help of a relay server.
3737

3838
We had great success integrating with the Quinn API. However, even with our success, we knew we would likely see some performance issues in iroh because we couldn’t integrate closely *enough* with certain QUIC features.
3939

src/app/docs/api/docs-switch/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Set the active document (only works within the Iroh console). {{ className: 'lea
2121

2222
| name | necessity | description |
2323
| ---- | --------- | ----------- |
24-
| id | required | The [identifier](/docs/layers/documents#document-identifiers) of the document to switch to. |
24+
| id | required | The [document identifier](/docs/components/documents#document-identifiers) of the document to switch to. |
2525

2626

2727

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{/* THIS FILE IS GENERATED FROM A TEMPLATE. See scripts/generate-api-pages.js for more */}
2+
import Breadcrumbs from '@/components/Breadcrumbs'
3+
export const metadata = {
4+
title: "gossip subscribe",
5+
description: "Subscribe to a gossip topic"
6+
}
7+
8+
<div className='not-prose mb-5'>
9+
<Breadcrumbs pages={[
10+
{ name: 'API', href: '/docs/api', current: false },
11+
{ name: 'gossip subscribe', href: '/docs/api/gossip-subscribe', current: true },
12+
]} />
13+
</div>
14+
15+
# gossip subscribe
16+
17+
Subscribe to a gossip topic {{ className: 'lead' }}
18+
19+
20+
### Arguments
21+
22+
| name | necessity | description |
23+
| ---- | --------- | ----------- |
24+
| topic | required | The topic to subscribe to |
25+
| bootstrap | | one or more nodeIDs to bootstrap the subscription (nodes already hosting the topic) |
26+
27+
28+
29+
## Examples
30+
31+
<CodeGroup title="gossip subscribe">
32+
```text {{ title: 'console' }}
33+
> gossip subscribe --topic your-topic-name-here
34+
```
35+
36+
37+
38+
39+
</CodeGroup>

src/app/docs/api/page.mdx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,28 @@ Iroh has a single application programming interface (API), implemented in numero
1515

1616
## Documents
1717

18-
Manage & manipulate [documents](/docs/layers/documents): syncable, multi-writer key-value stores.
18+
Manage & manipulate [documents](/docs/components/docs): syncable, multi-writer key-value stores.
1919

2020
<ApiCommands commands={commands.docs} />
2121

2222
---
2323

2424
## Authors
2525

26-
[Authors](/docs/layers/documents#authors-and-permissions) manage & view documents.
26+
[Authors](/docs/components/docs#authors-and-permissions) manage & view documents.
2727

2828
<ApiCommands commands={commands.authors} />
2929

3030
---
3131

32+
## Gossip
33+
34+
[Gossip](/docs/components/gossip) broadcasts messages to a group of nodes.
35+
36+
<ApiCommands commands={commands.gossip} />
37+
38+
---
39+
3240
## Tags
3341

3442
Tags are local, human-readable names for things iroh should keep.
@@ -39,15 +47,15 @@ Tags are local, human-readable names for things iroh should keep.
3947

4048
## Blobs
4149

42-
[Blobs](/docs/layers/blobs) are opaque content-addressed byte sequences.
50+
[Blobs](/docs/components/blobs) are opaque content-addressed byte sequences.
4351

4452
<ApiCommands commands={commands.blobs} />
4553

4654
---
4755

4856
## Net
4957

50-
Manage [remote node connections](/docs/layers/networking)
58+
Manage [remote node connections](/docs/components/networking)
5159

5260
<ApiCommands commands={commands.net} />
5361

src/app/docs/concepts/page.mdx

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,26 @@ import { Resources, Resource } from '@/components/Resources';
22

33
# Concepts
44

5-
<Resources title='iroh layers'>
5+
<Resources title='iroh components'>
66
<Resource
7-
href='/docs/layers/documents'
7+
href='/docs/components/documents'
88
name='Documents'
99
description='Documents are portable, syncable key-value stores'
1010
icon='CodeBracketIcon'
1111
pattern={{ y: 32, squares: [[0, 2], [1, 4]] }}
1212
/>
1313
<Resource
14-
href='/docs/layers/blobs'
14+
href='/docs/components/blobs'
1515
name='SDKs'
1616
description='Content-addressable storage & transfer of any-sized binary data'
1717
icon='ArchiveBoxIcon'
1818
pattern={{ y: -6, squares: [[-1, 2], [1, 3]] }}
1919
/>
2020
<Resource
21-
href='/docs/layers/networking'
21+
href='/docs/components/net'
2222
name='Todos Example'
2323
description='Connect to any device by node ID'
2424
icon='UserIcon'
2525
pattern={{ y: 16, squares:[[0, 1],[1, 3]] }}
2626
/>
27-
</Resources>
28-
29-
<Resources title='iroh concepts'>
30-
<Resource
31-
href='/docs/concepts/anchors'
32-
name='Anchor Nodes'
33-
description='Anchors are high-availability iroh nodes that support apps'
34-
icon='CodeBracketIcon'
35-
pattern={{ y: 32, squares: [[0, 2], [1, 4]] }}
36-
/>
3727
</Resources>

src/app/docs/install/page.mdx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Iroh is meant be used as a library by importing one of the existing Iroh SDKs, b
1313
</div>
1414
</Note>
1515

16+
## Install via bash script
1617

1718
Run this script to get started:
1819
```bash
@@ -34,7 +35,17 @@ $ iroh --help
3435

3536
## Docker Containers
3637

37-
The Iroh CLI is not currently available as a docker image. We're working on it.
38+
Iroh is available as a Docker container. To run the latest version, run:
39+
40+
```bash
41+
docker pull n0computer/iroh
42+
```
43+
44+
We also make supporting binaries like the iroh relay & iroh DNS available on [docker hub](https://hub.docker.com/u/n0computer)
45+
46+
## NixOS
47+
48+
Iroh is available as a [nix flake](https://mynixos.com/nixpkgs/package/iroh)
3849

3950
## Building from Source
4051
Details on how to build from source can be found in the iroh [Developer documentation](https://github.com/n0-computer/iroh).

src/app/docs/ipfs/page.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Here's a quick rundown on some of the core technical distinctions between IPFS &
2020

2121
| Concept | Iroh | Kubo |
2222
| ------- | ---- | ---- |
23-
| **[CID](https://docs.ipfs.tech/concepts/content-addressing/) Usage** | Used for root hashes on the [Blob layer](/docs/layers/blobs) | Used for all blocks |
23+
| **[CID](https://docs.ipfs.tech/concepts/content-addressing/) Usage** | Used for root hashes on the [Blob layer](/docs/components/blobs) | Used for all blocks |
2424
| **Hash Function** | BLAKE3 | Various, SHA2 by default |
2525
| **Maximum Block Size** | none | 1MiB |
2626
| **Data Layout** | Key-Value | Directed Acyclic Graphs (DAGs) |
2727
| **Data Model** | "Bring your own" | [IPLD](https://ipld.io/specs) or "Bring your own" |
28-
| **Syncing** | [Document Layer](/docs/layers/documents) | none |
29-
| **Networking Stack** | [Connection Layer](/docs/layers/connections) | [libp2p](https://libp2p.io) |
28+
| **Syncing** | [documents](/docs/components/documents) | none |
29+
| **Networking Stack** | [iroh-net](/docs/components/net) | [libp2p](https://libp2p.io) |
3030
| **Public Key Cryptography** | ED25519 Keys | Various, ED25519 by default |
3131
| **Naming system** | none | [IPNS](https://specs.ipfs.tech/ipns/), [DNSLink](https://dnslink.dev/) |
3232
| **Content Storage** | User Files + Cache | Internal Repository |

src/app/docs/overview/page.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ Every key in a document points to a hash-verified blob of bytes. We say “blobs
4343
Iroh is organized into three _layers_. Each higher layer depends on functionality in the layer below it. Documents rely on blobs, and blobs rely on connections.
4444

4545
<Concepts>
46-
<Concept name="Documents" href="/docs/layers/documents" description="Collaborate on shared key-value tables of blobs with peers." />
47-
<Concept name="Blobs" href="/docs/layers/blobs" description="Fetch and cache byte sequences by their hash." />
48-
<Concept name="Connections" href="/docs/layers/connections" description="Open a connection to any available peer on the network." />
46+
<Concept name="Documents" href="/docs/components/documents" description="Collaborate on shared key-value tables of blobs with peers." />
47+
<Concept name="Blobs" href="/docs/components/blobs" description="Fetch and cache byte sequences by their hash." />
48+
<Concept name="Gossip" href="/docs/components/gossip" description="Broadcast messages to a swarm of peers." />
49+
<Concept name="Net" href="/docs/components/net" description="Open a connection to any available peer on the network." />
4950
</Concepts>
5051

5152
Most users can and should be able to build entire applications with only the sync layer. If your use case is complex, iroh lets you remove the batteries, dropping down to lower layers in the stack. You can build trustless systems directly on the blob layer, or build your own networking protocol using the networking layer.

src/app/docs/quickstart/page.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ export const metadata = {
88

99
This guide will give you a quick tour of iroh from the command line. We'll create a document and sync it between two terminals. After that we'll look at where to go next to learn about how iroh works & where to integrate into your application. {{className: 'lead'}}
1010

11+
<Note>
12+
Iroh is meant be used as a library by importing one of the existing Iroh SDKs. the Quickstart uses the CLI as a language-agnostic startiong point.
13+
14+
<div className="not-prose mb-16 mt-6 flex gap-3">
15+
<Button href="/docs/sdks" arrow="right" variant="text" children="Explore SDKs" />
16+
</div>
17+
</Note>
18+
1119
## Install Iroh
1220

1321
The first thing you'll need to do is get the iroh CLI. Follow the instructions on our [install guide](/docs/install) to install iroh.

0 commit comments

Comments
 (0)