From 6ffb3830811af2b094e02d475eb64bba57348cfd Mon Sep 17 00:00:00 2001 From: Lincon Vidal Date: Fri, 12 Sep 2025 14:58:43 -0300 Subject: [PATCH 1/6] docs: enhance README for clarity and add contributing guidelines - Introduced a new CONTRIBUTING.md file outlining contribution guidelines, development environment setup, and testing procedures. - Enhanced README.md with updated project overview, key features, quick start instructions, and detailed API usage examples. - Improved documentation structure for better navigation and clarity, including links to relevant resources and support channels. --- CONTRIBUTING.md | 356 ++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 298 ++++++++++++++++++++++++++++------------ 2 files changed, 564 insertions(+), 90 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..6c8fb1d4e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,356 @@ +# Contributing to Cardano Rosetta Java + +Thank you for your interest in contributing to Cardano Rosetta Java! This document provides guidelines and instructions for contributing to the project. + +## Table of Contents + +- [Code of Conduct](#code-of-conduct) +- [Getting Started](#getting-started) +- [Development Environment Setup](#development-environment-setup) +- [Project Structure](#project-structure) +- [Making Contributions](#making-contributions) +- [Testing](#testing) +- [Pull Request Process](#pull-request-process) +- [Code Style Guidelines](#code-style-guidelines) +- [Reporting Issues](#reporting-issues) + +## Code of Conduct + +Please read and follow our [Code of Conduct](CODE-OF-CONDUCT.md). We are committed to providing a welcoming and inclusive environment for all contributors. + +## Getting Started + +1. **Fork the Repository**: Start by forking the [cardano-rosetta-java repository](https://github.com/cardano-foundation/cardano-rosetta-java) to your GitHub account. + +2. **Clone Your Fork**: + ```bash + git clone https://github.com/YOUR-USERNAME/cardano-rosetta-java.git + cd cardano-rosetta-java + ``` + +3. **Add Upstream Remote**: + ```bash + git remote add upstream https://github.com/cardano-foundation/cardano-rosetta-java.git + ``` + +## Development Environment Setup + +### Prerequisites + +- **Java 24** with preview features enabled +- **Maven 3.9+** +- **Docker and Docker Compose** +- **Git** +- **IDE** with Java support (IntelliJ IDEA recommended) + +### Local Development Setup + +1. **Install Java 24**: + ```bash + # Using SDKMAN + sdk install java 24-open + sdk use java 24-open + ``` + +2. **Build the Project**: + ```bash + # Build all modules + mvn clean install + + # Build specific module + mvn clean install -pl api + ``` + +3. **Run Tests**: + ```bash + # Run all tests + mvn test + + # Run specific test class + mvn test -Dtest=ClassName + ``` + +4. **Run Locally with H2 Database** (for development): + ```bash + # Set H2 profile + export SPRING_PROFILES_ACTIVE=h2 + + # Run the API module + cd api + mvn spring-boot:run + ``` + +5. **Run with Docker Compose** (full stack): + ```bash + docker compose --env-file .env.docker-compose-preprod \ + --env-file .env.docker-compose-profile-mid-level \ + -f docker-compose.yaml up -d + ``` + +## Project Structure + +``` +cardano-rosetta-java/ +├── api/ # Main Rosetta API implementation +│ ├── src/main/java/ # API controllers, services, mappers +│ └── src/test/ # API tests +├── yaci-indexer/ # Blockchain indexer module +├── test-data-generator/ # Test data generation utility +├── docker/ # Docker configuration files +├── docs/ # Documentation (Docusaurus) +└── pom.xml # Parent POM +``` + +### Key Packages in API Module + +- `account/` - Account balance operations +- `block/` - Block and transaction retrieval +- `construction/` - Transaction building +- `network/` - Network status and configuration +- `mempool/` - Mempool operations + +## Making Contributions + +### Branch Naming Convention + +- `feature/description` - New features +- `fix/description` - Bug fixes +- `docs/description` - Documentation updates +- `refactor/description` - Code refactoring +- `test/description` - Test additions or fixes + +### Commit Message Format + +Follow the conventional commits specification: + +``` +(): + + + +