MESH ONLINECODENAME: Circus Maximus
$ lang
v0.33
docs/start/install/TypeScript
getting started

Install

Net ships as one release across five surfaces: a Rust crate, native Node and Python bindings built from that same crate, a Go module over its C ABI, and the C ABI itself. They are not independent ports. A version number means the same code underneath, whichever package you install.

What you are installing

Two layers, and knowing which one you have saves an afternoon:

  • The core binding — the bus, the mesh transport, the storage stack. In Rust that is the crate; in Node and Python it is the native addon.
  • The ergonomic SDK — typed channels, node builders, RPC helpers. A thin layer over the core, published separately.

Some surfaces reach features only through the core layer, never the SDK. That is not a bug to work around and it is the most common way to be wrong about Net in Node and Python: if an import fails, check which layer the symbol lives on before concluding the feature is missing.

Versions move together

Every package publishes at the same version from the same commit. The current published release is 0.33. Pin the same version across layers — a core at one version and an SDK at another is a combination nobody built or tested.

What an install gives you

Whichever surface you start on:

  • the event bus — publish, poll, filters, shards;
  • mesh transport with NAT traversal — peer discovery, encrypted sessions, identity-bound routing;
  • the storage stack — RedEX logs, CortEX folds, NetDB queries, Dataforts blobs;
  • daemon authoring through MeshOS;
  • typed RPC through nRPC.

You do not have to use any of the higher layers to use the bus. They are there when you need them.

One thing to expect on your first run

The default transport is memory, and memory discards events after counting them. A first program that publishes and then tries to read the event back will not fail — it will hang, waiting for something that is never coming. Verifying that the bus accepted an event is the right first check, and every language's instructions below end with exactly that.

Receiving events back needs an adapter that retains them (Redis, JetStream) or the mesh transport between two nodes. That is a separate decision, not a default.

Deck, the operator TUI

A separate binary that nothing else depends on. Install it from whichever ecosystem is convenient — it is the same tool either way:

code
cargo install net-deck
npm i -g @net-mesh/deck
pip install net-deck

See the Deck reference for the tabs and the signed admin surface.

Install it — TypeScript / Node

code
npm install @net-mesh/core     # the native addon
npm install @net-mesh/sdk      # the ergonomic SDK, if you want typed channels

Both publish at 0.33. @net-mesh/core is a native addon built with napi-rs; prebuilt binaries ship for Windows, macOS and Linux on x86-64 and aarch64, including musl. Node 20 or newer.

The core package also exposes subpath entries, so RPC and query code stays tree-shakeable:

code
import { call } from "@net-mesh/core/mesh_rpc";
import { query } from "@net-mesh/core/meshdb";

What is peculiar about TypeScript here

The exported bus class is Net, not EventBus. EventBus is the internal Rust type the addon is built from; it is not a JS export, and reaching for it is the first thing that goes wrong.

Several surfaces live only on @net-mesh/core, never on @net-mesh/sdk — payments is the clearest case. If an import from the SDK fails, try the core package before concluding the feature does not exist.

Counters are bigint. stats.eventsIngested is not a number; comparing it to one with === is always false, and casting a value above 2^53 truncates silently.

Errors throw, they do not return null. emit and emitRaw throw on failure; the fire-and-forget variants return a boolean instead.

Verify it worked

code
import { NetNode } from '@net-mesh/sdk';
 
interface Hello {
  msg: string;
}
 
async function main(): Promise<void> {
  const node = await NetNode.create({ shards: 1 });
  const ch = node.channel<Hello>('hello/world');
 
  const accepted = ch.publish({ msg: 'hello, mesh' });
  if (!accepted) throw new Error('the bus did not accept the event');
 
  // Counts at the PRODUCER boundary: accepted, not received or stored.
  const stats = node.stats();
  console.log(`accepted: ingested=${stats.eventsIngested}`);
 
  await node.shutdown();
}
 
main().catch((err) => {
  console.error(err);
  process.exit(1);
});

Expect one line, accepted: ingested=1, and a clean exit. This is the example CI executes on every commit, so if it does not behave this way for you the difference is your environment, not the docs.

Next: the TypeScript SDK spine.