Skip to content

Commit

Permalink
7.0.0rc3 release (#778)
Browse files Browse the repository at this point in the history
  • Loading branch information
droserasprout authored Aug 5, 2023
1 parent e3b871f commit 8882029
Show file tree
Hide file tree
Showing 43 changed files with 176 additions and 197 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,12 @@ jobs:
- name: Build docs
run: pdm run docs_build

# FIXME: Reenable before 7.0.0rc3 release
# - name: Commit and push frontend
# if: github.ref == 'refs/heads/next'
# run: |
# cd ../interface
# git config --local user.email "[email protected]"
# git config --local user.name "GitHub Action"
# git add .
# git diff-index --quiet HEAD || git commit -m "${{ github.event.head_commit.message }}"
# git push origin $FRONTEND_BRANCH
- name: Commit and push frontend
if: github.ref == 'refs/heads/next'
run: |
cd ../interface
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git diff-index --quiet HEAD || git commit -m "${{ github.event.head_commit.message }}"
git push origin $FRONTEND_BRANCH
19 changes: 10 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog], and this project adheres to [Semantic Versioning].

## [Unreleased]
## [7.0.0rc3] - 2023-08-05

### Fixed

Expand Down Expand Up @@ -86,19 +86,19 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic

- tzkt: Request plain values instead of mappings from TzKT when possible.

## [6.5.9] - 2022-07-11
## [6.5.9] - 2023-07-11

### Fixed

- tzkt: Optimized queries for `operation_unfiltered` index.

## [6.5.8] - 2022-06-28
## [6.5.8] - 2023-06-28

### Fixed

- cli: Fixed `init` crash when package name is equal to one of the project typenames.

## [6.5.7] - 2022-05-30
## [6.5.7] - 2023-05-30

### Added

Expand All @@ -115,7 +115,7 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic

- http: Deserialize JSON responses with `orjson`.

## [6.5.6] - 2022-05-02
## [6.5.6] - 2023-05-02

### Fixed

Expand All @@ -127,7 +127,7 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
- ci: Slim Docker image updated to Alpine 3.17.
- metadata: Added `nairobinet` to supported networks.

## [6.5.5] - 2022-04-17
## [6.5.5] - 2023-04-17

### Fixed

Expand All @@ -139,7 +139,7 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic

- ci: Default git branch switched to `next`.

## [6.5.4] - 2022-03-31
## [6.5.4] - 2023-03-31

### Fixed

Expand All @@ -149,7 +149,7 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic

- deps: Updated pytezos to 3.9.0.

## [6.5.3] - 2022-03-28
## [6.5.3] - 2023-03-28

### Fixed

Expand Down Expand Up @@ -1116,7 +1116,8 @@ This release contains no changes except for the version number.
[semantic versioning]: https://semver.org/spec/v2.0.0.html

<!-- Versions -->
[Unreleased]: https://github.com/dipdup-io/dipdup/compare/7.0.0rc2...HEAD
[Unreleased]: https://github.com/dipdup-io/dipdup/compare/7.0.0rc3...HEAD
[7.0.0rc3]: https://github.com/dipdup-io/dipdup/compare/7.0.0rc2...7.0.0rc3
[6.5.10]: https://github.com/dipdup-io/dipdup/compare/6.5.9...6.5.10
[7.0.0rc2]: https://github.com/dipdup-io/dipdup/compare/7.0.0rc1...7.0.0rc2
[7.0.0rc1]: https://github.com/dipdup-io/dipdup/compare/6.5.9...7.0.0rc1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ DipDup is a Python framework for building smart contract indexers. It helps deve

- **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).

