Table of Contents

Config reference

dipdup.config.DipDupConfig

class dipdup.config.DipDupConfig(*args, spec_version, package, datasources=<factory>, database=<factory>, contracts=<factory>, indexes=<factory>, templates=<factory>, jobs=<factory>, hooks=<factory>, hasura=None, sentry=None, prometheus=None, api=None, advanced=<factory>, custom=<factory>, logging='INFO')

DipDup project configuration file

Parameters:

dipdup.config.abi_etherscan.AbiEtherscanDatasourceConfig

class dipdup.config.abi_etherscan.AbiEtherscanDatasourceConfig(**kwargs)

Etherscan datasource config

Parameters:
  • kind – always ‘abi.etherscan’
  • url – API URL
  • api_key – API key
  • http – HTTP client configuration
  • kwargs (Any)

dipdup.config.AdvancedConfig

class dipdup.config.AdvancedConfig(**kwargs)

This section allows users to tune some system-wide options, either experimental or unsuitable for generic configurations.

Parameters:
  • reindex – Mapping of reindexing reasons and actions DipDup performs.
  • schedulerapscheduler scheduler config.
  • postpone_jobs – Do not start job scheduler until all indexes reach the realtime state.
  • early_realtime – Establish realtime connection and start collecting messages while sync is in progress (faster, but consumes more RAM).
  • rollback_depth – A number of levels to keep for rollback.
  • decimal_precision – Overwrite precision if it’s not guessed correctly based on project models.
  • unsafe_sqlite – Disable journaling and data integrity checks. Use only for testing.
  • alt_operation_matcher – Use different algorithm to match Tezos operations (dev only)
  • kwargs (Any)

dipdup.config.ApiConfig

class dipdup.config.ApiConfig(**kwargs)

Management API config

Parameters:
  • host – Host to bind to
  • port – Port to bind to
  • kwargs (Any)

dipdup.config.coinbase.CoinbaseDatasourceConfig

class dipdup.config.coinbase.CoinbaseDatasourceConfig(**kwargs)

Coinbase datasource config

Parameters:
  • kind – always ‘coinbase’
  • api_key – API key
  • secret_key – API secret key
  • passphrase – API passphrase
  • http – HTTP client configuration
  • kwargs (Any)

dipdup.config.ContractConfig

class dipdup.config.ContractConfig(**kwargs)

Contract config

Parameters:
  • kind – Defined by child class
  • typename – Alias for the typeclass directory
  • kwargs (Any)

dipdup.config.DatasourceConfig

class dipdup.config.DatasourceConfig(*args)

Base class for datasource configs

Parameters:
  • kind – Defined by child class
  • url – URL of the API
  • http – HTTP connection tunables

dipdup.config.evm.EvmContractConfig

class dipdup.config.evm.EvmContractConfig(*args)

EVM contract config

Parameters:
  • kind – Always evm
  • address – Contract address
  • abi – Contract ABI
  • typename – Alias for the contract script

dipdup.config.evm_node.EvmNodeDatasourceConfig

class dipdup.config.evm_node.EvmNodeDatasourceConfig(*args)

EVM node datasource config

Parameters:
  • kind – Always ‘evm.node’
  • url – EVM node URL
  • ws_url – EVM node WebSocket URL
  • http – HTTP client configuration
  • rollback_depth – A number of blocks to store in database for rollback

dipdup.config.evm_events.EvmEventsHandlerConfig

class dipdup.config.evm_events.EvmEventsHandlerConfig(**kwargs)

Subsquid event handler

Parameters:
  • callback – Callback name
  • contract – EVM contract
  • name – Event name
  • kwargs (Any)

dipdup.config.evm_events.EvmEventsIndexConfig

class dipdup.config.evm_events.EvmEventsIndexConfig(*args)

Subsquid datasource config

Parameters:
  • kind – Always ‘evm.events’
  • datasourcesevm datasources to use
  • handlers – Event handlers
  • first_level – Level to start indexing from
  • last_level – Level to stop indexing and disable this index

dipdup.config.evm_subsquid.EvmSubsquidDatasourceConfig

class dipdup.config.evm_subsquid.EvmSubsquidDatasourceConfig(*args)

