Skip to main content

Quickstart

Get an NTL node running and emit your first signal.
NTL is in active development. The API and CLI are subject to change.

Prerequisites

Install

# Install the NTL CLI
cargo install ntl-cli

# Verify installation
ntl --version

Initialize a Node

# Create a new node with default configuration
ntl init

# This creates:
# - ~/.ntl/config.toml    (node configuration)
# - ~/.ntl/identity.key   (node keypair)
# - ~/.ntl/state/         (local state directory)

Start the Node

# Start in development mode (connects to test network)
ntl start --dev

# You should see:
# ✓ Node identity: ntl:8f3a...c721
# ✓ Crypto module: post-quantum (CRYSTALS-Dilithium)
# ✓ Connected to bootstrap: ntl://testnet.nyuchi.com:4433
# ✓ Synapses formed: 3
# ✓ Node ready. Listening for signals.

Emit Your First Signal

Open a second terminal:
# Emit a data signal
ntl emit --type data --payload '{"hello": "world"}' --weight 0.5

# Output:
# ✓ Signal emitted: 01HYX3K...
# ✓ Type: Data
# ✓ Weight: 0.5
# ✓ TTL: 10
# ✓ Propagated to 3 synapses

Listen for Signals

# Listen for all incoming signals
ntl listen

# Or filter by type
ntl listen --type event

# Output (streaming):
# [2026-04-13T10:00:01Z] Signal 01HYX3M... | Type: Data | Weight: 0.42 | From: ntl:a1b2...
# [2026-04-13T10:00:03Z] Signal 01HYX3P... | Type: Event | Weight: 0.38 | From: ntl:c3d4...

Inspect Node State

# View active synapses
ntl synapses

# Output:
# ID          Remote Node       Weight  State   Signals  Latency
# syn:001     ntl:a1b2...c3d4   0.45   Active  142      12ms
# syn:002     ntl:e5f6...g7h8   0.32   Active  87       28ms
# syn:003     ntl:i9j0...k1l2   0.12   Active  23       45ms

# View node health
ntl status

# View local topology
ntl topology

Programmatic Usage

Add NTL to your Rust project:
cargo add ntl
use ntl::{Node, Signal, SignalType};

#[tokio::main]
async fn main() -> Result<(), ntl::Error> {
    // Initialize node
    let node = Node::builder()
        .with_config_file("~/.ntl/config.toml")
        .build()
        .await?;

    // Emit a signal
    let signal = Signal::data("greeting")
        .with_payload(serde_json::json!({"hello": "world"}))
        .with_weight(0.5)
        .emit(&node)
        .await?;

    println!("Signal emitted: {}", signal.id);

    // Listen for signals
    let mut listener = node.listen(SignalType::Data).await?;
    while let Some(signal) = listener.next().await {
        println!("Received: {:?}", signal.payload);
    }

    Ok(())
}

Next Steps

Core Concepts

Understand signals, synapses, and propagation

Your First Signal Handler

Build an application that processes signals

Adapters

Connect existing systems to NTL

Specification

Read the formal protocol spec