{"id":19096754,"url":"https://github.com/sky-ecosystem/gov-polling-db","last_synced_at":"2026-05-26T21:30:16.857Z","repository":{"id":39542439,"uuid":"194999196","full_name":"makerdao/gov-polling-db","owner":"makerdao","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-21T23:22:37.000Z","size":976,"stargazers_count":5,"open_issues_count":4,"forks_count":10,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-03T00:27:14.235Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PLpgSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/makerdao.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":"2019-07-03T07:09:49.000Z","updated_at":"2024-10-21T23:22:43.000Z","dependencies_parsed_at":"2024-03-07T19:24:57.581Z","dependency_job_id":"9aa99eff-a3d7-4dc2-b9df-7a2db6a00149","html_url":"https://github.com/makerdao/gov-polling-db","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fgov-polling-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fgov-polling-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fgov-polling-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fgov-polling-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makerdao","download_url":"https://codeload.github.com/makerdao/gov-polling-db/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240149841,"owners_count":19755753,"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":[],"created_at":"2024-11-09T03:37:39.970Z","updated_at":"2026-05-26T21:30:16.544Z","avatar_url":"https://github.com/makerdao.png","language":"PLpgSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blockchain ETL for Maker Governance\n\nCopyright [Dai Foundation](https://daifoundation.org/) 2022.\n\nBackend that uses the [spock SDK](https://github.com/oasisdex/spock) to:\n\n1. Extract: listen for events from specified contracts. Extractors are defined in the ./config.js file.\n2. Transform/Load: Sanitize the event and tx info and store it in the database. See the [spock readme](https://github.com/oasisdex/spock) for requirements on writing transformers. Transformers are found in the ./transformers folder, and written in JavaScript.\n3. Expose: Use SQL functions to expose this data via a GraphQL API, in a format that makes it easier to calculate polling results. These SQL functions are found in the migrations folder. Spock uses PostGraphile to automatically create the API. Any sql function written on the `api` schema becomes a graphQL query. For example, if a sql function is in the format `api.my_function`, then a graphQL query will be created called `myFunction`.\n\n## Development\n\n```sh\n\ndocker-compose up # starts a database (run 'docker-compose down' then 'docker-compose up' to restart)\n\n# in other terminal window\n\nyarn               # installs deps (just once)\n\nyarn migrate       # migrate database schema\n\nyarn start-etl     # starts ETL\n\n# in other terminal window\n\nyarn start-api     # starts GraphQL API\n\n```\n\n## Environment\n\nCreate the connection details for the database by setting the following environment variables. A default .env file is provided, which uses the following values:\n\n```\nVL_DB_DATABASE=database\nVL_DB_USER=user\nVL_DB_PASSWORD=password\nVL_DB_HOST=localhost\nVL_DB_PORT=5433\n```\n\nYou'll also need to set a `VL_CHAIN_HOST` env variable that points to an ethereum node. Alchemy is recommended, Infura is not. See the [spock readme](https://github.com/oasisdex/spock) for more information, and also for information about the `VL_LOGGING_LEVEL` env variable.\n\n## Using Postico (optional)\n\nYou can use Postico to connect to your database, just input the connection details defined by the environment variables.\n\nIn postico, you can view all the tables, and the data inside them.  In the [vulcan2x.jobs](http://vulcan2x.jobs) table, you’ll see all the extractors and transformers, and the last block id that they have processed.\n\n## Tests (WIP)\n\n1.  start a test db instance `yarn test:db`\n\n2.  run the tests `yarn test`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsky-ecosystem%2Fgov-polling-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsky-ecosystem%2Fgov-polling-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsky-ecosystem%2Fgov-polling-db/lists"}