Skip to content

catalyst-network/catalyst-node-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Catalyst Network Node

A truly decentralized blockchain node implementation that prioritizes accessibility, fairness, and real-world utility over speculation and wealth concentration.

🌟 Key Features

  • True Decentralization: Anyone can participate without expensive hardware or large token stakes
  • Collaborative Consensus: Energy-efficient, work-based consensus mechanism
  • Multi-Runtime Support: EVM, SVM, and WASM smart contract execution
  • Web2 Integration: Service bus for seamless traditional application integration
  • Modular Architecture: Pluggable components for future extensibility
  • Fair Launch: No pre-mine, no ICO, earn through contribution

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Consensus     β”‚    Database     β”‚    Network      β”‚
β”‚   Module        β”‚    Module       β”‚    Module       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Collaborative   β”‚ Multi-level     β”‚ libp2p-based    β”‚
β”‚ 4-phase         β”‚ RocksDB         β”‚ Peer Discovery  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   File System   β”‚ Virtual Machine β”‚    Service Bus  β”‚
β”‚   Module        β”‚    Module       β”‚    Module       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ IPFS-based      β”‚ EVM/SVM/WASM    β”‚ WebSocket +     β”‚
β”‚ Distributed     β”‚ Multi-runtime   β”‚ Webhook Events  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

Prerequisites

Linux system packages (required for building)

Some crates use native dependencies (e.g. RocksDB / zstd / OpenSSL) and require a C toolchain + headers.

  • Ubuntu/Debian:
    • sudo apt update && sudo apt install -y build-essential pkg-config libssl-dev clang libclang-dev cmake
  • Fedora/RHEL:
    • sudo dnf install -y gcc gcc-c++ make pkgconf-pkg-config openssl-devel clang clang-devel cmake

Working from a network filesystem (GVFS/SMB)

If your repo lives under a GVFS mount (paths containing /gvfs/), Cargo’s file locking inside target/ may fail with Operation not supported (os error 95). This repo’s makefile/Makefile automatically sets CARGO_TARGET_DIR to a local cache dir in that case.

Additionally, some GVFS/SMB mounts prevent Cargo from updating Cargo.lock. In that case, make build will build from a local rsynced mirror under ~/.cache/catalyst-node/gvfs-workdir/src to avoid lockfile write failures.

Build and Run

# Clone the repository
git clone https://github.com/catalyst-network/catalyst-node
cd catalyst-node

# Set up development environment
make setup

# Build the project
make build

# Run a basic node
make run

# Run as validator
make run-validator

# Run with storage provision
make run-storage

Local Testnet (recommended for validating current functionality)

