Skip to content

Commit 9feaf48

Browse files
committed
Update F.A.Q.
1 parent 8b543cb commit 9feaf48

1 file changed

Lines changed: 23 additions & 6 deletions

File tree

docs/12.faq.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,44 @@ DipDup is a Python framework for building indexing applications. It allows you t
2828

2929
### What hardware do I need to run DipDup?
3030

31-
DipDup can run on any amd64/arm64 machine that runs Python. Aim for good single-threaded and disk I/O performance.
31+
DipDup can run on any amd64/arm64 machine that runs Python 3.12. Aim for good single-thread CPU performance and fast storage.
3232

3333
You need at least 512M of RAM, but actual requirements can grow significantly depending on the number and complexity of indexes, the size of internal queues and caches, and `CachedModel` usage.
3434

3535
## Indexing
3636

37+
### What's the difference between "level" and "block number"?
38+
39+
The term "level" is used in Tezos and some other blockchains as a synonym for "block height" or "block number". We use this term for historical reasons.
40+
41+
### What does "head" mean?
42+
43+
You may see the term "head" in logs, metrics and internal db tables. It refers to the latest known position in the blockchain, but with some nuances:
44+
45+
For **datasources** it means the last block available from the datalake/node/API indexer knows about. It may differ from the actual chain head for various reasons: network latency, node sync status, rate limits, etc.
46+
47+
For **indexes** it means the last block processed and stored in the database. It may lag behind the datasource head if indexing is still in progress or latest blocks have not triggered any handlers.
48+
49+
What to use for monitoring depend on your use case.
50+
3751
### How to index similar but not identical contracts as a single entity?
3852

3953
Multiple contracts can provide the same interface but have different storage structures. Examples are ERC20/ERC721/ERC1155 standard tokens on Ethereum and FA1.2/FA2 ones on Tezos. If you try to use the same typename for them, indexing will fail because of the storage mismatch. However, you can modify typeclasses manually. Edit the `types/<typename>/storage.py` file and comment out fields, leaving only the ones used in your index (common for all contracts with the same interface).
4054

4155
```python
4256
class ContractStorage(BaseModel):
43-
class Config:
44-
extra = Extra.ignore
57+
model_config = ConfigDict(
58+
extra='forbid',
59+
)
4560

4661
common_ledger: dict[str, str]
4762
# unique_field_foo: str
4863
# unique_field_bar: str
4964
```
5065

51-
Don't forget the `Extra.ignore` Pydantic hint; otherwise, storage deserialization will fail. To restore the original typeclass, remove the modified file and run `dipdup init` again. You can also add the `--force` flag to overwrite all ABIs and typeclasses.
66+
Don't forget the `model_config` field.
67+
68+
To restore the original typeclass, remove the modified file and run `dipdup init` again. You can also add the `--force` flag to overwrite all ABIs and typeclasses.
5269

5370
### How to use off-chain datasources?
5471

@@ -177,11 +194,11 @@ It will update both the CLI tool and Python package.
177194

178195
**tl;dr**: Just use `uv` for everything.
179196

180-
For historical reasons, Python package management is a mess. There are multiple tools and approaches to manage Python dependencies. **pip** is a general-purpose package manager. It's simple and robust, but only covers basic functionality. For a full-fledged project, you need to use a tool to handle virtual environments, lock files, dependency resolution, publishing, etc. Some of the most popular tools are: uv, Poetry, PDM, Hatch and others.
197+
For historical reasons, Python package management is a mess. There are multiple tools and approaches to manage Python dependencies. **pip** is a general-purpose package manager. It's simple and robust, but only covers basic functionality. For a full-fledged project, you need a tool to handle virtual environments, lock files, dependency resolution, publishing, etc. Some of the most popular tools are: uv, Poetry, PDM, pip-tools ([performance benchmark](https://lincolnloop.github.io/python-package-manager-shootout/)).
181198

182199
Starting with version 8.3, DipDup uses **uv** as the default package manager for both CLI installer and project management. This tool is extremely fast, reliable, and replaces the bulk of functionality provided by other tools.
183200

184-
Poetry and PDM integration in DipDup is deprecated and will be removed in future releases. To perform a migration, run the following commands:
201+
Poetry and PDM integration in DipDup is deprecated and will be removed in future releases. To perform migration after updating to >8.3 run the following commands:
185202

186203
```shell [Terminal]
187204
rm *.lock

0 commit comments

Comments
 (0)