Skip to content

Fetch the latest Basin vaults & related info with a daily GitHub action

Notifications You must be signed in to change notification settings

textileio/demo-vault-tracker

Repository files navigation

Vaults Tracker

Caution

This demo is no longer active. The project indexed Basin v1 (MVP) data, but Basin v2 is now live and replaces v1. Thus, this demo is no longer maintained or useful.

standard-readme compliant

Fetch & inspect the latest Basin vaults.

Table of Contents

Background

This project is a simple tool to track the new vaults that are created with Basin.

The script fetches data from onchain events at the Basin storage contract on Filecoin Calibration (0xaB16d51Fa80EaeAF9668CE102a783237A045FC37), retrieves relevant information from the Basin HTTP API, and does this all on a weekly cron schedule with GitHub Actions. For every run, it will write the results to:

  • Data: Summary data for all vaults ever created.
  • State: A JSON file containing the full history of all runs, along with the relevant log/event data and cumulative vaults created.

Install

For working on your machine, make sure pipx and pipenv are installed.

brew install pipx
pipx install pipenv

Then, install dependencies:

pipenv install --dev

And set up pre-commit and pre-push hooks:

pipenv run pre-commit install -t pre-commit
pipenv run pre-commit install -t pre-push

These latter steps are also available in the Makefile as make install and make setup. This project also uses python 3.12, so make sure you have that installed. You can see a full list of requirements in the Pipfile.

Note: This project was created with Cookiecutter and the sourcery-ai project template—check it out!

Usage

Running the script

The vaults_tracker module is the main entrypoint for the project. You can run it with:

make run

This will fetch new events that have occurred after the latest run & block number in the state file, and write the results to the Data file. The data file lists out each vault owner's address, the vault's name, and a link to the vault mutation "events" (CIDs) for subsequent retrieval. You can see the GitHub actions setup in the workflow file.

Makefile reference

The following defines all commands available in the Makefile:

  • make install: Install dependencies with pipenv.
  • make setup: Install pre-commit and pre-push hooks that run checks on the code.
  • make format: Directly run black, isort, flake8, and mypy on the project.
  • make coverage: Not used but available if tests are written.

Contributing

PRs accepted. Be sure to run the pre-commit and pre-push hooks, and the make format command also does similar actions.

Small note: If editing the README, please conform to the standard-readme specification.

About

Fetch the latest Basin vaults & related info with a daily GitHub action

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published