Skip to content

Commit

Permalink
Update dipdup.yaml config to handle both mainnet and ghostnet
Browse files Browse the repository at this point in the history
  • Loading branch information
k-karuna committed Aug 13, 2024
1 parent c25c299 commit f451bf0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
31 changes: 24 additions & 7 deletions manutd_indexer/dipdup.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
spec_version: 3.0
package: manutd_indexer


database:
kind: postgres
host: ${POSTGRES_HOST:-db}
Expand All @@ -10,7 +9,6 @@ database:
password: ${POSTGRES_PASSWORD:-changeme}
database: ${POSTGRES_DB:-dipdup}


hasura:
url: ${HASURA_URL:-http://hasura:8080}
admin_secret: ${ADMIN_SECRET:-changeme}
Expand All @@ -19,28 +17,47 @@ hasura:
rest: false

contracts:
mu_minter_ghostnet:
mainnet:
kind: tezos
address: ${CONTRACT}
address: ${CONTRACT_MAINNET}
typename: mu_minter
ghostnet:
kind: tezos
address: ${CONTRACT_GHOSTNET}
typename: mu_minter

datasources:
mainnet:
kind: tezos.tzkt
url: https://api.tzkt.io
ghostnet:
kind: tezos.tzkt
url: ${TZKT_URL:-https://api.ghostnet.tzkt.io}

indexes:
big_maps_ghostnet:
metadata_mainnet:
kind: tezos.big_maps
datasources:
- mainnet
skip_history: never
handlers:
- callback: on_metadata_update
contract: mainnet
path: metadata
- callback: on_token_metadata_update
contract: mainnet
path: assets.token_metadata
metadata_ghostnet:
kind: tezos.big_maps
datasources:
- ghostnet
skip_history: never
handlers:
- callback: on_metadata_update
contract: mu_minter_ghostnet
contract: ghostnet
path: metadata
- callback: on_token_metadata_update
contract: mu_minter_ghostnet
contract: ghostnet
path: assets.token_metadata

advanced:
Expand Down
6 changes: 5 additions & 1 deletion manutd_indexer/handlers/big_map_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,15 @@ async def handle_token_metadata(self, key):
if key is None:
return
metadata = await MetadataBigMapState.get_or_none(
key=key
network=self._network,
contract=self._contract,
key=key,
)
if metadata is None:
return
token_metadata_queryset = await TokenMetadataBigMapState.filter(
network=self._network,
contract=self._contract,
metadata_key=key
)
for token_metadata in token_metadata_queryset:
Expand Down

0 comments on commit f451bf0

Please sign in to comment.