Subsquid datasource config

Parameters:
  • kind – always ‘evm.subsquid’
  • url – URL of Subsquid Network API
  • http – HTTP client configuration

dipdup.config.evm.EvmIndexConfig

class dipdup.config.evm.EvmIndexConfig(*args)

EVM index that use Subsquid Network as a datasource

Parameters:
  • kind – starts with ‘evm’
  • datasourcesevm datasources to use

dipdup.config.evm_transactions.EvmTransactionsHandlerConfig

class dipdup.config.evm_transactions.EvmTransactionsHandlerConfig(**kwargs)

Subsquid transaction handler

Parameters:
  • callback – Callback name
  • from – Transaction sender
  • to – Transaction receiver
  • method – Method name
  • signature – Method signature
  • kwargs (Any)

dipdup.config.evm_transactions.EvmTransactionsIndexConfig

class dipdup.config.evm_transactions.EvmTransactionsIndexConfig(kind, datasources)

Index that uses Subsquid Network as a datasource for transactions

Parameters:

dipdup.config.HandlerConfig

class dipdup.config.HandlerConfig(**kwargs)

Base class for index handlers

Parameters:
  • callback – Callback name
  • kwargs (Any)

dipdup.config.HasuraConfig

class dipdup.config.HasuraConfig(**kwargs)

Config for the Hasura integration.

Parameters:
  • url – URL of the Hasura instance.
  • admin_secret – Admin secret of the Hasura instance.
  • create_source – Whether source should be added to Hasura if missing.
  • source – Hasura source for DipDup to configure, others will be left untouched.
  • select_limit – Row limit for unauthenticated queries.
  • allow_aggregations – Whether to allow aggregations in unauthenticated queries.
  • allow_inconsistent_metadata – Whether to ignore errors when applying Hasura metadata.
  • camel_case – Whether to use camelCase instead of default pascal_case for the field names.
  • rest – Enable REST API both for autogenerated and custom queries.
  • http – HTTP connection tunables
  • hide_internal – Whether to make internal tables (prefixed with “dipdup”) private.
  • hide – List of table/view names to make private.
  • kwargs (Any)

dipdup.config.HookConfig

class dipdup.config.HookConfig(**kwargs)

Hook config

Parameters:
  • callback – Callback name
  • args (dict[str, str]) – Mapping of argument names and annotations (checked lazily when possible)
  • atomic – Wrap hook in a single database transaction
  • kwargs (Any)

dipdup.config.HttpConfig

class dipdup.config.HttpConfig(retry_count=None, retry_sleep=None, retry_multiplier=None, ratelimit_rate=None, ratelimit_period=None, ratelimit_sleep=None, connection_limit=None, connection_timeout=None, request_timeout=None, batch_size=None, polling_interval=None, replay=None, replay_path=None, alias=None)

Advanced configuration of HTTP client

Parameters:
  • retry_count (int | None) – Number of retries after request failed before giving up
  • retry_sleep (float | None) – Sleep time between retries
  • retry_multiplier (float | None) – Multiplier for sleep time between retries
  • ratelimit_rate (int | None) – Number of requests per period (“drops” in leaky bucket)
  • ratelimit_period (int | None) – Time period for rate limiting in seconds
  • ratelimit_sleep (float | None) – Sleep time between requests when rate limit is reached
  • connection_limit (int | None) – Number of simultaneous connections
  • connection_timeout (int | None) – Connection timeout in seconds
  • request_timeout (int | None) – Request timeout in seconds
  • batch_size (int | None) – Number of items fetched in a single paginated request (when applicable)
  • polling_interval (float | None) – Interval between polling requests in seconds (when applicable)
  • replay (bool | None) – Use cached HTTP responses instead of making real requests (dev only)
  • replay_path (str | Path | None) – Use cached HTTP responses instead of making real requests (dev only)
  • alias (str | None) – Alias for this HTTP client (dev only)

dipdup.config.http.HttpDatasourceConfig

class dipdup.config.http.HttpDatasourceConfig(*args)

Generic HTTP datasource config

