The exporter is used to scrape metrics from blockchain RPC endpoints. The purpose of this exporter is to perform black-box testing on RPC endpoints.
Exporter currently supports all EVM-compatible chains. In addition, there is limited support for the following chains:
- Cardano (wss)
- Conflux (wss)
- Solana (https & wss)
- Bitcoin (https)
- Dogecoin (https)
- Filecoin (https)
- Starknet (https)
Please note that this tool is in the early development stage and should not be used to influence critical business decisions. The project in its current form suits our short-term needs and will receive limited support. We encourage you to fork the project and extend it with additional functionality you might need.
You should install pre-commit so that automated linting and formatting checks are performed before each commit.
Run:
pip install pre-commit
pre-commit install
- Make sure you have python3 installed (>3.11)
- Set up your python environment
pip3 install virtualenv
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
- Generate valid exporter config and validation file. For example see config example and validation example.
- Export paths of generated configuration files relative to
src/exporter.py
:
export VALIDATION_FILE_PATH="validation.yml" # For example if we saved validation config file in src/validation.yml
export CONFIG_FILE_PATH="config.yml" # For example if we saved config file in src/config.yml
- Finally you can run the exporter
python exporter.py
- Generate valid exporter config and validation file. For example see config example and validation example.
- Export paths of generated configuration files relative to
docker-compose.yml
:
export VALIDATION_FILE_PATH="src/validation.yml" # For example if we saved validation config file in src/validation.yml
export CONFIG_FILE_PATH="src/config.yml" # For example if we saved config file in src/config.yml
- Execute
docker-compose build
docker-compose up
curl localhost:8000/metrics # Exporter
curl localhost:3000 # Grafana
curl localhost:9090 # Prometheus
Testing is performed using pytest run by coverage.py to generate test coverage reporting. pylint is used to lint the pyhton code. These dependencies can be found in the requirements-dev.txt file. Unit testing and linting is performed on every commit push to the repository. 90% test coverage and no linter errors/warnings are a requirement for the tests to pass.
Tests can be run locally in the virtual environment.
- Run the unit tests with coverage.py from within the
src
directory.
coverage run --branch -m pytest
- Generate the coverage report. To view the report open the generated
index.html
file in a browser.
coverage html
- Run the linter to find any errors/warnings.
pylint src/*py
The tests and linter can be run using docker by building the test
docker stage.
- Build the
test
stage in theDockerfile
.
docker build --target test .