This repo includes a working local testnet harness that runs 3 nodes with:

  • deterministic faucet funding
  • RPC enabled on node1 (http://127.0.0.1:8545)
  • signature + nonce validation
  • LSU application into RocksDB state
  • DFS-backed LSU sync (CID gossip + local content store)
  • persistent mempool with deterministic re-broadcast on restart

Start / stop

Start:

make testnet

Stop:

make stop-testnet

Faster iteration helpers (non-blocking start + status + basic check)

make testnet blocks (it waits on node processes). For day-to-day testing, use:

make testnet-up
make testnet-status
make testnet-basic-test
make testnet-down

Tail logs:

make testnet-logs NODE=node1

Contract sanity check (EVM execution)

This uses a deterministic initcode fixture (testdata/evm/return_2a_initcode.hex) that deploys a contract which returns 0x2a on empty calldata.

make testnet-up
make testnet-contract-test
make testnet-down

Smoke test (single command)

Runs an end-to-end test that:

  • starts the 3-node testnet
  • submits a faucet transaction to node1
  • restarts node1 to test mempool persistence + rehydrate + deterministic re-broadcast
  • verifies node1 balance increases
  • stops the testnet
make smoke-testnet

Logs:

  • testnet/node1/logs/stdout.log
  • testnet/node2/logs/stdout.log
  • testnet/node3/logs/stdout.log

Send a transaction (faucet β†’ node1)

Get node1 public key (used as the β€œaddress” in this scaffold):

NODE1_PUBKEY=$(grep -a "Node ID:" -m1 testnet/node1/logs/stdout.log | awk '{print $NF}')
echo "node1_pubkey=$NODE1_PUBKEY"

Send 25 units from the faucet:

cargo run -p catalyst-cli -- send $NODE1_PUBKEY 25 --key-file testnet/faucet.key --rpc-url http://127.0.0.1:8545

Check node1 balance:

cargo run -p catalyst-cli -- balance $NODE1_PUBKEY --rpc-url http://127.0.0.1:8545

Query peers / chain head / nonce

Peers:

cargo run -p catalyst-cli -- peers --rpc-url http://127.0.0.1:8545

Head:

cargo run -p catalyst-cli -- status --rpc-url http://127.0.0.1:8545

Nonce (faucet):

FAUCET_PUBKEY=$(python3 -c 'print("fa"*32)')
curl -s -X POST http://127.0.0.1:8545 -H 'content-type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"catalyst_getNonce\",\"params\":[\"0x${FAUCET_PUBKEY}\"]}"
echo

Mempool persistence + deterministic re-broadcast

Pending protocol transactions are persisted in RocksDB and reloaded on startup. On restart, node1 will:

  • rehydrate the mempool from persisted txs (after revalidation)
  • deterministically rebroadcast them periodically (stable txid order)
  • prune them once their sender nonce is applied (LSU application)

Docker

# Build Docker image
make docker-build

# Run with Docker
make docker-run

Stable Devnet (invite others to connect)

You can run a single-node β€œdevnet” that:

  • listens on a public P2P port
  • exposes RPC externally (binds to 0.0.0.0)
  • prints the bootstrap multiaddr + RPC URL to share

Public Testnet (operator docs)

  • Config template: crates/catalyst-config/configs/public_testnet.toml
  • Minimal runbook: docs/public_testnet_runbook.md

Start (replace HOST with your public IP or DNS name):

make devnet-up HOST=<public_ip_or_dns> P2P_PORT=30333 RPC_PORT=8545

Stop:

make devnet-down

How others connect

On a remote machine, they run their node and point it at your bootstrap address:

cargo run -p catalyst-cli -- start \
  --validator --rpc --rpc-address 127.0.0.1 --rpc-port 8545 \
  --bootstrap-peers "/ip4/<HOST>/tcp/30333"

Smart contract dev scaffolding (current state)

This repo currently has a scaffolded SmartContract transaction flow:

  • catalyst deploy <bytecode_file> stores contract bytecode under evm:code:<addr20>
  • catalyst_getCode returns that stored bytecode
  • catalyst call is a placeholder (no real EVM bytecode execution yet)

πŸ“‹ Usage

Starting a Node

# Basic node (user role)
catalyst start

# Validator node with RPC
catalyst start --validator --rpc

# Storage provider node
catalyst start --storage --storage-capacity 100

# Full node (validator + storage + RPC)
catalyst start --validator --storage --rpc

Configuration

Create a configuration file:

# Generate default configuration
catalyst start --config catalyst.toml

# Generate node identity
catalyst generate-identity --output identity.json

# Create genesis configuration
catalyst create-genesis --output genesis.json

Interacting with the Network

# Check node status
catalyst status

# View connected peers
catalyst peers

# Send KAT tokens
catalyst send <recipient_address> <amount> --key-file wallet.key

# Check account balance
catalyst balance <address>

# Deploy a smart contract
catalyst deploy contract.bytecode --runtime evm --key-file wallet.key

# Call a smart contract
catalyst call <contract_address> "transfer(address,uint256)" --key-file wallet.key

πŸ”§ Development

Project Structure

catalyst-node/
β”œβ”€β”€ crates/
β”‚   β”œβ”€β”€ catalyst-core/         # Core traits and types
β”‚   β”œβ”€β”€ catalyst-consensus/    # Collaborative consensus implementation
β”‚   β”œβ”€β”€ catalyst-network/      # P2P networking (libp2p)
β”‚   β”œβ”€β”€ catalyst-storage/      # RocksDB storage layer
β”‚   β”œβ”€β”€ catalyst-runtime-evm/  # Ethereum Virtual Machine runtime
β”‚   β”œβ”€β”€ catalyst-runtime-svm/  # Solana Virtual Machine runtime
β”‚   β”œβ”€β”€ catalyst-service-bus/  # Web2 integration service bus
β”‚   β”œβ”€β”€ catalyst-dfs/          # IPFS-based distributed file system
β”‚   β”œβ”€β”€ catalyst-crypto/       # Cryptographic utilities
β”‚   β”œβ”€β”€ catalyst-rpc/          # JSON-RPC server
β”‚   β”œβ”€β”€ catalyst-config/       # Configuration management
β”‚   β”œβ”€β”€ catalyst-utils/        # Common utilities
β”‚   └── catalyst-cli/          # Command-line interface
β”œβ”€β”€ configs/                   # Configuration files
β”œβ”€β”€ docs/                      # Documentation
β”œβ”€β”€ scripts/                   # Build and deployment scripts
└── tests/                     # Integration tests

Development Commands

# Format code
make fmt

# Run lints
make clippy

# Run tests
make test

# Run benchmarks
make bench

# Generate documentation
make docs

# Start local testnet
make testnet

# Watch for changes
make watch

Adding a New Module

  1. Create a new crate: cargo new --lib crates/catalyst-my-module
  2. Add to workspace in root Cargo.toml
  3. Implement the appropriate trait from catalyst-core
  4. Register in the main node configuration

Example module implementation:

use async_trait::async_trait;
use catalyst_core::{CatalystModule, CatalystResult};

pub struct MyModule {
    // Module state
}

#[async_trait]
impl CatalystModule for MyModule {
    fn name(&self) -> &'static str {
        "my-module"
    }

    fn version(&self) -> &'static str {
        "0.1.0"
    }

    async fn initialize(&mut self) -> CatalystResult<()> {
        // Initialize module
        Ok(())
    }

    async fn start(&mut self) -> CatalystResult<()> {
        // Start module processing
        Ok(())
    }

    async fn stop(&mut self) -> CatalystResult<()> {
        // Stop module gracefully
        Ok(())
    }

    async fn health_check(&self) -> CatalystResult<bool> {
        // Check module health
        Ok(true)
    }
}