Parameters:
  • kind – always ‘http’
  • url – URL to fetch data from
  • http – HTTP client configuration

dipdup.config.IndexConfig

class dipdup.config.IndexConfig(*args)

Index config

Parameters:
  • kind – Defined by child class
  • datasources – Aliases of index datasources in datasources section

id0

class dipdup.config.DatasourceConfig(*args)

Base class for datasource configs

Parameters:
  • kind – Defined by child class
  • url – URL of the API
  • http – HTTP connection tunables

dipdup.config.IndexTemplateConfig

class dipdup.config.IndexTemplateConfig(*args)

Index template config

Parameters:
  • kind – always ‘template’
  • values – Values to be substituted in template (<key> -> value)
  • first_level – Level to start indexing from
  • last_level – Level to stop indexing at
  • template – Template alias in templates section

dipdup.config.ipfs.IpfsDatasourceConfig

class dipdup.config.ipfs.IpfsDatasourceConfig(*args)

IPFS datasource config

Parameters:
  • kind – always ‘ipfs’
  • url – IPFS node URL, e.g. https://ipfs.io/ipfs/
  • http – HTTP client configuration

dipdup.config.JobConfig

class dipdup.config.JobConfig(*args)

Job schedule config

Parameters:
  • hook – Name of hook to run
  • args (dict[str, Any]) – Arguments to pass to the hook
  • crontab – Schedule with crontab syntax (* * * * *)
  • interval – Schedule with interval in seconds
  • daemon – Run hook as a daemon (never stops)

dipdup.config.PostgresDatabaseConfig

class dipdup.config.PostgresDatabaseConfig(**kwargs)

Postgres database connection config

Parameters:
  • kind – always ‘postgres’
  • host – Host
  • port – Port
  • user – User
  • password – Password
  • database – Database name
  • schema_name – Schema name
  • immune_tables – List of tables to preserve during reindexing
  • connection_timeout – Connection timeout
  • kwargs (Any)

dipdup.config.PrometheusConfig

class dipdup.config.PrometheusConfig(**kwargs)

Config for Prometheus integration.

Parameters:
  • host – Host to bind to
  • port – Port to bind to
  • update_interval – Interval to update some metrics in seconds
  • kwargs (Any)

dipdup.config.ResolvedHttpConfig

class dipdup.config.ResolvedHttpConfig(**kwargs)

Advanced configuration of HTTP client

Parameters:
  • retry_count – Number of retries after request failed before giving up
  • retry_sleep – Sleep time between retries
  • retry_multiplier – Multiplier for sleep time between retries
  • ratelimit_rate – Number of requests per period (“drops” in leaky bucket)
  • ratelimit_period – Time period for rate limiting in seconds
  • ratelimit_sleep – Sleep time between requests when rate limit is reached
  • connection_limit – Number of simultaneous connections
  • connection_timeout – Connection timeout in seconds
  • request_timeout – Request timeout in seconds
  • batch_size – Number of items fetched in a single paginated request (when applicable)
  • polling_interval – Interval between polling requests in seconds (when applicable)
  • replay – Use cached HTTP responses instead of making real requests (dev only)
  • replay_path – Use cached HTTP responses instead of making real requests (dev only)
  • alias – Alias for this HTTP client (dev only)
  • kwargs (Any)

dipdup.config.SentryConfig

class dipdup.config.SentryConfig(**kwargs)

Config for Sentry integration.

Parameters:
  • dsn – DSN of the Sentry instance
  • environment – Environment; if not set, guessed from docker/ci/gha/local.
  • server_name – Server name; defaults to obfuscated hostname.
  • release – Release version; defaults to DipDup package version.
  • user_id – User ID; defaults to obfuscated package/environment.
  • debug – Catch warning messages, increase verbosity.
  • kwargs (Any)

dipdup.config.SqliteDatabaseConfig

class dipdup.config.SqliteDatabaseConfig(**kwargs)

SQLite connection config

Parameters:
  • kind – always ‘sqlite’
  • path – Path to .sqlite file, leave default for in-memory database (:memory:)
  • immune_tables – List of tables to preserve during reindexing
  • kwargs (Any)

dipdup.config.SystemHookConfig

