Skip to content

Commit cbc84a0

Browse files
6.0 docs final touches (#441)
1 parent c943935 commit cbc84a0

31 files changed

+255
-145
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ This release contains no changes except for the version number.
507507

508508
## [4.0.0-rc2] - 2021-12-11
509509

510-
### Migration
510+
### Migration
511511

512512
- Run `dipdup init` command to generate `on_synchronized` hook stubs.
513513

@@ -529,7 +529,7 @@ This release contains no changes except for the version number.
529529

530530
## [4.0.0-rc1] - 2021-12-02
531531

532-
### Migration
532+
### Migration
533533

534534
- Run `dipdup schema approve` command on every database you want to use with 4.0.0-rc1. Running `dipdup migrate` is not necessary since `spec_version` hasn't changed in this release.
535535

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,18 @@
99
* To set up the development environment, you need to install [Poetry](https://python-poetry.org/docs/#installation) package manager and GNU Make.
1010
* Run `make help` to get available commands.
1111

12+
## Git
13+
14+
* Branch names MUST follow `prefix/short-descriptions` format. Prefixes we currently use: `feat` for features, `fix` for bugfixes, `docs` for documentation, `aux` for miscellaneous, `exp` for experiments.
15+
1216
## Codestyle
1317

18+
* We use the following combo of linters and formatters: `isort`, `black`, `flake8`, `mypy`. All linter checks MUST pass before merging code to master.
19+
1420
## Releases
1521

1622
* Release versions SHOULD conform to [Semantic Versioning](https://semver.org/). Releases that introduce breaking changes MUST be major ones.
23+
* Only the latest major version is supported in general. Critical fixes CAN be backported to the previous major release. To do so, git checkout from the latest stable tag, bump DipDup version manually and add a new tag.
1724

1825
## Documentation
1926

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/_/ /_/
1919
```
2020

21-
DipDup is a Python framework for building indexers of [Tezos](https://tezos.com/) smart-contracts. It helps developers focus on the business logic instead of writing data storing and serving boilerplate. DipDup-based indexers are selective, which means only required data is requested. This approach allows to achieve faster indexing times and decreased load on APIs DipDup uses.
21+
DipDup is a Python framework for building indexers of [Tezos](https://tezos.com/) smart contracts. It helps developers focus on the business logic instead of writing data storing and serving boilerplate. DipDup-based indexers are selective, which means only required data is requested. This approach allows to achieve faster indexing times and decreased load on APIs DipDup uses.
2222

2323
* **Ready to build your first indexer?** Head to [Quickstart](https://dipdup.net/docs/quickstart).
2424

@@ -29,4 +29,5 @@ DipDup is a Python framework for building indexers of [Tezos](https://tezos.com/
2929
* **Have a question?** Contact us on [Discord](https://discord.com/invite/RcPGSdcVSx), [Telegram](https://t.me/baking_bad_chat), or [Slack](https://tezos-dev.slack.com/archives/CV5NX7F2L)!
3030

3131
This project is maintained by the [Baking Bad](https://baking-bad.org/) team.
32+
<br>
3233
Development is supported by [Tezos Foundation](https://tezos.foundation/).

docs/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ docs:
2323
poetry run make html
2424
tail -n '+34' _build/html/cli-reference.html | head -n '-63' > cli-reference.md
2525
tail -n '+34' _build/html/config-reference.html | head -n '-63' > config/reference.md
26-
tail -n '+34' _build/html/context-reference.html | head -n '-63' > advanced/context/reference.md
26+
tail -n '+34' _build/html/context-reference.html | head -n '-63' > include/context-reference.md
2727
mdbook build --dest-dir=dist/docs
2828

2929
homepage:
@@ -46,6 +46,6 @@ orphans:
4646
cat SUMMARY.md | grep ".md" > mentioned.tmp
4747
sed -i -E 's@^.*\[(.*)\]\((.*)\).*$$@\2@p' mentioned.tmp
4848
cat mentioned.tmp | uniq | sort -o mentioned.tmp
49-
find . | grep ".md" | grep -v -e "node_modules/" -e " book/" -e "placeholders.md" -e "SUMMARY.md" -e "mdbook-summary" | cut -c "3-" | sort -o existing.tmp
49+
find . | grep ".md" | grep -v -e "node_modules/" -e " book/" -e "placeholders.md" -e "SUMMARY.md" -e "mdbook-summary" -e "include" | cut -c "3-" | sort -o existing.tmp
5050
diff --color mentioned.tmp existing.tmp
5151
rm mentioned.tmp existing.tmp

docs/SUMMARY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* [Feature flags](advanced/feature-flags.md)
2323
* [SQL scripts](advanced/sql.md)
2424
* [Improving performance](advanced/performance.md)
25-
* [Callback context (ctx)](advanced/context/README.md)
25+
* [Callback context (ctx)](advanced/context.md)
2626
* [Internal models](advanced/internal-models.md)
2727
* [Index factories](advanced/index-factories.md)
2828
* [Metadata interface](advanced/metadata-interface.md)
@@ -81,7 +81,7 @@
8181

8282
* [Changelog](CHANGELOG.md)
8383
* [Release notes](release-notes/README.md)
84-
* [6.0.0 (unreleased)](release-notes/6.0.0.md)
84+
* [6.0.0](release-notes/6.0.0.md)
8585
* [5.1.0](release-notes/5.1.0.md)
8686
* [5.0.0](release-notes/5.0.0.md)
8787
* [4.2.0](release-notes/4.2.0.md)

docs/advanced/context/README.md renamed to docs/advanced/context.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ An instance of the `HandlerContext` class is passed to every handler providing a
44

55
## Reference
66

7-
{{ #include reference.md}}
7+
{{ #include ../include/context-reference.md}}

docs/advanced/datasources.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ datasources:
3838

3939
The rest HTTP tunables are the same as for other datasources.
4040

41-
<!-- FIXME: Not needed since we have DB rollbacks? -->
42-
Also, you can wait for several block confirmations before processing the operations, e.g. to mitigate chain reorgs:
41+
Also, you can wait for several block confirmations before processing the operations:
4342

4443
```yaml
4544
datasources:
@@ -48,6 +47,8 @@ datasources:
4847
buffer_size: 1 # indexing with a single block lag
4948
```
5049

50+
Since 6.0 chain reorgs are processed automatically, but you may find this feature useful for other cases.
51+
5152
## Tezos node
5253

5354
Tezos RPC is a standard interface provided by the Tezos node. This datasource is used solely by `mempool` and `metadata` standalone services; you can't use it in regular DipDup indexes.
@@ -83,7 +84,12 @@ datasources:
8384
network: mainnet | ithacanet
8485
```
8586

86-
<!-- FIXME: No usage example -->
87+
Then, in your hook or handler code:
88+
89+
```python
90+
datasource = ctx.get_metadata_datasource('metadata')
91+
token_metadata = await datasource.get_token_metadata('KT1...', '0')
92+
```
8793

8894
## IPFS
8995

docs/advanced/event-hooks.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ This hook fires when every active index reaches a realtime state. Here you can c
1616

1717
## `on_index_rollback`
1818

19-
Fires when TzKT datasource has received a chain reorg message which can't be processed automatically.
19+
Fires when TzKT datasource has received a chain reorg message which can't be processed by dropping buffered messages (`buffer_size` option).
2020

21-
<!-- FIXME -->
22-
If your indexer is stateless, you can just drop DB data saved after `to_level` and continue indexing. Otherwise, implement more complex logic. By default, this hook triggers full reindexing.
21+
Since version 6.0 this hook performs a database-level rollback by default. If it doesn't work for you for some reason remove `ctx.rollback` call and implement your own rollback logic.
2322

2423
> 💡 **SEE ALSO**
2524
>
2625
> * {{ #summary advanced/reindexing.md}}
2726
> * {{ #summary advanced/sql.md}}
28-
> * {{ #summary advanced/context/README.md}}
27+
> * {{ #summary advanced/context.md}}

docs/advanced/feature-flags.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ advanced:
1111
postpone_jobs: False
1212
metadata_interface: False
1313
skip_version_check: False
14+
crash_reporting: False
1415
```
1516
1617
## Early realtime
@@ -35,8 +36,12 @@ Do not start the job scheduler until all indexes are synchronized. If your jobs
3536

3637
## Metadata interface
3738

38-
Without this flag calling `ctx.update_contract_metadata` and `ctx.update_token_metadata` will make no effect. Corresponding internal tables are created on reindex in any way.
39+
Without this flag calling `ctx.update_contract_metadata` and `ctx.update_token_metadata` will make no effect. Corresponding internal tables are created on reindexing in any way.
3940

4041
## Skip version check
4142

4243
Disables warning about running unstable or out-of-date DipDup version.
44+
45+
## Crash reporting
46+
47+
Enables sending crash reports to the Baking Bad team. This is **disabled by default**. You can inspect crash dumps saved as `/tmp/dipdup-tombstone_XXXXXXX.json` before enabling this option.

docs/advanced/index-factories.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ Another solution is to implement custom logic in `on_restart` hook (see {{ #summ
2828

2929
> 💡 **SEE ALSO**
3030
>
31-
> * {{ #summary advanced/context/README.md}}
31+
> * {{ #summary advanced/context.md}}
3232
> * {{ #summary config/templates.md}}

0 commit comments

Comments
 (0)