{"id":20267287,"url":"https://github.com/potlock/django-indexer","last_synced_at":"2026-05-10T11:32:46.400Z","repository":{"id":232053540,"uuid":"783351771","full_name":"PotLock/django-indexer","owner":"PotLock","description":"Potlock indexer built using Django \u0026 NEAR Data Lake Framework","archived":false,"fork":false,"pushed_at":"2024-05-22T15:23:11.000Z","size":187,"stargazers_count":0,"open_issues_count":13,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-05-22T15:26:22.331Z","etag":null,"topics":["indexer","potlock"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PotLock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-07T16:49:19.000Z","updated_at":"2024-05-29T23:21:22.452Z","dependencies_parsed_at":"2024-05-29T23:21:18.440Z","dependency_job_id":"673648fd-4c69-4a90-9fd9-b1610d8e0e86","html_url":"https://github.com/PotLock/django-indexer","commit_stats":null,"previous_names":["potlock/django-indexer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotLock%2Fdjango-indexer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotLock%2Fdjango-indexer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotLock%2Fdjango-indexer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotLock%2Fdjango-indexer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PotLock","download_url":"https://codeload.github.com/PotLock/django-indexer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241746798,"owners_count":20013165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["indexer","potlock"],"created_at":"2024-11-14T12:14:06.110Z","updated_at":"2026-05-10T11:32:41.351Z","avatar_url":"https://github.com/PotLock.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"- [Potlock Indexer (Django / Poetry / Celery / NEAR Lake Framework)](#potlock-indexer-django--poetry--celery--near-lake-framework)\n  - [Stack:](#stack)\n  - [Steps to run:](#steps-to-run)\n    - [Env vars example](#env-vars-example)\n  - [API Basics](#api-basics)\n      - [Base URL](#base-url)\n      - [Authorization](#authorization)\n      - [Error Responses](#error-responses)\n      - [Pagination](#pagination)\n  - [API Endpoints](#api-endpoints)\n    - [`Account` endpoints](#account-endpoints)\n      - [✅ Get all accounts: `GET /accounts` (paginated)](#-get-all-accounts-get-accounts-paginated)\n      - [✅ Get account by ID (address): `GET /accounts/{ACCOUNT_ID}`](#-get-account-by-id-address-get-accountsaccount_id)\n      - [✅ Get donations received for account: `GET /accounts/{ACCOUNT_ID}/donations_received` (paginated)](#-get-donations-received-for-account-get-accountsaccount_iddonations_received-paginated)\n      - [✅ Get donations sent for account: `GET /accounts/{ACCOUNT_ID}/donations_sent` (paginated)](#-get-donations-sent-for-account-get-accountsaccount_iddonations_sent-paginated)\n      - [✅ Get pots for account: `GET /accounts/{ACCOUNT_ID}/active_pots` (paginated)](#-get-pots-for-account-get-accountsaccount_idactive_pots-paginated)\n      - [✅ Get applications for account: `GET /accounts/{ACCOUNT_ID}/pot_applications` (paginated)](#-get-applications-for-account-get-accountsaccount_idpot_applications-paginated)\n      - [✅ Get registrations to lists by account: `GET /accounts/{ACCOUNT_ID}/list-registrations` (paginated)](#-get-registrations-to-lists-by-account-get-accountsaccount_idlist-registrations-paginated)\n    - [`List` endpoints](#list-endpoints)\n      - [✅ Get all lists: `GET /lists` (paginated)](#-get-all-lists-get-lists-paginated)\n      - [✅ Get list by ID: `GET /lists/{LIST_ID}` (paginated)](#-get-list-by-id-get-listslist_id-paginated)\n      - [✅ Get registrations for list: `GET /lists/{LIST_ID}/registrations` (paginated)](#-get-registrations-for-list-get-listslist_idregistrations-paginated)\n      - [✅ Get random registration for list: `GET /lists/{LIST_ID}/random_registration`](#-get-random-registration-for-list-get-listslist_idrandom_registration)\n    - [Donate Contract Config endpoint](#donate-contract-config-endpoint)\n      - [✅ Get donate contract config: `GET /donate_contract_config`](#-get-donate-contract-config-get-donate_contract_config)\n    - [`Donors` endpoints](#donors-endpoints)\n      - [✅ Get all donors: `GET /donors` (paginated)](#-get-all-donors-get-donors-paginated)\n    - [`Pots` endpoints](#pots-endpoints)\n      - [✅ Get all pots: `GET /pots` (paginated)](#-get-all-pots-get-pots-paginated)\n      - [✅ Get applications for pot: `GET /pots/{POT_ID}/applications`](#-get-applications-for-pot-get-potspot_idapplications)\n      - [✅ Get donations for pot: `GET /pots/{POT_ID}/donations`](#-get-donations-for-pot-get-potspot_iddonations)\n      - [✅ Get sponsors for pot: `GET /pots/{POT_ID}/sponsors`](#-get-sponsors-for-pot-get-potspot_idsponsors)\n      - [✅ Get payouts for pot: `GET /pots/{POT_ID}/payouts`](#-get-payouts-for-pot-get-potspot_idpayouts)\n    - [`Stats` endpoints](#stats-endpoints)\n      - [✅ Get stats: `GET /stats`](#-get-stats-get-stats)\n\n# Potlock Indexer (Django / Poetry / Celery / NEAR Lake Framework)\n\n## Stack:\n\n- Django w/ Poetry\n- Celery for background indexer task\n- NEAR Data Lake Framework for fetching/listening for blocks\n\n## Steps to run:\n\n- Set up env vars via `~/.bashrc` or `~/.zshrc` (see below)\n- Install poetry\n- Install redis\n- Install postgres\n- Create postgres database `potlock` for user `postgres`\n- Activate poetry shell (`poetry shell`)\n- Install dependencies (`poetry install`)\n- Run migrations (`python manage.py migrate`)\n- Update `indexer_app.tasks.listen_to_near_events` with desired network \u0026 start block (if desired)\n- Start celery worker with logger (`celery -A base worker --loglevel=info`)\n- Start indexer (`python manage.py runindexer`)\n- Kill indexer (`python manage.py killindexer`)\n  - If for some reason this doesn't kill any active celery tasks, run `ps auxww | grep 'celery' | grep -v grep` and kill resulting PIDs\n\nExtra commands that might come in useful:\n\n- Purge celery queue (`celery -A base purge`)\n\n### Env vars example\n\n```\nexport PL_AWS_ACCESS_KEY_ID=\nexport PL_AWS_SECRET_ACCESS_KEY=\nexport PL_CACHALOT_ENABLED=False\nexport PL_DEBUG=True\nexport PL_ENVIRONMENT=local\nexport PL_LOG_LEVEL=debug\nexport PL_POSTGRES_DB=potlock\nexport PL_POSTGRES_HOST=127.0.0.1\nexport PL_POSTGRES_PASS=\nexport PL_POSTGRES_PORT=5432\nexport PL_POSTGRES_USER=$USER\nexport PL_REDIS_HOST=\nexport PL_REDIS_PORT=6379\nexport PL_SENTRY_DSN=\n```\n\n## API Basics\n\n#### Base URL\n\n**dev (mainnet):** `https://dev.potlock.io/api/v1/`\n**testnet:** `https://test-dev.potlock.io/api/v1/`\n\n#### Authorization\n\nThis is a public, read-only API and as such does not currently implement authentication or authorization.\n\nRate limits of 500 requests/min are enforced to ensure service for all users.\n\n#### Error Responses\n\nAn error response (status code not within range 200-299) will always contain an object body with a `message` string property containing more information about the error.\n\nPossible Error Codes:\n\n- **`400` (Bad Request)**\n  - Error in client request\n- **`404` (Not found)**\n  - Requested resource could not be located\n- **`500` (Internal Error)**\n  - Check `message` string for more information\n\n#### Pagination\n\nPagination available using `page` and `page_size` as query param on endpoints that specify `paginated`. Default `page_size` is 30.\n\nEndpoints that support pagination will return a success response containing the following:\n\n- `count` (int) - total number of items available\n- `next` (str | null) - pre-populated endpoint link to the next page of results\n- `previous` (str | null) - pre-populated endpoint link to the previous page of results\n- `results` (any[]) - array of results\n\n## API Endpoints\n\n_NB: These endpoints are what is required to integrate with BOS app \u0026 replace current RPC calls, but more endpoints can easily be added as needed._\n\n### `Account` endpoints\n\n#### ✅ Get all accounts: `GET /accounts` (paginated)\n\n#### ✅ Get account by ID (address): `GET /accounts/{ACCOUNT_ID}`\n\n#### ✅ Get donations received for account: `GET /accounts/{ACCOUNT_ID}/donations_received` (paginated)\n\n#### ✅ Get donations sent for account: `GET /accounts/{ACCOUNT_ID}/donations_sent` (paginated)\n\n#### ✅ Get pots for account: `GET /accounts/{ACCOUNT_ID}/active_pots` (paginated)\n\nCan specify `status=live` query param to retrieve only pots that are currently active (live matching round)\n\n#### ✅ Get applications for account: `GET /accounts/{ACCOUNT_ID}/pot_applications` (paginated)\n\nCan specify `status={PotApplicationStatus}` query param to retrieve applications with a given status:\n\n```py\nenum PotApplicationStatus {\n  Pending,\n  Approved,\n  Rejected,\n  InReview,\n}\n```\n\n#### ✅ Get registrations to lists by account: `GET /accounts/{ACCOUNT_ID}/list-registrations` (paginated)\n\nCan specify status to filter by using `status` query param if desired, e.g. `status=Approved`\n\n### `List` endpoints\n\n#### ✅ Get all lists: `GET /lists` (paginated)\n\n#### ✅ Get list by ID: `GET /lists/{LIST_ID}` (paginated)\n\n#### ✅ Get registrations for list: `GET /lists/{LIST_ID}/registrations` (paginated)\n\nCan specify status to filter by using `status` query param if desired, e.g. `status=Approved`\nCan also specify project category to filter by using `category` query param if desired, e.g. `category=Education`\n\n#### ✅ Get random registration for list: `GET /lists/{LIST_ID}/random_registration`\n\nCan specify status to filter by using `status` query param if desired, e.g. `status=Approved`\n\n### Donate Contract Config endpoint\n\n#### ✅ Get donate contract config: `GET /donate_contract_config`\n\n### `Donors` endpoints\n\n#### ✅ Get all donors: `GET /donors` (paginated)\n\nReturns all accounts that have sent at least one donation.\n\nOptional query params:\n\n- `sort` (currently only allowed value is `most_donated_usd`, which returns results in the order of most to least donated in USD) e.g. `?sort=most_donated_usd`\n\n### `Pots` endpoints\n\n_NB: `POT_ID` == on-chain Pot address_\n\n#### ✅ Get all pots: `GET /pots` (paginated)\n\n#### ✅ Get applications for pot: `GET /pots/{POT_ID}/applications`\n\n#### ✅ Get donations for pot: `GET /pots/{POT_ID}/donations`\n\n#### ✅ Get sponsors for pot: `GET /pots/{POT_ID}/sponsors`\n\n#### ✅ Get payouts for pot: `GET /pots/{POT_ID}/payouts`\n\n### `Stats` endpoints\n\n#### ✅ Get stats: `GET /stats`\n\nReturns:\n\n- `total_donations_usd`\n- `total_payouts_usd`\n- `total_donations_count`\n- `total_donors_count`\n- `total_recipients_count`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotlock%2Fdjango-indexer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpotlock%2Fdjango-indexer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotlock%2Fdjango-indexer/lists"}