This guide helps you get started developing the Bacalhau project.
- Git
- Python (see pyproject.toml for supported versions)
- Go
- Earthly
- Docker (optional for building, required for running integration tests)
Clone the Bacalhau repository using your preferred tool. Refer to GitHub's documentation for different options.
To clone Bacalhau repository using Git CLI:
git clone https://github.com/bacalhau-project/bacalhau.git
cd bacalhau
We recommend using Python virtual environments to avoid version conflicts.
Create a virtual environment in the .venv
folder:
python -m venv .venv
And activate it:
source .venv/bin/activate
Bacalhau uses pre-commit hooks for linting and formatting code. These checks will also be executed by Bacalhau's CI pipeline on all new pull requests. Check .golangci.yml for the linter rules.
To install the pre-commit hooks:
make install-pre-commit
To check if pre-commit passes:
make precommit
You can check individual build targets in the Makefile or build all of them together. Refer to Key Concepts to learn more about different Bacalhau components.
To build all Bacalhau components:
make build
You can spin up a local Bacalhau stack and interact with it. For a detailed guide, check Bacalhau documentation.
To run a local stack:
make devstack
You can run the local stack with a number of different configurations. For details, check the devstack-*
targets in the Makefile.
Bacalhau tests can be generally divided into these categories:
- Unit tests
- Tests against a local stack
- Integration tests using Docker
To run all unit tests:
make unit-test
These tests will run a Bacalhau stack in local processes and execute tests against it. No Docker is required.
To run tests against a local stack:
make integration-test
These tests mimic a real-life distributed installation of Bacalhau by running node processes in Docker containers (using Testcontainers). Refer to the Integration Test guide for detailed steps.