🌐 Web2 Integration

Service Bus Example

Connect traditional applications to blockchain events:

// Node.js example
const CatalystServiceBus = require('catalyst-service-bus');

const bus = new CatalystServiceBus('ws://localhost:8546');

// Listen for token transfers
bus.on('token_transfer', (event) => {
    console.log('Token transfer:', event);
    
    // Update your traditional database
    updateUserBalance(event.to_address, event.amount);
    
    // Send notification
    sendPushNotification(event.to_address, 'Payment received');
});

bus.connect();
# Python example
from catalyst_service_bus import ServiceBus

bus = ServiceBus('ws://localhost:8546')

@bus.on('contract_event')
def handle_contract_event(event):
    if event.event_name == 'Transfer':
        # Process transfer event
        process_transfer(event.data)

bus.start()

Smart Contract Deployment

Deploy existing Ethereum contracts:

# Deploy with Hardhat/Truffle configuration
npx hardhat deploy --network catalyst

# Or use Catalyst CLI directly
catalyst deploy MyContract.sol --runtime evm --args "constructor_arg"

πŸ“Š Economics

Token Model (KAT)

  • Fair Launch: No pre-mine, no ICO
  • Work-Based Rewards: Earn through network contribution
  • Dynamic Supply: 1-2% annual inflation based on network needs
  • Low Fees: Optimized for usage, not speculation

Earning Opportunities

  1. Validator Rewards: Participate in consensus
  2. Storage Rewards: Provide file storage
  3. Compute Rewards: Execute smart contracts
  4. Development Rewards: Contribute code

Hardware Requirements

Minimum (User Node):

  • 2 CPU cores
  • 4 GB RAM
  • 20 GB storage
  • Broadband internet

Recommended (Validator):

  • 4 CPU cores
  • 8 GB RAM
  • 100 GB SSD storage
  • Stable internet connection

No Special Hardware Required - runs on commodity computers

πŸ” Security

Consensus Security

  • Byzantine Fault Tolerance: Secure with <33% malicious nodes
  • Sybil Resistance: Resource proofs prevent fake nodes
  • Economic Security: Attack cost scales with network size

Cryptographic Foundations

  • Curve25519: Elliptic curve for signatures and keys
  • Blake2b: Fast, secure hashing
  • Bulletproofs: Confidential transaction privacy
  • Schnorr Signatures: Efficient signature aggregation

πŸ§ͺ Testing

Unit Tests

# Run all tests
make test

# Run specific module tests
cargo test --package catalyst-consensus

# Run with output
cargo test -- --nocapture

Integration Tests

# Run integration tests
make test-integration

# Start local testnet for testing
make testnet

Benchmarks

# Run performance benchmarks
make bench

# Profile performance
make profile

πŸ“š Documentation

🀝 Contributing

We welcome contributions! Please see our Contributing Guide.

Getting Started

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes
  4. Run tests: make test
  5. Submit a pull request

Code Standards

  • Format code: make fmt
  • Pass lints: make clippy
  • Add tests for new features
  • Update documentation

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

🌍 Community

πŸ—ΊοΈ Roadmap

Phase 1: Foundation (Q1-Q2 2025)

  • βœ… Modular architecture
  • βœ… Collaborative consensus
  • βœ… EVM compatibility
  • βœ… Basic networking
  • πŸ”„ Fair launch preparation

Phase 2: Integration (Q3-Q4 2025)

  • πŸ”„ Service bus implementation
  • πŸ“‹ SVM runtime integration
  • πŸ“‹ Mobile applications
  • πŸ“‹ Developer tools expansion

Phase 3: Ecosystem (2026+)

  • πŸ“‹ Cross-chain bridges
  • πŸ“‹ Enterprise tools
  • πŸ“‹ Additional runtimes
  • πŸ“‹ Global scaling

❓ FAQ

Q: How is Catalyst different from Ethereum? A: Catalyst prioritizes accessibility over artificial scarcity. No 32 ETH required to validate, collaborative consensus instead of competitive staking.

Q: Can I run existing Ethereum contracts? A: Yes! Catalyst supports EVM compatibility, so existing Ethereum smart contracts can be deployed without modification.

Q: How do I earn rewards? A: Run a node and contribute resources - validation, storage, or computation. Rewards are proportional to contribution, not capital.

Q: What's the service bus? A: A WebSocket/webhook system that lets traditional web applications receive blockchain events like database triggers.

Q: Is there a token sale? A: No. Catalyst launches fairly like Bitcoin - anyone can run a node and earn from day one.


"The future of blockchain is not about who can afford to participate, but about who chooses to contribute."

About

Rust node for version 2 of Catalyst protocol

Resources

Stars

Watchers

Forks

Packages

No packages published