A decentralized, economic, censorship-resistant, public compute infrastructure and blockchain that hosts and executes smart contracts with trustworthy, scalable, concurrent proof-of-stake consensus.
- What is F1r3fly?
- Security Notice
- Installation
- Building
- Running
- Usage
- Configuration
- Troubleshooting
- Development
- Support & Community
- Known Issues & Reporting
- Acknowledgements
- License
F1r3fly is an open-source blockchain platform that provides:
- Decentralized compute infrastructure - Censorship-resistant public blockchain
- Smart contract execution - Hosts and executes programs (smart contracts)
- Scalable consensus - Proof-of-stake consensus with content delivery
- Concurrent processing - Trustworthy and scalable concurrent execution
- Development: Install locally using Nix and direnv for a complete development environment
- Production: Use Docker or system packages for running nodes
- Community: Join the F1r3fly Discord for tutorials, documentation, and project information
- Testnet: Public testnet access coming soon
F1r3fly has two node implementations in this repository on different branches:
| Implementation | Branch | Status | Description |
|---|---|---|---|
| Rust Node | rust/dev (default) |
Production (recommended) | Pure Rust implementation with better performance and no JVM dependency |
| Scala Node | main |
Stable | Original Scala implementation, being phased out in favor of Rust |
Note: You are on the
rust/devbranch (Rust node). For the Scala implementation, switch to themainbranch.
A security review of this code is underway. If you are looking for production ready deployment of this codebase, please contact F1r3fly at f1r3fly.ceo <at> gmail <dot> com. F1r3fly takes no responsibility for material or financial loss under the terms of the Apache 2.0 license.
Pure Rust node - recommended for production and testing
# Pull the latest image
docker pull f1r3flyindustries/f1r3fly-rust-node:latest
# Start a standalone node (simplest - for development)
docker compose -f docker/standalone.yml up
# Or start a multi-validator network (for testing consensus)
docker compose -f docker/shard-with-autopropose.yml up| Port | Service | Description |
|---|---|---|
| 40400 | Protocol Server | Main blockchain protocol |
| 40401 | gRPC External | External gRPC API |
| 40402 | gRPC Internal | Internal gRPC API |
| 40403 | HTTP API | REST/HTTP API endpoints |
| 40404 | Peer Discovery | Node discovery service |
The network automatically creates a docker/data/ directory for blockchain state.
Fresh Start - Reset to genesis:
docker compose -f docker/standalone.yml down
rm -rf docker/data/
docker compose -f docker/standalone.yml up- Docker Hub - f1r3fly-rust-node
- Docker Setup Guide - Complete setup, validator bonding, and network configuration
For development and contributing to F1r3fly
- Install Nix: https://nixos.org/download/
- Install direnv: https://direnv.net/#basic-installation
git clone <repository-url>
cd f1r3fly
direnv allowIf you encounter error: experimental Nix feature 'nix-command' is disabled:
mkdir -p ~/.config/nix
echo "experimental-features = flakes nix-command" > ~/.config/nix/nix.conf
direnv allowThe initial setup will compile all libraries (takes a few minutes).
Docker is recommended for macOS
# Install Docker Desktop for Mac, then:
docker compose -f docker/standalone.yml upNative macOS packages are not currently available.
Note: These packages install the legacy hybrid Scala+Rust node which requires Java. For new deployments, use Docker with the pure Rust node.
Debian/Ubuntu (Legacy)
Dependency: java17-runtime-headless
# Download from GitHub Releases
sudo apt update
sudo apt install ./rnode_X.Y.Z_all.deb
rnode run -sPaths: /usr/bin/rnode, /usr/share/rnode/rnode.jar
RedHat/Fedora (Legacy)
Dependency: java-17-openjdk
# Download from GitHub Releases
sudo dnf install ./rnode-X.Y.Z-1.noarch.rpm
rnode run -sPaths: /usr/bin/rnode, /usr/share/rnode/rnode.jar
Prerequisites: Development environment setup
# Pure Rust Docker image (recommended)
./node/docker-commands.sh build-local
# Clean build
sbt "clean"
# Legacy: Fat JAR for local development (hybrid Scala + Rust)
sbt ";compile ;project node ;assembly ;project rchain"
# Legacy: Hybrid Docker image
docker context use default && sbt ";compile ;project node ;Docker/publishLocal ;project rchain"Build the Rust node Docker image directly using Docker (no SBT required)
The Rust node Docker image is built from a multi-stage Dockerfile located at node/Dockerfile. This creates a pure Rust binary image without Java dependencies.
Using helper script (recommended):
# Source the helper script
source node/docker-commands.sh
# Build for local use (faster, single architecture)
docker_build_local
# Build for production (single architecture)
docker_build
# Build multi-architecture (amd64 + arm64, requires Docker buildx)
MULTI_ARCH=1 docker_buildDirect execution:
# Build locally
./node/docker-commands.sh build-local
# Build for production
./node/docker-commands.sh build
# Build multi-architecture
MULTI_ARCH=1 ./node/docker-commands.sh buildFrom workspace root:
# Build for current architecture
docker build -f node/Dockerfile -t f1r3flyindustries/f1r3fly-rust-node:latest .
# Build for specific architecture
docker buildx build --platform linux/amd64 -f node/Dockerfile \
-t f1r3flyindustries/f1r3fly-rust-node:amd64 .
# Multi-architecture build (requires buildx)
docker buildx build --platform linux/amd64,linux/arm64 \
-f node/Dockerfile \
-t f1r3flyindustries/f1r3fly-rust-node:latest \
--push .- Base images:
rust:bookworm(builder),debian:12-slim(runtime) - Binary: Pure Rust
nodebinary with all dependencies linked - Ports: Exposes 40400-40404 (protocol, gRPC external/internal, HTTP API, discovery)
- Healthcheck: Uses
grpcurlandcurlwithjqfor service validation - User: Runs as
daemonuser - Entrypoint:
/opt/docker/bin/docker-entrypoint.sh(automatically sets--profile=docker)
# Using helper script
source node/docker-commands.sh
docker_publish
DRONE_BUILD_NUMBER=123 docker_publish_drone
# Direct execution
./node/docker-commands.sh publish
DRONE_BUILD_NUMBER=123 ./node/docker-commands.sh publish-droneπ³ Docker Setup: docker/README.md
- Keep SBT running: Use
sbtshell for faster subsequent commands - Project-specific builds:
sbt "project node" compile - Parallel compilation: Automatic with modern SBT
Note: The hybrid node is deprecated. Use the pure Rust node for production deployments.
After setting up the development environment, build the hybrid Docker image:
Native Build:
docker context use default && sbt ";compile ;project node ;Docker/publishLocal ;project rchain"Cross-Platform Build (AMD64 + ARM64):
docker context use default && MULTI_ARCH=true sbt ";compile ;project node ;Docker/publishLocal ;project rchain"Both create: f1r3flyindustries/f1r3fly-hybrid-node:latest
Standalone Node (simplest - for development):
# Single-validator node with instant finalization
docker compose -f docker/standalone.yml up
# Start in background
docker compose -f docker/standalone.yml up -d
# View logs
docker compose -f docker/standalone.yml logs -f
# Stop the node
docker compose -f docker/standalone.yml downMulti-Validator Network (for testing consensus):
# Start the shard network (3 validators + bootstrap + observer)
docker compose -f docker/shard-with-autopropose.yml up
# Start in background
docker compose -f docker/shard-with-autopropose.yml up -d
# View logs
docker compose -f docker/shard-with-autopropose.yml logs -f
# Stop the network
docker compose -f docker/shard-with-autopropose.yml downFresh Start: Reset to genesis state:
# Stop network and remove all blockchain data
docker compose -f docker/standalone.yml down # or shard-with-autopropose.yml
rm -rf docker/data/
docker compose -f docker/standalone.yml up # or shard-with-autopropose.ymlObserver Node (optional - read-only access):
# Start observer (requires running shard network)
docker compose -f docker/observer.yml upBuild the Rust node image and start the cluster:
# Build the Rust node image and start standalone
./node/docker-commands.sh build-local && cd docker && docker-compose -f standalone.yml up
# Or start the full shard network
./node/docker-commands.sh build-local && cd docker && docker-compose -f shard-with-autopropose.yml upIf image is already built:
cd docker && docker-compose -f standalone.yml up
# OR
cd docker && docker-compose -f shard-with-autopropose.yml upNote: This uses the legacy hybrid Scala+Rust node. For production, use the pure Rust Docker image.
After building from source:
java -Djna.library.path=./rust_libraries/release \
--add-opens java.base/sun.security.util=ALL-UNNAMED \
--add-opens java.base/java.nio=ALL-UNNAMED \
--add-opens java.base/sun.nio.ch=ALL-UNNAMED \
-jar node/target/scala-2.12/rnode-assembly-1.0.0-SNAPSHOT.jar \
run -s --no-upnp --allow-private-addresses --synchrony-constraint-threshold=0.0Fresh Start: rm -rf ~/.rnode/
Modern Rust-based CLI for interacting with F1r3fly nodes
The F1r3fly Rust Client provides a comprehensive command-line interface for blockchain operations:
| Feature | Description |
|---|---|
| Deploy | Upload Rholang code to F1r3fly nodes |
| Propose | Create new blocks containing deployed code |
| Full Deploy | Deploy + propose in a single operation |
| Deploy & Wait | Deploy with automatic finalization checking |
| Exploratory Deploy | Execute Rholang without blockchain commitment (read-only) |
| Transfer | Send REV tokens between addresses |
| Bond Validator | Add new validators to the network |
| Network Health | Check validator status and network consensus |
| Key Management | Generate public keys and key pairs for blockchain identities |
π Repository: F1R3FLY-io/rust-client
Installation:
git clone https://github.com/F1R3FLY-io/rust-client.git
cd rust-client
cargo build --releaseQuick Example:
# Deploy a Rholang contract
cargo run -- deploy -f ./rho_examples/stdout.rho
# Check network status
cargo run -- statusPrerequisites: Running node
-
Build the evaluator:
sbt ";compile ;stage" -
Evaluate a contract:
./node/target/universal/stage/bin/rnode \ -Djna.library.path=./rust_libraries/release \ eval ./rholang/examples/tut-ai.rho
Explore the rholang/examples/ directory for sample contracts and tutorials.
Distributed file system built on F1r3fly
F1r3flyFS provides a simple, fast file system interface on top of the F1r3fly blockchain.
π Project: F1r3flyFS Repository
Problem: Unable to load flake.nix or general Nix problems
nix-garbage-collectProblem: Build failures or dependency issues
# Clear coursier cache
rm -rf ~/.cache/coursier/
# Clean SBT
sbt cleanProblem: StackOverflow error during compilation
# Option 1: Direct compile
sbt "node/compile"
# Option 2: Use SBT shell (recommended)
sbt
sbt:rchain> project node
sbt:node> compileProblem: Rust compilation or library loading errors
# Clean Rust libraries
./scripts/clean_rust_libraries.sh
# Reset Rust toolchain
rustup default stableProblem: Docker build failures
# Reset Docker context
docker context use default
# Clean Docker system
docker system prune -aProblem: "Port already in use" errors
# Find processes using F1r3fly ports
lsof -i :40400-40404
# Kill specific process
kill -9 <PID>Customize RNode behavior with HOCON configuration
- Default location: Data directory (usually
~/.rnode/) - Custom location: Use
--config-file <path>command line option - Format: HOCON (Human-Optimized Config Object Notation)
- All available options: defaults.conf
- Standalone example: docker/conf/standalone-dev.conf - Ready-to-use development configuration
Contributing to F1r3fly? Start here!
- Environment: Follow source installation instructions
- Docker: Use
docker/shard-with-autopropose.ymlfor testing - Client: Use F1r3fly Rust Client for interaction
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Make changes and test locally
- Submit pull request
π³ Docker Guide: docker/README.md - Complete Docker setup, validator bonding, and network configuration
Join the F1r3fly community for real-time support, tutorials, and project updates:
π F1r3fly Discord
Available Resources:
- Project tutorials and documentation
- Development planning and discussions
- Events calendar and announcements
- Community support and Q&A
- Documentation: Start with this README and the Node CLI docs
- Troubleshooting: Check the troubleshooting section
- Community: Ask questions in Discord
- Issues: Report bugs in GitHub Issues
Current Issue Trackers:
- F1r3fly Issues: GitHub Issues
- RChain Legacy Issues: Legacy Bug Reports
Report Issues: Create New Issue
Include in your report:
- F1r3fly version
- Operating system and version
- Steps to reproduce
- Expected vs actual behavior
- Relevant logs or error messages
Performance Profiling: We use YourKit to profile F1r3fly performance. YourKit supports open source projects with their full-featured Java and .NET profilers.
Tools:
F1r3fly is licensed under the Apache License 2.0.