Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Add build files
!requirements**
!README.md
!fix_reward_field.py

# Add code
!registrydao
Expand Down
16 changes: 15 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
FROM dipdup/dipdup:6.1.2
FROM dipdup/dipdup:7.5.10

USER root

RUN apt-get update && apt-get install -y \
build-essential \
curl \
python3-dev \
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& rm -rf /var/lib/apt/lists/*

ENV PATH="/root/.cargo/bin:${PATH}"

COPY requirements.txt .

RUN pip3 install -r requirements.txt

COPY fix_reward_field.py .
RUN python3 fix_reward_field.py

COPY . .
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Homebase Indexer (v3)

Minimal DipDup (v6.1) + Hasura + Postgres indexer for Homebase/RegistryDAO. It indexes on-chain events into Postgres and exposes them via Hasura GraphQL.
Minimal DipDup (v7.x) + Hasura + Postgres indexer for Homebase/RegistryDAO. It indexes on-chain events into Postgres and exposes them via Hasura GraphQL.

## Quick Start (Docker)
- Start services: `docker-compose up -d`
- Hasura Console: open `http://localhost:9088`
- Hasura Console: open `http://localhost:9013`
- Track tables: Hasura → Data → public → Track All tables (Optional)
- Logs (indexer): `docker-compose logs -f indexer`

Expand All @@ -17,7 +17,7 @@ Minimal DipDup (v6.1) + Hasura + Postgres indexer for Homebase/RegistryDAO. It i
- `registrydao/` Python package (handlers, utils, models, hooks, types, sql)
- `hasura/` Hasura metadata (optional)
- `dipdup.yml` DipDup configuration (contracts, datasources, indexes)
- `docker-compose.yml` Postgres, Hasura (mapped to `http://localhost:9088`), indexer
- `docker-compose.yml` Postgres, Hasura (mapped to `http://localhost:9013`), indexer

## Development Notes
- Format with Black and isort (see `requirements.txt`)
Expand All @@ -26,14 +26,9 @@ Minimal DipDup (v6.1) + Hasura + Postgres indexer for Homebase/RegistryDAO. It i

## Configuration
- Review `dipdup.yml` before enabling new indexes (check `first_level`, network)
- Optional: `tzkt-proxy` and `vector` services are included in compose

## TzKT Proxy (1.16 Compatibility)
- Why: TzKT 1.16 replaces the SignalR events hub (`/v1/events`) with a native WebSocket endpoint (`/v1/ws`). Some clients (including current DipDup usage) still call `/v1/events`.
- How: The `tzkt-proxy` Nginx service rewrites `/v1/events` and `/v1/events/*` to the new WebSocket path and upgrades the connection, while proxying other `/v1/*` REST calls unchanged.
- Wiring: In `docker-compose.yml`, the proxy is reachable as `tzkt-mainnet` and `tzkt-ghostnet` (network aliases). `dipdup.yml` points datasources to `http://tzkt-mainnet` and `http://tzkt-ghostnet`, enabling streaming against TzKT 1.16.
- Config: See `nginx-tzkt.conf`. Adjust upstreams if using a self-hosted TzKT; keep server names consistent with `dipdup.yml`.
- Optional: `vector` service for log shipping to Axiom is included in compose
- DipDup 7.x has native WebSocket support for TzKT 1.16+, connecting directly to `https://api.tzkt.io` and `https://api.ghostnet.tzkt.io`

# Deprecation Notices

https://x.com/dipdup_io/status/1955649362069201026
https://x.com/dipdup_io/status/1955649362069201026
288 changes: 139 additions & 149 deletions dipdup.yml
Original file line number Diff line number Diff line change
@@ -1,182 +1,172 @@
spec_version: 1.2
spec_version: 2.0
package: registrydao

database:
kind: postgres
url: !env DATABASE_URL
schema_name: ${PG_SCHEMA:-changeme}

host: ${PG_HOST:-db}
port: ${PG_PORT:-5432}
user: ${PG_USER:-indexer}
password: ${PG_PASSWORD:-qwerty}
database: ${PG_DB:-indexer_db}
schema_name: ${PG_SCHEMA:-public}
sentry:
dsn: ${SENTRY_DSN}
environment: prod
debug: True

debug: true
advanced:
reindex:
manual: wipe
migration: wipe
rollback: wipe
config_modified: wipe
schema_modified: wipe

contracts:
registry_mainnet:
kind: tezos
address: KT1MFxwTan4ptw6PSc3KK6e1xfzMrCb382tw
typename: registry
registry_ghostnet:
address: KT1QZtF8vVUvZYRxttRwgftc4EaQHZWgzXNp
registry_shadownet:
kind: tezos
address: KT1MgGJX3V6stxaxkynfRR6ShJTEKFy9tLnk
typename: registry

datasources:
tzkt_mainnet:
kind: tzkt
url: http://tzkt-mainnet

tzkt_ghostnet:
kind: tzkt
url: http://tzkt-ghostnet

kind: tezos.tzkt
url: https://api.mainnet.tzkt.io
tzkt_shadownet:
kind: tezos.tzkt
url: https://api.shadownet.tzkt.io
templates:
registry_dao:
kind: operation
kind: tezos.tzkt.operations
datasource: <datasource>
types:
- transaction
- origination
- transaction
- origination
contracts:
- <contract>
- <contract>
handlers:
- callback: on_origination
pattern:
- type: origination
originated_contract: <contract>
- callback: on_propose
pattern:
- type: transaction
destination: <contract>
entrypoint: propose
- callback: on_flush
pattern:
- type: transaction
destination: <contract>
entrypoint: flush
- callback: on_vote
pattern:
- type: transaction
destination: <contract>
entrypoint: vote
- callback: on_drop_proposal
pattern:
- type: transaction
destination: <contract>
entrypoint: drop_proposal
- callback: on_unstake_vote
pattern:
- type: transaction
destination: <contract>
entrypoint: unstake_vote
- callback: on_freeze
pattern:
- type: transaction
destination: <contract>
entrypoint: freeze
- callback: on_unfreeze
pattern:
- type: transaction
destination: <contract>
entrypoint: unfreeze

- callback: on_origination
pattern:
- type: origination
originated_contract: <contract>
- callback: on_propose
pattern:
- destination: <contract>
entrypoint: propose
- callback: on_flush
pattern:
- destination: <contract>
entrypoint: flush
- callback: on_vote
pattern:
- destination: <contract>
entrypoint: vote
- callback: on_drop_proposal
pattern:
- destination: <contract>
entrypoint: drop_proposal
- callback: on_unstake_vote
pattern:
- destination: <contract>
entrypoint: unstake_vote
- callback: on_freeze
pattern:
- destination: <contract>
entrypoint: freeze
- callback: on_unfreeze
pattern:
- destination: <contract>
entrypoint: unfreeze
indexes:
factory_mainnet:
kind: operation
kind: tezos.tzkt.operations
datasource: tzkt_mainnet
first_level: 30000
first_level: 2900000
types:
- origination
- transaction
- origination
contracts:
- registry_mainnet
handlers:
- callback: on_factory_origination
pattern:
- type: origination
similar_to: registry_mainnet
- callback: on_propose
pattern:
- type: transaction
destination: registry_mainnet
entrypoint: propose
- callback: on_vote
pattern:
- type: transaction
destination: registry_mainnet
entrypoint: vote
- callback: on_drop_proposal
pattern:
- type: transaction
destination: registry_mainnet
entrypoint: drop_proposal
- callback: on_unstake_vote
pattern:
- type: transaction
destination: registry_mainnet
entrypoint: unstake_vote
- callback: on_flush
pattern:
- type: transaction
destination: registry_mainnet
entrypoint: flush
- callback: on_freeze
pattern:
- type: transaction
destination: registry_mainnet
entrypoint: freeze
- callback: on_unfreeze
pattern:
- type: transaction
destination: registry_mainnet
entrypoint: unfreeze

factory_ghostnet:
kind: operation
datasource: tzkt_ghostnet
first_level: 8916100
- callback: on_origination
pattern:
- type: origination
originated_contract: registry_mainnet
- callback: on_factory_origination
pattern:
- type: origination
similar_to: registry_mainnet
- callback: on_propose
pattern:
- destination: registry_mainnet
entrypoint: propose
- callback: on_vote
pattern:
- destination: registry_mainnet
entrypoint: vote
- callback: on_drop_proposal
pattern:
- destination: registry_mainnet
entrypoint: drop_proposal
- callback: on_unstake_vote
pattern:
- destination: registry_mainnet
entrypoint: unstake_vote
- callback: on_flush
pattern:
- destination: registry_mainnet
entrypoint: flush
- callback: on_freeze
pattern:
- destination: registry_mainnet
entrypoint: freeze
- callback: on_unfreeze
pattern:
- destination: registry_mainnet
entrypoint: unfreeze
factory_shadownet:
kind: tezos.tzkt.operations
datasource: tzkt_shadownet
first_level: 0
types:
- origination
- transaction
- origination
contracts:
- registry_shadownet
handlers:
- callback: on_factory_origination
pattern:
- type: origination
similar_to: registry_ghostnet
- callback: on_propose
pattern:
- type: transaction
destination: registry_ghostnet
entrypoint: propose
- callback: on_vote
pattern:
- type: transaction
destination: registry_ghostnet
entrypoint: vote
- callback: on_drop_proposal
pattern:
- type: transaction
destination: registry_ghostnet
entrypoint: drop_proposal
- callback: on_unstake_vote
pattern:
- type: transaction
destination: registry_ghostnet
entrypoint: unstake_vote
- callback: on_flush
pattern:
- type: transaction
destination: registry_ghostnet
entrypoint: flush
- callback: on_freeze
pattern:
- type: transaction
destination: registry_ghostnet
entrypoint: freeze
- callback: on_unfreeze
pattern:
- type: transaction
destination: registry_ghostnet
entrypoint: unfreeze
- callback: on_origination
pattern:
- type: origination
originated_contract: registry_shadownet
- callback: on_factory_origination
pattern:
- type: origination
similar_to: registry_shadownet
- callback: on_propose
pattern:
- destination: registry_shadownet
entrypoint: propose
- callback: on_vote
pattern:
- destination: registry_shadownet
entrypoint: vote
- callback: on_drop_proposal
pattern:
- destination: registry_shadownet
entrypoint: drop_proposal
- callback: on_unstake_vote
pattern:
- destination: registry_shadownet
entrypoint: unstake_vote
- callback: on_flush
pattern:
- destination: registry_shadownet
entrypoint: flush
- callback: on_freeze
pattern:
- destination: registry_shadownet
entrypoint: freeze
- callback: on_unfreeze
pattern:
- destination: registry_shadownet
entrypoint: unfreeze
Loading