Skip to content

Commit 3be2ceb

Browse files
Bump version 8.2.2 (#1226)
1 parent 60d2453 commit 3be2ceb

File tree

111 files changed

+691
-989
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+691
-989
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
66

77
Releases prior to 7.0 has been removed from this file to declutter search results; see the [archived copy](https://github.com/dipdup-io/dipdup/blob/8.0.0b5/CHANGELOG.md) for the full list.
88

9-
## [Unreleased]
9+
## [8.2.2] - 2025-03-13
10+
11+
### Added
12+
13+
- starknet.node: Added `fetch_block_headers` option to datasource config.
1014

1115
### Fixed
1216

@@ -637,7 +641,8 @@ Releases prior to 7.0 has been removed from this file to declutter search result
637641
[semantic versioning]: https://semver.org/spec/v2.0.0.html
638642

639643
<!-- Versions -->
640-
[Unreleased]: https://github.com/dipdup-io/dipdup/compare/8.2.1...HEAD
644+
[Unreleased]: https://github.com/dipdup-io/dipdup/compare/8.2.2...HEAD
645+
[8.2.2]: https://github.com/dipdup-io/dipdup/compare/8.2.1...8.2.2
641646
[8.2.1]: https://github.com/dipdup-io/dipdup/compare/8.2.0...8.2.1
642647
[8.2.0]: https://github.com/dipdup-io/dipdup/compare/8.2.0rc1...8.2.0
643648
[8.2.0rc1]: https://github.com/dipdup-io/dipdup/compare/8.1.4...8.2.0rc1

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ help: ## Show this help (default)
1818
##
1919

2020
install: ## Install dependencies
21-
uv sync --all-extras --all-groups --locked
21+
uv sync --all-extras --all-groups --link-mode symlink --locked
2222

2323
update: ## Update dependencies and dump requirements.txt
24-
uv sync -U --all-extras --all-groups
24+
uv sync -U --all-extras --all-groups --link-mode symlink
2525
uv export --all-extras --locked --no-group lint --no-group test --no-group docs --no-group perf > requirements.txt
2626

2727

docs/0.quickstart-evm.md

Lines changed: 7 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -7,61 +7,25 @@ network: "ethereum"
77

88
# Quickstart
99

10-
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.
11-
12-
A selective blockchain indexer is an application that extracts and organizes specific blockchain data from multiple data sources, rather than processing all blockchain data. It allows users to index only relevant entities, reducing storage and computational requirements compared to full node indexing, and query data more efficiently for specific use cases. Think of it as a customizable filter that captures and stores only the blockchain data you need, making data retrieval faster and more resource-efficient. DipDup is a framework that helps you implement such an indexer.
10+
{{ #include _quickstart_01_intro.md }}
1311

1412
Let's create an indexer for the [USDt token contract](https://etherscan.io/address/0xdac17f958d2ee523a2206206994597c13d831ec7). Our goal is to save all token transfers to the database and then calculate some statistics of its holders' activity.
1513

16-
## Install DipDup
17-
18-
A modern Linux/macOS distribution with Python 3.12 installed is required to run DipDup.
19-
20-
The recommended way to install DipDup CLI is [pipx](https://pipx.pypa.io/stable/). We also provide a convenient helper script that installs all necessary tools. Run the following command in your terminal:
21-
22-
{{ #include _curl-spell.md }}
23-
24-
See the [Installation](../docs/1.getting-started/1.installation.md) page for all options.
25-
26-
## Create a project
27-
28-
DipDup CLI has a built-in project generator. Run the following command in your terminal:
29-
30-
```shell [Terminal]
31-
dipdup new
32-
```
14+
{{ #include _quickstart_02_installation.md }}
3315

3416
Choose `From template`, then `EVM` network and `demo_evm_events` template.
3517

36-
::banner{type="note"}
37-
Want to skip a tutorial and start from scratch? Choose `Blank` at the first step instead and proceed to the [Config](../docs/1.getting-started/3.config.md) section.
38-
::
39-
40-
Follow the instructions; the project will be created in the new directory.
41-
42-
## Write a configuration file
43-
44-
In the project root, you'll find a file named `dipdup.yaml`. It's the main configuration file of your indexer. We will discuss it in detail in the [Config](../docs/1.getting-started/3.config.md) section; now it has the following content:
18+
{{ #include _quickstart_03_config.md }}
4519

4620
```yaml [dipdup.yaml]
4721
{{ #include ../src/demo_evm_events/dipdup.yaml }}
4822
```
4923

50-
## Generate types and stubs
51-
52-
Now it's time to generate typeclasses and callback stubs based on definitions from config. Examples below use `demo_evm_events` as a package name; yours may differ.
53-
54-
Run the following command:
55-
56-
```shell [Terminal]
57-
dipdup init
58-
```
59-
60-
DipDup will create a Python package `demo_evm_events` with everything you need to start writing your indexer. Use `package tree` command to see the generated structure:
24+
{{ #include _quickstart_04_codegen.md }}
6125

6226
```shell [Terminal]
6327
$ dipdup package tree
64-
demo_evm_events [.]
28+
dipdup_indexer [.]
6529
├── abi
6630
│ └── eth_usdt/abi.json
6731
├── configs
@@ -94,23 +58,7 @@ demo_evm_events [.]
9458
└── py.typed
9559
```
9660

97-
That's a lot of files and directories! But don't worry, we will need only `models` and `handlers` sections in this guide.
98-
99-
## Define data models
100-
101-
DipDup supports storing data in SQLite, PostgreSQL and TimescaleDB databases. We use modified [Tortoise ORM](https://tortoise.github.io/) library as an abstraction layer.
102-
103-
First, you need to define a model class. DipDup uses model definitions both for database schema and autogenerated GraphQL API. Our schema will consist of a single model `Holder` with the following fields:
104-
105-
| | |
106-
| ----------- | ----------------------------------- |
107-
| `address` | account address |
108-
| `balance` | token amount held by the account |
109-
| `turnover` | total amount of transfer/mint calls |
110-
| `tx_count` | number of transfers/mints |
111-
| `last_seen` | time of the last transfer/mint |
112-
113-
Here's how to define this model in DipDup:
61+
{{ #include _quickstart_05_models.md }}
11462

11563
```python [models/__init__.py]
11664
{{ #include ../src/demo_evm_events/models/__init__.py }}
@@ -128,39 +76,4 @@ Our task is to index all the balance updates. Put some code to the `on_transfer`
12876
{{ #include ../src/demo_evm_events/handlers/on_transfer.py }}
12977
```
13078

131-
And that's all! We can run the indexer now.
132-
133-
## Next steps
134-
135-
Run the indexer in memory:
136-
137-
```shell
138-
dipdup run
139-
```
140-
141-
Store data in SQLite database (defaults to /tmp, set `SQLITE_PATH` env variable):
142-
143-
```shell
144-
dipdup -c . -c configs/dipdup.sqlite.yaml run
145-
```
146-
147-
Or spawn a Compose stack with PostgreSQL and Hasura:
148-
149-
```shell
150-
cd deploy
151-
cp .env.default .env
152-
# Edit .env file before running
153-
docker-compose up
154-
```
155-
156-
DipDup will fetch all the historical data and then switch to realtime updates. You can check the progress in the logs.
157-
158-
If you use SQLite, run this query to check the data:
159-
160-
```bash
161-
sqlite3 /tmp/demo_evm_events.sqlite 'SELECT * FROM holder LIMIT 10'
162-
```
163-
164-
If you run a Compose stack, open `http://127.0.0.1:8080` in your browser to see the Hasura console (an exposed port may differ). You can use it to explore the database and build GraphQL queries.
165-
166-
Congratulations! You've just created your first DipDup indexer. Proceed to the Getting Started section to learn more about DipDup configuration and features.
79+
{{ #include _quickstart_06_next_steps.md }}

docs/0.quickstart-starknet.md

Lines changed: 7 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -7,61 +7,25 @@ network: "starknet"
77

88
# Quickstart
99

10-
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.
11-
12-
A selective blockchain indexer is an application that extracts and organizes specific blockchain data from multiple data sources, rather than processing all blockchain data. It allows users to index only relevant entities, reducing storage and computational requirements compared to full node indexing, and query data more efficiently for specific use cases. Think of it as a customizable filter that captures and stores only the blockchain data you need, making data retrieval faster and more resource-efficient. DipDup is a framework that helps you implement such an indexer.
10+
{{ #include _quickstart_01_intro.md }}
1311

1412
Let's create an indexer for the [USDt token contract](https://starkscan.co/contract/0x68f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8). Our goal is to save all token transfers to the database and then calculate some statistics of its holders' activity.
1513

16-
## Install DipDup
17-
18-
A modern Linux/macOS distribution with Python 3.12 installed is required to run DipDup.
19-
20-
The recommended way to install DipDup CLI is [pipx](https://pipx.pypa.io/stable/). We also provide a convenient helper script that installs all necessary tools. Run the following command in your terminal:
21-
22-
{{ #include _curl-spell.md }}
23-
24-
See the [Installation](../docs/1.getting-started/1.installation.md) page for all options.
25-
26-
## Create a project
27-
28-
DipDup CLI has a built-in project generator. Run the following command in your terminal:
29-
30-
```shell [Terminal]
31-
dipdup new
32-
```
14+
{{ #include _quickstart_02_installation.md }}
3315

3416
Choose `From template`, then `Starknet` network and `demo_starknet_events` template.
3517

36-
::banner{type="note"}
37-
Want to skip a tutorial and start from scratch? Choose `Blank` at the first step instead and proceed to the [Config](../docs/1.getting-started/3.config.md) section.
38-
::
39-
40-
Follow the instructions; the project will be created in the new directory.
41-
42-
## Write a configuration file
43-
44-
In the project root, you'll find a file named `dipdup.yaml`. It's the main configuration file of your indexer. We will discuss it in detail in the [Config](../docs/1.getting-started/3.config.md) section; now it has the following content:
18+
{{ #include _quickstart_03_config.md }}
4519

4620
```yaml [dipdup.yaml]
4721
{{ #include ../src/demo_starknet_events/dipdup.yaml }}
4822
```
4923

50-
## Generate types and stubs
51-
52-
Now it's time to generate typeclasses and callback stubs based on definitions from config. Examples below use `demo_starknet_events` as a package name; yours may differ.
53-
54-
Run the following command:
55-
56-
```shell [Terminal]
57-
dipdup init
58-
```
59-
60-
DipDup will create a Python package `demo_starknet_events` with everything you need to start writing your indexer. Use `package tree` command to see the generated structure:
24+
{{ #include _quickstart_04_codegen.md }}
6125

6226
```shell [Terminal]
6327
$ dipdup package tree
64-
demo_starknet_events [.]
28+
dipdup_indexer [.]
6529
├── abi
6630
│ └── stark_usdt/cairo_abi.json
6731
├── configs
@@ -94,23 +58,7 @@ demo_starknet_events [.]
9458
└── py.typed
9559
```
9660

97-
That's a lot of files and directories! But don't worry, we will need only `models` and `handlers` sections in this guide.
98-
99-
## Define data models
100-
101-
DipDup supports storing data in SQLite, PostgreSQL and TimescaleDB databases. We use modified [Tortoise ORM](https://tortoise.github.io/) library as an abstraction layer.
102-
103-
First, you need to define a model class. DipDup uses model definitions both for database schema and autogenerated GraphQL API. Our schema will consist of a single model `Holder` with the following fields:
104-
105-
| | |
106-
| ----------- | ----------------------------------- |
107-
| `address` | account address |
108-
| `balance` | token amount held by the account |
109-
| `turnover` | total amount of transfer/mint calls |
110-
| `tx_count` | number of transfers/mints |
111-
| `last_seen` | time of the last transfer/mint |
112-
113-
Here's how to define this model in DipDup:
61+
{{ #include _quickstart_05_models.md }}
11462

11563
```python [models/__init__.py]
11664
{{ #include ../src/demo_starknet_events/models/__init__.py }}
@@ -128,39 +76,4 @@ Our task is to index all the balance updates. Put some code to the `on_transfer`
12876
{{ #include ../src/demo_starknet_events/handlers/on_transfer.py }}
12977
```
13078

131-
And that's all! We can run the indexer now.
132-
133-
## Next steps
134-
135-
Run the indexer in memory:
136-
137-
```shell
138-
dipdup run
139-
```
140-
141-
Store data in SQLite database (defaults to /tmp, set `SQLITE_PATH` env variable):
142-
143-
```shell
144-
dipdup -c . -c configs/dipdup.sqlite.yaml run
145-
```
146-
147-
Or spawn a Compose stack with PostgreSQL and Hasura:
148-
149-
```shell
150-
cd deploy
151-
cp .env.default .env
152-
# Edit .env file before running
153-
docker-compose up
154-
```
155-
156-
DipDup will fetch all the historical data and then switch to realtime updates. You can check the progress in the logs.
157-
158-
If you use SQLite, run this query to check the data:
159-
160-
```bash
161-
sqlite3 /tmp/demo_starknet_events.sqlite 'SELECT * FROM holder LIMIT 10'
162-
```
163-
164-
If you run a Compose stack, open `http://127.0.0.1:8080` in your browser to see the Hasura console (an exposed port may differ). You can use it to explore the database and build GraphQL queries.
165-
166-
Congratulations! You've just created your first DipDup indexer. Proceed to the Getting Started section to learn more about DipDup configuration and features.
79+
{{ #include _quickstart_06_next_steps.md }}

0 commit comments

Comments
 (0)