class dipdup.config.SystemHookConfig(callback, atomic=False)

Hook config

Parameters:
  • callback (str) – Callback name
  • args (dict[str, str]) – Mapping of argument names and annotations (checked lazily when possible)
  • atomic (bool) – Wrap hook in a single database transaction

dipdup.config.tezos.TezosContractConfig

class dipdup.config.tezos.TezosContractConfig(*args)

Tezos contract config.

Parameters:
  • kind – Always tezos
  • address – Contract address
  • code_hash – Contract code hash or address to fetch it from
  • typename – Alias for the contract script

dipdup.config.tezos.TezosIndexConfig

class dipdup.config.tezos.TezosIndexConfig(kind, datasources)

TzKT index config

Parameters:

dipdup.config.tezos_big_maps.TezosBigMapsHandlerConfig

class dipdup.config.tezos_big_maps.TezosBigMapsHandlerConfig(callback)

Big map handler config

Parameters:
  • callback (str) – Callback name
  • contract – Contract to fetch big map from
  • path – Path to big map (alphanumeric string with dots)

dipdup.config.tezos_big_maps.TezosBigMapsIndexConfig

class dipdup.config.tezos_big_maps.TezosBigMapsIndexConfig(kind, datasources)

Big map index config

Parameters:
  • kind (Literal['tezos.big_maps']) – always ‘tezos.big_maps’
  • datasources (tuple[str | TezosTzktDatasourceConfig, ...]) – Tezos datasources to use
  • handlers – Mapping of big map diff handlers
  • skip_history – Fetch only current big map keys ignoring historical changes
  • first_level – Level to start indexing from
  • last_level – Level to stop indexing at

dipdup.config.tezos_events.TezosEventsHandlerConfig

class dipdup.config.tezos_events.TezosEventsHandlerConfig(callback)

Event handler config

Parameters:
  • callback (str) – Callback name
  • contract – Contract which emits event
  • tag – Event tag

dipdup.config.tezos_events.TezosEventsIndexConfig

class dipdup.config.tezos_events.TezosEventsIndexConfig(kind, datasources)

Event index config

Parameters:
  • kind (Literal['tezos.events']) – always ‘tezos.events’
  • datasources (tuple[str | TezosTzktDatasourceConfig, ...]) – evm datasources to use
  • handlers – Event handlers
  • first_level – First block level to index
  • last_level – Last block level to index

dipdup.config.tezos_events.TezosEventsUnknownEventHandlerConfig

class dipdup.config.tezos_events.TezosEventsUnknownEventHandlerConfig(callback)

Unknown event handler config

Parameters:
  • callback (str) – Callback name
  • contract – Contract which emits event

dipdup.config.tezos_head.TezosTzktHeadHandlerConfig

class dipdup.config.tezos_head.TezosTzktHeadHandlerConfig(callback)

Head block handler config

Parameters:
  • callback (str) – Callback name

dipdup.config.tezos_head.TezosHeadIndexConfig

class dipdup.config.tezos_head.TezosHeadIndexConfig(kind, datasources)

Head block index config

Parameters:
  • kind (Literal['tezos.head']) – always ‘tezos.head’
  • callback – Callback name
  • datasources (tuple[str | TezosTzktDatasourceConfig, ...]) – tezos datasources to use

dipdup.config.tezos_operations.TezosOperationsHandlerConfig

class dipdup.config.tezos_operations.TezosOperationsHandlerConfig(callback)

Operation handler config

Parameters:
  • callback (str) – Callback name
  • pattern – Filters to match operation groups

dipdup.config.tezos_operations.TezosOperationsHandlerOriginationPatternConfig

class dipdup.config.tezos_operations.TezosOperationsHandlerOriginationPatternConfig(**kwargs)

Origination handler pattern config

Parameters:
  • type – always ‘origination’
  • source – Match operations by source contract alias
  • originated_contract – Match origination of exact contract
  • optional – Whether can operation be missing in operation group
  • strict – Match operations by storage only or by the whole code
  • alias – Alias for operation (helps to avoid duplicates)
  • kwargs (Any)

dipdup.config.tezos_operations.TezosOperationsHandlerSmartRollupCementPatternConfig

