{"id":20138314,"url":"https://github.com/pinax-network/substreams-clock-api","last_synced_at":"2026-04-28T13:36:13.924Z","repository":{"id":205641522,"uuid":"703963018","full_name":"pinax-network/substreams-clock-api","owner":"pinax-network","description":"Timestamps \u003c\u003e Block numbers conversion for your favorite chains","archived":false,"fork":false,"pushed_at":"2024-02-17T13:43:33.000Z","size":166,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-02T23:14:32.682Z","etag":null,"topics":["api","blockchain","bun","clickhouse","clock","rest","substreams"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/pinax-network.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":"2023-10-12T09:03:52.000Z","updated_at":"2023-11-05T16:27:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"db6425f4-1903-42af-8356-f654e2efacb3","html_url":"https://github.com/pinax-network/substreams-clock-api","commit_stats":null,"previous_names":["pinax-network/substreams-clock-api"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/pinax-network/substreams-clock-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinax-network%2Fsubstreams-clock-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinax-network%2Fsubstreams-clock-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinax-network%2Fsubstreams-clock-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinax-network%2Fsubstreams-clock-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pinax-network","download_url":"https://codeload.github.com/pinax-network/substreams-clock-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinax-network%2Fsubstreams-clock-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261820925,"owners_count":23214799,"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":["api","blockchain","bun","clickhouse","clock","rest","substreams"],"created_at":"2024-11-13T21:37:23.965Z","updated_at":"2026-04-28T13:36:08.903Z","avatar_url":"https://github.com/pinax-network.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [`Substreams`](https://substreams.streamingfast.io/) Clock API\n\n[![.github/workflows/bun-test.yml](https://github.com/pinax-network/substreams-clock-api/actions/workflows/bun-test.yml/badge.svg)](https://github.com/pinax-network/substreams-clock-api/actions/workflows/bun-test.yml)\n\n\u003e Block \u0026 Timestamps API\n\n## REST API\n\n| Pathname                                  | Description           |\n|-------------------------------------------|-----------------------|\n| GET `/chains`                             | Available `chains`\n| GET `/block`                              | Get block by `block_number`, `block_id` or `timestamp`\n| GET `/trace_calls`                        | Get aggregate of trace_calls for given time range filtered by `chain`\n| GET `/transaction_traces`                 | Get aggregate of transaction_traces for given time range filtered by `chain`\n| GET `/uaw`                                | Get daily unique active wallets for given time range filtered by `chain`\n| GET `/health`                             | Health check\n| GET `/metrics`                            | Prometheus metrics\n| GET `/openapi`                            | [OpenAPI v3 JSON](https://spec.openapis.org/oas/v3.0.0)\n\n**Important note regarding `timestamp` query parameter**\n\nExpects **UTC** datetime or UNIX-like timestamp for matching the data in the Clickhouse DB. Passing `timestamp` data with additional timezone information (such as `...T...Z` or `±hh`) will likely fail the query to match (unless it corresponds to UTC0).\n\n## Requirements\n\n- [ClickHouse](clickhouse.com/)\n- [Substreams Sink ClickHouse](https://github.com/pinax-network/substreams-sink-clickhouse/)\n\n## Quickstart\n\n```console\n$ bun install\n$ bun dev\n```\n\n## [`Bun` Binary Releases](https://github.com/pinax-network/substreams-sink-websockets/releases)\n\n\u003e Linux Only\n\n```console\n$ wget https://github.com/pinax-network/substreams-clock-api/releases/download/v0.2.0/substreams-clock-api\n$ chmod +x ./substreams-clock-api\n```\n\n## `.env` Environment variables\n\n```env\n# API Server\nPORT=8080\nHOSTNAME=localhost\n\n# Clickhouse Database\nHOST=http://127.0.0.1:8123\nDATABASE=default\nUSERNAME=default\nPASSWORD=\nTABLE=blocks\nMAX_LIMIT=500\n\n# Logging\nVERBOSE=true\n```\n\n## Help\n\n```console\n$ ./substreams-clock-api -h\nUsage: substreams-clock-api [options]\n\nBlock \u0026 Timestamps API\n\nOptions:\n  -V, --version            output the version number\n  -p, --port \u003cnumber\u003e      HTTP port on which to attach the API (default: \"8080\", env: PORT)\n  -v, --verbose \u003cboolean\u003e  Enable verbose logging (choices: \"true\", \"false\", default: false, env: VERBOSE)\n  --hostname \u003cstring\u003e      Server listen on HTTP hostname (default: \"localhost\", env: HOSTNAME)\n  --host \u003cstring\u003e          Database HTTP hostname (default: \"http://localhost:8123\", env: HOST)\n  --username \u003cstring\u003e      Database user (default: \"default\", env: USERNAME)\n  --password \u003cstring\u003e      Password associated with the specified username (default: \"\", env: PASSWORD)\n  --database \u003cstring\u003e      The database to use inside ClickHouse (default: \"default\", env: DATABASE)\n  --table \u003cstring\u003e         Clickhouse table name (default: \"blocks\", env: TABLE)\n  --max-limit \u003cnumber\u003e     Maximum LIMIT queries (default: 500, env: MAX_LIMIT)\n  -h, --help               display help for command\n```\n\n## Docker environment\n\nPull from GitHub Container registry\n```bash\ndocker pull ghcr.io/pinax-network/substreams-clock-api:latest\n```\n\nBuild from source\n```bash\ndocker build -t substreams-clock-api .\n```\n\nRun with `.env` file\n```bash\ndocker run -it --rm --env-file .env ghcr.io/pinax-network/substreams-clock-api\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinax-network%2Fsubstreams-clock-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpinax-network%2Fsubstreams-clock-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinax-network%2Fsubstreams-clock-api/lists"}