GitHub Actions Bot 0399db879c Initial open-sourcing hace 9 meses
..
apps 0399db879c Initial open-sourcing hace 9 meses
crown 0399db879c Initial open-sourcing hace 9 meses
README.md 0399db879c Initial open-sourcing hace 9 meses
nested-workspace.toml 0399db879c Initial open-sourcing hace 9 meses
rustfmt.toml 0399db879c Initial open-sourcing hace 9 meses

README.md

NockApp

DEVELOPER ALPHA

NockApp

NockApps are pure-functional state machines with automatic persistence and modular IO.

The NockApp framework provides two modules, Crown and Sword:

  1. Crown provides a minimal Rust interface to a Nock kernel.
  2. Sword is a modern Nock runtime that achieves durable execution.


Get Started

To test compiling a Nock kernel using the choo command-line Hoon compiler, run the following commands:

cargo build
cd apps/choo
cargo run --release bootstrap/kernel.hoon ../hoon-deps
yes | mv out.jam bootstrap/choo.jam
cargo run --release bootstrap/kernel.hoon ../hoon-deps

For large builds, the rust stack might overflow. To get around this, increase the stack size by setting: RUST_MIN_STACK=838860.

Building NockApps

The crown library is the primary framework for building NockApps. It provides a simple interface to a Kernel: a Nock core which can make state transitions with effects (via the poke() method) and allow inspection of its state via the peek() method.

For compiling Hoon to Nock, we're also including a pre-release of choo: a NockApp for the Hoon compiler. choo can compile Hoon to Nock as a batch-mode command-line process, without the need to spin up an interactive Urbit ship. It is intended both for developer workflows and for CI. choo is also our first example NockApp. More are coming!

Logging Configuration

Basic Usage

# Run with default settings (production mode)
cargo run

# Use minimal log format
MINIMAL_LOG_FORMAT=true cargo run

TLDR

Use MINIMAL_LOG_FORMAT=true for compact logging format

Minimal Log Format Features

The minimal log format (MINIMAL_LOG_FORMAT=true) provides:

  • Single-letter colored log levels (T, D, I, W, E)
  • Simplified timestamps in HH:MM:SS format
  • Abbreviated module paths (e.g., 'crown::kernel::boot' becomes '[cr] kernel::boot')
  • Special handling for slogger messages (colored by log level)

Environment Variables

The following environment variables can be used to configure logging:

# Set log level
RUST_LOG="crown::kernel=trace" cargo run

# Enable minimal log format
MINIMAL_LOG_FORMAT=true cargo run

# Combine environment variables
RUST_LOG="crown::kernel=trace" MINIMAL_LOG_FORMAT=true cargo run