Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ Status: **proposal**. This README records the design research and the
rulings it produced; open questions are tracked in the
[issues](../../issues).

## Releases

Everything here is **unstable** (0.x), but [releases](../../releases) are
**caret-honest**: within a minor line they stay backward-compatible, and
anything breaking bumps the minor. Consumption is pinned at a release's
commit — sibling checkouts and vendored WIT at pinned release commits,
the release-pinned deltic/JSR graph — and bumped deliberately.

## What iroh is, layer by layer

Iroh's stack, per its own documentation, is a set of small layers with a
Expand Down
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "iroh-endpoint-core"
version = "0.0.1"
version = "0.1.0"
edition.workspace = true
publish.workspace = true
description = "Shared endpoint core: the webcrypto-held identity, RPK TLS configs over the polymorph:tls profile, and relay wire framing"
Expand Down
11 changes: 6 additions & 5 deletions experiments/iroh-relay-ws/host/deno.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"//": "MODULE-IDENTITY CONSTRAINT: deltic's wasi-shims and the sibling deltic host modules (.deps/{websocket,webrtc}) import @deltic/runtime/embedder by bare specifier internally; this file maps that specifier ONCE for the whole module graph, so `instanceof ComponentException` holds across every boundary. This is the ONE deno config for all three experiments (iroh-relay-ws, iroh-blobs, ping-demo): the others pass --config pointing here. deltic arrives as exactly-pinned JSR prereleases (0.1.0-pre.g<shorthash> names one upstream commit; @deltic/translator ships the translator wasm for the SAME commit); the version matches host-deltic/deno.json by repo convention (exam-deltic asserts it; see host-deltic/README.md, 'The pin'). minimumDependencyAge keeps Deno's default supply-chain gate for everything else while letting same-day @deltic prereleases resolve. The npm mappings serve the webrtc module's bare specifiers under Deno; a browser build resolves the RTCPeerConnection global instead. compilerOptions.lib carries dom next to deno.ns so the browser entries (browser-entry.ts, ping-demo's demo.ts/overlay.ts) type-check in the same graph as the Deno drivers.",
"//": "MODULE-IDENTITY CONSTRAINT: deltic's wasi package and the sibling deltic host modules (.deps/{websocket,webrtc}) import @deltic/runtime/embedder by bare specifier internally; this file maps that specifier ONCE for the whole module graph, so `instanceof ComponentException` holds across every boundary. This is the ONE deno config for all three experiments (iroh-relay-ws, iroh-blobs, ping-demo): the others pass --config pointing here. deltic arrives as exact-pinned JSR releases (caret-honest upstream: within a minor line releases stay compatible, breaking bumps the minor; per-commit `<next>-pre.g<hash>` prereleases exist between releases — pin exactly; @deltic/translator ships the translator wasm for the SAME commit); the version matches host-deltic/deno.json by repo convention (exam-deltic asserts it; see host-deltic/README.md, 'The pin'). minimumDependencyAge keeps Deno's default supply-chain gate for everything else while letting same-day @deltic publishes resolve. The npm mappings serve the webrtc module's bare specifiers under Deno; a browser build resolves the RTCPeerConnection global instead. compilerOptions.lib carries dom next to deno.ns so the browser entries (browser-entry.ts, ping-demo's demo.ts/overlay.ts) type-check in the same graph as the Deno drivers.",
"nodeModulesDir": "auto",
"minimumDependencyAge": {
"age": "P1D",
Expand All @@ -9,10 +9,11 @@
"lib": ["dom", "dom.iterable", "dom.asynciterable", "deno.ns"]
},
"imports": {
"@deltic/runtime/embedder": "jsr:@deltic/runtime@0.1.0-pre.ga2f84a5/embedder",
"@deltic/runtime/shim": "jsr:@deltic/runtime@0.1.0-pre.ga2f84a5/shim",
"@deltic/translator": "jsr:@deltic/translator@0.1.0-pre.ga2f84a5",
"@deltic/wasi-shims": "jsr:@deltic/wasi-shims@0.1.0-pre.ga2f84a5",
"@deltic/runtime/embedder": "jsr:@deltic/runtime@0.1.0/embedder",
"@deltic/runtime/shim": "jsr:@deltic/runtime@0.1.0/shim",
"@deltic/translator": "jsr:@deltic/translator@0.1.0",
"@deltic/wasi": "jsr:@deltic/wasi@0.1.0",
"@deltic/wasi/io": "jsr:@deltic/wasi@0.1.0/io",
"node-datachannel": "npm:node-datachannel@0.32.3",
"node-datachannel/polyfill": "npm:node-datachannel@0.32.3/polyfill",
"werift": "npm:werift@0.22.2"
Expand Down
30 changes: 15 additions & 15 deletions experiments/iroh-relay-ws/host/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions experiments/iroh-relay-ws/host/harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// globals only.
//
// MODULE-IDENTITY CONSTRAINT (host-deltic/README.md "Module identity"):
// deltic's wasi-shims and this package import `@deltic/runtime/embedder`
// deltic's wasi package and this package import `@deltic/runtime/embedder`
// by bare specifier; the `deno.json` next to this file maps that
// specifier once for the whole module graph, so there is exactly one
// `ComponentException` module instance and `instanceof` holds across every
Expand All @@ -15,7 +15,8 @@
import type { ComponentArtifacts } from "@deltic/runtime/embedder";
import { artifactsFromEnvelope, instantiate } from "@deltic/runtime/embedder";
import type { Translator } from "@deltic/runtime/shim";
import { OutputStream, wasiShims } from "@deltic/wasi-shims";
import { wasi } from "@deltic/wasi";
import { OutputStream } from "@deltic/wasi/io";
import { syntheticNetImports } from "./sockets.ts";

/** Reconstitute build-time-translated artifacts (embedder-api A4). */
Expand Down Expand Up @@ -49,7 +50,7 @@ export interface GuestOptions {
}

/**
* The full import record for the spike guests: deltic's wasi-shims
* The full import record for the spike guests: deltic's wasi()
* baseline (whose A5 parking kernel serves poll/clock suspension), the
* synthetic network fragment (sockets.ts), and stdio routed to the
* console line-buffered.
Expand All @@ -58,7 +59,7 @@ export function guestImports(options: GuestOptions): Record<string, unknown> {
const stdout = new OutputStream(lineSink("guest-out", console.log));
const stderr = new OutputStream(lineSink("guest-err", console.error));
return {
...wasiShims({ cli: { args: options.args, env: options.env } }),
...wasi({ cli: { args: options.args, env: options.env } }),
...syntheticNetImports(),
"wasi:cli/stdout@0.2": { getStdout: (): OutputStream => stdout },
"wasi:cli/stderr@0.2": { getStderr: (): OutputStream => stderr },
Expand All @@ -71,7 +72,7 @@ export function guestImports(options: GuestOptions): Record<string, unknown> {
* `artifacts` is anything `instantiate` accepts (embedder-api A3): the
* translated `ComponentArtifacts`, or `{ componentBytes, translator }`
* with `@deltic/translator`'s instance for in-process translation. jspi
* mode is selected by wasi-shims' own `suspending()` markers (the A5
* mode is selected by the wasi package's own `suspending()` markers (the A5
* kernel); no explicit option is needed.
*/
export async function runGuest(
Expand Down
6 changes: 3 additions & 3 deletions experiments/iroh-relay-ws/host/sockets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// to host-side bridges by well-known port (bridge.ts, webrtc-bridge.ts)
// or by full synthetic destination address (the issue #26 overlay).
//
// Parking is deltic's, not this module's: wasi-shims' kernel (embedder-api
// Parking is deltic's, not this module's: the wasi package's kernel (embedder-api
// A5) serves `wasi:io/poll` and the clock subscriptions with real
// suspension, and its `Pollable` is publicly constructible as the interop
// seam — this module only mints `new Pollable(ready, wait)` over its
Expand All @@ -23,7 +23,7 @@
// browsers.

import { ComponentException } from "@deltic/runtime/embedder";
import { Pollable } from "@deltic/wasi-shims";
import { Pollable } from "@deltic/wasi/io";

// ---------------------------------------------------------------------------
// instrumentation
Expand Down Expand Up @@ -330,7 +330,7 @@ export class ResolveAddressStream {

/**
* The synthetic-network provider fragment (track keys), spread next to
* deltic's `wasiShims(...)`, whose A5 kernel serves `wasi:io/poll` and
* deltic's `wasi(...)`, whose A5 kernel serves `wasi:io/poll` and
* the clock subscriptions these sockets' pollables park under.
*/
export function syntheticNetImports(): Record<string, unknown> {
Expand Down
9 changes: 5 additions & 4 deletions host-deltic/deno.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"//": "MODULE-IDENTITY CONSTRAINT: deltic's wasi-shims and the sibling deltic host modules (.deps/{websocket,webrtc,webcrypto}) import @deltic/runtime/embedder by bare specifier internally; this file maps that specifier ONCE for the whole module graph, so `instanceof ComponentException` holds across every boundary. deltic arrives as exactly-pinned JSR prereleases (0.1.0-pre.g<shorthash> names one upstream commit; @deltic/translator ships the translator wasm for the SAME commit, so the plan-format coupling is self-consistent per graph); deno.lock carries integrity, enforced with --frozen. The version matches experiments/iroh-relay-ws/host/deno.json by repo convention (see README.md, 'The pin'; exam-deltic asserts it). minimumDependencyAge keeps Deno's default supply-chain gate for everything else while letting same-day @deltic prereleases resolve. The npm mappings serve the webrtc module's bare specifiers, which resolve against this config as the entry import map.",
"//": "MODULE-IDENTITY CONSTRAINT: deltic's wasi package and the sibling deltic host modules (.deps/{websocket,webrtc,webcrypto}) import @deltic/runtime/embedder by bare specifier internally; this file maps that specifier ONCE for the whole module graph, so `instanceof ComponentException` holds across every boundary. deltic arrives as exact-pinned JSR releases (caret-honest upstream: within a minor line releases stay compatible, breaking bumps the minor; per-commit `<next>-pre.g<hash>` prereleases exist between releases — pin exactly; @deltic/translator ships the translator wasm for the SAME commit, so the plan-format coupling is self-consistent per graph); deno.lock carries integrity, enforced with --frozen. The version matches experiments/iroh-relay-ws/host/deno.json by repo convention (see README.md, 'The pin'; exam-deltic asserts it). minimumDependencyAge keeps Deno's default supply-chain gate for everything else while letting same-day @deltic publishes resolve. The npm mappings serve the webrtc module's bare specifiers, which resolve against this config as the entry import map.",
"nodeModulesDir": "auto",
"minimumDependencyAge": {
"age": "P1D",
"exclude": ["jsr:@deltic/*"]
},
"imports": {
"@deltic/runtime/embedder": "jsr:@deltic/runtime@0.1.0-pre.ga2f84a5/embedder",
"@deltic/translator": "jsr:@deltic/translator@0.1.0-pre.ga2f84a5",
"@deltic/wasi-shims": "jsr:@deltic/wasi-shims@0.1.0-pre.ga2f84a5",
"@deltic/runtime/embedder": "jsr:@deltic/runtime@0.1.0/embedder",
"@deltic/translator": "jsr:@deltic/translator@0.1.0",
"@deltic/wasi": "jsr:@deltic/wasi@0.1.0",
"@deltic/wasi/io": "jsr:@deltic/wasi@0.1.0/io",
"@polymorph/webcrypto-deltic": "../.deps/webcrypto/js/deltic/src/mod.ts",
"node-datachannel": "npm:node-datachannel@0.32.3",
"node-datachannel/polyfill": "npm:node-datachannel@0.32.3/polyfill",
Expand Down
34 changes: 17 additions & 17 deletions host-deltic/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions host-deltic/src/harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// `iroh.Endpoint.bind(...)` driving shape over `instantiate` + the deltic
// embedder facade.
//
// MODULE-IDENTITY CONSTRAINT: deltic's wasi-shims and the sibling host
// MODULE-IDENTITY CONSTRAINT: deltic's wasi package and the sibling host
// modules import `@deltic/runtime/embedder` by bare specifier internally;
// this package's `deno.json` maps that specifier ONCE for the whole module
// graph, so there is exactly one `ComponentException`/`Stream` module
Expand All @@ -15,7 +15,7 @@
import { defaultTranslator } from "@deltic/translator";
import type { ComponentArtifacts } from "@deltic/runtime/embedder";
import { instantiate, ComponentException } from "@deltic/runtime/embedder";
import { wasiShims } from "@deltic/wasi-shims";
import { wasi } from "@deltic/wasi";
import { webcryptoImports } from "@polymorph/webcrypto-deltic";
import { websocketImports } from "../../.deps/websocket/js/deltic/websocket.ts";
import { webrtcImports } from "../../.deps/webrtc/deltic-impl/src/webrtc.ts";
Expand Down Expand Up @@ -112,7 +112,7 @@ export async function newEndpointInstance(
options: EndpointInstanceOptions,
): Promise<EndpointInstance> {
const artifacts = await loadArtifacts();
const shims = wasiShims({
const shims = wasi({
cli: {
args: [`iroh-endpoint-${options.label}`],
env: { ...options.env },
Expand Down
2 changes: 1 addition & 1 deletion host-deltic/src/sockets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// socket. Scenario 1 asserts exactly that.
//
// A direct-path leg (real UDP over `Deno.listenDatagram`) is the natural
// extension once deltic's wasi-shims grow p3 `wasi:sockets` providers
// extension once deltic's wasi package grows p3 `wasi:sockets` providers
// (lann/deltic#4); this file is where that provider would be wired.

import { ComponentException } from "@deltic/runtime/embedder";
Expand Down
8 changes: 4 additions & 4 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ JUST_VERSION="${JUST_VERSION:-1.54.0}"
WAC_VERSION="${WAC_VERSION:-0.10.1}"

WEBRTC_REPO=https://github.com/polymorph-components/polymorph-webrtc-datachannels.git
WEBRTC_PIN=aa9460c674e9f9a5d3227291333a60ecd5bcd988
WEBRTC_PIN=003aaef572ad2ec847718e326aa4f08879bcf685
WEBCRYPTO_REPO=https://github.com/polymorph-components/polymorph-webcrypto.git
WEBCRYPTO_PIN=662586ad873469c2329a0a73986adef8d5e3c908
WEBCRYPTO_PIN=5bb3d483f30e78b0b029bdedb500956710234c1b
WEBSOCKET_REPO=https://github.com/polymorph-components/polymorph-websocket.git
WEBSOCKET_PIN=9808bdb5d3f62d5212e2e91c9645d2f6cdda9e74
WEBSOCKET_PIN=9bf9e92bb40937724d92a96e357a26c2b715a6dd
IROH_REPO=https://github.com/n0-computer/iroh.git
IROH_PIN=816dd70c056b813dcb5cbfb6a9a15e12d04b72b1 # v1.0.3
TLS_REPO=https://github.com/polymorph-components/polymorph-tls.git
TLS_PIN=e43cad46625b049c1037cc734114457e1ae2cac1
TLS_PIN=2f7a203a711b585439ed679aa3fa4e274284eb33

log() { printf '\n==> %s\n' "$1"; }

Expand Down
Loading
Loading