class dipdup.config.tezos_operations.TezosOperationsHandlerSmartRollupCementPatternConfig(**kwargs)

Operation handler pattern config

Parameters:
  • type – always ‘sr_cement’
  • source – Match operations by source contract alias
  • destination – Match operations by destination contract alias
  • optional – Whether can operation be missing in operation group
  • alias – Alias for operation (helps to avoid duplicates)
  • kwargs (Any)

dipdup.config.tezos_operations.TezosOperationsHandlerSmartRollupExecutePatternConfig

class dipdup.config.tezos_operations.TezosOperationsHandlerSmartRollupExecutePatternConfig(**kwargs)

Operation handler pattern config

Parameters:
  • type – always ‘sr_execute’
  • source – Match operations by source contract alias
  • destination – Match operations by destination contract alias
  • optional – Whether can operation be missing in operation group
  • alias – Alias for operation (helps to avoid duplicates)
  • kwargs (Any)

dipdup.config.tezos_operations.TezosOperationsHandlerTransactionPatternConfig

class dipdup.config.tezos_operations.TezosOperationsHandlerTransactionPatternConfig(**kwargs)

Transaction handler pattern config

Parameters:
  • type – always ‘transaction’
  • source – Match operations by source contract alias
  • destination – Match operations by destination contract alias
  • entrypoint – Match operations by contract entrypoint
  • optional – Whether can operation be missing in operation group
  • alias – Alias for operation (helps to avoid duplicates)
  • kwargs (Any)

dipdup.config.tezos_operations.TezosOperationsIndexConfig

class dipdup.config.tezos_operations.TezosOperationsIndexConfig(kind, datasources)

Operation index config

Parameters:
  • kind (Literal['tezos.operations']) – always ‘tezos.operations’
  • datasources (tuple[str | TezosTzktDatasourceConfig, ...]) – tezos datasources to use
  • handlers – List of indexer handlers
  • types – Types of transaction to fetch
  • contracts – Aliases of contracts being indexed in contracts section
  • first_level – Level to start indexing from
  • last_level – Level to stop indexing at

dipdup.config.tezos_operations.TezosOperationsPatternConfig

class dipdup.config.tezos_operations.TezosOperationsPatternConfig(**kwargs)

Base class for pattern config items.

Contains methods for import and method signature generation during handler callbacks codegen.

Parameters:
  • kwargs (Any)

dipdup.config.tezos_operations.TezosOperationsUnfilteredHandlerConfig

class dipdup.config.tezos_operations.TezosOperationsUnfilteredHandlerConfig(callback)

Handler of unfiltered operation index

Parameters:
  • callback (str) – Callback name

dipdup.config.tezos_operations.TezosOperationsUnfilteredIndexConfig

class dipdup.config.tezos_operations.TezosOperationsUnfilteredIndexConfig(kind, datasources)

Operation index config

Parameters:
  • kind (Literal['tezos.operations_unfiltered']) – always ‘tezos.operations_unfiltered’
  • datasources (tuple[str | TezosTzktDatasourceConfig, ...]) – tezos datasources to use
  • callback – Callback name
  • types – Types of transaction to fetch
  • first_level – Level to start indexing from
  • last_level – Level to stop indexing at

dipdup.config.tezos_tzkt.TezosTzktDatasourceConfig

class dipdup.config.tezos_tzkt.TezosTzktDatasourceConfig(*args)

TzKT datasource config

Parameters:
  • kind – always ‘tezos.tzkt’
  • url – Base API URL, e.g. https://api.tzkt.io/
  • http – HTTP client configuration
  • buffer_size – Number of levels to keep in FIFO buffer before processing
  • merge_subscriptions – Whether to merge realtime subscriptions
  • rollback_depth – Number of blocks to keep in the database to handle reorgs

dipdup.config.tezos_token_balances.TezosTokenBalancesHandlerConfig

class dipdup.config.tezos_token_balances.TezosTokenBalancesHandlerConfig(callback)

Token balance handler config

Parameters:
  • callback (str) – Callback name
  • contract – Filter by contract
  • token_id – Filter by token ID

