Build from Source¶
This guide covers building Fukuii from source for development or custom builds.
Prerequisites¶
Required Software¶
| Software | Version | Purpose |
|---|---|---|
| JDK | 21 | Runtime and build |
| sbt | 1.10.7+ | Scala build tool |
| Git | Any | Version control |
Install JDK 21¶
Download from Adoptium and install.
Verify installation:
Install sbt¶
Download the MSI installer from scala-sbt.org
Clone the Repository¶
Initialize Submodules¶
Fukuii uses git submodules for some dependencies:
Build Commands¶
Compile¶
# Compile all modules
sbt compile-all
# Or compile individual modules
sbt bytes/compile
sbt crypto/compile
sbt rlp/compile
sbt compile # Main module
Build Distribution¶
The distribution is created at: target/universal/fukuii-<version>.zip
Build Assembly JAR¶
The JAR is created at: target/scala-3.3.4/fukuii-assembly-<version>.jar
Run from Source¶
Using sbt¶
Using Distribution¶
# Extract distribution
cd target/universal
unzip fukuii-*.zip
cd fukuii-*/
# Make launcher executable
chmod +x bin/fukuii
# Run
./bin/fukuii etc
Development Commands¶
Code Quality¶
# Format all code
sbt formatAll
# Check formatting (what CI runs)
sbt formatCheck
# Run static analysis
sbt runScapegoat
Testing¶
# Run all tests
sbt testAll
# Run with coverage
sbt testCoverage
# Run specific module tests
sbt bytes/test
sbt crypto/test
sbt rlp/test
# Run integration tests
sbt "IntegrationTest / test"
Prepare for PR¶
Configuration¶
JVM Options¶
Create or edit .jvmopts in the project root:
Build Settings¶
The main build configuration is in build.sbt. Module dependencies are in project/Dependencies.scala.
Troubleshooting¶
Out of Memory¶
Increase heap size in .jvmopts:
Compilation Errors¶
Ensure you're using JDK 21:
Submodule Issues¶
Re-initialize submodules:
sbt Resolution Errors¶
Clear caches: