Skip to content
kynesyslabsPublic

About

Demos Node

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

2 watching

Forks

Latest commit

 

History

4,968 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demos Network Node

Ask DeepWiki

The official node implementation for the Demos Network - a decentralized network enabling secure, cross-chain communication and computation.

Overview

This repository contains the core node software that allows machines to participate in the Demos Network as validators and service providers. The Demos Network is designed to facilitate secure cross-chain operations, privacy-preserving computations, and decentralized services across multiple blockchain ecosystems.

The Demos Yellowpaper

Demos is defined by the Yellowpaper publicly available in its own repository.

System Requirements

Minimum Requirements

  • 4GB RAM
  • 4 CPU cores (2GHz or higher)
  • Modern SSD storage
  • 200 Mbps internet connection
  • Ubuntu 22.04 LTS or compatible Linux distribution

Recommended Specifications

  • 8GB RAM or higher
  • 6 CPU cores (2GHz or higher)
  • High-performance SSD storage
  • 1 Gbps internet connection

Installation

Docker Compose is now the recommended way to run a Demos node. For full installation instructions — both the Docker path and the bare-metal ./run path — see INSTALL.md. The guide covers:

  • Docker Compose quickstart (recommended)
  • Bare-metal install with Bun + Postgres (alternative)
  • Node configuration and key generation
  • Network peer configuration
  • Troubleshooting common issues

Quick Start (Docker)

git clone https://github.com/kynesyslabs/node.git && cd node
cp .env.example .env  # defaults are fine; edit only if you want to override
./run --docker        # docker compose up, with the commit the image is built from

The image refuses to build without the git commit it is built from. ./run --docker exports it; to call compose directly, export it first: export GIT_COMMIT=$(git rev-parse HEAD), then docker compose up.

Once the stack is healthy: RPC at http://localhost:53550 (try curl http://localhost:53550/info) and Grafana at http://localhost:3000 (admin / the GRAFANA_ADMIN_PASSWORD you set in .env).

Reverse-proxy mode (Caddy)

Bring up the same stack behind Caddy on a single TLS endpoint:

./run --docker --proxy            # equivalent to scripts/docker-run --proxy
./run --docker --proxy --no-monitor   # drop Grafana/Prom
./run --docker --proxy -d         # detach
./run --docker down               # teardown (proxy or not)

./run --docker [...] forwards to scripts/docker-run. Plain ./run (no flag) keeps using the bare-metal launcher unchanged.

--proxy merges docker-compose.proxy.yml so only ports 80 + 443 (Caddy) and 53551 (OmniProtocol, custom TLS) remain published. Requires PROXY_DOMAIN + ACME_EMAIL in .env. See docs/runbooks/proxy-setup.md.

See INSTALL.md for profiles, env vars, volumes, upgrades, and troubleshooting.

Publishing the Image

Release images are built and published by CI from a signed tag, twice from clean checkouts, and pushed to ghcr.io/kynesyslabs/node:<tag> only when both builds produce the same digest. Validators pin that tag and digest in .env. The procedure, including how to verify the digest a node runs, is in docs/runbooks/release.md.

The compose file uses ${IMAGE_NAME}:${IMAGE_TAG} (default demos-node:local) for the node service, so the same compose either builds locally for development or pulls the released image. For private registries, run docker login <registry> first.

Advanced / Bare-Metal Run

If you'd rather run the node directly on the host (no Docker for the node itself), the legacy ./run shell script is still supported. It installs Bun, runs Postgres in a sidecar container, and starts the node natively — useful for development, debugging, and TUI-based operation.

See INSTALL.md → Track 2: Bare metal with ./run for the full walkthrough.

Terminal User Interface (TUI)

By default, the node runs with an interactive TUI that provides:

  • Categorized log tabs: View logs filtered by category (Core, Network, Chain, Consensus, etc.)
  • Real-time node status: Block height, peer count, sync status in the header
  • Keyboard navigation: Switch tabs with number keys (0-9), scroll with arrow keys or j/k

TUI Controls

Key Action
0-9, -, = Switch to tab
↑/↓ or j/k Scroll logs
PgUp/PgDn Page scroll
Home/End Jump to top/bottom
A Toggle auto-scroll
C Clear current tab logs
H or ? Show help
Q Quit node

Legacy Mode (for developers)

For debugging and development, you can disable the TUI and use traditional scrolling log output:

./run -t           # Short form
./run --no-tui     # Long form

This provides linear console output that can be easily piped, searched with grep, or redirected to files.

Monitoring

Prometheus + Grafana are part of the unified compose (default profile). Once docker compose up is healthy, Grafana is at http://localhost:3000 (admin / your GRAFANA_ADMIN_PASSWORD, which the monitoring profile requires) with pre-provisioned dashboards. Configuration knobs (GRAFANA_ADMIN_PASSWORD, PROMETHEUS_RETENTION, etc.) live in .env — see INSTALL.md → Track 1 for the full list.

Available node-side metrics (scraped at node:9090/metrics):

Metric Description
demos_block_height Current block height
demos_seconds_since_last_block Time since last block
demos_peer_online_count Connected peers
demos_system_cpu_usage_percent CPU utilization
demos_system_memory_usage_percent Memory utilization
demos_service_docker_container_up Container health status

For dashboard internals and customization, see monitoring/README.md.

