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
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ DipDup is a Python framework for building smart contract indexers. It helps deve
19
19
20
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).
21
21
22
-
-**Have a question?** Join our [Discord](https://discord.gg/NbANhqCJHA) or tag @dipdup_io on [Twitter](https://twitter.com/dipdup_io).
22
+
-**Have a question?** Join our [Discord](https://discord.gg/aG8XKuwsQd) or tag @dipdup_io on [Twitter](https://twitter.com/dipdup_io).
23
23
24
24
This project is maintained by the [Baking Bad](https://bakingbad.dev/) team.
Copy file name to clipboardExpand all lines: docs/0.quickstart.md
+14-13Lines changed: 14 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,27 +20,27 @@ We have a [convenient installer](https://dipdup.io/install.py) that will install
20
20
curl -Lsf https://dipdup.io/install.py | python3
21
21
```
22
22
23
-
If you don't want to use our installer, create a new project directory you can install DipDup manually. You can use any Python package manager you like, but we recommend [PDM](https://pdm.fming.dev/latest/). Here are some spells to get you started:
23
+
If you don't want to use our script, install DipDup manually using commands from the snippet below. You can use any Python package manager you like, but we recommend [PDM](https://pdm.fming.dev/latest/) and provide some useful scripts for it. Here are some spells to get you started:
24
24
25
25
```shell [Terminal]
26
26
# pipx
27
-
pipx install dipdup datamodel-code-generator pdm
27
+
pipx install dipdup datamodel-code-generator
28
28
29
29
# PDM
30
-
pdm init --python 3.11
31
-
pdm use .venv
32
-
pdm add "dipdup>=7.0.0rc2,<8"
30
+
pdm init --python 3.11 --lib # use "">=3.11,<3.12" for requires-python
31
+
pdm venv create
32
+
pdm add "dipdup>=7.0.0rc3,<8" --venv
33
33
$(pdm venv activate)
34
34
35
35
# Poetry
36
36
poetry init --python ">=3.11,<3.12"
37
-
poetry add "dipdup>=7.0.0rc2,<8"
37
+
poetry add "dipdup>=7.0.0rc3,<8"
38
38
poetry shell
39
39
40
40
# pip + venv
41
41
python -m venv .venv
42
42
. .venv/bin/activate
43
-
echo"dipdup>=7.0.0rc2,<8"> requirements.txt
43
+
echo"dipdup>=7.0.0rc3,<8"> requirements.txt
44
44
pip install -r requirements.txt -e .
45
45
```
46
46
@@ -115,7 +115,6 @@ demo_token [.]
115
115
│ ├── tzbtc/tezos_parameters/mint.py
116
116
│ ├── tzbtc/tezos_parameters/transfer.py
117
117
│ └── tzbtc/tezos_storage.py
118
-
├── demo_token.py
119
118
└── py.typed
120
119
```
121
120
@@ -127,11 +126,13 @@ DipDup supports storing data in SQLite, PostgreSQL and TimescaleDB databases. We
127
126
128
127
First, you need to define a model class. Our schema will consist of a single model `Holder` with the following fields:
Copy file name to clipboardExpand all lines: docs/1.getting-started/1.installation.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ This page covers the installation of DipDup in different environments.
9
9
10
10
## Host requirements
11
11
12
-
A Linux/macOS environment with Python 3.11 installed is required to use DipDup. Also you need basic Python environment for install script, `python3.11 -m ensurepip`. Apple silicon is also supported. Other UNIX-like systems should work but are not supported officially. If you use Windows, please use [WSL](https://docs.microsoft.com/en-us/windows/wsl/about) or Docker.
12
+
A Linux/macOS environment with Python 3.11 installed is required to use DipDup. Also, you need a basic Python environment for the install script, `python3.11 -m ensurepip`. Apple silicon is supported. Other UNIX-like systems should work but are not supported officially. If you use Windows, please use [WSL](https://docs.microsoft.com/en-us/windows/wsl/about) or Docker.
13
13
14
14
Minimum hardware requirements are 256 MB RAM, 1 CPU core, and some disk space for the database. RAM requirements increase with the number of indexes.
15
15
@@ -43,22 +43,22 @@ Then use the snippets below to create a new Python project and add DipDup as a d
43
43
44
44
#### PDM (recommended)
45
45
46
-
PDM is a very powerful package manager with a lot of features. Also, it can run scripts from pyproject.toml as npm does. It's a good choice for both beginners and advanced users.
46
+
PDM is a very powerful package manager with a lot of features. Also, it can run scripts from pyproject.toml as npm does. It's a good choice for both beginners and advanced users. Some commands are hard to remember though.
47
47
48
48
```shell [Terminal]
49
-
pdm init --python 3.11
50
-
pdm use .venv
51
-
pdm add "dipdup>=7.0.0rc2,<8"
49
+
pdm init --python 3.11 --lib # use "">=3.11,<3.12" for requires-python
50
+
pdm venv create
51
+
pdm add "dipdup>=7.0.0rc3,<8" --venv
52
52
$(pdm venv activate)
53
53
```
54
54
55
55
#### Poetry
56
56
57
-
Poetry is another popular tool to manage Python projects. It's less stable and often slower than PDM, but it's still a good choice.
57
+
Poetry is another popular tool to manage Python projects. It doesn't support scripts and resolving is slower in some cases, but in all other aspects, it's a great tool!
58
58
59
59
```shell [Terminal]
60
60
poetry init --python ">=3.11,<3.12"
61
-
poetry add "dipdup>=7.0.0rc2,<8"
61
+
poetry add "dipdup>=7.0.0rc3,<8"
62
62
poetry shell
63
63
```
64
64
@@ -69,7 +69,7 @@ Finally, if you prefer to do everything manually, you can use pip. It's the most
Copy file name to clipboardExpand all lines: docs/1.getting-started/2.core-concepts.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: "Before proceeding to development, let's take a look at basic DipDu
4
4
---
5
5
6
6
# Core concepts
7
-
7
+
8
8
Before proceeding to development, let's take a look at basic DipDup concepts. The main terms are highlighted in _italics_ and will be discussed in detail in the following sections.
Copy file name to clipboardExpand all lines: docs/1.getting-started/4.package.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,11 +24,11 @@ The structure of the resulting package is the following:
24
24
|:file_folder:`sql`| SQL scripts and queries to run manually or on specific events |
25
25
|:file_folder:`types`| Automatically generated Pydantic dataclasses for contract types |
26
26
|`dipdup.yaml`| Root DipDup config; can be expanded with env-specific files |
27
-
|`{{ project.package }} -> .`| A little helperto let you import the package from the root directory.|
27
+
|`{{ project.package }} -> .`| A little helper, symlink to let you import the package from the root directory. |
28
28
|`pyproject.toml`| Python package metadata (introduced in PEP 518; see [details](https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/)) |
29
29
|||
30
30
31
-
There are also a bunch files in the root directory: .ignore files, PEP 561 marker, etc. Usually, you won't need to modify them.
31
+
There are also preconfigured .dockerignore and .gitignore files; py.typed marker. Usually, you won't need to modify them.
32
32
33
33
## ABIs and typeclasses
34
34
@@ -81,4 +81,4 @@ After running the `init` command, you'll get the following directory tree (short
81
81
└── on_restore
82
82
```
83
83
84
-
Handler callbacks can be grouped the same way. Note, that callback name still needs to be a valid Python module path: _only lowercase letters, underscores, and dots_.
84
+
Handler callbacks can be grouped the same way. Note, that the callback name still needs to be a valid Python module path: _only lowercase letters, underscores, and dots_.
Copy file name to clipboardExpand all lines: docs/1.getting-started/5.models.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,4 +87,4 @@ In Tortoise ORM each subsequent call creates a new queryset using an expensive `
87
87
88
88
### Transactions
89
89
90
-
DipDup manages transactions automatically for indexes opening one for each level. You can't open another one. Entering a transaction context manually with `in_transaction()` will return the same active transaction. For hooks, there's `atomic` flag in the configuration.
90
+
DipDup manages transactions automatically for indexes opening one for each level. You can't open another one. Entering a transaction context manually with `in_transaction()` will return the same active transaction. For hooks, there's the `atomic` flag in the configuration.
Copy file name to clipboardExpand all lines: docs/1.getting-started/8.handlers.md
+2-17Lines changed: 2 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ Define the callback body to process the data. The most common case is to perform
47
47
48
48
## Handling name collisions
49
49
50
-
Indexing operations of multiple contracts with the same entrypoints can lead to name collisions during code generation. In this case DipDup raises a `ConfigurationError`{lang="python"} and suggests to set alias for each conflicting handler. Currently, it applies to `tezos.tzkt.operation` indexes only. Consider the following index definition, some kind of "chain minting" contract:
50
+
Indexing operations of multiple contracts with the same entrypoints can lead to name collisions during code generation. In this case DipDup raises a `ConfigurationError`{lang="python"} and suggests to set alias for each conflicting handler. Currently, it applies to `tezos.tzkt.operation` indexes only. In the the following snippet "call" entrypoint of both contracts is called. Add `alias` field to resolve the conflict:
51
51
52
52
```yaml
53
53
callback: on_mint
@@ -60,19 +60,4 @@ pattern:
60
60
alias: bar_mint
61
61
```
62
62
63
-
The following code will be generated for `on_mint`{lang="python"} callback (shortened):
64
-
65
-
```python [on_transaction.py]
66
-
from example.types.foo.parameter.mint import MintParameter as FooMintParameter
67
-
from example.types.bar.parameter.mint import MintParameter as BarMintParameter
0 commit comments