Welcome to the Quorum project! This guide helps developers get set up with the local environment, including:
- Installing and configuring Poetry for dependency management
- Using direnv for automatic environment activation
- Running Quorum commands and verifying everything is correct
- Python version
>=3.11,<4.0
- Poetry version
1.8+
(recommended) - direnv (optional but highly recommended for convenience)
- (Optional) A local
.env
file for secret variables, personal overrides, etc.
A quick look at our relevant files and directories:
.
├── LICENSE
├── MANIFEST.in
├── Makefile
├── README.md
├── poetry.lock
├── pyproject.toml
├── .envrc # direnv config file
├── .env.example # Example environment variables
└── src
└── quorum # Project code
├── __init__.py
├── entry_points
├── ...
If you haven’t installed Poetry (or have an older version), do so with:
curl -sSL https://install.python-poetry.org | python3 -
Verify the version:
poetry --version
direnv is a tool that automatically loads/unloads environment variables when entering/leaving directories. We use it to:
- Auto-activate the correct Poetry virtual environment
- Optionally load environment variables from a
.env
file
On macOS (Homebrew):
brew install direnv
On Linux (e.g., Ubuntu/Debian):
sudo apt-get update
sudo apt-get install direnv
For bash or zsh, add this to your ~/.bashrc
, ~/.zshrc
, etc.:
eval "$(direnv hook bash)" # or zsh, fish, etc.
Then run:
direnv allow
So every time you cd
into the project folder, your environment is automatically loaded
And fully configured according to your .env and all packages already installed.
Once inside your project directory (and optionally, after direnv allow
), run:
poetry install
This installs all dependencies (including dev dependencies) listed in pyproject.toml
.
We provide a CLI quorum
. Once your environment is active, you can run:
poetry run quorum --help
Or, if you’re using direnv or in the Poetry shell:
quorum --help
- Single Payload Validation:
quorum validate-address --protocol-name Aave --chain Ethereum --payload-address 0xAD6...
- Batch Validation (config-based):
quorum validate-batch --config path/to/config.json
- Proposal ID Check:
quorum validate-by-id --proposal-id 137 --protocol-name Aave
- IPFS Validation:
quorum validate-ipfs --proposal-id 20 --chain Scroll --payload-address 0x2B25cb...
- Generate Report:
quorum generate-report --proposal_id 137
Ruff is our linter and auto-fixer. pre-commit runs Ruff automatically before each commit if you have it configured. Typical usage:
# Run ruff checks manually:
poetry run ruff check src
# Auto-fix issues:
poetry run ruff check src --fix
If you have a .pre-commit-config.yaml
with a ruff hook, you can do:
pre-commit install
pre-commit run --all-files
If you want to store secrets like ETHSCAN_API_KEY
, ANTHROPIC_API_KEY
, etc., do one of the following:
- Put them in a local
.env
file in the project root (which is.gitignore
d). Example:Then addETHSCAN_API_KEY="abc123" ANTHROPIC_API_KEY="xxx"
dotenv 2>/dev/null
in your.envrc
. - Or set them in your shell profile (
~/.bashrc
,~/.zshrc
, etc.). - Or pass them directly in your CI environment.
You are now set up with:
- Poetry for dependency and environment management
- direnv for auto-activating your environment
- Ruff linting with optional pre-commit hooks
- Quorum CLI commands to run local validations and generate reports