dipdup.config.tezos_token_balances.TezosTokenBalancesIndexConfig

class dipdup.config.tezos_token_balances.TezosTokenBalancesIndexConfig(kind, datasources)

Token balance index config

Parameters:
  • kind (Literal['tezos.token_balances']) – always ‘tezos.token_balances’
  • datasources (tuple[str | TezosTzktDatasourceConfig, ...]) – tezos datasources to use
  • handlers – Mapping of token transfer handlers
  • first_level – Level to start indexing from
  • last_level – Level to stop indexing at

dipdup.config.tezos_token_transfers.TezosTokenTransfersHandlerConfig

class dipdup.config.tezos_token_transfers.TezosTokenTransfersHandlerConfig(callback)

Token transfer handler config

Parameters:
  • callback (str) – Callback name
  • contract – Filter by contract
  • token_id – Filter by token ID
  • from – Filter by sender
  • to – Filter by recipient

dipdup.config.tezos_token_transfers.TezosTokenTransfersIndexConfig

class dipdup.config.tezos_token_transfers.TezosTokenTransfersIndexConfig(kind, datasources)

Token transfer index config

Parameters:
  • kind (Literal['tezos.token_transfers']) – always ‘tezos.token_transfers’
  • datasources (tuple[str | TezosTzktDatasourceConfig, ...]) – tezos datasources to use
  • handlers – Mapping of token transfer handlers
  • first_level – Level to start indexing from
  • last_level – Level to stop indexing at

dipdup.config.starknet.StarknetContractConfig

class dipdup.config.starknet.StarknetContractConfig(*args)

Starknet contract config

Parameters:
  • kind – Always starknet
  • address – Contract address
  • abi – Contract ABI
  • typename – Alias for the contract script

dipdup.config.starknet.StarknetIndexConfig

class dipdup.config.starknet.StarknetIndexConfig(kind, datasources)

Starknet index that use Subsquid Network as a datasource

Parameters:

dipdup.config.starknet_events.StarknetEventsHandlerConfig

class dipdup.config.starknet_events.StarknetEventsHandlerConfig(callback)

Subsquid event handler

Parameters:
  • callback (str) – Callback name
  • contract – Starknet contract
  • name – Event name

dipdup.config.starknet_events.StarknetEventsIndexConfig

class dipdup.config.starknet_events.StarknetEventsIndexConfig(kind, datasources, first_level=0, last_level=0)

Starknet events index config

Parameters:
  • kind (Literal['starknet.events']) – Always ‘starknet.events’
  • datasources (tuple[str | StarknetSubsquidDatasourceConfig | StarknetNodeDatasourceConfig, ...]) – Aliases of index datasources in datasources section
  • handlers – Event handlers
  • first_level (int) – Level to start indexing from
  • last_level (int) – Level to stop indexing at

dipdup.config.starknet_node.StarknetNodeDatasourceConfig

class dipdup.config.starknet_node.StarknetNodeDatasourceConfig(*args)

Starknet node datasource config

Parameters:
  • kind – Always ‘starknet.node’
  • url – Starknet node URL
  • ws_url – Starknet node WebSocket URL
  • http – HTTP client configuration
  • rollback_depth – A number of blocks to store in database for rollback

dipdup.config.starknet_subsquid.StarknetSubsquidDatasourceConfig

class dipdup.config.starknet_subsquid.StarknetSubsquidDatasourceConfig(*args)

Subsquid datasource config

Parameters:
  • kind – always ‘starknet.subsquid’
  • url – URL of Subsquid Network API
  • http – HTTP client configuration

dipdup.config.tzip_metadata.TzipMetadataDatasourceConfig

class dipdup.config.tzip_metadata.TzipMetadataDatasourceConfig(*args)

DipDup Metadata datasource config

Parameters:
  • kind – always ‘tzip_metadata’
  • network – Network name, e.g. mainnet, ghostnet, etc.
  • url – GraphQL API URL, e.g. https://metadata.dipdup.net
  • http – HTTP client configuration
Help and tips -> Join our Discord
Ideas or suggestions -> Issue Tracker
GraphQL IDE -> Open Playground
Table of Contents