Development Setup
This guide explains how to set up your development environment for TrustWeave.
Prerequisites
Required Software
- Java 21+ – Required for compilation and runtime
- Kotlin 2.2.0+ – Included via Gradle plugin
- Gradle 8.5+ – Automatically downloaded via Gradle Wrapper
- Git – For version control
Optional Software
- Docker – Required for
chains/plugins/ganache tests using TestContainers
- IntelliJ IDEA – Recommended IDE with excellent Kotlin support
- Eclipse – Alternative IDE with Kotlin plugin
Cloning the Repository
1
2
| git clone https://github.com/geoknoesis/trustweave.git
cd trustweave
|
Building the Project
Using Gradle Wrapper
Unix/Linux/macOS:
Windows:
Building Specific Modules
1
2
3
4
5
| # Build specific module
./gradlew :trust:build
# Build all modules
./gradlew build
|
Running Tests
All Tests
Specific Module Tests
1
2
3
4
5
| # Run tests for specific module
./gradlew :trust:test
# Run specific test class
./gradlew :trust:test --tests "TrustWeaveTest"
|
EO Integration Tests
1
2
| # Run EO integration tests
./gradlew :chains/plugins/algorand:test --tests "*EoIntegrationTest"
|
Note: Some integration tests require Docker for TestContainers.
IDE Setup
IntelliJ IDEA
- Open IntelliJ IDEA
- Select “Open or Import”
- Navigate to the TrustWeave directory
- Select the root
build.gradle.kts file
- Select “Open as Project”
- Wait for Gradle sync to complete
Eclipse
- Install Kotlin plugin for Eclipse
- Import project as Gradle project
- Wait for Gradle build to complete
Code Quality
1
2
3
4
5
| # Check code formatting
./gradlew ktlintCheck
# Auto-format code
./gradlew ktlintFormat
|
Linting
The project uses ktlint for code formatting. Configure your IDE to format on save:
IntelliJ IDEA:
- Install ktlint plugin
- Enable “Reformat code on save”
- Configure ktlint as formatter
Development Workflow
Creating a Feature Branch
1
| git checkout -b feature/my-feature
|
Running Tests Before Commit
1
2
3
4
5
| # Run all tests
./gradlew test
# Run specific module tests
./gradlew :trust:test
|
Building Before Commit
Code Review Checklist
Before submitting a pull request:
Troubleshooting
Gradle Sync Issues
If Gradle sync fails:
1
2
3
4
5
| # Clean and rebuild
./gradlew clean build
# Invalidate caches (IntelliJ)
File > Invalidate Caches / Restart
|
Test Failures
If tests fail:
1
2
3
4
5
| # Run with more verbose output
./gradlew test --info
# Run specific test
./gradlew test --tests "SpecificTestClass.testMethod"
|
Dependency Issues
If dependencies fail to resolve:
1
2
3
4
5
| # Refresh dependencies
./gradlew --refresh-dependencies
# Clean build
./gradlew clean build
|
Next Steps
References