{"id":13628895,"url":"https://github.com/baking-bad/tzkt","last_synced_at":"2026-01-14T20:46:43.375Z","repository":{"id":37082555,"uuid":"188470716","full_name":"baking-bad/tzkt","owner":"baking-bad","description":"😼 Awesome Tezos blockchain indexer and API","archived":false,"fork":false,"pushed_at":"2026-01-12T12:15:49.000Z","size":6140,"stargazers_count":188,"open_issues_count":3,"forks_count":34,"subscribers_count":10,"default_branch":"master","last_synced_at":"2026-01-12T19:38:24.935Z","etag":null,"topics":["blockchain-api","blockchain-indexer","tezos-api","tezos-blockchain","tezos-indexer","tzkt-api","tzkt-indexer"],"latest_commit_sha":null,"homepage":"https://tzkt.io","language":"C#","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/baking-bad.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-05-24T18:36:58.000Z","updated_at":"2026-01-12T12:15:59.000Z","dependencies_parsed_at":"2024-03-17T14:31:31.319Z","dependency_job_id":"c3d6a9f0-e5ca-41de-b68b-50d223d5b971","html_url":"https://github.com/baking-bad/tzkt","commit_stats":null,"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"purl":"pkg:github/baking-bad/tzkt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baking-bad%2Ftzkt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baking-bad%2Ftzkt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baking-bad%2Ftzkt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baking-bad%2Ftzkt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baking-bad","download_url":"https://codeload.github.com/baking-bad/tzkt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baking-bad%2Ftzkt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["blockchain-api","blockchain-indexer","tezos-api","tezos-blockchain","tezos-indexer","tzkt-api","tzkt-indexer"],"created_at":"2024-08-01T22:00:59.131Z","updated_at":"2026-01-14T20:46:43.363Z","avatar_url":"https://github.com/baking-bad.png","language":"C#","funding_links":[],"categories":["C#","C# #"],"sub_categories":[],"readme":"# Tezos Indexer by Baking Bad\n[![Made With](https://img.shields.io/badge/made%20with-C%23-success.svg?)](https://docs.microsoft.com/en-gb/dotnet/csharp/language-reference/)\n[![License: MIT](https://img.shields.io/github/license/baking-bad/netezos.svg)](https://opensource.org/licenses/MIT)\n\nTzKT is the most advanced [Tezos](https://tezos.com/) blockchain indexer with powerful API created by the [Baking Bad](https://bakingbad.dev) team with huge support from the [Tezos Foundation](https://tezos.foundation/).\n\nThe indexer fetches raw data from the Tezos blockchain, processes it, and saves it to its database to provide efficient access to the blockchain data. Using indexers is necessary part for most blockchain-related applications, because indexers expose much more data and cover much more use-cases than native node RPC, for example getting operations by hash, or operations related to particular accounts and smart contracts, or created NFTs, or token balances, or baking rewards, etc.\n\n## Features:\n- **More detailed data.** TzKT not only collects blockchain data, but also processes and extends it to make it more convenient to work with. For example, TzKT was the first indexer introduced synthetic operation types such as \"migration\" or \"revelation penalty\", which fill in the gaps in account's history, because this data is simply not available from the node.\n- **Micheline-to-JSON conversion** TzKT automatically converts raw Micheline JSON to human-readable JSON, so it's extremely handy to work with transaction parameters, contract storages, bigmaps keys, etc.\n- **Tokens support** TzKT also indexes FA1.2 and FA2 tokens (including NFTs), token balances, and token transfers (including mints and burns), as well as token metadata, even if it is stored in IPFS.\n- **Data quality comes first!** You will never see an incorrect account balance, or contract storage, or missed operations, etc. TzKT was built by professionals who know Tezos from A to Z (or from tz to KT 😼).\n- **Advanced API.** TzKT provides a REST-like API, so you don't have to connect to the database directly (but you can, if you want). In addition to basic data access TzKT API has a lot of cool features such as \"deep filtering\", \"deep selection\", \"deep sorting\", exporting .csv statements, calculating historical data (at some block in the past) such as balances, storages, and bigmap keys, injecting historical quotes and metadata, built-in response cache, and much more. See the complete [API documentation](https://api.tzkt.io).\n- **WebSocket API.** TzKT allows to subscribe to real-time blockchain data, such as new blocks or new operations, etc. via WebSocket. TzKT uses SignalR, which is very easy to use and for which there are many client libraries for different languages.\n- **No local node needed.** There is no need to run your own local node. Also, the indexer does not create much load on the node RPC, so it's ok to use any public one. By default it uses [rpc.tzkt.io](https://rpc.tzkt.io/mainnet/chains/main/blocks/head/header).\n- **No archive node needed.** There is no need to use an archive node (running in \"archive\" mode). If you bootstrap the indexer from the most recent snapshot, using a simple rolling node will be enough.\n- **Easy to start.** Indexer bootstrap is very simple and quite fast, because you can easily restore it from a fresh snapshot, publicly available for all supported networks, so you don't need to index the whole blockchain from scratch. But of course, you can do that, if you want.\n- **Validation and diagnostics.** TzKT indexer validates all incoming data so you will never get to the wrong chain and will never commit corrupted data because of invalid response from the node. Also, the indexer performs self-diagnostics after each block, which guarantees the correctness of its state after committing new data.\n- **Flexibility and scalability.** TzKT is split into 3 components: indexer, database, and API, which enables quite efficient horizontal scalability ([see example](https://baking-bad.org/blog/2019/12/03/tezos-explorer-tzkt-2-overview-of-architecture-and-core-components/#general-picture)). This also enables flexible optimization, because you can optimize each component separately and according to your needs.\n- **PostgreSQL.** TzKT uses the world's most advanced open source database, that gives a lot of possibilities such as removing unused indexes to reduce storage usage or adding specific indexes to increase performance of specific queries. You can configure replication, clustering, partitioning and much more. You can use a lot of plugins to enable cool features like GraphQL. This is a really powerful database.\n- **Friendly support.** We are always happy to help and open for discussions and feature requests. Feel free to [contact us](https://bakingbad.dev).\n\n## Installation (docker)\n\nFirst of all, install `git`, `make`, `docker`, `docker-compose`, then run the following commands:\n\n````sh\ngit clone https://github.com/baking-bad/tzkt\ncd tzkt/\n\nmake init  # Restores DB from the latest snapshot. Skip it, if you want to index from scratch.\nmake start # Starts DB, indexer, and API. By default, the API will be available at http://127.0.0.1:5000.\nmake stop  # Stops DB, indexer, and API.\n````\n\nYou can configure TzKT via `Tzkt.Sync/appsettings.json` (indexer) and `Tzkt.Api/appsettings.json` (API). All the settings can also be passed via env vars or command line args. See an example of how to [provide settings via env vars](https://github.com/baking-bad/tzkt/blob/master/docker-compose.yml#L25) and read some tips about [indexer configuration](#configure-indexer-example-for-mainnet) and [API configuration](#configure-api).\n\n## Installation (from source)\n\nThis guide is for Ubuntu 22.04, but even if you use a different OS, the installation process will likely be the same, except for the \"Install packages\" part.\n\n### Install packages\n\n#### Install Git\n\n````\nsudo apt update\nsudo apt install git\n````\n\n#### Install .NET\n\n````\nsudo add-apt-repository ppa:dotnet/backports\n\nsudo apt update\nsudo apt install -y dotnet-sdk-9.0\n````\n\n#### Install Postgresql\n\n````\nsudo sh -c 'echo \"deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main\" \u003e /etc/apt/sources.list.d/pgdg.list'\nwget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -\n\nsudo apt update\nsudo apt install -y postgresql-17\n````\n\n---\n\n### Prepare database\n\n#### Create an empty database and its user\n\n````\nsudo -u postgres psql\n\npostgres=# create user tzkt with encrypted password 'qwerty';\npostgres=# create database tzkt_db owner tzkt;\npostgres=# \\q\n````\n\n#### Download fresh snapshot (example for mainnet)\n\n````\nwget \"https://snapshots.tzkt.io/tzkt_v1.17_mainnet.backup\" -O /tmp/tzkt_db.backup\n````\n\n#### Restore database from the snapshot\n\n````c\nsudo -u postgres pg_restore -c --if-exists -v -1 -d tzkt_db /tmp/tzkt_db.backup\n````\n\nNotes:\n- to speed up the restoration replace `-1` with `-e -j {n}`, where `{n}` is a number of parallel workers (e.g., `-e -j 8`);\n- in case of Docker use you may need to add `-U tzkt` parameter.\n\n---\n\n### Build, configure and run TzKT Indexer\n\n#### Clone repo\n\n````\ngit clone https://github.com/baking-bad/tzkt.git ~/tzkt\n````\n\n#### Build indexer\n\n````\ncd ~/tzkt/Tzkt.Sync/\ndotnet publish -o ~/tzkt-sync\n````\n\n#### Configure indexer (example for mainnet)\n\nEdit the configuration file `~/tzkt-sync/appsettings.json`. What you basically need is to adjust the `TezosNode.Endpoint` and `ConnectionStrings.DefaultConnection`, if needed:\n\n````json\n{\n  \"TezosNode\": {\n    \"Endpoint\": \"https://rpc.tzkt.io/mainnet/\"\n  },\n  \"ConnectionStrings\": {\n    \"DefaultConnection\": \"host=localhost;port=5432;database=tzkt_db;username=tzkt;password=qwerty;command timeout=600;\"\n  }\n}\n````\n\n[Read more](https://www.npgsql.org/doc/connection-string-parameters.html) about connection string and available parameters.\n\n##### Chain reorgs and indexing lag\n\nTo avoid reorgs (chain reorganizations) you can set the indexing lag `TezosNode.Lag` (1-2 blocks lag is enough):\n\n````json\n{\n  \"TezosNode\": {\n    \"Lag\": 1\n  }\n}\n````\n\n##### Collect metrics\n\nYou can enable/disable Prometheus metrics by setting `MetricsOptions.Enabled`. By default, they will be available at `http://localhost:5001/metrics` (protobuf) and `http://localhost:5001/metrics-text` (plain text):\n\n````json\n  \"MetricsOptions\": {\n    \"Enabled\": true\n  }\n````\n\n#### Run indexer\n\n````c\ncd ~/tzkt-sync\ndotnet Tzkt.Sync.dll\n````\n\nThat's it. If you want to run the indexer as a daemon, take a look at this guide: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-9.0#create-the-service-file.\n\n---\n\n### Build, configure and run TzKT API\n\nSuppose, you have already cloned the repo to `~/tzkt` during the steps above.\n\n#### Build API\n\n````\ncd ~/tzkt/Tzkt.Api/\ndotnet publish -o ~/tzkt-api\n````\n\n#### Configure API\n\nEdit the configuration file `~/tzkt-api/appsettings.json`. What you basically need is to adjust the `ConnectionStrings.DefaultConnection`, if needed:\n\nLike this:\n\n````js\n{\n  \"ConnectionStrings\": {\n    \"DefaultConnection\": \"host=localhost;port=5432;database=tzkt_db;username=tzkt;password=qwerty;command timeout=600;\"\n  },\n}\n````\n\n[Read more](https://www.npgsql.org/doc/connection-string-parameters.html) about connection string and available parameters.\n\n##### Response cache\n\nThe API has built-in response cache, enabled by default. You can control the cache size limit by setting the `ResponseCache.CacheSize` (MB), or disable it by setting to `0`:\n````json\n{\n   \"ResponseCache\": {\n      \"CacheSize\": 1024\n   }\n}\n````\n\n##### RPC helpers (example for mainnet)\n\nThe API provides RPC helpers - endpoints proxied directly to the node RPC, specified in the API settings. The Rpc helpers can be enabled in the `RpcHelpers` section:\n\n`````json\n{\n   \"RpcHelpers\": {\n      \"Enabled\": true,\n      \"Endpoint\": \"https://rpc.tzkt.io/mainnet/\"\n   }\n}\n`````\n\nPlease, notice, the API's `RpcHelpers.Endpoint` must point to the same network (with the same `chain_id`) as `TezosNode.Endpoint` in the indexer. Otherwise, an exception will be thrown.\n\n##### Collect metrics\n\nYou can enable/disable Prometheus metrics by setting `MetricsOptions.Enabled`. By default, they will be available at `http://localhost:5000/metrics` (protobuf) and `http://localhost:5000/metrics-text` (plain text):\n\n````json\n  \"MetricsOptions\": {\n    \"Enabled\": true\n  }\n````\n\n##### TCP port\n\nBy default, the API is available at the port `5000`. You can configure it at `Kestrel.Endpoints.Http.Url`:\n\n````json\n  \"Kestrel\": {\n    \"Endpoints\": {\n      \"Http\": {\n        \"Url\": \"http://localhost:5000\"\n      }\n    }\n  }\n````\n\n#### Run API\n\n````\ncd ~/tzkt-api\ndotnet Tzkt.Api.dll\n````\n\nThat's it. If you want to run the API as a daemon, take a look at this guide: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-9.0#create-the-service-file.\n\n## Install Tzkt Indexer and API for testnets\n\nIn general the steps are the same as for the mainnet, you will just need to use a different RPC endpoint and DB snapshot. Here are presets for the current testnets:\n - Shadownet:\n   - Snapshot: https://snapshots.tzkt.io/tzkt_v1.17_shadownet.backup\n   - RPC node: https://rpc.tzkt.io/shadownet/\n - Tallinnnet:\n   - Snapshot: https://snapshots.tzkt.io/tzkt_v1.17_tallinnnet.backup\n   - RPC node: https://rpc.tzkt.io/tallinnnet/\n\n### Testnets \u0026 docker\n\nFirst of all, install `git`, `make`, `docker`, `docker-compose`, then run the following commands:\n\n````sh\ngit clone https://github.com/baking-bad/tzkt.git\ncd tzkt/\n\nmake ghost-init  # Restores DB from the latest snapshot. Skip it, if you want to index from scratch.\nmake ghost-start # Starts DB, indexer, and API. By default, the API will be available at http://127.0.0.1:5010.\nmake ghost-stop  # Stops DB, indexer, and API.\n````\n\n## Have a question?\n\nFeel free to contact us via:\n- Discord: https://discord.gg/aG8XKuwsQd\n- Telegram: https://t.me/baking_bad_chat\n- Slack: https://tezos-dev.slack.com/archives/CV5NX7F2L\n- Twitter: https://twitter.com/TezosBakingBad\n- Email: hello@bakingbad.dev\n\nCheers! 🍺\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaking-bad%2Ftzkt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaking-bad%2Ftzkt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaking-bad%2Ftzkt/lists"}