- **Have a question?** Join our [Discord](https://discord.gg/NbANhqCJHA) or tag @dipdup_io on [Twitter](https://twitter.com/dipdup_io).
- **Have a question?** Join our [Discord](https://discord.gg/aG8XKuwsQd) or tag @dipdup_io on [Twitter](https://twitter.com/dipdup_io).

This project is maintained by the [Baking Bad](https://bakingbad.dev/) team.
<br>
Expand Down
27 changes: 14 additions & 13 deletions docs/0.quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,27 @@ We have a [convenient installer](https://dipdup.io/install.py) that will install
curl -Lsf https://dipdup.io/install.py | python3
```

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:
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:

```shell [Terminal]
# pipx
pipx install dipdup datamodel-code-generator pdm
pipx install dipdup datamodel-code-generator

# PDM
pdm init --python 3.11
pdm use .venv
pdm add "dipdup>=7.0.0rc2,<8"
pdm init --python 3.11 --lib # use "">=3.11,<3.12" for requires-python
pdm venv create
pdm add "dipdup>=7.0.0rc3,<8" --venv
$(pdm venv activate)

# Poetry
poetry init --python ">=3.11,<3.12"
poetry add "dipdup>=7.0.0rc2,<8"
poetry add "dipdup>=7.0.0rc3,<8"
poetry shell

# pip + venv
python -m venv .venv
. .venv/bin/activate
echo "dipdup>=7.0.0rc2,<8" > requirements.txt
echo "dipdup>=7.0.0rc3,<8" > requirements.txt
pip install -r requirements.txt -e .
```

Expand Down Expand Up @@ -115,7 +115,6 @@ demo_token [.]
│ ├── tzbtc/tezos_parameters/mint.py
│ ├── tzbtc/tezos_parameters/transfer.py
│ └── tzbtc/tezos_storage.py
├── demo_token.py
└── py.typed
```

Expand All @@ -127,11 +126,13 @@ DipDup supports storing data in SQLite, PostgreSQL and TimescaleDB databases. We

First, you need to define a model class. Our schema will consist of a single model `Holder` with the following fields:

- `address` — account address
- `balance` — token amount held by the account
- `volume` — total amount of transfer/mint calls
- `tx_count` — number of transfers/mints
- `last_seen` — time of the last transfer/mint
| | |
| ----------- | ----------------------------------- |
| `address` | account address |
| `balance` | token amount held by the account |
| `turnover` | total amount of transfer/mint calls |
| `tx_count` | number of transfers/mints |
| `last_seen` | time of the last transfer/mint |

Here's how to implement this model in DipDup:

Expand Down
16 changes: 8 additions & 8 deletions docs/1.getting-started/1.installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This page covers the installation of DipDup in different environments.

## Host requirements

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.
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.

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.

Expand Down Expand Up @@ -43,22 +43,22 @@ Then use the snippets below to create a new Python project and add DipDup as a d

#### PDM (recommended)

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.
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.

```shell [Terminal]
pdm init --python 3.11
pdm use .venv
pdm add "dipdup>=7.0.0rc2,<8"
pdm init --python 3.11 --lib # use "">=3.11,<3.12" for requires-python
pdm venv create
pdm add "dipdup>=7.0.0rc3,<8" --venv
$(pdm venv activate)
```

#### Poetry

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.
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!

```shell [Terminal]
poetry init --python ">=3.11,<3.12"
poetry add "dipdup>=7.0.0rc2,<8"
poetry add "dipdup>=7.0.0rc3,<8"
poetry shell
```

Expand All @@ -69,7 +69,7 @@ Finally, if you prefer to do everything manually, you can use pip. It's the most
```shell [Terminal]
python -m venv .venv
. .venv/bin/activate
echo "dipdup>=7.0.0rc2,<8" >> requirements.txt
echo "dipdup>=7.0.0rc3,<8" >> requirements.txt
pip install -r requirements.txt -e .
```

Expand Down
2 changes: 1 addition & 1 deletion docs/1.getting-started/2.core-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Before proceeding to development, let's take a look at basic DipDu
---

# Core concepts

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.

## Big picture
Expand Down
6 changes: 3 additions & 3 deletions docs/1.getting-started/4.package.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ The structure of the resulting package is the following:
| :file_folder: `sql` | SQL scripts and queries to run manually or on specific events |
| :file_folder: `types` | Automatically generated Pydantic dataclasses for contract types |
| `dipdup.yaml` | Root DipDup config; can be expanded with env-specific files |
| `{{ project.package }} -> .` | A little helper to let you import the package from the root directory. |
| `{{ project.package }} -> .` | A little helper, symlink to let you import the package from the root directory. |
| `pyproject.toml` | Python package metadata (introduced in PEP 518; see [details](https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/)) |
| | |

There are also a bunch files in the root directory: .ignore files, PEP 561 marker, etc. Usually, you won't need to modify them.
There are also preconfigured .dockerignore and .gitignore files; py.typed marker. Usually, you won't need to modify them.

## ABIs and typeclasses

Expand Down Expand Up @@ -81,4 +81,4 @@ After running the `init` command, you'll get the following directory tree (short
└── on_restore
```
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_.
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_.
2 changes: 1 addition & 1 deletion docs/1.getting-started/5.models.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ In Tortoise ORM each subsequent call creates a new queryset using an expensive `
### Transactions

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.
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.
19 changes: 2 additions & 17 deletions docs/1.getting-started/8.handlers.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Define the callback body to process the data. The most common case is to perform

## Handling name collisions

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:
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:

```yaml
callback: on_mint
Expand All @@ -60,19 +60,4 @@ pattern:
alias: bar_mint
```

The following code will be generated for `on_mint`{lang="python"} callback (shortened):

```python [on_transaction.py]
from example.types.foo.parameter.mint import MintParameter as FooMintParameter
from example.types.bar.parameter.mint import MintParameter as BarMintParameter
async def on_transaction(
ctx: HandlerContext,
foo_mint: TzktTransaction[FooMintParameter, FooStorage],
bar_mint: TzktTransaction[BarMintParameter, BarStorage],
) -> None:
...
```

You can also change argument names (but not the order) manually if you want to.
You can also change argument names (but not the order!) manually if you want to.
Loading

0 comments on commit 8882029

Please sign in to comment.