-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Igor Sereda <[email protected]>
- Loading branch information
1 parent
d9ff712
commit 9a220a5
Showing
193 changed files
with
1,433 additions
and
1,300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
--- | ||
title: 7.1.0 | ||
description: DipDup 7.1 release notes | ||
--- | ||
|
||
# Release Notes: 7.1 | ||
|
||
Welcome, developers! | ||
|
||
After maybe-too-long awaited 7.0 stable release we decided to establish shorter and more predictable release cycle. So, expect new DipDup versions to arrive more frequently, but maybe be less groundbreaking. Today we're releasing DipDup 7.1 with new index kind, CLI options, and lots of small improvements. Let's dive in! | ||
|
||
## Indexing Tezos token balances | ||
|
||
Starting with 7.1 a new index kind `tezos.tzkt.token_balances` is available. It allows indexing token balances of Tezos contracts compatible with [FA1.2](https://gitlab.com/tzip/tzip/-/blob/master/proposals/tzip-7/README.md) or [FA2](https://gitlab.com/tzip/tzip/-/blob/master/proposals/tzip-12/tzip-12.md) standards. This index is similar to existing `tezos.tzkt.token_transfers`, but provides only the current balances skipping historical data. In cases when you don't need the history of changes, this index is much more efficient. | ||
|
||
```yaml [dipdup.yaml] | ||
spec_version: 2.0 | ||
package: demo_token_balances | ||
|
||
contracts: | ||
tzbtc_mainnet: | ||
kind: tezos | ||
address: KT1PWx2mnDueood7fEmfbBDKx1D9BAnnXitn | ||
typename: tzbtc | ||
|
||
datasources: | ||
tzkt: | ||
kind: tezos.tzkt | ||
url: https://api.tzkt.io | ||
|
||
indexes: | ||
tzbtc_holders_mainnet: | ||
kind: tezos.tzkt.token_balances | ||
datasource: tzkt | ||
handlers: | ||
- callback: on_balance_update | ||
contract: tzbtc_mainnet | ||
``` | ||
## SQL helpers to manage database schema | ||
Two new SQL functions were added to the schema: `dipdup_approve` and `dipdup_wipe`. These helpers are equivalent to `schema approve` and `schema wipe` CLI commands, but can be used directly in SQL queries. | ||
|
||
```sql | ||
SELECT dipdup_approve('public'); | ||
-- WARNING: This action is irreversible! All indexed data will be lost! | ||
SELECT dipdup_wipe('public'); | ||
``` | ||
|
||
Please note that `dipdup_wipe` function doesn't support preserving immune tables. | ||
|
||
DipDup has lots of tools to work with SQL like parameterized scripts, queries, and more. Visit the [Advanced SQL](../5.advanced/3.sql.md) page to learn more. | ||
|
||
## More `config env` command options | ||
|
||
Managing environment variables could be a pain, still it's an important part of a modern 12-factor application. Try to keep your project config completely environment-agnostic to make deploy easier and ensure secrets are safe. This release brings a few new options to the `config env` command to make it easier to work with environment variables. | ||
|
||
Compose stack definitions in `deploy` package directory include environment variables from `.env` files (generated with `config env` command without arguments). New `--compose, -c` flag also allows exporting config variables in Compose format. Copy necessary strings from the output to the `environment` section of the service definition and you're good. | ||
|
||
```shell [Terminal] | ||
$ dipdup config env --compose | ||
services: | ||
dipdup: | ||
environment: | ||
- API_KEY=${API_KEY} | ||
- API_URL=${API_URL:-https://api.example.com} | ||
``` | ||
|
||
`--internal, -i` flag allows including internal variables (with `DIPDUP_` prefix) in the command output. All of them are optional and rarely needed, but handy for debugging. See the [Feature Flags](../5.advanced/2.feature-flags.md) page for the full list of internal variables. | ||
|
||
```shell [Terminal] | ||
$ dipdup config env --internal | ||
DIPDUP_CI= | ||
DIPDUP_DEBUG= | ||
DIPDUP_DOCKER= | ||
DIPDUP_NEXT= | ||
DIPDUP_REPLAY_PATH= | ||
DIPDUP_TEST= | ||
``` | ||
|
||
You could notice a new variable here, `DIPDUP_DEBUG`. Setting it to true will increase logging verbosity (equal to `logging: debug` in config) and enable some additional checks. Make sure that this flag is set if you're gathering logs for a bug report. | ||
|
||
Finally, `--unsafe` flag allows exporting environment variables from the current shell session. Missing short option is intentional to prevent accidental usage. Missing example output here is also intentional, because it's, you know, unsafe to share your secrets. Don't do that. | ||
|
||
## Improved base template | ||
|
||
One of DipDup killer features is that we scaffold everything: package metadata, types and callback stubs, Compose definitions etc. We constantly improve the base template to make it more useful. You can run `dipdup new` once, answer a few questions get a fully working project. But you also use `init` command later to refresh files from the base template in your project. | ||
|
||
```shell [Terminal] | ||
# First make sure that repo is clean | ||
git status --porcelane | ||
# Refresh only `pyproject.toml` file | ||
dipdup init --force pyproject.toml | ||
|
||
# Refresh everything | ||
dipdup init --force --base | ||
|
||
# Check what has changed | ||
git diff | ||
``` | ||
|
||
This feature is a huge time saver when you maintain multiple projects and want them to be consistent. Or to modify the `replay.yaml` file and apply changes to the whole project instead of generating a new one or finding and replacing all occurrences manually. | ||
|
||
In this release we have updated included scripts to run CI checks and format code. Run `pdm run -l` to see the full list of available scripts. | ||
|
||
```shell | ||
$ pdm run -l | ||
╭────────┬───────────┬──────────────────────────────────╮ | ||
│ Name │ Type │ Description │ | ||
├────────┼───────────┼──────────────────────────────────┤ | ||
│ all │ composite │ Run all checks │ | ||
│ format │ composite │ Format code with isort and black │ | ||
│ image │ cmd │ Build Docker image │ | ||
│ lint │ composite │ Check code with ruff and mypy │ | ||
╰────────┴───────────┴──────────────────────────────────╯ | ||
``` | ||
|
||
Inspect `pyproject.toml` to see how these scripts are defined. You can also add your own scripts to automate common tasks. | ||
|
||
Here's a basic example of a GitHub Actions workflow to run all checks on every push: | ||
|
||
```yaml [.github/workflows/test.yml] | ||
name: Test DipDup project | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
on: | ||
push: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install PDM | ||
run: pipx install pdm | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@main | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
|
||
- name: Install project dependencies | ||
run: pdm install | ||
|
||
- name: Run all checks | ||
run: pdm all | ||
``` | ||
That's all for today. Thanks for reading! | ||
{{ #include 9.release-notes/_footer.md }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.