Technology Stack

  • Runtime: Bun (required due to performances and advanced native features)
  • Language: TypeScript with modern ES modules
  • Database: PostgreSQL with TypeORM
  • Web Framework: Bun HTTP server with JSON-RPC and REST endpoints
  • Networking: Custom P2P protocol implementation
  • Cryptography: Advanced encryption libraries and post-quantum algorithms

Configuration

After installation, configure your node by editing:

  • .env: Core node settings including network endpoints
  • demos_peerlist.json: Known peer connections for network participation

L2PS subnets and ZK proofs have a guided setup: bun run setup (see INSTALL.md).

Network Ports

For the docker-compose path see INSTALL.md → Network Exposure — that section has the canonical inbound/outbound rules and a ufw example for VPS deployments.

For the bare-metal ./run path:

Required Ports (bare metal)

Port Protocol Description
53550 TCP Node RPC API
53551 TCP OmniProtocol P2P communication
7047 TCP TLSNotary server (FFI/docker)
55000-60000 TCP WebSocket proxy for TLSNotary FFI mode

Optional Ports (bare metal)

Port Protocol Description
9090 TCP Metrics endpoint (monitoring)
9091 TCP Prometheus server (monitoring stack)
3000 TCP Grafana dashboard (monitoring stack)
5332 TCP PostgreSQL (local only, do not expose externally)

Firewall example (ufw):

# Required
sudo ufw allow 53550/tcp        # Node RPC
sudo ufw allow 53551/tcp        # OmniProtocol
sudo ufw allow 7047/tcp         # TLSNotary
sudo ufw allow 55000:60000/tcp  # TLSNotary WS proxy (FFI mode)

Security

The Demos Network node implements multiple layers of security:

  • Cryptographic identity management with public/private key pairs
  • Post-quantum cryptographic algorithms for future-proof security
  • Secure peer-to-peer communication protocols
  • Privacy-preserving computation capabilities

Important: Always keep your private key (.demos_identity file) secure and never share it publicly.

Network Participation

Once your node is running, it will:

  1. Generate a unique cryptographic identity
  2. Connect to other network peers
  3. Participate in consensus mechanisms
  4. Process cross-chain transactions and computations
  5. Contribute to network security and decentralization

Local Development Network (Devnet)

For local development and testing, you can run a 4-node network using Docker Compose instead of requiring 4 separate VPSes.

Quick Start

cd devnet
./scripts/setup.sh           # One-time setup (generates identities + peerlist)
docker-compose up -d         # Start the 4-node network
docker-compose logs -f       # View logs from all nodes
docker-compose down          # Stop the network

Requirements

  • Docker and Docker Compose
  • BuildKit enabled (recommended): export DOCKER_BUILDKIT=1

Node Ports

Node RPC Port Omni Port
node-1 53551 53561
node-2 53552 53562
node-3 53553 53563
node-4 53554 53564

For detailed devnet documentation, see testing/devnet/README.md.

Developer's Guide

This is the official implementation maintained by KyneSys Labs. The codebase follows TypeScript best practices with comprehensive error handling and type safety.

Tooling Overview

Tool Purpose Command
Bun Runtime & package manager bun install, bun run <script>
Trunk Linting & formatting (owns ESLint + Prettier) bun check, bun fmt
TypeScript Type checking bun type-check
Jest Testing bun test:chains

Quick Commands

# Install dependencies
bun install

# Linting & formatting (Trunk-managed)
bun check                    # Run all linters
bun fmt                      # Auto-format code
bun lint                     # ESLint only
bun lint:fix                 # ESLint with auto-fix

# Type checking
bun type-check               # Fast check via Bun
bun type-check-ts            # Full tsc --noEmit

# Development
bun start:bun                # Start node with Bun runtime
bun dev                      # Start with hot reload

# Dependency management
bun upgrade_sdk              # Update @kynesyslabs/demosdk
bun upgrade_deps             # Interactive dependency update

Code Style

  • Trunk owns linting: ESLint and Prettier are managed by Trunk, not npm packages
  • Run bun check before committing: Catches style issues early
  • Double quotes, no semicolons: Per .prettierrc and .eslintrc.cjs
  • camelCase for variables/functions, PascalCase for types/classes

Project Structure Tips

src/
├── features/          # Feature modules (MCP, metrics, multichain, etc.)
├── libs/              # Core libraries (blockchain, consensus, crypto, network)
├── model/             # TypeORM entities and database
├── utilities/         # CLI tools, TUI, helpers
└── index.ts           # Entry point

Common Patterns

  • Logging: Use CategorizedLogger instead of console.log in src/ (ESLint warns)
  • Imports: Prefer @/ path aliases over deep relative imports
  • SDK: Import from @kynesyslabs/demosdk, check demosdk-refs MCP for docs
  • Database: schema changes are TypeORM migrations in src/migrations/, applied by hand with bun run migration:run (the node never migrates at boot, synchronize is off). See docs/runbooks/database-migrations.md

Issue Tracking

This project uses Mycelium (myc) for task and epic management.

Support

For technical support and community discussions, visit demos.sh.

License

This project is licensed under the CC BY-NC-SA 4.0 License - see the LICENSE file for details.

Contributing

We welcome contributions to the Demos Network node implementation! Before contributing, please read our comprehensive Contributing Guide which covers:

  • Code style and naming conventions
  • Development workflow and best practices
  • AI-assisted development guidelines
  • Pull request process and review requirements
  • Testing and quality standards

For quick reference, also see:


Demos Network - Building the future of decentralized, cross-chain computing.

About

Demos Node

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages