You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DipDup is a Python framework for building smart contract indexers. It helps developers focus on business logic instead of writing a boilerplate to store and serve data. DipDup-based indexers are selective, which means only required data is requested. This approach allows to achieve faster indexing times and decreased load on underlying APIs.
22
15
@@ -26,7 +19,7 @@ DipDup is a Python framework for building smart contract indexers. It helps deve
26
19
27
20
***Want to participate?** Vote for [open issues](https://github.com/dipdup-io/dipdup/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc), join [discussions](https://github.com/dipdup-io/dipdup/discussions) or [become a sponsor](https://github.com/sponsors/dipdup-io).
28
21
29
-
***Have a question?** Join our [Discord](https://discord.gg/sfqjBpmU) or tag @dipdup_io on [Twitter](https://twitter.com/dipdup_io).
22
+
***Have a question?** Join our [Discord](https://discord.gg/NbANhqCJHA) or tag @dipdup_io on [Twitter](https://twitter.com/dipdup_io).
30
23
31
24
This project is maintained by the [Baking Bad](https://bakingbad.dev/) team.
description: "This page will guide you through the steps to get your first selective indexer up and running in a few minutes without getting too deep into the details."
4
+
navigation.icon: "stars"
5
+
---
6
+
1
7
# Quickstart
2
8
3
9
This page will guide you through the steps to get your first selective indexer up and running in a few minutes without getting too deep into the details.
4
10
5
11
Let's create an indexer for the [tzBTC FA1.2 token contract](https://tzkt.io/KT1PWx2mnDueood7fEmfbBDKx1D9BAnnXitn/operations/). Our goal is to save all token transfers to the database and then calculate some statistics of its holders' activity.
6
12
13
+
`demo_token` demo is discussed in this guide; you can find it in the list of available templates when running `dipdup new` command.
14
+
7
15
A modern Linux/macOS distribution with Python 3.11 installed is required to run DipDup.
8
16
9
17
## Create a new project
@@ -12,25 +20,30 @@ A modern Linux/macOS distribution with Python 3.11 installed is required to run
12
20
13
21
You can initialize a hello-world project interactively by choosing configuration options in the terminal. The following command will install DipDup for the current user:
Follow the instructions; the project will be created in the current directory. You can skip reading the rest of this page and slap `dipdup run` instead.
26
34
27
35
### From scratch
28
36
29
-
Currently, we mainly use [Poetry](https://python-poetry.org) for dependency management in DipDup. If you prefer hatch, pdb, piptools or others — use them instead. Below are some snippets to get you started.
37
+
If you don't want to use our installer, you can install DipDup manually. You can use any Python package manager you like, but we recommend [PDM](https://pdm.fming.dev/latest/).
DipDup configuration is stored in YAML files of a specific format. Create a new file named `dipdup.yaml` in your current working directory with the following content:
61
+
DipDup configuration is stored in YAML files of a specific format. Create a new file named `dipdup.yaml` in the project root with the following content:
Everything's ready to implement an actual indexer logic.
141
137
142
138
Our task is to index all the balance updates, so we'll start with a helper method to handle them. Create a file named `on_balance_update.py` in the `handlers` package with the following content:
Three methods of tzBTC contract can alter token balances — `transfer`, `mint`, and`burn`. The last one is omitted in this tutorial for simplicity. Edit corresponding handlers to call the `on_balance_update` method with data from matched operations:
0 commit comments