Config reference
Main indexer config
- Parameters:
- spec_version (str | float) – Version of config specification, currently always 2.0
- package (str) – Name of indexer’s Python package, existing or not
- datasources (dict[str, coinbase.CoinbaseDatasourceConfig | abi_etherscan.EtherscanDatasourceConfig | http.HttpDatasourceConfig | ipfs.IpfsDatasourceConfig | evm_subsquid.SubsquidDatasourceConfig | evm_node.EvmNodeDatasourceConfig | tzip_metadata.TzipMetadataDatasourceConfig | tezos_tzkt.TzktDatasourceConfig]) – Mapping of datasource aliases and datasource configs
- database (SqliteDatabaseConfig | PostgresDatabaseConfig) – Database config
- contracts (dict[str, evm.EvmContractConfig | tezos.TezosContractConfig]) – Mapping of contract aliases and contract configs
- indexes (dict[str, evm_subsquid_events.SubsquidEventsIndexConfig | evm_subsquid_operations.SubsquidOperationsIndexConfig | tezos_tzkt_big_maps.TzktBigMapsIndexConfig | tezos_tzkt_events.TzktEventsIndexConfig | tezos_tzkt_head.TzktHeadIndexConfig | tezos_tzkt_operations.TzktOperationsIndexConfig | tezos_tzkt_operations.TzktOperationsUnfilteredIndexConfig | tezos_tzkt_token_transfers.TzktTokenTransfersIndexConfig | IndexTemplateConfig]) – Mapping of index aliases and index configs
- templates (dict[str, evm_subsquid_events.SubsquidEventsIndexConfig | evm_subsquid_operations.SubsquidOperationsIndexConfig | tezos_tzkt_big_maps.TzktBigMapsIndexConfig | tezos_tzkt_events.TzktEventsIndexConfig | tezos_tzkt_head.TzktHeadIndexConfig | tezos_tzkt_operations.TzktOperationsIndexConfig | tezos_tzkt_operations.TzktOperationsUnfilteredIndexConfig | tezos_tzkt_token_transfers.TzktTokenTransfersIndexConfig]) – Mapping of template aliases and index templates
- jobs (dict[str, JobConfig]) – Mapping of job aliases and job configs
- hooks (dict[str, HookConfig]) – Mapping of hook aliases and hook configs
- hasura (HasuraConfig | None) – Hasura integration config
- sentry (SentryConfig) – Sentry integration config
- prometheus (PrometheusConfig | None) – Prometheus integration config
- advanced (AdvancedConfig) – Advanced config
- custom (dict[str, dipdup.fields.Any]) – User-defined configuration to use in callbacks
- logging (dict[str, str | int] | str | int) – Modify logging verbosity
- class AdvancedConfig(reindex=<factory>, scheduler=None, postpone_jobs=False, early_realtime=False, skip_version_check=False, rollback_depth=None, decimal_precision=None, unsafe_sqlite=False, api=<factory>, metrics=MetricsLevel.basic, alt_operation_matcher=False)¶
Feature flags and other advanced config.
- Parameters:
- reindex (dict[dipdup.models.ReindexingReason, dipdup.models.ReindexingAction]) – Mapping of reindexing reasons and actions DipDup performs
- scheduler (dict[str, dipdup.fields.Any] | None) – apscheduler scheduler config
- postpone_jobs (bool) – Do not start job scheduler until all indexes are in realtime state
- early_realtime (bool) – Establish realtime connection immediately after startup
- skip_version_check (bool) – Do not check for new DipDup versions on startup
- rollback_depth (int | None) – A number of levels to keep for rollback
- decimal_precision (int | None) – Overwrite precision if it’s not guessed correctly based on project models.
- unsafe_sqlite (bool) – Disable journaling and data integrity checks. Use only for testing.
- api (ApiConfig) – Monitoring API config
- metrics (MetricsLevel) – off/basic/advanced based on how much performance metrics you want to collect
- alt_operation_matcher (bool) – Use different algorithm to match operations (undocumented)
- class CoinbaseDatasourceConfig(kind, api_key=None, secret_key=None, passphrase=None, http=None)¶
Coinbase datasource config
- Parameters:
- kind (Literal['coinbase']) – always ‘coinbase’
- api_key (str | None) – API key
- secret_key (str | None) – API secret key
- passphrase (str | None) – API passphrase
- http (HttpConfig | None) – HTTP client configuration
- class ContractConfig(kind, typename)¶
Contract config
- Parameters:
- typename (str | None) – Alias for the contract script
- kind (str) –
- class TzktEventsIndexConfig(kind, datasource, handlers=<factory>, first_level=0, last_level=0)¶
Event index config
- Parameters:
- kind (Literal['tezos.tzkt.events']) – always tezos.tzkt.events
- datasource (str | TzktDatasourceConfig) – Datasource config
- handlers (tuple[tezos_tzkt_events.TzktEventsHandlerConfig | tezos_tzkt_events.TzktEventsUnknownEventHandlerConfig, ...]) – Event handlers
- first_level (int) – First block level to index
- last_level (int) – Last block level to index
- class HasuraConfig(url, admin_secret=None, create_source=False, source='default', select_limit=100, allow_aggregations=True, allow_inconsistent_metadata=False, camel_case=False, rest=True, http=None)¶
Config for the Hasura integration.
- Parameters:
- url (str) – URL of the Hasura instance.
- admin_secret (str | None) – Admin secret of the Hasura instance.
- create_source (bool) – Whether source should be added to Hasura if missing.
- source (str) – Hasura source for DipDup to configure, others will be left untouched.
- select_limit (int) – Row limit for unauthenticated queries.
- allow_aggregations (bool) – Whether to allow aggregations in unauthenticated queries.
- allow_inconsistent_metadata (bool) – Whether to ignore errors when applying Hasura metadata.
- camel_case (bool) – Whether to use camelCase instead of default pascal_case for the field names.
- rest (bool) – Enable REST API both for autogenerated and custom queries.
- http (HttpConfig | None) – HTTP connection tunables
- class tezos_tzkt_head.HeadHandlerConfig(callback)¶
Head block handler config
- Parameters:
callback (str) – Callback name
- class TzktHeadIndexConfig(kind, datasource, callback)¶
Head block index config
- Parameters:
- kind (Literal['tezos.tzkt.head']) – always tezos.tzkt.head
- datasource (str | TzktDatasourceConfig) – Index datasource to receive head blocks
- handlers – Mapping of head block handlers
- callback (str) –
- class HookConfig(callback, args=<factory>, atomic=False)¶
Hook config
- Parameters:
- args (dict[str, str]) – Mapping of argument names and annotations (checked lazily when possible)
- atomic (bool) – Wrap hook in a single database transaction
- callback (str) – Callback name
- class ResolvedHttpConfig(retry_count=10, retry_sleep=1.0, retry_multiplier=2.0, ratelimit_rate=0, ratelimit_period=0, ratelimit_sleep=0.0, connection_limit=100, connection_timeout=60, batch_size=10000, replay_path=None, alias=None)¶
HTTP client configuration with defaults
- Parameters:
- retry_count (int) –
- retry_sleep (float) –
- retry_multiplier (float) –
- ratelimit_rate (int) –
- ratelimit_period (int) –
- ratelimit_sleep (float) –
- connection_limit (int) –
- connection_timeout (int) –
- batch_size (int) –
- replay_path (str | None) –
- alias (str | None) –
- class 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, batch_size=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
- batch_size (int | None) – Number of items fetched in a single paginated request
- replay_path (str | None) – Use cached HTTP responses instead of making real requests (dev only)
- alias (str | None) – Alias for this HTTP client (dev only)
- class HttpDatasourceConfig(kind, url, http=None)¶
Generic HTTP datasource config
- Parameters:
- kind (Literal['http']) – always ‘http’
- url (str) – URL to fetch data from
- http (HttpConfig | None) – HTTP client configuration
- class IndexTemplateConfig(template, values, first_level=0, last_level=0)¶
Index template config
- Parameters:
- kind – always template
- values (dict[str, str]) – Values to be substituted in template (<key> -> value)
- first_level (int) – Level to start indexing from
- last_level (int) – Level to stop indexing at
- template (str) – Template alias in templates section
- class IpfsDatasourceConfig(kind, url='https://ipfs.io/ipfs', http=None)¶
IPFS datasource config
- Parameters:
- kind (Literal['ipfs']) – always ‘ipfs’
- url (str) – IPFS node URL, e.g. https://ipfs.io/ipfs/
- http (HttpConfig | None) – HTTP client configuration
- class JobConfig(hook, args=<factory>, crontab=None, interval=None, daemon=False)¶
Job schedule config
- Parameters:
- hook (str | HookConfig) – Name of hook to run
- crontab (str | None) – Schedule with crontab syntax (* * * * *)
- interval (int | None) – Schedule with interval in seconds
- daemon (bool) – Run hook as a daemon (never stops)
- args (dict[str, dipdup.fields.Any]) – Arguments to pass to the hook
- class EtherscanDatasourceConfig(kind, url='https://api.etherscan.io/api', api_key=None, http=None)¶
Etherscan datasource config
- Parameters:
- kind (Literal['abi.etherscan']) – always ‘abi.etherscan’
- url (str) – API URL
- api_key (str | None) – API key
- http (HttpConfig | None) –
- class EvmNodeDatasourceConfig(kind, url, ws_url, http=None, rollback_depth=32)¶
Subsquid datasource config
- Parameters:
- kind (Literal['evm.node']) – Always ‘evm.node’
- url (str) – Ethereum node URL
- ws_url (str) – Ethereum node WebSocket URL
- http (HttpConfig | None) – HTTP client configuration
- rollback_depth (int) – A number of blocks to store in database for rollback
- class EvmContractConfig(kind, typename=None, address=None, abi=None)¶
EVM contract config
- Parameters:
- kind (Literal['evm']) – Always evm
- address (str | None) – Contract address
- abi (str | None) – ABI or topic0
- typename (str | None) – Alias for the contract script
- class SubsquidEventsIndexConfig(kind, datasource, handlers=<factory>, abi=None, first_level=0, last_level=0)¶
Subsquid datasource config
- Parameters:
- kind (Literal['evm.subsquid.events']) – Always ‘evm.subsquid.events’
- datasource (str | SubsquidDatasourceConfig) – Subsquid datasource
- handlers (tuple[evm_subsquid_events.SubsquidEventsHandlerConfig, ...]) – Event handlers
- abi (AbiDatasourceConfig | tuple[AbiDatasourceConfig, ...] | None) – One or more evm.abi datasource(s) for the same network
- first_level (int) – Level to start indexing from
- last_level (int) – Level to stop indexing and disable this index
- class SubsquidOperationsIndexConfig(kind: "Literal['evm.subsquid.operations']", datasource: 'SubsquidDatasourceConfig', handlers: 'tuple[SubsquidOperationsHandlerConfig, ...]' = <factory>, contracts: 'tuple[EvmContractConfig, ...]' = <factory>, abi: 'AbiDatasourceConfig | tuple[AbiDatasourceConfig, ...] | None' = None, first_level: 'int' = 0, last_level: 'int' = 0)¶
- Parameters:
- kind (Literal['evm.subsquid.operations']) –
- datasource (str | SubsquidDatasourceConfig) –
- handlers (tuple[evm_subsquid_operations.SubsquidOperationsHandlerConfig, ...]) –
- contracts (tuple[evm.EvmContractConfig, ...]) –
- abi (AbiDatasourceConfig | tuple[AbiDatasourceConfig, ...] | None) –
- first_level (int) –
- last_level (int) –
- class SubsquidDatasourceConfig(kind, url, node=None, http=None)¶
Subsquid datasource config
- Parameters:
- kind (Literal['evm.subsquid']) – always ‘evm.subsquid’
- url (str) – URL of Subsquid Archives API
- node (str | tuple[str, ...] | EvmNodeDatasourceConfig | tuple[evm_node.EvmNodeDatasourceConfig, ...] | None) – One or more evm.node datasource(s) for the same network
- http (HttpConfig | None) – HTTP client configuration
- http: HttpConfig | None = None¶
- kind: Literal['evm.subsquid']¶
- property merge_subscriptions: bool¶
- node: str | tuple[str, ...] | EvmNodeDatasourceConfig | tuple[evm_node.EvmNodeDatasourceConfig, ...] | None = None¶
- property random_node: EvmNodeDatasourceConfig | None¶
- property rollback_depth: int¶
- url: str¶
- class TzipMetadataDatasourceConfig(kind, network, url='https://metadata.dipdup.net', http=None)¶
DipDup Metadata datasource config
- Parameters:
- kind (Literal['tzip_metadata']) – always ‘tzip_metadata’
- network (TzipMetadataNetwork) – Network name, e.g. mainnet, ghostnet, etc.
- url (str) – GraphQL API URL, e.g. https://metadata.dipdup.net
- http (HttpConfig | None) – HTTP client configuration
- class OperationsHandlerOriginationPatternConfig(type='origination', source=None, originated_contract=None, optional=False, strict=False, alias=None)¶
Origination handler pattern config
- Parameters:
- type (Literal['origination']) – always ‘origination’
- source (str | TezosContractConfig | None) – Match operations by source contract alias
- originated_contract (str | TezosContractConfig | None) – Match origination of exact contract
- optional (bool) – Whether can operation be missing in operation group
- strict (bool) – Match operations by storage only or by the whole code
- alias (str | None) – Alias for transaction (helps to avoid duplicates)
- class OperationsHandlerTransactionPatternConfig(type='transaction', source=None, destination=None, entrypoint=None, optional=False, alias=None)¶
Operation handler pattern config
- Parameters:
- type (Literal['transaction']) – always ‘transaction’
- source (str | TezosContractConfig | None) – Match operations by source contract alias
- destination (str | TezosContractConfig | None) – Match operations by destination contract alias
- entrypoint (str | None) – Match operations by contract entrypoint
- optional (bool) – Whether can operation be missing in operation group
- alias (str | None) – Alias for transaction (helps to avoid duplicates)
- class dipdup.models.tezos_tzkt.TzktOperationType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Type of blockchain operation
- migration = 'migration'¶
- origination = 'origination'¶
- transaction = 'transaction'¶
- class PostgresDatabaseConfig(kind, host, user='postgres', database='postgres', port=5432, schema_name='public', password='', immune_tables=<factory>, connection_timeout=60)¶
Postgres database connection config
- Parameters:
- kind (Literal['postgres']) – always ‘postgres’
- host (str) – Host
- port (int) – Port
- user (str) – User
- password (str) – Password
- database (str) – Database name
- schema_name (str) – Schema name
- immune_tables (set[str]) – List of tables to preserve during reindexing
- connection_timeout (int) – Connection timeout
- class PrometheusConfig(host, port=8000, update_interval=1.0)¶
Config for Prometheus integration.
- Parameters:
- host (str) – Host to bind to
- port (int) – Port to bind to
- update_interval (float) – Interval to update some metrics in seconds
- class dipdup.models.ReindexingAction(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Action that should be performed on reindexing
- exception = 'exception'¶
- ignore = 'ignore'¶
- wipe = 'wipe'¶
- class dipdup.models.ReindexingReason(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Reason that caused reindexing
- config_modified = 'config_modified'¶
- manual = 'manual'¶
- migration = 'migration'¶
- rollback = 'rollback'¶
- schema_modified = 'schema_modified'¶
- class SentryConfig(dsn='', environment=None, server_name=None, release=None, user_id=None, debug=False)¶
Config for Sentry integration.
- Parameters:
- dsn (str) – DSN of the Sentry instance
- environment (str | None) – Environment; if not set, guessed from docker/ci/gha/local.
- server_name (str | None) – Server name; defaults to obfuscated hostname.
- release (str | None) – Release version; defaults to DipDup package version.
- user_id (str | None) – User ID; defaults to obfuscated package/environment.
- debug (bool) – Catch warning messages, increase verbosity.
- class dipdup.models.SkipHistory(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Whether to skip indexing operation history and use only current state
- always = 'always'¶
- never = 'never'¶
- once = 'once'¶
- class SqliteDatabaseConfig(kind, path=':memory:', immune_tables=<factory>)¶
SQLite connection config
- Parameters:
- kind (Literal['sqlite']) – always ‘sqlite’
- path (str) – Path to .sqlite3 file, leave default for in-memory database (:memory:)
- immune_tables (set[str]) –
- class TzktTokenTransfersIndexConfig(kind, datasource, handlers=FieldInfo(default=PydanticUndefined, default_factory=<class 'tuple'>, extra={}), first_level=0, last_level=0)¶
Token transfer index config
- Parameters:
- kind (Literal['tezos.tzkt.token_transfers']) – always tezos.tzkt.token_transfers
- datasource (str | TzktDatasourceConfig) – Index datasource to use
- handlers (tuple[tezos_tzkt_token_transfers.TzktTokenTransfersHandlerConfig, ...]) – Mapping of token transfer handlers
- first_level (int) – Level to start indexing from
- last_level (int) – Level to stop indexing at
- class TzktDatasourceConfig(kind, url='https://api.tzkt.io', http=None, buffer_size=0, merge_subscriptions=False, rollback_depth=2)¶
TzKT datasource config
- Parameters:
- kind (Literal['tezos.tzkt']) – always ‘tezos.tzkt’
- url (str) – Base API URL, e.g. https://api.tzkt.io/
- http (HttpConfig | None) – HTTP client configuration
- buffer_size (int) – Number of levels to keep in FIFO buffer before processing
- merge_subscriptions (bool) – Whether to merge realtime subscriptions
- rollback_depth (int) – Number of blocks to keep in the database to handle reorgs