diff --git a/CHANGELOG.md b/CHANGELOG.md index 87128b64d..8c1dad573 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic Releases prior to 7.0 has been removed from this file to declutter search results; see the [archived copy](https://github.com/dipdup-io/dipdup/blob/8.0.0b5/CHANGELOG.md) for the full list. +## [Unreleased] + +### Fixed + +- config: Fixed parsing config files after updating to pydantic 2.10.3. + ## [8.1.2] - 2024-12-10 ### Fixed diff --git a/docs/7.references/2.config.md b/docs/7.references/2.config.md index ead794c18..de39d42fd 100644 --- a/docs/7.references/2.config.md +++ b/docs/7.references/2.config.md @@ -10,7 +10,7 @@ description: "Config file reference" ## dipdup.config.DipDupConfig -class dipdup.config.DipDupConfig(spec_version, package, datasources=None, database=None, contracts=None, indexes=None, templates=None, jobs=None, hooks=None, hasura=None, sentry=None, prometheus=None, api=None, advanced=None, custom=None, logging='INFO') +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:
@@ -41,9 +41,15 @@ description: "Config file reference" ## dipdup.config.AbiDatasourceConfig -class dipdup.config.AbiDatasourceConfig +class dipdup.config.AbiDatasourceConfig(**kwargs)

Provider of EVM contract ABIs. Datasource kind starts with ‘abi.’

+
Parameters:
+
    + +
  • kwargs (Any)

  • +
+
@@ -51,15 +57,15 @@ description: "Config file reference" ## dipdup.config.abi_etherscan.AbiEtherscanDatasourceConfig -class dipdup.config.abi_etherscan.AbiEtherscanDatasourceConfig(kind, url='https://api.etherscan.io/api', api_key=None, http=None) +class dipdup.config.abi_etherscan.AbiEtherscanDatasourceConfig(*args)

Etherscan datasource config

Parameters:
    -
  • kind (Literal['abi.etherscan']) – always ‘abi.etherscan’

  • -
  • url (str) – API URL

  • -
  • api_key (str | None) – API key

  • -
  • http (HttpConfig | None) – HTTP client configuration

  • +
  • kind – always ‘abi.etherscan’

  • +
  • url – API URL

  • +
  • api_key – API key

  • +
  • http – HTTP client configuration

@@ -70,19 +76,19 @@ description: "Config file reference" ## dipdup.config.AdvancedConfig -class dipdup.config.AdvancedConfig(reindex=None, scheduler=None, postpone_jobs=False, early_realtime=False, rollback_depth=None, decimal_precision=None, unsafe_sqlite=False, alt_operation_matcher=False, **kwargs) +class dipdup.config.AdvancedConfig(**kwargs)

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

Parameters:
    -
  • reindex (dict[ReindexingReason, ReindexingAction]) – Mapping of reindexing reasons and actions DipDup performs.

  • -
  • scheduler (dict[str, Any] | None) – apscheduler scheduler config.

  • -
  • postpone_jobs (bool) – Do not start job scheduler until all indexes reach the realtime state.

  • -
  • early_realtime (bool) – Establish realtime connection and start collecting messages while sync is in progress (faster, but consumes more RAM).

  • -
  • 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.

  • -
  • alt_operation_matcher (bool) – Use different algorithm to match Tezos operations (dev only)

  • +
  • 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)

@@ -94,14 +100,15 @@ description: "Config file reference" ## dipdup.config.ApiConfig -class dipdup.config.ApiConfig(host='127.0.0.1', port=46339) +class dipdup.config.ApiConfig(**kwargs)

Management API config

Parameters:
    -
  • host (str) – Host to bind to

  • -
  • port (int) – Port to bind to

  • +
  • host – Host to bind to

  • +
  • port – Port to bind to

  • +
  • kwargs (Any)

@@ -111,16 +118,16 @@ description: "Config file reference" ## dipdup.config.coinbase.CoinbaseDatasourceConfig -class dipdup.config.coinbase.CoinbaseDatasourceConfig(kind, api_key=None, secret_key=None, passphrase=None, http=None) +class dipdup.config.coinbase.CoinbaseDatasourceConfig(*args)

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

  • +
  • kind – always ‘coinbase’

  • +
  • api_key – API key

  • +
  • secret_key – API secret key

  • +
  • passphrase – API passphrase

  • +
  • http – HTTP client configuration

@@ -131,13 +138,14 @@ description: "Config file reference" ## dipdup.config.ContractConfig -class dipdup.config.ContractConfig +class dipdup.config.ContractConfig(*args)

Contract config

Parameters:
  • kind – Defined by child class

  • typename – Alias for the contract script

  • +
@@ -147,7 +155,7 @@ description: "Config file reference" ## dipdup.config.DatasourceConfig -class dipdup.config.DatasourceConfig +class dipdup.config.DatasourceConfig(*args)

Base class for datasource configs

Parameters:
@@ -155,6 +163,7 @@ description: "Config file reference"
  • kind – Defined by child class

  • url – URL of the API

  • http – HTTP connection tunables

  • +
    @@ -164,15 +173,15 @@ description: "Config file reference" ## dipdup.config.evm.EvmContractConfig -class dipdup.config.evm.EvmContractConfig(kind, address=None, abi=None, typename=None) +class dipdup.config.evm.EvmContractConfig(*args)

    EVM contract config

    Parameters:
      -
    • kind (Literal['evm']) – Always evm

    • -
    • address (EvmAddress | None) – Contract address

    • -
    • abi (EvmAddress | None) – Contract ABI

    • -
    • typename (str | None) – Alias for the contract script

    • +
    • kind – Always evm

    • +
    • address – Contract address

    • +
    • abi – Contract ABI

    • +
    • typename – Alias for the contract script

    @@ -183,16 +192,16 @@ description: "Config file reference" ## dipdup.config.evm_node.EvmNodeDatasourceConfig -class dipdup.config.evm_node.EvmNodeDatasourceConfig(kind, url, ws_url=None, http=None, rollback_depth=32) +class dipdup.config.evm_node.EvmNodeDatasourceConfig(*args)

    EVM node datasource config

    Parameters:
      -
    • kind (Literal['evm.node']) – Always ‘evm.node’

    • -
    • url (Url) – EVM node URL

    • -
    • ws_url (WsUrl | None) – EVM node WebSocket URL

    • -
    • http (HttpConfig | None) – HTTP client configuration

    • -
    • rollback_depth (int) – A number of blocks to store in database for rollback

    • +
    • 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

    @@ -203,15 +212,16 @@ description: "Config file reference" ## dipdup.config.evm_events.EvmEventsHandlerConfig -class dipdup.config.evm_events.EvmEventsHandlerConfig(callback, contract, name) +class dipdup.config.evm_events.EvmEventsHandlerConfig(**kwargs)

    Subsquid event handler

    Parameters:
      -
    • callback (str) – Callback name

    • -
    • contract (str | EvmContractConfig) – EVM contract

    • -
    • name (str) – Event name

    • +
    • callback – Callback name

    • +
    • contract – EVM contract

    • +
    • name – Event name

    • +
    • kwargs (Any)

    @@ -221,16 +231,16 @@ description: "Config file reference" ## dipdup.config.evm_events.EvmEventsIndexConfig -class dipdup.config.evm_events.EvmEventsIndexConfig(kind, datasources, handlers, first_level=0, last_level=0) +class dipdup.config.evm_events.EvmEventsIndexConfig(*args)

    Subsquid datasource config

    Parameters:
      -
    • kind (Literal['evm.events']) – Always ‘evm.events’

    • -
    • datasources (tuple[str | EvmSubsquidDatasourceConfig | EvmNodeDatasourceConfig | AbiEtherscanDatasourceConfig, ...]) – evm datasources to use

    • -
    • handlers (tuple[EvmEventsHandlerConfig, ...]) – Event handlers

    • -
    • first_level (int) – Level to start indexing from

    • -
    • last_level (int) – Level to stop indexing and disable this index

    • +
    • 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

    @@ -241,14 +251,14 @@ description: "Config file reference" ## dipdup.config.evm_subsquid.EvmSubsquidDatasourceConfig -class dipdup.config.evm_subsquid.EvmSubsquidDatasourceConfig(kind, url, http=None) +class dipdup.config.evm_subsquid.EvmSubsquidDatasourceConfig(*args)

    Subsquid datasource config

    Parameters:
      -
    • kind (Literal['evm.subsquid']) – always ‘evm.subsquid’

    • -
    • url (Url) – URL of Subsquid Network API

    • -
    • http (HttpConfig | None) – HTTP client configuration

    • +
    • kind – always ‘evm.subsquid’

    • +
    • url – URL of Subsquid Network API

    • +
    • http – HTTP client configuration

    @@ -259,13 +269,13 @@ description: "Config file reference" ## dipdup.config.evm.EvmIndexConfig -class dipdup.config.evm.EvmIndexConfig(kind, datasources) +class dipdup.config.evm.EvmIndexConfig(*args)

    EVM index that use Subsquid Network as a datasource

    Parameters:
    @@ -276,18 +286,18 @@ description: "Config file reference" ## dipdup.config.evm_transactions.EvmTransactionsHandlerConfig -class dipdup.config.evm_transactions.EvmTransactionsHandlerConfig(callback, from_=None, to=None, method=None, signature=None) +class dipdup.config.evm_transactions.EvmTransactionsHandlerConfig(**kwargs)

    Subsquid transaction handler

    Parameters:
      -
    • callback (str) – Callback name

    • +
    • callback – Callback name

    • from – Transaction sender

    • -
    • to (str | EvmContractConfig | None) – Transaction receiver

    • -
    • method (str | None) – Method name

    • -
    • signature (str | None) – Method signature

    • +
    • to – Transaction receiver

    • +
    • method – Method name

    • +
    • signature – Method signature

    • -
    • from_ (str | EvmContractConfig | None)

    • +
    • kwargs (Any)

    @@ -297,16 +307,16 @@ description: "Config file reference" ## dipdup.config.evm_transactions.EvmTransactionsIndexConfig -class dipdup.config.evm_transactions.EvmTransactionsIndexConfig(kind, datasources, handlers, first_level=0, last_level=0) +class dipdup.config.evm_transactions.EvmTransactionsIndexConfig(kind, datasources)

    Index that uses Subsquid Network as a datasource for transactions

    Parameters:
    @@ -317,13 +327,14 @@ description: "Config file reference" ## dipdup.config.HandlerConfig -class dipdup.config.HandlerConfig(callback) +class dipdup.config.HandlerConfig(**kwargs)

    Base class for index handlers

    Parameters:
      -
    • callback (str) – Callback name

    • +
    • callback – Callback name

    • +
    • kwargs (Any)

    @@ -333,24 +344,25 @@ description: "Config file reference" ## dipdup.config.HasuraConfig -class dipdup.config.HasuraConfig(url, admin_secret=None, create_source=False, source='default', select_limit=1000, allow_aggregations=True, allow_inconsistent_metadata=False, camel_case=False, rest=True, http=None, hide_internal=False, hide=None) +class dipdup.config.HasuraConfig(**kwargs)

    Config for the Hasura integration.

    Parameters:
      -
    • url (Url) – 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

    • -
    • hide_internal (bool) – Whether to make internal tables (prefixed with “dipdup”) private.

    • -
    • hide (list[str]) – List of table/view names to make private.

    • +
    • 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)

    @@ -360,14 +372,15 @@ description: "Config file reference" ## dipdup.config.HookConfig -class dipdup.config.HookConfig(callback, atomic=False) +class dipdup.config.HookConfig(**kwargs)

    Hook config

    Parameters:
      -
    • callback (str) – Callback name

    • +
    • callback – 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

    • +
    • atomic – Wrap hook in a single database transaction

    • +
    • kwargs (Any)

    @@ -405,14 +418,14 @@ description: "Config file reference" ## dipdup.config.http.HttpDatasourceConfig -class dipdup.config.http.HttpDatasourceConfig(kind, url, http=None) +class dipdup.config.http.HttpDatasourceConfig(*args)

    Generic HTTP datasource config

    Parameters:
      -
    • kind (Literal['http']) – always ‘http’

    • -
    • url (str) – URL to fetch data from

    • -
    • http (HttpConfig | None) – HTTP client configuration

    • +
    • kind – always ‘http’

    • +
    • url – URL to fetch data from

    • +
    • http – HTTP client configuration

    @@ -423,13 +436,13 @@ description: "Config file reference" ## dipdup.config.IndexConfig -class dipdup.config.IndexConfig(kind, datasources) +class dipdup.config.IndexConfig(*args)

    Index config

    Parameters:
      -
    • kind (str) – Defined by child class

    • -
    • datasources (tuple[str | DatasourceConfig, ...]) – Aliases of index datasources in datasources section

    • +
    • kind – Defined by child class

    • +
    • datasources – Aliases of index datasources in datasources section

    @@ -440,9 +453,12 @@ description: "Config file reference" ## dipdup.config.IndexDatasourceConfig -class dipdup.config.IndexDatasourceConfig +class dipdup.config.IndexDatasourceConfig(*args)

    Datasource that can be used as a primary source of historical data

    +
    Parameters:
    +

    args (Any)

    +
    @@ -450,16 +466,16 @@ description: "Config file reference" ## dipdup.config.IndexTemplateConfig -class dipdup.config.IndexTemplateConfig(template, values, first_level=0, last_level=0) +class dipdup.config.IndexTemplateConfig(*args)

    Index template config

    Parameters:
    • kind – always ‘template’

    • -
    • values (dict[str, Any]) – 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

    • +
    • 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

    @@ -470,14 +486,14 @@ description: "Config file reference" ## dipdup.config.ipfs.IpfsDatasourceConfig -class dipdup.config.ipfs.IpfsDatasourceConfig(kind, url='https://ipfs.io/ipfs', http=None) +class dipdup.config.ipfs.IpfsDatasourceConfig(*args)

    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

    • +
    • kind – always ‘ipfs’

    • +
    • url – IPFS node URL, e.g. https://ipfs.io/ipfs/

    • +
    • http – HTTP client configuration

    @@ -488,16 +504,16 @@ description: "Config file reference" ## dipdup.config.JobConfig -class dipdup.config.JobConfig(hook, crontab=None, interval=None, daemon=False) +class dipdup.config.JobConfig(*args)

    Job schedule config

    Parameters:
      -
    • hook (str | HookConfig) – Name of hook to run

    • +
    • hook – Name of hook to run

    • args (dict[str, Any]) – Arguments to pass to the hook

    • -
    • crontab (str | None) – Schedule with crontab syntax (* * * * *)

    • -
    • interval (int | None) – Schedule with interval in seconds

    • -
    • daemon (bool) – Run hook as a daemon (never stops)

    • +
    • crontab – Schedule with crontab syntax (* * * * *)

    • +
    • interval – Schedule with interval in seconds

    • +
    • daemon – Run hook as a daemon (never stops)

    @@ -507,21 +523,22 @@ description: "Config file reference" ## dipdup.config.PostgresDatabaseConfig -class dipdup.config.PostgresDatabaseConfig(kind, host, user='postgres', database='postgres', port=5432, schema_name='public', password='', immune_tables=None, connection_timeout=60) +class dipdup.config.PostgresDatabaseConfig(**kwargs)

    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

    • +
    • 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)

    @@ -531,15 +548,16 @@ description: "Config file reference" ## dipdup.config.PrometheusConfig -class dipdup.config.PrometheusConfig(host='127.0.0.1', port=8000, update_interval=1.0) +class dipdup.config.PrometheusConfig(**kwargs)

    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

    • +
    • host – Host to bind to

    • +
    • port – Port to bind to

    • +
    • update_interval – Interval to update some metrics in seconds

    • +
    • kwargs (Any)

    @@ -549,25 +567,26 @@ description: "Config file reference" ## dipdup.config.ResolvedHttpConfig -class dipdup.config.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, request_timeout=60, batch_size=10000, polling_interval=1.0, replay_path=None, alias=None) +class dipdup.config.ResolvedHttpConfig(**kwargs)

    Advanced configuration of HTTP client

    Parameters:
      -
    • retry_count (int) – Number of retries after request failed before giving up

    • -
    • retry_sleep (float) – Sleep time between retries

    • -
    • retry_multiplier (float) – Multiplier for sleep time between retries

    • -
    • ratelimit_rate (int) – Number of requests per period (“drops” in leaky bucket)

    • -
    • ratelimit_period (int) – Time period for rate limiting in seconds

    • -
    • ratelimit_sleep (float) – Sleep time between requests when rate limit is reached

    • -
    • connection_limit (int) – Number of simultaneous connections

    • -
    • connection_timeout (int) – Connection timeout in seconds

    • -
    • request_timeout (int) – Request timeout in seconds

    • -
    • batch_size (int) – Number of items fetched in a single paginated request (when applicable)

    • -
    • polling_interval (float) – Interval between polling requests in seconds (when applicable)

    • -
    • 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)

    • +
    • 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_path – Use cached HTTP responses instead of making real requests (dev only)

    • +
    • alias – Alias for this HTTP client (dev only)

    • +
    • kwargs (Any)

    @@ -577,18 +596,19 @@ description: "Config file reference" ## dipdup.config.SentryConfig -class dipdup.config.SentryConfig(dsn=None, environment=None, server_name=None, release=None, user_id=None, debug=False) +class dipdup.config.SentryConfig(**kwargs)

    Config for Sentry integration.

    Parameters:
      -
    • dsn (str | None) – 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.

    • +
    • 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)

    @@ -598,15 +618,16 @@ description: "Config file reference" ## dipdup.config.SqliteDatabaseConfig -class dipdup.config.SqliteDatabaseConfig(kind, path=':memory:', immune_tables=None) +class dipdup.config.SqliteDatabaseConfig(**kwargs)

    SQLite connection config

    Parameters:
      -
    • kind (Literal['sqlite']) – always ‘sqlite’

    • -
    • path (str) – Path to .sqlite file, leave default for in-memory database (:memory:)

    • -
    • immune_tables (set[str]) – List of tables to preserve during reindexing

    • +
    • 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)

    @@ -633,15 +654,15 @@ description: "Config file reference" ## dipdup.config.tezos.TezosContractConfig -class dipdup.config.tezos.TezosContractConfig(kind, address=None, code_hash=None, typename=None) +class dipdup.config.tezos.TezosContractConfig(*args)

    Tezos contract config.

    Parameters:
      -
    • kind (Literal['tezos']) – Always tezos

    • -
    • address (TezosAddress | None) – Contract address

    • -
    • code_hash (int | TezosAddress | None) – Contract code hash or address to fetch it from

    • -
    • typename (str | None) – Alias for the contract script

    • +
    • kind – Always tezos

    • +
    • address – Contract address

    • +
    • code_hash – Contract code hash or address to fetch it from

    • +
    • typename – Alias for the contract script

    @@ -669,14 +690,14 @@ description: "Config file reference" ## dipdup.config.tezos_big_maps.TezosBigMapsHandlerConfig -class dipdup.config.tezos_big_maps.TezosBigMapsHandlerConfig(callback, contract, path) +class dipdup.config.tezos_big_maps.TezosBigMapsHandlerConfig(callback)

    Big map handler config

    Parameters:
    • callback (str) – Callback name

    • -
    • contract (str | TezosContractConfig) – Contract to fetch big map from

    • -
    • path (str) – Path to big map (alphanumeric string with dots)

    • +
    • contract – Contract to fetch big map from

    • +
    • path – Path to big map (alphanumeric string with dots)

    @@ -687,17 +708,17 @@ description: "Config file reference" ## dipdup.config.tezos_big_maps.TezosBigMapsIndexConfig -class dipdup.config.tezos_big_maps.TezosBigMapsIndexConfig(kind, datasources, handlers, skip_history=SkipHistory.never, first_level=0, last_level=0) +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 (tuple[TezosBigMapsHandlerConfig, ...]) – Mapping of big map diff handlers

    • -
    • skip_history (SkipHistory) – Fetch only current big map keys ignoring historical changes

    • -
    • first_level (int) – Level to start indexing from

    • -
    • last_level (int) – Level to stop indexing at

    • +
    • 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

    @@ -708,14 +729,14 @@ description: "Config file reference" ## dipdup.config.tezos_events.TezosEventsHandlerConfig -class dipdup.config.tezos_events.TezosEventsHandlerConfig(callback, contract, tag) +class dipdup.config.tezos_events.TezosEventsHandlerConfig(callback)

    Event handler config

    Parameters:
    • callback (str) – Callback name

    • -
    • contract (str | TezosContractConfig) – Contract which emits event

    • -
    • tag (str) – Event tag

    • +
    • contract – Contract which emits event

    • +
    • tag – Event tag

    @@ -726,16 +747,16 @@ description: "Config file reference" ## dipdup.config.tezos_events.TezosEventsIndexConfig -class dipdup.config.tezos_events.TezosEventsIndexConfig(kind, datasources, handlers, first_level=0, last_level=0) +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 (tuple[TezosEventsHandlerConfig | TezosEventsUnknownEventHandlerConfig, ...]) – Event handlers

    • -
    • first_level (int) – First block level to index

    • -
    • last_level (int) – Last block level to index

    • +
    • handlers – Event handlers

    • +
    • first_level – First block level to index

    • +
    • last_level – Last block level to index

    @@ -746,13 +767,13 @@ description: "Config file reference" ## dipdup.config.tezos_events.TezosEventsUnknownEventHandlerConfig -class dipdup.config.tezos_events.TezosEventsUnknownEventHandlerConfig(callback, contract) +class dipdup.config.tezos_events.TezosEventsUnknownEventHandlerConfig(callback)

    Unknown event handler config

    Parameters:
    • callback (str) – Callback name

    • -
    • contract (str | TezosContractConfig) – Contract which emits event

    • +
    • contract – Contract which emits event

    @@ -779,13 +800,13 @@ description: "Config file reference" ## dipdup.config.tezos_head.TezosHeadIndexConfig -class dipdup.config.tezos_head.TezosHeadIndexConfig(kind, datasources, callback) +class dipdup.config.tezos_head.TezosHeadIndexConfig(kind, datasources)

    Head block index config

    Parameters:
    • kind (Literal['tezos.head']) – always ‘tezos.head’

    • -
    • callback (str) – Callback name

    • +
    • callback – Callback name

    • datasources (tuple[str | TezosTzktDatasourceConfig, ...]) – tezos datasources to use

    @@ -797,13 +818,13 @@ description: "Config file reference" ## dipdup.config.tezos_operations.TezosOperationsHandlerConfig -class dipdup.config.tezos_operations.TezosOperationsHandlerConfig(callback, pattern) +class dipdup.config.tezos_operations.TezosOperationsHandlerConfig(callback)

    Operation handler config

    Parameters:
    @@ -814,18 +835,19 @@ description: "Config file reference" ## dipdup.config.tezos_operations.TezosOperationsHandlerOriginationPatternConfig -class dipdup.config.tezos_operations.TezosOperationsHandlerOriginationPatternConfig(type='origination', source=None, originated_contract=None, optional=False, strict=False, alias=None) +class dipdup.config.tezos_operations.TezosOperationsHandlerOriginationPatternConfig(**kwargs)

    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 operation (helps to avoid duplicates)

    • +
    • 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)

    @@ -835,17 +857,18 @@ description: "Config file reference" ## dipdup.config.tezos_operations.TezosOperationsHandlerSmartRollupCementPatternConfig -class dipdup.config.tezos_operations.TezosOperationsHandlerSmartRollupCementPatternConfig(type='sr_cement', source=None, destination=None, optional=False, alias=None) +class dipdup.config.tezos_operations.TezosOperationsHandlerSmartRollupCementPatternConfig(**kwargs)

    Operation handler pattern config

    Parameters:
      -
    • type (Literal['sr_cement']) – always ‘sr_cement’

    • -
    • source (str | TezosContractConfig | None) – Match operations by source contract alias

    • -
    • destination (str | TezosContractConfig | None) – Match operations by destination contract alias

    • -
    • optional (bool) – Whether can operation be missing in operation group

    • -
    • alias (str | None) – Alias for operation (helps to avoid duplicates)

    • +
    • 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)

    @@ -855,17 +878,18 @@ description: "Config file reference" ## dipdup.config.tezos_operations.TezosOperationsHandlerSmartRollupExecutePatternConfig -class dipdup.config.tezos_operations.TezosOperationsHandlerSmartRollupExecutePatternConfig(type='sr_execute', source=None, destination=None, optional=False, alias=None) +class dipdup.config.tezos_operations.TezosOperationsHandlerSmartRollupExecutePatternConfig(**kwargs)

    Operation handler pattern config

    Parameters:
      -
    • type (Literal['sr_execute']) – always ‘sr_execute’

    • -
    • source (str | TezosContractConfig | None) – Match operations by source contract alias

    • -
    • destination (str | TezosContractConfig | None) – Match operations by destination contract alias

    • -
    • optional (bool) – Whether can operation be missing in operation group

    • -
    • alias (str | None) – Alias for operation (helps to avoid duplicates)

    • +
    • 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)

    @@ -875,18 +899,19 @@ description: "Config file reference" ## dipdup.config.tezos_operations.TezosOperationsHandlerTransactionPatternConfig -class dipdup.config.tezos_operations.TezosOperationsHandlerTransactionPatternConfig(type='transaction', source=None, destination=None, entrypoint=None, optional=False, alias=None) +class dipdup.config.tezos_operations.TezosOperationsHandlerTransactionPatternConfig(**kwargs)

    Transaction 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 operation (helps to avoid duplicates)

    • +
    • 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)

    @@ -896,18 +921,18 @@ description: "Config file reference" ## dipdup.config.tezos_operations.TezosOperationsIndexConfig -class dipdup.config.tezos_operations.TezosOperationsIndexConfig(kind, datasources, handlers, contracts=None, types=(TezosOperationType.transaction,), first_level=0, last_level=0) +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 (tuple[TezosOperationsHandlerConfig, ...]) – List of indexer handlers

    • -
    • types (tuple[TezosOperationType, ...]) – Types of transaction to fetch

    • -
    • contracts (list[str | TezosContractConfig]) – Aliases of contracts being indexed in contracts section

    • -
    • first_level (int) – Level to start indexing from

    • -
    • last_level (int) – Level to stop indexing at

    • +
    • 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

    @@ -918,10 +943,16 @@ description: "Config file reference" ## dipdup.config.tezos_operations.TezosOperationsPatternConfig -class 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)

    • +
    +
    @@ -945,17 +976,17 @@ description: "Config file reference" ## dipdup.config.tezos_operations.TezosOperationsUnfilteredIndexConfig -class dipdup.config.tezos_operations.TezosOperationsUnfilteredIndexConfig(kind, datasources, callback, types=(TezosOperationType.transaction,), first_level=0, last_level=0) +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 (str) – Callback name

    • -
    • types (tuple[TezosOperationType, ...]) – Types of transaction to fetch

    • -
    • first_level (int) – Level to start indexing from

    • -
    • last_level (int) – Level to stop indexing at

    • +
    • callback – Callback name

    • +
    • types – Types of transaction to fetch

    • +
    • first_level – Level to start indexing from

    • +
    • last_level – Level to stop indexing at

    @@ -966,17 +997,17 @@ description: "Config file reference" ## dipdup.config.tezos_tzkt.TezosTzktDatasourceConfig -class dipdup.config.tezos_tzkt.TezosTzktDatasourceConfig(kind, url='https://api.tzkt.io', http=None, buffer_size=0, merge_subscriptions=False, rollback_depth=2) +class dipdup.config.tezos_tzkt.TezosTzktDatasourceConfig(*args)

    TzKT datasource config

    Parameters:
      -
    • kind (Literal['tezos.tzkt']) – always ‘tezos.tzkt’

    • -
    • url (Url) – 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

    • +
    • 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

    @@ -987,14 +1018,14 @@ description: "Config file reference" ## dipdup.config.tezos_token_balances.TezosTokenBalancesHandlerConfig -class dipdup.config.tezos_token_balances.TezosTokenBalancesHandlerConfig(callback, contract=None, token_id=None) +class dipdup.config.tezos_token_balances.TezosTokenBalancesHandlerConfig(callback)

    Token balance handler config

    Parameters:
    • callback (str) – Callback name

    • -
    • contract (str | TezosContractConfig | None) – Filter by contract

    • -
    • token_id (int | None) – Filter by token ID

    • +
    • contract – Filter by contract

    • +
    • token_id – Filter by token ID

    @@ -1005,16 +1036,16 @@ description: "Config file reference" ## dipdup.config.tezos_token_balances.TezosTokenBalancesIndexConfig -class dipdup.config.tezos_token_balances.TezosTokenBalancesIndexConfig(kind, datasources, handlers, first_level=0, last_level=0) +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 (tuple[TezosTokenBalancesHandlerConfig, ...]) – Mapping of token transfer handlers

    • -
    • first_level (int) – Level to start indexing from

    • -
    • last_level (int) – Level to stop indexing at

    • +
    • handlers – Mapping of token transfer handlers

    • +
    • first_level – Level to start indexing from

    • +
    • last_level – Level to stop indexing at

    @@ -1025,18 +1056,17 @@ description: "Config file reference" ## dipdup.config.tezos_token_transfers.TezosTokenTransfersHandlerConfig -class dipdup.config.tezos_token_transfers.TezosTokenTransfersHandlerConfig(callback, contract=None, token_id=None, from_=None, to=None) +class dipdup.config.tezos_token_transfers.TezosTokenTransfersHandlerConfig(callback)

    Token transfer handler config

    Parameters:
    • callback (str) – Callback name

    • -
    • contract (str | TezosContractConfig | None) – Filter by contract

    • -
    • token_id (int | None) – Filter by token ID

    • +
    • contract – Filter by contract

    • +
    • token_id – Filter by token ID

    • from – Filter by sender

    • -
    • to (str | TezosContractConfig | None) – Filter by recipient

    • +
    • to – Filter by recipient

    • -
    • from_ (str | TezosContractConfig | None)

    @@ -1046,16 +1076,16 @@ description: "Config file reference" ## dipdup.config.tezos_token_transfers.TezosTokenTransfersIndexConfig -class dipdup.config.tezos_token_transfers.TezosTokenTransfersIndexConfig(kind, datasources, handlers, first_level=0, last_level=0) +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 (tuple[TezosTokenTransfersHandlerConfig, ...]) – Mapping of token transfer handlers

    • -
    • first_level (int) – Level to start indexing from

    • -
    • last_level (int) – Level to stop indexing at

    • +
    • handlers – Mapping of token transfer handlers

    • +
    • first_level – Level to start indexing from

    • +
    • last_level – Level to stop indexing at

    @@ -1066,15 +1096,15 @@ description: "Config file reference" ## dipdup.config.starknet.StarknetContractConfig -class dipdup.config.starknet.StarknetContractConfig(kind, address=None, abi=None, typename=None) +class dipdup.config.starknet.StarknetContractConfig(*args)

    Starknet contract config

    Parameters:
      -
    • kind (Literal['starknet']) – Always starknet

    • -
    • address (StarknetAddress | None) – Contract address

    • -
    • abi (StarknetAddress | None) – Contract ABI

    • -
    • typename (str | None) – Alias for the contract script

    • +
    • kind – Always starknet

    • +
    • address – Contract address

    • +
    • abi – Contract ABI

    • +
    • typename – Alias for the contract script

    @@ -1085,14 +1115,14 @@ description: "Config file reference" ## dipdup.config.starknet.StarknetIndexConfig -class dipdup.config.starknet.StarknetIndexConfig(kind, datasources, first_level=0, last_level=0) +class dipdup.config.starknet.StarknetIndexConfig(kind, datasources)

    Starknet index that use Subsquid Network as a datasource

    Parameters:
    • datasources (tuple[str | StarknetSubsquidDatasourceConfig | StarknetNodeDatasourceConfig, ...]) – starknet datasources to use

    • -
    • first_level (int) – Level to start indexing from

    • -
    • last_level (int) – Level to stop indexing and disable this index

    • +
    • first_level – Level to start indexing from

    • +
    • last_level – Level to stop indexing and disable this index

    • kind (str)

    @@ -1104,14 +1134,14 @@ description: "Config file reference" ## dipdup.config.starknet_events.StarknetEventsHandlerConfig -class dipdup.config.starknet_events.StarknetEventsHandlerConfig(callback, contract, name) +class dipdup.config.starknet_events.StarknetEventsHandlerConfig(callback)

    Subsquid event handler

    Parameters:
    • callback (str) – Callback name

    • -
    • contract (str | StarknetContractConfig) – Starknet contract

    • -
    • name (str) – Event name

    • +
    • contract – Starknet contract

    • +
    • name – Event name

    @@ -1122,14 +1152,14 @@ description: "Config file reference" ## dipdup.config.starknet_events.StarknetEventsIndexConfig -class dipdup.config.starknet_events.StarknetEventsIndexConfig(kind, datasources, first_level=0, last_level=0, handlers) +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 (tuple[StarknetEventsHandlerConfig, ...]) – Event handlers

    • +
    • handlers – Event handlers

    • first_level (int) – Level to start indexing from

    • last_level (int) – Level to stop indexing at

    • @@ -1142,16 +1172,16 @@ description: "Config file reference" ## dipdup.config.starknet_node.StarknetNodeDatasourceConfig -class dipdup.config.starknet_node.StarknetNodeDatasourceConfig(kind, url, ws_url=None, http=None, rollback_depth=32) +class dipdup.config.starknet_node.StarknetNodeDatasourceConfig(*args)

      Starknet node datasource config

      Parameters:
        -
      • kind (Literal['starknet.node']) – Always ‘starknet.node’

      • -
      • url (Url) – Starknet node URL

      • -
      • ws_url (WsUrl | None) – Starknet node WebSocket URL

      • -
      • http (HttpConfig | None) – HTTP client configuration

      • -
      • rollback_depth (int) – A number of blocks to store in database for rollback

      • +
      • 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

      @@ -1162,14 +1192,14 @@ description: "Config file reference" ## dipdup.config.starknet_subsquid.StarknetSubsquidDatasourceConfig -class dipdup.config.starknet_subsquid.StarknetSubsquidDatasourceConfig(kind, url, http=None) +class dipdup.config.starknet_subsquid.StarknetSubsquidDatasourceConfig(*args)

      Subsquid datasource config

      Parameters:
        -
      • kind (Literal['starknet.subsquid']) – always ‘starknet.subsquid’

      • -
      • url (Url) – URL of Subsquid Network API

      • -
      • http (HttpConfig | None) – HTTP client configuration

      • +
      • kind – always ‘starknet.subsquid’

      • +
      • url – URL of Subsquid Network API

      • +
      • http – HTTP client configuration

      @@ -1180,15 +1210,15 @@ description: "Config file reference" ## dipdup.config.tzip_metadata.TzipMetadataDatasourceConfig -class dipdup.config.tzip_metadata.TzipMetadataDatasourceConfig(kind, network, url='https://metadata.dipdup.net', http=None) +class dipdup.config.tzip_metadata.TzipMetadataDatasourceConfig(*args)

      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

      • +
      • 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

      diff --git a/docs/9.release-notes/_8.0_changelog.md b/docs/9.release-notes/_8.0_changelog.md index f20cb17da..cd7476d1a 100644 --- a/docs/9.release-notes/_8.0_changelog.md +++ b/docs/9.release-notes/_8.0_changelog.md @@ -32,6 +32,7 @@ - cli: Improved logging of indexer status. - config: Allow `sentry.dsn` to be empty string. - config: Fixed (de)serialization of hex strings in config. +- config: Fixed parsing config files after updating to pydantic 2.10.3. - config: Fixed setting logging levels according to the config. - database: Fixed concurrency issue when using `get_or_create` method. - evm.events: Fixed matching logs when filtering by topic0. diff --git a/docs/conf.py b/docs/conf.py index 64d82012e..116005500 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -57,4 +57,10 @@ # NOTE: Nice dataclasses autodoc_typehints = 'description' -autodoc_typehints_format = 'short' \ No newline at end of file +autodoc_typehints_format = 'short' + +# NOTE: The code below is required because of `defer_build=True` in dataclass definitions + +from dipdup.config import DipDupConfig +from pydantic.dataclasses import rebuild_dataclass +rebuild_dataclass(DipDupConfig) \ No newline at end of file diff --git a/pdm.lock b/pdm.lock index 37af68e87..09aa75a7d 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "docs", "lint", "migrations", "perf", "test"] strategy = ["inherit_metadata"] lock_version = "4.5.0" -content_hash = "sha256:11874c607f0da4385fa80be7fc120a0471b123c459d8043e682a232417b82673" +content_hash = "sha256:f6d3398f8c6129e88d381b14fbfae9486c7ef293d3ca7aad3c84b4c7550e3e69" [[metadata.targets]] requires_python = ">=3.12,<3.13" @@ -1321,24 +1321,23 @@ files = [ [[package]] name = "pydantic" -version = "2.9.2" +version = "2.10.3" requires_python = ">=3.8" summary = "Data validation using Python type hints" groups = ["default", "migrations", "perf"] dependencies = [ "annotated-types>=0.6.0", - "pydantic-core==2.23.4", - "typing-extensions>=4.12.2; python_version >= \"3.13\"", - "typing-extensions>=4.6.1; python_version < \"3.13\"", + "pydantic-core==2.27.1", + "typing-extensions>=4.12.2", ] files = [ - {file = "pydantic-2.9.2-py3-none-any.whl", hash = "sha256:f048cec7b26778210e28a0459867920654d48e5e62db0958433636cde4254f12"}, - {file = "pydantic-2.9.2.tar.gz", hash = "sha256:d155cef71265d1e9807ed1c32b4c8deec042a44a50a4188b25ac67ecd81a9c0f"}, + {file = "pydantic-2.10.3-py3-none-any.whl", hash = "sha256:be04d85bbc7b65651c5f8e6b9976ed9c6f41782a55524cef079a34a0bb82144d"}, + {file = "pydantic-2.10.3.tar.gz", hash = "sha256:cb5ac360ce894ceacd69c403187900a02c4b20b693a9dd1d643e1effab9eadf9"}, ] [[package]] name = "pydantic-core" -version = "2.23.4" +version = "2.27.1" requires_python = ">=3.8" summary = "Core functionality for Pydantic validation and serialization" groups = ["default", "migrations", "perf"] @@ -1346,24 +1345,26 @@ dependencies = [ "typing-extensions!=4.7.0,>=4.6.0", ] files = [ - {file = "pydantic_core-2.23.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f3e0da4ebaef65158d4dfd7d3678aad692f7666877df0002b8a522cdf088f231"}, - {file = "pydantic_core-2.23.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f69a8e0b033b747bb3e36a44e7732f0c99f7edd5cea723d45bc0d6e95377ffee"}, - {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:723314c1d51722ab28bfcd5240d858512ffd3116449c557a1336cbe3919beb87"}, - {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bb2802e667b7051a1bebbfe93684841cc9351004e2badbd6411bf357ab8d5ac8"}, - {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d18ca8148bebe1b0a382a27a8ee60350091a6ddaf475fa05ef50dc35b5df6327"}, - {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:33e3d65a85a2a4a0dc3b092b938a4062b1a05f3a9abde65ea93b233bca0e03f2"}, - {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:128585782e5bfa515c590ccee4b727fb76925dd04a98864182b22e89a4e6ed36"}, - {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:68665f4c17edcceecc112dfed5dbe6f92261fb9d6054b47d01bf6371a6196126"}, - {file = "pydantic_core-2.23.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:20152074317d9bed6b7a95ade3b7d6054845d70584216160860425f4fbd5ee9e"}, - {file = "pydantic_core-2.23.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:9261d3ce84fa1d38ed649c3638feefeae23d32ba9182963e465d58d62203bd24"}, - {file = "pydantic_core-2.23.4-cp312-none-win32.whl", hash = "sha256:4ba762ed58e8d68657fc1281e9bb72e1c3e79cc5d464be146e260c541ec12d84"}, - {file = "pydantic_core-2.23.4-cp312-none-win_amd64.whl", hash = "sha256:97df63000f4fea395b2824da80e169731088656d1818a11b95f3b173747b6cd9"}, - {file = "pydantic_core-2.23.4.tar.gz", hash = "sha256:2584f7cf844ac4d970fba483a717dbe10c1c1c96a969bf65d61ffe94df1b2863"}, + {file = "pydantic_core-2.27.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9cbd94fc661d2bab2bc702cddd2d3370bbdcc4cd0f8f57488a81bcce90c7a54f"}, + {file = "pydantic_core-2.27.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5f8c4718cd44ec1580e180cb739713ecda2bdee1341084c1467802a417fe0f02"}, + {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:15aae984e46de8d376df515f00450d1522077254ef6b7ce189b38ecee7c9677c"}, + {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1ba5e3963344ff25fc8c40da90f44b0afca8cfd89d12964feb79ac1411a260ac"}, + {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:992cea5f4f3b29d6b4f7f1726ed8ee46c8331c6b4eed6db5b40134c6fe1768bb"}, + {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0325336f348dbee6550d129b1627cb8f5351a9dc91aad141ffb96d4937bd9529"}, + {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7597c07fbd11515f654d6ece3d0e4e5093edc30a436c63142d9a4b8e22f19c35"}, + {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3bbd5d8cc692616d5ef6fbbbd50dbec142c7e6ad9beb66b78a96e9c16729b089"}, + {file = "pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:dc61505e73298a84a2f317255fcc72b710b72980f3a1f670447a21efc88f8381"}, + {file = "pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:e1f735dc43da318cad19b4173dd1ffce1d84aafd6c9b782b3abc04a0d5a6f5bb"}, + {file = "pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:f4e5658dbffe8843a0f12366a4c2d1c316dbe09bb4dfbdc9d2d9cd6031de8aae"}, + {file = "pydantic_core-2.27.1-cp312-none-win32.whl", hash = "sha256:672ebbe820bb37988c4d136eca2652ee114992d5d41c7e4858cdd90ea94ffe5c"}, + {file = "pydantic_core-2.27.1-cp312-none-win_amd64.whl", hash = "sha256:66ff044fd0bb1768688aecbe28b6190f6e799349221fb0de0e6f4048eca14c16"}, + {file = "pydantic_core-2.27.1-cp312-none-win_arm64.whl", hash = "sha256:9a3b0793b1bbfd4146304e23d90045f2a9b5fd5823aa682665fbdaf2a6c28f3e"}, + {file = "pydantic_core-2.27.1.tar.gz", hash = "sha256:62a763352879b84aa31058fc931884055fd75089cccbd9d58bb6afd01141b235"}, ] [[package]] name = "pydantic" -version = "2.9.2" +version = "2.10.3" extras = ["email"] requires_python = ">=3.8" summary = "Data validation using Python type hints" @@ -1371,11 +1372,11 @@ groups = ["default"] marker = "python_version ~= \"3.11\"" dependencies = [ "email-validator>=2.0.0", - "pydantic==2.9.2", + "pydantic==2.10.3", ] files = [ - {file = "pydantic-2.9.2-py3-none-any.whl", hash = "sha256:f048cec7b26778210e28a0459867920654d48e5e62db0958433636cde4254f12"}, - {file = "pydantic-2.9.2.tar.gz", hash = "sha256:d155cef71265d1e9807ed1c32b4c8deec042a44a50a4188b25ac67ecd81a9c0f"}, + {file = "pydantic-2.10.3-py3-none-any.whl", hash = "sha256:be04d85bbc7b65651c5f8e6b9976ed9c6f41782a55524cef079a34a0bb82144d"}, + {file = "pydantic-2.10.3.tar.gz", hash = "sha256:cb5ac360ce894ceacd69c403187900a02c4b20b693a9dd1d643e1effab9eadf9"}, ] [[package]] @@ -1913,13 +1914,13 @@ files = [ [[package]] name = "sqlparse" -version = "0.5.2" +version = "0.5.3" requires_python = ">=3.8" summary = "A non-validating SQL parser." groups = ["default"] files = [ - {file = "sqlparse-0.5.2-py3-none-any.whl", hash = "sha256:e99bc85c78160918c3e1d9230834ab8d80fc06c59d03f8db2618f65f65dda55e"}, - {file = "sqlparse-0.5.2.tar.gz", hash = "sha256:9e37b35e16d1cc652a2545f0997c1deb23ea28fa1f3eefe609eee3063c3b105f"}, + {file = "sqlparse-0.5.3-py3-none-any.whl", hash = "sha256:cf2196ed3418f3ba5de6af7e82c694a9fbdbfecccdfc72e281548517081f16ca"}, + {file = "sqlparse-0.5.3.tar.gz", hash = "sha256:09f67787f56a0b16ecdbde1bfc7f5d9c3371ca683cfeaa8e6ff60b4807ec9272"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index e59598e10..c01d135b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,8 +63,7 @@ dependencies = [ "orjson~=3.10", "prometheus-client~=0.20", "pycryptodome~=3.20", - # FIXME: - "pydantic~=2.9.2", + "pydantic~=2.10.3", "pyhumps~=3.8", "pysignalr~=1.0", "python-dotenv~=1.0", diff --git a/requirements.txt b/requirements.txt index ea86208fc..e740d5121 100644 --- a/requirements.txt +++ b/requirements.txt @@ -63,8 +63,8 @@ poseidon-py==0.1.5 prometheus-client==0.21.1 propcache==0.2.0 pycryptodome==3.21.0 -pydantic-core==2.23.4 -pydantic[email]==2.9.2; python_version ~= "3.11" +pydantic-core==2.27.1 +pydantic[email]==2.10.3; python_version ~= "3.11" pyhumps==3.8.0 pypika-tortoise==0.2.1 pysignalr==1.1.0 @@ -82,7 +82,7 @@ ruamel-yaml-clib==0.2.8; platform_python_implementation == "CPython" and python_ sentry-sdk==2.19.2 six==1.16.0 sniffio==1.3.1 -sqlparse==0.5.2 +sqlparse==0.5.3 starknet-py==0.24.0 strict-rfc3339==0.7 survey==5.4.2 diff --git a/schemas/dipdup-3.0.json b/schemas/dipdup-3.0.json index 2abe91f8c..f55c000ab 100644 --- a/schemas/dipdup-3.0.json +++ b/schemas/dipdup-3.0.json @@ -4,18 +4,6 @@ "additionalProperties": false, "description": "Etherscan datasource config", "properties": { - "kind": { - "const": "abi.etherscan", - "title": "kind", - "type": "string", - "description": "always 'abi.etherscan'" - }, - "url": { - "default": "https://api.etherscan.io/api", - "title": "url", - "type": "string", - "description": "API URL" - }, "api_key": { "anyOf": [ { @@ -26,8 +14,8 @@ } ], "default": null, - "title": "api_key", - "description": "API key" + "description": "API key", + "title": "api_key" }, "http": { "anyOf": [ @@ -39,8 +27,20 @@ } ], "default": null, - "title": "http", - "description": "HTTP client configuration" + "description": "HTTP client configuration", + "title": "http" + }, + "kind": { + "const": "abi.etherscan", + "description": "always 'abi.etherscan'", + "title": "kind", + "type": "string" + }, + "url": { + "default": "https://api.etherscan.io/api", + "description": "API URL", + "title": "url", + "type": "string" } }, "required": [ @@ -53,38 +53,47 @@ "additionalProperties": true, "description": "This section allows users to tune some system-wide options, either experimental or unsuitable for generic configurations.", "properties": { - "reindex": { - "additionalProperties": { - "$ref": "#/$defs/ReindexingAction" - }, - "title": "reindex", - "type": "object", - "description": "Mapping of reindexing reasons and actions DipDup performs." + "alt_operation_matcher": { + "default": false, + "description": "Use different algorithm to match Tezos operations (dev only)", + "title": "alt_operation_matcher", + "type": "boolean" }, - "scheduler": { + "decimal_precision": { "anyOf": [ { - "type": "object" + "type": "integer" }, { "type": "null" } ], "default": null, - "title": "scheduler", - "description": "`apscheduler` scheduler config." + "description": "Overwrite precision if it's not guessed correctly based on project models.", + "title": "decimal_precision" + }, + "early_realtime": { + "default": false, + "description": "Establish realtime connection and start collecting messages while sync is in progress (faster, but consumes more RAM).", + "title": "early_realtime", + "type": "boolean" }, "postpone_jobs": { "default": false, + "description": "Do not start job scheduler until all indexes reach the realtime state.", "title": "postpone_jobs", - "type": "boolean", - "description": "Do not start job scheduler until all indexes reach the realtime state." + "type": "boolean" }, - "early_realtime": { - "default": false, - "title": "early_realtime", - "type": "boolean", - "description": "Establish realtime connection and start collecting messages while sync is in progress (faster, but consumes more RAM)." + "reindex": { + "additionalProperties": { + "$ref": "#/$defs/ReindexingAction" + }, + "description": "Mapping of reindexing reasons and actions DipDup performs.", + "propertyNames": { + "$ref": "#/$defs/ReindexingReason" + }, + "title": "reindex", + "type": "object" }, "rollback_depth": { "anyOf": [ @@ -96,33 +105,27 @@ } ], "default": null, - "title": "rollback_depth", - "description": "A number of levels to keep for rollback." + "description": "A number of levels to keep for rollback.", + "title": "rollback_depth" }, - "decimal_precision": { + "scheduler": { "anyOf": [ { - "type": "integer" + "type": "object" }, { "type": "null" } ], "default": null, - "title": "decimal_precision", - "description": "Overwrite precision if it's not guessed correctly based on project models." + "description": "`apscheduler` scheduler config.", + "title": "scheduler" }, "unsafe_sqlite": { "default": false, + "description": "Disable journaling and data integrity checks. Use only for testing.", "title": "unsafe_sqlite", - "type": "boolean", - "description": "Disable journaling and data integrity checks. Use only for testing." - }, - "alt_operation_matcher": { - "default": false, - "title": "alt_operation_matcher", - "type": "boolean", - "description": "Use different algorithm to match Tezos operations (dev only)" + "type": "boolean" } }, "title": "AdvancedConfig", @@ -134,15 +137,15 @@ "properties": { "host": { "default": "127.0.0.1", + "description": "Host to bind to", "title": "host", - "type": "string", - "description": "Host to bind to" + "type": "string" }, "port": { "default": 46339, + "description": "Port to bind to", "title": "port", - "type": "integer", - "description": "Port to bind to" + "type": "integer" } }, "title": "ApiConfig", @@ -152,12 +155,6 @@ "additionalProperties": false, "description": "Coinbase datasource config", "properties": { - "kind": { - "const": "coinbase", - "title": "kind", - "type": "string", - "description": "always 'coinbase'" - }, "api_key": { "anyOf": [ { @@ -168,21 +165,27 @@ } ], "default": null, - "title": "api_key", - "description": "API key" + "description": "API key", + "title": "api_key" }, - "secret_key": { + "http": { "anyOf": [ { - "type": "string" + "$ref": "#/$defs/HttpConfig" }, { "type": "null" } ], "default": null, - "title": "secret_key", - "description": "API secret key" + "description": "HTTP client configuration", + "title": "http" + }, + "kind": { + "const": "coinbase", + "description": "always 'coinbase'", + "title": "kind", + "type": "string" }, "passphrase": { "anyOf": [ @@ -194,21 +197,21 @@ } ], "default": null, - "title": "passphrase", - "description": "API passphrase" + "description": "API passphrase", + "title": "passphrase" }, - "http": { + "secret_key": { "anyOf": [ { - "$ref": "#/$defs/HttpConfig" + "type": "string" }, { "type": "null" } ], "default": null, - "title": "http", - "description": "HTTP client configuration" + "description": "API secret key", + "title": "secret_key" } }, "required": [ @@ -224,13 +227,7 @@ "additionalProperties": false, "description": "EVM contract config", "properties": { - "kind": { - "const": "evm", - "title": "kind", - "type": "string", - "description": "Always `evm`" - }, - "address": { + "abi": { "anyOf": [ { "type": "integer" @@ -243,10 +240,10 @@ } ], "default": null, - "title": "address", - "description": "Contract address" + "description": "Contract ABI", + "title": "abi" }, - "abi": { + "address": { "anyOf": [ { "type": "integer" @@ -259,8 +256,14 @@ } ], "default": null, - "title": "abi", - "description": "Contract ABI" + "description": "Contract address", + "title": "address" + }, + "kind": { + "const": "evm", + "description": "Always `evm`", + "title": "kind", + "type": "string" }, "typename": { "anyOf": [ @@ -272,8 +275,8 @@ } ], "default": null, - "title": "typename", - "description": "Alias for the contract script" + "description": "Alias for the contract script", + "title": "typename" } }, "required": [ @@ -287,9 +290,9 @@ "description": "Subsquid event handler", "properties": { "callback": { + "description": "Callback name", "title": "callback", - "type": "string", - "description": "Callback name" + "type": "string" }, "contract": { "anyOf": [ @@ -300,13 +303,13 @@ "$ref": "#/$defs/EvmContractConfig" } ], - "title": "contract", - "description": "EVM contract" + "description": "EVM contract", + "title": "contract" }, "name": { + "description": "Event name", "title": "name", - "type": "string", - "description": "Event name" + "type": "string" } }, "required": [ @@ -321,13 +324,8 @@ "additionalProperties": false, "description": "Subsquid datasource config", "properties": { - "kind": { - "const": "evm.events", - "title": "kind", - "type": "string", - "description": "Always 'evm.events'" - }, "datasources": { + "description": "`evm` datasources to use", "items": { "anyOf": [ { @@ -345,28 +343,33 @@ ] }, "title": "datasources", - "type": "array", - "description": "`evm` datasources to use" + "type": "array" + }, + "first_level": { + "default": 0, + "description": "Level to start indexing from", + "title": "first_level", + "type": "integer" }, "handlers": { + "description": "Event handlers", "items": { "$ref": "#/$defs/EvmEventsHandlerConfig" }, "title": "handlers", - "type": "array", - "description": "Event handlers" + "type": "array" }, - "first_level": { - "default": 0, - "title": "first_level", - "type": "integer", - "description": "Level to start indexing from" + "kind": { + "const": "evm.events", + "description": "Always 'evm.events'", + "title": "kind", + "type": "string" }, "last_level": { "default": 0, + "description": "Level to stop indexing and disable this index", "title": "last_level", - "type": "integer", - "description": "Level to stop indexing and disable this index" + "type": "integer" } }, "required": [ @@ -381,48 +384,48 @@ "additionalProperties": false, "description": "EVM node datasource config", "properties": { - "kind": { - "const": "evm.node", - "title": "kind", - "type": "string", - "description": "Always 'evm.node'" - }, - "url": { - "$ref": "#/$defs/Url", - "title": "url", - "description": "EVM node URL" - }, - "ws_url": { + "http": { "anyOf": [ { - "$ref": "#/$defs/WsUrl" + "$ref": "#/$defs/HttpConfig" }, { "type": "null" } ], "default": null, - "title": "ws_url", - "description": "EVM node WebSocket URL" + "description": "HTTP client configuration", + "title": "http" }, - "http": { + "kind": { + "const": "evm.node", + "description": "Always 'evm.node'", + "title": "kind", + "type": "string" + }, + "rollback_depth": { + "default": 32, + "description": "A number of blocks to store in database for rollback", + "title": "rollback_depth", + "type": "integer" + }, + "url": { + "$ref": "#/$defs/Url", + "description": "EVM node URL", + "title": "url" + }, + "ws_url": { "anyOf": [ { - "$ref": "#/$defs/HttpConfig" + "$ref": "#/$defs/WsUrl" }, { "type": "null" } ], "default": null, - "title": "http", - "description": "HTTP client configuration" - }, - "rollback_depth": { - "default": 32, - "title": "rollback_depth", - "type": "integer", - "description": "A number of blocks to store in database for rollback" + "description": "EVM node WebSocket URL", + "title": "ws_url" } }, "required": [ @@ -436,17 +439,6 @@ "additionalProperties": false, "description": "Subsquid datasource config", "properties": { - "kind": { - "const": "evm.subsquid", - "title": "kind", - "type": "string", - "description": "always 'evm.subsquid'" - }, - "url": { - "$ref": "#/$defs/Url", - "title": "url", - "description": "URL of Subsquid Network API" - }, "http": { "anyOf": [ { @@ -457,8 +449,19 @@ } ], "default": null, - "title": "http", - "description": "HTTP client configuration" + "description": "HTTP client configuration", + "title": "http" + }, + "kind": { + "const": "evm.subsquid", + "description": "always 'evm.subsquid'", + "title": "kind", + "type": "string" + }, + "url": { + "$ref": "#/$defs/Url", + "description": "URL of Subsquid Network API", + "title": "url" } }, "required": [ @@ -473,11 +476,11 @@ "description": "Subsquid transaction handler", "properties": { "callback": { + "description": "Callback name", "title": "callback", - "type": "string", - "description": "Callback name" + "type": "string" }, - "to": { + "from": { "anyOf": [ { "type": "string" @@ -490,8 +493,8 @@ } ], "default": null, - "title": "to", - "description": "Transaction receiver" + "description": "Transaction sender", + "title": "from" }, "method": { "anyOf": [ @@ -503,8 +506,8 @@ } ], "default": null, - "title": "method", - "description": "Method name" + "description": "Method name", + "title": "method" }, "signature": { "anyOf": [ @@ -516,10 +519,10 @@ } ], "default": null, - "title": "signature", - "description": "Method signature" + "description": "Method signature", + "title": "signature" }, - "from": { + "to": { "anyOf": [ { "type": "string" @@ -532,8 +535,8 @@ } ], "default": null, - "title": "from", - "description": "Transaction sender" + "description": "Transaction receiver", + "title": "to" } }, "required": [ @@ -546,13 +549,8 @@ "additionalProperties": false, "description": "Index that uses Subsquid Network as a datasource for transactions", "properties": { - "kind": { - "const": "evm.transactions", - "title": "kind", - "type": "string", - "description": "always 'evm.transactions'" - }, "datasources": { + "description": "`evm` datasources to use", "items": { "anyOf": [ { @@ -570,28 +568,33 @@ ] }, "title": "datasources", - "type": "array", - "description": "`evm` datasources to use" + "type": "array" + }, + "first_level": { + "default": 0, + "description": "Level to start indexing from", + "title": "first_level", + "type": "integer" }, "handlers": { + "description": "Transaction handlers", "items": { "$ref": "#/$defs/EvmTransactionsHandlerConfig" }, "title": "handlers", - "type": "array", - "description": "Transaction handlers" + "type": "array" }, - "first_level": { - "default": 0, - "title": "first_level", - "type": "integer", - "description": "Level to start indexing from" + "kind": { + "const": "evm.transactions", + "description": "always 'evm.transactions'", + "title": "kind", + "type": "string" }, "last_level": { "default": 0, + "description": "Level to stop indexing at", "title": "last_level", - "type": "integer", - "description": "Level to stop indexing at" + "type": "integer" } }, "required": [ @@ -606,19 +609,6 @@ "additionalProperties": false, "description": "Config for the Hasura integration.", "properties": { - "hide": { - "items": { - "type": "string" - }, - "title": "hide", - "type": "array", - "description": "List of table/view names to make private." - }, - "url": { - "$ref": "#/$defs/Url", - "title": "url", - "description": "URL of the Hasura instance." - }, "admin_secret": { "anyOf": [ { @@ -629,50 +619,46 @@ } ], "default": null, - "title": "admin_secret", - "description": "Admin secret of the Hasura instance." - }, - "create_source": { - "default": false, - "title": "create_source", - "type": "boolean", - "description": "Whether source should be added to Hasura if missing." - }, - "source": { - "default": "default", - "title": "source", - "type": "string", - "description": "Hasura source for DipDup to configure, others will be left untouched." - }, - "select_limit": { - "default": 1000, - "title": "select_limit", - "type": "integer", - "description": "Row limit for unauthenticated queries." + "description": "Admin secret of the Hasura instance.", + "title": "admin_secret" }, "allow_aggregations": { "default": true, + "description": "Whether to allow aggregations in unauthenticated queries.", "title": "allow_aggregations", - "type": "boolean", - "description": "Whether to allow aggregations in unauthenticated queries." + "type": "boolean" }, "allow_inconsistent_metadata": { "default": false, + "description": "Whether to ignore errors when applying Hasura metadata.", "title": "allow_inconsistent_metadata", - "type": "boolean", - "description": "Whether to ignore errors when applying Hasura metadata." + "type": "boolean" }, "camel_case": { "default": false, + "description": "Whether to use camelCase instead of default pascal_case for the field names.", "title": "camel_case", - "type": "boolean", - "description": "Whether to use camelCase instead of default pascal_case for the field names." + "type": "boolean" }, - "rest": { - "default": true, - "title": "rest", - "type": "boolean", - "description": "Enable REST API both for autogenerated and custom queries." + "create_source": { + "default": false, + "description": "Whether source should be added to Hasura if missing.", + "title": "create_source", + "type": "boolean" + }, + "hide": { + "description": "List of table/view names to make private.", + "items": { + "type": "string" + }, + "title": "hide", + "type": "array" + }, + "hide_internal": { + "default": false, + "description": "Whether to make internal tables (prefixed with \"dipdup\") private.", + "title": "hide_internal", + "type": "boolean" }, "http": { "anyOf": [ @@ -684,14 +670,31 @@ } ], "default": null, - "title": "http", - "description": "HTTP connection tunables" + "description": "HTTP connection tunables", + "title": "http" }, - "hide_internal": { - "default": false, - "title": "hide_internal", - "type": "boolean", - "description": "Whether to make internal tables (prefixed with \"dipdup\") private." + "rest": { + "default": true, + "description": "Enable REST API both for autogenerated and custom queries.", + "title": "rest", + "type": "boolean" + }, + "select_limit": { + "default": 1000, + "description": "Row limit for unauthenticated queries.", + "title": "select_limit", + "type": "integer" + }, + "source": { + "default": "default", + "description": "Hasura source for DipDup to configure, others will be left untouched.", + "title": "source", + "type": "string" + }, + "url": { + "$ref": "#/$defs/Url", + "description": "URL of the Hasura instance.", + "title": "url" } }, "required": [ @@ -711,20 +714,20 @@ "additionalProperties": { "type": "string" }, + "description": "Mapping of argument names and annotations (checked lazily when possible)", "title": "args", - "type": "object", - "description": "Mapping of argument names and annotations (checked lazily when possible)" - }, - "callback": { - "title": "callback", - "type": "string", - "description": "Callback name" + "type": "object" }, "atomic": { "default": false, + "description": "Wrap hook in a single database transaction", "title": "atomic", - "type": "boolean", - "description": "Wrap hook in a single database transaction" + "type": "boolean" + }, + "callback": { + "description": "Callback name", + "title": "callback", + "type": "string" } }, "required": [ @@ -737,46 +740,46 @@ "additionalProperties": false, "description": "Advanced configuration of HTTP client", "properties": { - "retry_count": { + "alias": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], "default": null, - "title": "retry_count", - "description": "Number of retries after request failed before giving up" + "description": "Alias for this HTTP client (dev only)", + "title": "alias" }, - "retry_sleep": { + "batch_size": { "anyOf": [ { - "type": "number" + "type": "integer" }, { "type": "null" } ], "default": null, - "title": "retry_sleep", - "description": "Sleep time between retries" + "description": "Number of items fetched in a single paginated request (when applicable)", + "title": "batch_size" }, - "retry_multiplier": { + "connection_limit": { "anyOf": [ { - "type": "number" + "type": "integer" }, { "type": "null" } ], "default": null, - "title": "retry_multiplier", - "description": "Multiplier for sleep time between retries" + "description": "Number of simultaneous connections", + "title": "connection_limit" }, - "ratelimit_rate": { + "connection_timeout": { "anyOf": [ { "type": "integer" @@ -786,36 +789,36 @@ } ], "default": null, - "title": "ratelimit_rate", - "description": "Number of requests per period (\"drops\" in leaky bucket)" + "description": "Connection timeout in seconds", + "title": "connection_timeout" }, - "ratelimit_period": { + "polling_interval": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" } ], "default": null, - "title": "ratelimit_period", - "description": "Time period for rate limiting in seconds" + "description": "Interval between polling requests in seconds (when applicable)", + "title": "polling_interval" }, - "ratelimit_sleep": { + "ratelimit_period": { "anyOf": [ { - "type": "number" + "type": "integer" }, { "type": "null" } ], "default": null, - "title": "ratelimit_sleep", - "description": "Sleep time between requests when rate limit is reached" + "description": "Time period for rate limiting in seconds", + "title": "ratelimit_period" }, - "connection_limit": { + "ratelimit_rate": { "anyOf": [ { "type": "integer" @@ -825,36 +828,36 @@ } ], "default": null, - "title": "connection_limit", - "description": "Number of simultaneous connections" + "description": "Number of requests per period (\"drops\" in leaky bucket)", + "title": "ratelimit_rate" }, - "connection_timeout": { + "ratelimit_sleep": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" } ], "default": null, - "title": "connection_timeout", - "description": "Connection timeout in seconds" + "description": "Sleep time between requests when rate limit is reached", + "title": "ratelimit_sleep" }, - "request_timeout": { + "replay_path": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], "default": null, - "title": "request_timeout", - "description": "Request timeout in seconds" + "description": "Use cached HTTP responses instead of making real requests (dev only)", + "title": "replay_path" }, - "batch_size": { + "request_timeout": { "anyOf": [ { "type": "integer" @@ -864,47 +867,47 @@ } ], "default": null, - "title": "batch_size", - "description": "Number of items fetched in a single paginated request (when applicable)" + "description": "Request timeout in seconds", + "title": "request_timeout" }, - "polling_interval": { + "retry_count": { "anyOf": [ { - "type": "number" + "type": "integer" }, { "type": "null" } ], "default": null, - "title": "polling_interval", - "description": "Interval between polling requests in seconds (when applicable)" + "description": "Number of retries after request failed before giving up", + "title": "retry_count" }, - "replay_path": { + "retry_multiplier": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], "default": null, - "title": "replay_path", - "description": "Use cached HTTP responses instead of making real requests (dev only)" + "description": "Multiplier for sleep time between retries", + "title": "retry_multiplier" }, - "alias": { + "retry_sleep": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], "default": null, - "title": "alias", - "description": "Alias for this HTTP client (dev only)" + "description": "Sleep time between retries", + "title": "retry_sleep" } }, "title": "HttpConfig", @@ -914,17 +917,6 @@ "additionalProperties": false, "description": "Generic HTTP datasource config", "properties": { - "kind": { - "const": "http", - "title": "kind", - "type": "string", - "description": "always 'http'" - }, - "url": { - "title": "url", - "type": "string", - "description": "URL to fetch data from" - }, "http": { "anyOf": [ { @@ -935,8 +927,19 @@ } ], "default": null, - "title": "http", - "description": "HTTP client configuration" + "description": "HTTP client configuration", + "title": "http" + }, + "kind": { + "const": "http", + "description": "always 'http'", + "title": "kind", + "type": "string" + }, + "url": { + "description": "URL to fetch data from", + "title": "url", + "type": "string" } }, "required": [ @@ -950,27 +953,27 @@ "additionalProperties": false, "description": "Index template config", "properties": { - "template": { - "title": "template", - "type": "string", - "description": "Template alias in `templates` section" - }, - "values": { - "title": "values", - "type": "object", - "description": "Values to be substituted in template (`` -> `value`)" - }, "first_level": { "default": 0, + "description": "Level to start indexing from", "title": "first_level", - "type": "integer", - "description": "Level to start indexing from" + "type": "integer" }, "last_level": { "default": 0, + "description": "Level to stop indexing at", "title": "last_level", - "type": "integer", - "description": "Level to stop indexing at" + "type": "integer" + }, + "template": { + "description": "Template alias in `templates` section", + "title": "template", + "type": "string" + }, + "values": { + "description": "Values to be substituted in template (`` -> `value`)", + "title": "values", + "type": "object" } }, "required": [ @@ -984,18 +987,6 @@ "additionalProperties": false, "description": "IPFS datasource config", "properties": { - "kind": { - "const": "ipfs", - "title": "kind", - "type": "string", - "description": "always 'ipfs'" - }, - "url": { - "default": "https://ipfs.io/ipfs", - "title": "url", - "type": "string", - "description": "IPFS node URL, e.g. https://ipfs.io/ipfs/" - }, "http": { "anyOf": [ { @@ -1006,8 +997,20 @@ } ], "default": null, - "title": "http", - "description": "HTTP client configuration" + "description": "HTTP client configuration", + "title": "http" + }, + "kind": { + "const": "ipfs", + "description": "always 'ipfs'", + "title": "kind", + "type": "string" + }, + "url": { + "default": "https://ipfs.io/ipfs", + "description": "IPFS node URL, e.g. https://ipfs.io/ipfs/", + "title": "url", + "type": "string" } }, "required": [ @@ -1021,34 +1024,40 @@ "description": "Job schedule config", "properties": { "args": { + "description": "Arguments to pass to the hook", "title": "args", - "type": "object", - "description": "Arguments to pass to the hook" + "type": "object" }, - "hook": { + "crontab": { "anyOf": [ { "type": "string" }, { - "$ref": "#/$defs/HookConfig" + "type": "null" } ], - "title": "hook", - "description": "Name of hook to run" + "default": null, + "description": "Schedule with crontab syntax (`* * * * *`)", + "title": "crontab" }, - "crontab": { + "daemon": { + "default": false, + "description": "Run hook as a daemon (never stops)", + "title": "daemon", + "type": "boolean" + }, + "hook": { "anyOf": [ { "type": "string" }, { - "type": "null" + "$ref": "#/$defs/HookConfig" } ], - "default": null, - "title": "crontab", - "description": "Schedule with crontab syntax (`* * * * *`)" + "description": "Name of hook to run", + "title": "hook" }, "interval": { "anyOf": [ @@ -1060,14 +1069,8 @@ } ], "default": null, - "title": "interval", - "description": "Schedule with interval in seconds" - }, - "daemon": { - "default": false, - "title": "daemon", - "type": "boolean", - "description": "Run hook as a daemon (never stops)" + "description": "Schedule with interval in seconds", + "title": "interval" } }, "required": [ @@ -1080,61 +1083,61 @@ "additionalProperties": false, "description": "Postgres database connection config", "properties": { + "connection_timeout": { + "default": 60, + "description": "Connection timeout", + "title": "connection_timeout", + "type": "integer" + }, + "database": { + "default": "postgres", + "description": "Database name", + "title": "database", + "type": "string" + }, + "host": { + "description": "Host", + "title": "host", + "type": "string" + }, "immune_tables": { + "description": "List of tables to preserve during reindexing", "items": { "type": "string" }, "title": "immune_tables", "type": "array", - "uniqueItems": true, - "description": "List of tables to preserve during reindexing" + "uniqueItems": true }, "kind": { "const": "postgres", + "description": "always 'postgres'", "title": "kind", - "type": "string", - "description": "always 'postgres'" - }, - "host": { - "title": "host", - "type": "string", - "description": "Host" - }, - "user": { - "default": "postgres", - "title": "user", - "type": "string", - "description": "User" + "type": "string" }, - "database": { - "default": "postgres", - "title": "database", - "type": "string", - "description": "Database name" + "password": { + "default": "", + "description": "Password", + "title": "password", + "type": "string" }, "port": { "default": 5432, + "description": "Port", "title": "port", - "type": "integer", - "description": "Port" + "type": "integer" }, "schema_name": { "default": "public", + "description": "Schema name", "title": "schema_name", - "type": "string", - "description": "Schema name" - }, - "password": { - "default": "", - "title": "password", - "type": "string", - "description": "Password" + "type": "string" }, - "connection_timeout": { - "default": 60, - "title": "connection_timeout", - "type": "integer", - "description": "Connection timeout" + "user": { + "default": "postgres", + "description": "User", + "title": "user", + "type": "string" } }, "required": [ @@ -1150,21 +1153,21 @@ "properties": { "host": { "default": "127.0.0.1", + "description": "Host to bind to", "title": "host", - "type": "string", - "description": "Host to bind to" + "type": "string" }, "port": { "default": 8000, + "description": "Port to bind to", "title": "port", - "type": "integer", - "description": "Port to bind to" + "type": "integer" }, "update_interval": { "default": 1.0, + "description": "Interval to update some metrics in seconds", "title": "update_interval", - "type": "number", - "description": "Interval to update some metrics in seconds" + "type": "number" } }, "title": "PrometheusConfig", @@ -1180,10 +1183,28 @@ "title": "ReindexingAction", "type": "string" }, + "ReindexingReason": { + "description": "Reason that caused reindexing\n\n:param manual: Manual reindexing.\n:param migration: Migration of the database schema.\n:param rollback: Rollback that couldn't be handled automatically.\n:param config_modified: Index config was modified.\n:param schema_modified: Project models or database schema were modified.", + "enum": [ + "manual", + "migration", + "rollback", + "config_modified", + "schema_modified" + ], + "title": "ReindexingReason", + "type": "string" + }, "SentryConfig": { "additionalProperties": false, "description": "Config for Sentry integration.", "properties": { + "debug": { + "default": false, + "description": "Catch warning messages, increase verbosity.", + "title": "debug", + "type": "boolean" + }, "dsn": { "anyOf": [ { @@ -1194,8 +1215,8 @@ } ], "default": null, - "title": "dsn", - "description": "DSN of the Sentry instance" + "description": "DSN of the Sentry instance", + "title": "dsn" }, "environment": { "anyOf": [ @@ -1207,10 +1228,10 @@ } ], "default": null, - "title": "environment", - "description": "Environment; if not set, guessed from docker/ci/gha/local." + "description": "Environment; if not set, guessed from docker/ci/gha/local.", + "title": "environment" }, - "server_name": { + "release": { "anyOf": [ { "type": "string" @@ -1220,10 +1241,10 @@ } ], "default": null, - "title": "server_name", - "description": "Server name; defaults to obfuscated hostname." + "description": "Release version; defaults to DipDup package version.", + "title": "release" }, - "release": { + "server_name": { "anyOf": [ { "type": "string" @@ -1233,8 +1254,8 @@ } ], "default": null, - "title": "release", - "description": "Release version; defaults to DipDup package version." + "description": "Server name; defaults to obfuscated hostname.", + "title": "server_name" }, "user_id": { "anyOf": [ @@ -1246,14 +1267,8 @@ } ], "default": null, - "title": "user_id", - "description": "User ID; defaults to obfuscated package/environment." - }, - "debug": { - "default": false, - "title": "debug", - "type": "boolean", - "description": "Catch warning messages, increase verbosity." + "description": "User ID; defaults to obfuscated package/environment.", + "title": "user_id" } }, "title": "SentryConfig", @@ -1274,25 +1289,25 @@ "description": "SQLite connection config", "properties": { "immune_tables": { + "description": "List of tables to preserve during reindexing", "items": { "type": "string" }, "title": "immune_tables", "type": "array", - "uniqueItems": true, - "description": "List of tables to preserve during reindexing" + "uniqueItems": true }, "kind": { "const": "sqlite", + "description": "always 'sqlite'", "title": "kind", - "type": "string", - "description": "always 'sqlite'" + "type": "string" }, "path": { "default": ":memory:", + "description": "Path to .sqlite file, leave default for in-memory database (`:memory:`)", "title": "path", - "type": "string", - "description": "Path to .sqlite file, leave default for in-memory database (`:memory:`)" + "type": "string" } }, "required": [ @@ -1308,13 +1323,7 @@ "additionalProperties": false, "description": "Starknet contract config", "properties": { - "kind": { - "const": "starknet", - "title": "kind", - "type": "string", - "description": "Always `starknet`" - }, - "address": { + "abi": { "anyOf": [ { "type": "integer" @@ -1327,10 +1336,10 @@ } ], "default": null, - "title": "address", - "description": "Contract address" + "description": "Contract ABI", + "title": "abi" }, - "abi": { + "address": { "anyOf": [ { "type": "integer" @@ -1343,8 +1352,14 @@ } ], "default": null, - "title": "abi", - "description": "Contract ABI" + "description": "Contract address", + "title": "address" + }, + "kind": { + "const": "starknet", + "description": "Always `starknet`", + "title": "kind", + "type": "string" }, "typename": { "anyOf": [ @@ -1356,8 +1371,8 @@ } ], "default": null, - "title": "typename", - "description": "Alias for the contract script" + "description": "Alias for the contract script", + "title": "typename" } }, "required": [ @@ -1371,9 +1386,9 @@ "description": "Subsquid event handler", "properties": { "callback": { + "description": "Callback name", "title": "callback", - "type": "string", - "description": "Callback name" + "type": "string" }, "contract": { "anyOf": [ @@ -1384,13 +1399,13 @@ "$ref": "#/$defs/StarknetContractConfig" } ], - "title": "contract", - "description": "Starknet contract" + "description": "Starknet contract", + "title": "contract" }, "name": { + "description": "Event name", "title": "name", - "type": "string", - "description": "Event name" + "type": "string" } }, "required": [ @@ -1405,18 +1420,10 @@ "additionalProperties": false, "description": "Starknet events index config", "properties": { - "kind": { - "const": "starknet.events", - "title": "kind", - "type": "string", - "description": "Always 'starknet.events'" - }, "datasources": { + "description": "Aliases of index datasources in `datasources` section", "items": { "anyOf": [ - { - "type": "string" - }, { "$ref": "#/$defs/StarknetSubsquidDatasourceConfig" }, @@ -1426,28 +1433,33 @@ ] }, "title": "datasources", - "type": "array", - "description": "Aliases of index datasources in `datasources` section" + "type": "array" }, "first_level": { "default": 0, + "description": "Level to start indexing from", "title": "first_level", - "type": "integer", - "description": "Level to start indexing from" - }, - "last_level": { - "default": 0, - "title": "last_level", - "type": "integer", - "description": "Level to stop indexing at" + "type": "integer" }, "handlers": { + "description": "Event handlers", "items": { "$ref": "#/$defs/StarknetEventsHandlerConfig" }, "title": "handlers", - "type": "array", - "description": "Event handlers" + "type": "array" + }, + "kind": { + "const": "starknet.events", + "description": "Always 'starknet.events'", + "title": "kind", + "type": "string" + }, + "last_level": { + "default": 0, + "description": "Level to stop indexing at", + "title": "last_level", + "type": "integer" } }, "required": [ @@ -1462,48 +1474,48 @@ "additionalProperties": false, "description": "Starknet node datasource config", "properties": { - "kind": { - "const": "starknet.node", - "title": "kind", - "type": "string", - "description": "Always 'starknet.node'" - }, - "url": { - "$ref": "#/$defs/Url", - "title": "url", - "description": "Starknet node URL" - }, - "ws_url": { + "http": { "anyOf": [ { - "$ref": "#/$defs/WsUrl" + "$ref": "#/$defs/HttpConfig" }, { "type": "null" } ], "default": null, - "title": "ws_url", - "description": "Starknet node WebSocket URL" + "description": "HTTP client configuration", + "title": "http" }, - "http": { + "kind": { + "const": "starknet.node", + "description": "Always 'starknet.node'", + "title": "kind", + "type": "string" + }, + "rollback_depth": { + "default": 32, + "description": "A number of blocks to store in database for rollback", + "title": "rollback_depth", + "type": "integer" + }, + "url": { + "$ref": "#/$defs/Url", + "description": "Starknet node URL", + "title": "url" + }, + "ws_url": { "anyOf": [ { - "$ref": "#/$defs/HttpConfig" + "$ref": "#/$defs/WsUrl" }, { "type": "null" } ], "default": null, - "title": "http", - "description": "HTTP client configuration" - }, - "rollback_depth": { - "default": 32, - "title": "rollback_depth", - "type": "integer", - "description": "A number of blocks to store in database for rollback" + "description": "Starknet node WebSocket URL", + "title": "ws_url" } }, "required": [ @@ -1517,17 +1529,6 @@ "additionalProperties": false, "description": "Subsquid datasource config", "properties": { - "kind": { - "const": "starknet.subsquid", - "title": "kind", - "type": "string", - "description": "always 'starknet.subsquid'" - }, - "url": { - "$ref": "#/$defs/Url", - "title": "url", - "description": "URL of Subsquid Network API" - }, "http": { "anyOf": [ { @@ -1538,15 +1539,26 @@ } ], "default": null, - "title": "http", - "description": "HTTP client configuration" - } - }, - "required": [ - "kind", - "url" - ], - "title": "StarknetSubsquidDatasourceConfig", + "description": "HTTP client configuration", + "title": "http" + }, + "kind": { + "const": "starknet.subsquid", + "description": "always 'starknet.subsquid'", + "title": "kind", + "type": "string" + }, + "url": { + "$ref": "#/$defs/Url", + "description": "URL of Subsquid Network API", + "title": "url" + } + }, + "required": [ + "kind", + "url" + ], + "title": "StarknetSubsquidDatasourceConfig", "type": "object" }, "TezosAddress": { @@ -1557,9 +1569,9 @@ "description": "Big map handler config", "properties": { "callback": { + "description": "Callback name", "title": "callback", - "type": "string", - "description": "Callback name" + "type": "string" }, "contract": { "anyOf": [ @@ -1570,13 +1582,13 @@ "$ref": "#/$defs/TezosContractConfig" } ], - "title": "contract", - "description": "Contract to fetch big map from" + "description": "Contract to fetch big map from", + "title": "contract" }, "path": { + "description": "Path to big map (alphanumeric string with dots)", "title": "path", - "type": "string", - "description": "Path to big map (alphanumeric string with dots)" + "type": "string" } }, "required": [ @@ -1591,13 +1603,8 @@ "additionalProperties": false, "description": "Big map index config", "properties": { - "kind": { - "const": "tezos.big_maps", - "title": "kind", - "type": "string", - "description": "always 'tezos.big_maps'" - }, "datasources": { + "description": "Tezos datasources to use", "items": { "anyOf": [ { @@ -1609,34 +1616,39 @@ ] }, "title": "datasources", - "type": "array", - "description": "Tezos datasources to use" + "type": "array" + }, + "first_level": { + "default": 0, + "description": "Level to start indexing from", + "title": "first_level", + "type": "integer" }, "handlers": { + "description": "Mapping of big map diff handlers", "items": { "$ref": "#/$defs/TezosBigMapsHandlerConfig" }, "title": "handlers", - "type": "array", - "description": "Mapping of big map diff handlers" - }, - "skip_history": { - "$ref": "#/$defs/SkipHistory", - "default": "never", - "title": "skip_history", - "description": "Fetch only current big map keys ignoring historical changes" + "type": "array" }, - "first_level": { - "default": 0, - "title": "first_level", - "type": "integer", - "description": "Level to start indexing from" + "kind": { + "const": "tezos.big_maps", + "description": "always 'tezos.big_maps'", + "title": "kind", + "type": "string" }, "last_level": { "default": 0, + "description": "Level to stop indexing at", "title": "last_level", - "type": "integer", - "description": "Level to stop indexing at" + "type": "integer" + }, + "skip_history": { + "$ref": "#/$defs/SkipHistory", + "default": "never", + "description": "Fetch only current big map keys ignoring historical changes", + "title": "skip_history" } }, "required": [ @@ -1651,12 +1663,6 @@ "additionalProperties": false, "description": "Tezos contract config.", "properties": { - "kind": { - "const": "tezos", - "title": "kind", - "type": "string", - "description": "Always `tezos`" - }, "address": { "anyOf": [ { @@ -1667,8 +1673,8 @@ } ], "default": null, - "title": "address", - "description": "Contract address" + "description": "Contract address", + "title": "address" }, "code_hash": { "anyOf": [ @@ -1683,8 +1689,14 @@ } ], "default": null, - "title": "code_hash", - "description": "Contract code hash or address to fetch it from" + "description": "Contract code hash or address to fetch it from", + "title": "code_hash" + }, + "kind": { + "const": "tezos", + "description": "Always `tezos`", + "title": "kind", + "type": "string" }, "typename": { "anyOf": [ @@ -1696,8 +1708,8 @@ } ], "default": null, - "title": "typename", - "description": "Alias for the contract script" + "description": "Alias for the contract script", + "title": "typename" } }, "required": [ @@ -1711,9 +1723,9 @@ "description": "Event handler config", "properties": { "callback": { + "description": "Callback name", "title": "callback", - "type": "string", - "description": "Callback name" + "type": "string" }, "contract": { "anyOf": [ @@ -1724,13 +1736,13 @@ "$ref": "#/$defs/TezosContractConfig" } ], - "title": "contract", - "description": "Contract which emits event" + "description": "Contract which emits event", + "title": "contract" }, "tag": { + "description": "Event tag", "title": "tag", - "type": "string", - "description": "Event tag" + "type": "string" } }, "required": [ @@ -1745,13 +1757,8 @@ "additionalProperties": false, "description": "Event index config", "properties": { - "kind": { - "const": "tezos.events", - "title": "kind", - "type": "string", - "description": "always 'tezos.events'" - }, "datasources": { + "description": "`evm` datasources to use", "items": { "anyOf": [ { @@ -1763,10 +1770,16 @@ ] }, "title": "datasources", - "type": "array", - "description": "`evm` datasources to use" + "type": "array" + }, + "first_level": { + "default": 0, + "description": "First block level to index", + "title": "first_level", + "type": "integer" }, "handlers": { + "description": "Event handlers", "items": { "anyOf": [ { @@ -1778,20 +1791,19 @@ ] }, "title": "handlers", - "type": "array", - "description": "Event handlers" + "type": "array" }, - "first_level": { - "default": 0, - "title": "first_level", - "type": "integer", - "description": "First block level to index" + "kind": { + "const": "tezos.events", + "description": "always 'tezos.events'", + "title": "kind", + "type": "string" }, "last_level": { "default": 0, + "description": "Last block level to index", "title": "last_level", - "type": "integer", - "description": "Last block level to index" + "type": "integer" } }, "required": [ @@ -1807,9 +1819,9 @@ "description": "Unknown event handler config", "properties": { "callback": { + "description": "Callback name", "title": "callback", - "type": "string", - "description": "Callback name" + "type": "string" }, "contract": { "anyOf": [ @@ -1820,8 +1832,8 @@ "$ref": "#/$defs/TezosContractConfig" } ], - "title": "contract", - "description": "Contract which emits event" + "description": "Contract which emits event", + "title": "contract" } }, "required": [ @@ -1835,13 +1847,13 @@ "additionalProperties": false, "description": "Head block index config", "properties": { - "kind": { - "const": "tezos.head", - "title": "kind", - "type": "string", - "description": "always 'tezos.head'" + "callback": { + "description": "Callback name", + "title": "callback", + "type": "string" }, "datasources": { + "description": "`tezos` datasources to use", "items": { "anyOf": [ { @@ -1853,13 +1865,13 @@ ] }, "title": "datasources", - "type": "array", - "description": "`tezos` datasources to use" + "type": "array" }, - "callback": { - "title": "callback", - "type": "string", - "description": "Callback name" + "kind": { + "const": "tezos.head", + "description": "always 'tezos.head'", + "title": "kind", + "type": "string" } }, "required": [ @@ -1887,11 +1899,12 @@ "description": "Operation handler config", "properties": { "callback": { + "description": "Callback name", "title": "callback", - "type": "string", - "description": "Callback name" + "type": "string" }, "pattern": { + "description": "Filters to match operation groups", "items": { "anyOf": [ { @@ -1909,8 +1922,7 @@ ] }, "title": "pattern", - "type": "array", - "description": "Filters to match operation groups" + "type": "array" } }, "required": [ @@ -1924,28 +1936,24 @@ "additionalProperties": false, "description": "Origination handler pattern config", "properties": { - "type": { - "const": "origination", - "default": "origination", - "title": "type", - "type": "string", - "description": "always 'origination'" - }, - "source": { + "alias": { "anyOf": [ { "type": "string" }, - { - "$ref": "#/$defs/TezosContractConfig" - }, { "type": "null" } ], "default": null, - "title": "source", - "description": "Match operations by source contract alias" + "description": "Alias for operation (helps to avoid duplicates)", + "title": "alias" + }, + "optional": { + "default": false, + "description": "Whether can operation be missing in operation group", + "title": "optional", + "type": "boolean" }, "originated_contract": { "anyOf": [ @@ -1960,33 +1968,37 @@ } ], "default": null, - "title": "originated_contract", - "description": "Match origination of exact contract" - }, - "optional": { - "default": false, - "title": "optional", - "type": "boolean", - "description": "Whether can operation be missing in operation group" - }, - "strict": { - "default": false, - "title": "strict", - "type": "boolean", - "description": "Match operations by storage only or by the whole code" + "description": "Match origination of exact contract", + "title": "originated_contract" }, - "alias": { + "source": { "anyOf": [ { "type": "string" }, + { + "$ref": "#/$defs/TezosContractConfig" + }, { "type": "null" } ], "default": null, - "title": "alias", - "description": "Alias for operation (helps to avoid duplicates)" + "description": "Match operations by source contract alias", + "title": "source" + }, + "strict": { + "default": false, + "description": "Match operations by storage only or by the whole code", + "title": "strict", + "type": "boolean" + }, + "type": { + "const": "origination", + "default": "origination", + "description": "always 'origination'", + "title": "type", + "type": "string" } }, "title": "TezosOperationsHandlerOriginationPatternConfig", @@ -1996,28 +2008,18 @@ "additionalProperties": false, "description": "Operation handler pattern config", "properties": { - "type": { - "const": "sr_cement", - "default": "sr_cement", - "title": "type", - "type": "string", - "description": "always 'sr_cement'" - }, - "source": { + "alias": { "anyOf": [ { "type": "string" }, - { - "$ref": "#/$defs/TezosContractConfig" - }, { "type": "null" } ], "default": null, - "title": "source", - "description": "Match operations by source contract alias" + "description": "Alias for operation (helps to avoid duplicates)", + "title": "alias" }, "destination": { "anyOf": [ @@ -2032,27 +2034,37 @@ } ], "default": null, - "title": "destination", - "description": "Match operations by destination contract alias" + "description": "Match operations by destination contract alias", + "title": "destination" }, "optional": { "default": false, + "description": "Whether can operation be missing in operation group", "title": "optional", - "type": "boolean", - "description": "Whether can operation be missing in operation group" + "type": "boolean" }, - "alias": { + "source": { "anyOf": [ { "type": "string" }, + { + "$ref": "#/$defs/TezosContractConfig" + }, { "type": "null" } ], "default": null, - "title": "alias", - "description": "Alias for operation (helps to avoid duplicates)" + "description": "Match operations by source contract alias", + "title": "source" + }, + "type": { + "const": "sr_cement", + "default": "sr_cement", + "description": "always 'sr_cement'", + "title": "type", + "type": "string" } }, "title": "TezosOperationsHandlerSmartRollupCementPatternConfig", @@ -2062,28 +2074,18 @@ "additionalProperties": false, "description": "Operation handler pattern config", "properties": { - "type": { - "const": "sr_execute", - "default": "sr_execute", - "title": "type", - "type": "string", - "description": "always 'sr_execute'" - }, - "source": { + "alias": { "anyOf": [ { "type": "string" }, - { - "$ref": "#/$defs/TezosContractConfig" - }, { "type": "null" } ], "default": null, - "title": "source", - "description": "Match operations by source contract alias" + "description": "Alias for operation (helps to avoid duplicates)", + "title": "alias" }, "destination": { "anyOf": [ @@ -2098,27 +2100,37 @@ } ], "default": null, - "title": "destination", - "description": "Match operations by destination contract alias" + "description": "Match operations by destination contract alias", + "title": "destination" }, "optional": { "default": false, + "description": "Whether can operation be missing in operation group", "title": "optional", - "type": "boolean", - "description": "Whether can operation be missing in operation group" + "type": "boolean" }, - "alias": { + "source": { "anyOf": [ { "type": "string" }, + { + "$ref": "#/$defs/TezosContractConfig" + }, { "type": "null" } ], "default": null, - "title": "alias", - "description": "Alias for operation (helps to avoid duplicates)" + "description": "Match operations by source contract alias", + "title": "source" + }, + "type": { + "const": "sr_execute", + "default": "sr_execute", + "description": "always 'sr_execute'", + "title": "type", + "type": "string" } }, "title": "TezosOperationsHandlerSmartRollupExecutePatternConfig", @@ -2128,28 +2140,18 @@ "additionalProperties": false, "description": "Transaction handler pattern config", "properties": { - "type": { - "const": "transaction", - "default": "transaction", - "title": "type", - "type": "string", - "description": "always 'transaction'" - }, - "source": { + "alias": { "anyOf": [ { "type": "string" }, - { - "$ref": "#/$defs/TezosContractConfig" - }, { "type": "null" } ], "default": null, - "title": "source", - "description": "Match operations by source contract alias" + "description": "Alias for operation (helps to avoid duplicates)", + "title": "alias" }, "destination": { "anyOf": [ @@ -2164,8 +2166,8 @@ } ], "default": null, - "title": "destination", - "description": "Match operations by destination contract alias" + "description": "Match operations by destination contract alias", + "title": "destination" }, "entrypoint": { "anyOf": [ @@ -2177,27 +2179,37 @@ } ], "default": null, - "title": "entrypoint", - "description": "Match operations by contract entrypoint" + "description": "Match operations by contract entrypoint", + "title": "entrypoint" }, "optional": { "default": false, + "description": "Whether can operation be missing in operation group", "title": "optional", - "type": "boolean", - "description": "Whether can operation be missing in operation group" + "type": "boolean" }, - "alias": { + "source": { "anyOf": [ { "type": "string" }, + { + "$ref": "#/$defs/TezosContractConfig" + }, { "type": "null" } ], "default": null, - "title": "alias", - "description": "Alias for operation (helps to avoid duplicates)" + "description": "Match operations by source contract alias", + "title": "source" + }, + "type": { + "const": "transaction", + "default": "transaction", + "description": "always 'transaction'", + "title": "type", + "type": "string" } }, "title": "TezosOperationsHandlerTransactionPatternConfig", @@ -2208,6 +2220,7 @@ "description": "Operation index config", "properties": { "contracts": { + "description": "Aliases of contracts being indexed in `contracts` section", "items": { "anyOf": [ { @@ -2219,16 +2232,10 @@ ] }, "title": "contracts", - "type": "array", - "description": "Aliases of contracts being indexed in `contracts` section" - }, - "kind": { - "const": "tezos.operations", - "title": "kind", - "type": "string", - "description": "always 'tezos.operations'" + "type": "array" }, "datasources": { + "description": "`tezos` datasources to use", "items": { "anyOf": [ { @@ -2240,39 +2247,44 @@ ] }, "title": "datasources", - "type": "array", - "description": "`tezos` datasources to use" + "type": "array" + }, + "first_level": { + "default": 0, + "description": "Level to start indexing from", + "title": "first_level", + "type": "integer" }, "handlers": { + "description": "List of indexer handlers", "items": { "$ref": "#/$defs/TezosOperationsHandlerConfig" }, "title": "handlers", - "type": "array", - "description": "List of indexer handlers" + "type": "array" + }, + "kind": { + "const": "tezos.operations", + "description": "always 'tezos.operations'", + "title": "kind", + "type": "string" + }, + "last_level": { + "default": 0, + "description": "Level to stop indexing at", + "title": "last_level", + "type": "integer" }, "types": { "default": [ "transaction" ], + "description": "Types of transaction to fetch", "items": { "$ref": "#/$defs/TezosOperationType" }, "title": "types", - "type": "array", - "description": "Types of transaction to fetch" - }, - "first_level": { - "default": 0, - "title": "first_level", - "type": "integer", - "description": "Level to start indexing from" - }, - "last_level": { - "default": 0, - "title": "last_level", - "type": "integer", - "description": "Level to stop indexing at" + "type": "array" } }, "required": [ @@ -2287,13 +2299,13 @@ "additionalProperties": false, "description": "Operation index config", "properties": { - "kind": { - "const": "tezos.operations_unfiltered", - "title": "kind", - "type": "string", - "description": "always 'tezos.operations_unfiltered'" + "callback": { + "description": "Callback name", + "title": "callback", + "type": "string" }, "datasources": { + "description": "`tezos` datasources to use", "items": { "anyOf": [ { @@ -2305,36 +2317,36 @@ ] }, "title": "datasources", - "type": "array", - "description": "`tezos` datasources to use" + "type": "array" }, - "callback": { - "title": "callback", - "type": "string", - "description": "Callback name" + "first_level": { + "default": 0, + "description": "Level to start indexing from", + "title": "first_level", + "type": "integer" + }, + "kind": { + "const": "tezos.operations_unfiltered", + "description": "always 'tezos.operations_unfiltered'", + "title": "kind", + "type": "string" + }, + "last_level": { + "default": 0, + "description": "Level to stop indexing at", + "title": "last_level", + "type": "integer" }, "types": { "default": [ "transaction" ], + "description": "Types of transaction to fetch", "items": { "$ref": "#/$defs/TezosOperationType" }, "title": "types", - "type": "array", - "description": "Types of transaction to fetch" - }, - "first_level": { - "default": 0, - "title": "first_level", - "type": "integer", - "description": "Level to start indexing from" - }, - "last_level": { - "default": 0, - "title": "last_level", - "type": "integer", - "description": "Level to stop indexing at" + "type": "array" } }, "required": [ @@ -2350,9 +2362,9 @@ "description": "Token balance handler config", "properties": { "callback": { + "description": "Callback name", "title": "callback", - "type": "string", - "description": "Callback name" + "type": "string" }, "contract": { "anyOf": [ @@ -2367,8 +2379,8 @@ } ], "default": null, - "title": "contract", - "description": "Filter by contract" + "description": "Filter by contract", + "title": "contract" }, "token_id": { "anyOf": [ @@ -2380,8 +2392,8 @@ } ], "default": null, - "title": "token_id", - "description": "Filter by token ID" + "description": "Filter by token ID", + "title": "token_id" } }, "required": [ @@ -2394,13 +2406,8 @@ "additionalProperties": false, "description": "Token balance index config", "properties": { - "kind": { - "const": "tezos.token_balances", - "title": "kind", - "type": "string", - "description": "always 'tezos.token_balances'" - }, "datasources": { + "description": "`tezos` datasources to use", "items": { "anyOf": [ { @@ -2412,28 +2419,33 @@ ] }, "title": "datasources", - "type": "array", - "description": "`tezos` datasources to use" + "type": "array" + }, + "first_level": { + "default": 0, + "description": "Level to start indexing from", + "title": "first_level", + "type": "integer" }, "handlers": { + "description": "Mapping of token transfer handlers", "items": { "$ref": "#/$defs/TezosTokenBalancesHandlerConfig" }, "title": "handlers", - "type": "array", - "description": "Mapping of token transfer handlers" + "type": "array" }, - "first_level": { - "default": 0, - "title": "first_level", - "type": "integer", - "description": "Level to start indexing from" + "kind": { + "const": "tezos.token_balances", + "description": "always 'tezos.token_balances'", + "title": "kind", + "type": "string" }, "last_level": { "default": 0, + "description": "Level to stop indexing at", "title": "last_level", - "type": "integer", - "description": "Level to stop indexing at" + "type": "integer" } }, "required": [ @@ -2449,9 +2461,9 @@ "description": "Token transfer handler config", "properties": { "callback": { + "description": "Callback name", "title": "callback", - "type": "string", - "description": "Callback name" + "type": "string" }, "contract": { "anyOf": [ @@ -2466,21 +2478,24 @@ } ], "default": null, - "title": "contract", - "description": "Filter by contract" + "description": "Filter by contract", + "title": "contract" }, - "token_id": { + "from": { "anyOf": [ { - "type": "integer" + "type": "string" + }, + { + "$ref": "#/$defs/TezosContractConfig" }, { "type": "null" } ], "default": null, - "title": "token_id", - "description": "Filter by token ID" + "description": "Filter by sender", + "title": "from" }, "to": { "anyOf": [ @@ -2495,24 +2510,21 @@ } ], "default": null, - "title": "to", - "description": "Filter by recipient" + "description": "Filter by recipient", + "title": "to" }, - "from": { + "token_id": { "anyOf": [ { - "type": "string" - }, - { - "$ref": "#/$defs/TezosContractConfig" + "type": "integer" }, { "type": "null" } ], "default": null, - "title": "from", - "description": "Filter by sender" + "description": "Filter by token ID", + "title": "token_id" } }, "required": [ @@ -2525,13 +2537,8 @@ "additionalProperties": false, "description": "Token transfer index config", "properties": { - "kind": { - "const": "tezos.token_transfers", - "title": "kind", - "type": "string", - "description": "always 'tezos.token_transfers'" - }, "datasources": { + "description": "`tezos` datasources to use", "items": { "anyOf": [ { @@ -2543,28 +2550,33 @@ ] }, "title": "datasources", - "type": "array", - "description": "`tezos` datasources to use" + "type": "array" + }, + "first_level": { + "default": 0, + "description": "Level to start indexing from", + "title": "first_level", + "type": "integer" }, "handlers": { + "description": "Mapping of token transfer handlers", "items": { "$ref": "#/$defs/TezosTokenTransfersHandlerConfig" }, "title": "handlers", - "type": "array", - "description": "Mapping of token transfer handlers" + "type": "array" }, - "first_level": { - "default": 0, - "title": "first_level", - "type": "integer", - "description": "Level to start indexing from" + "kind": { + "const": "tezos.token_transfers", + "description": "always 'tezos.token_transfers'", + "title": "kind", + "type": "string" }, "last_level": { "default": 0, + "description": "Level to stop indexing at", "title": "last_level", - "type": "integer", - "description": "Level to stop indexing at" + "type": "integer" } }, "required": [ @@ -2579,17 +2591,11 @@ "additionalProperties": false, "description": "TzKT datasource config", "properties": { - "kind": { - "const": "tezos.tzkt", - "title": "kind", - "type": "string", - "description": "always 'tezos.tzkt'" - }, - "url": { - "$ref": "#/$defs/Url", - "default": "https://api.tzkt.io", - "title": "url", - "description": "Base API URL, e.g. https://api.tzkt.io/" + "buffer_size": { + "default": 0, + "description": "Number of levels to keep in FIFO buffer before processing", + "title": "buffer_size", + "type": "integer" }, "http": { "anyOf": [ @@ -2601,26 +2607,32 @@ } ], "default": null, - "title": "http", - "description": "HTTP client configuration" + "description": "HTTP client configuration", + "title": "http" }, - "buffer_size": { - "default": 0, - "title": "buffer_size", - "type": "integer", - "description": "Number of levels to keep in FIFO buffer before processing" + "kind": { + "const": "tezos.tzkt", + "description": "always 'tezos.tzkt'", + "title": "kind", + "type": "string" }, "merge_subscriptions": { "default": false, + "description": "Whether to merge realtime subscriptions", "title": "merge_subscriptions", - "type": "boolean", - "description": "Whether to merge realtime subscriptions" + "type": "boolean" }, "rollback_depth": { "default": 2, + "description": "Number of blocks to keep in the database to handle reorgs", "title": "rollback_depth", - "type": "integer", - "description": "Number of blocks to keep in the database to handle reorgs" + "type": "integer" + }, + "url": { + "$ref": "#/$defs/Url", + "default": "https://api.tzkt.io", + "description": "Base API URL, e.g. https://api.tzkt.io/", + "title": "url" } }, "required": [ @@ -2643,23 +2655,6 @@ "additionalProperties": false, "description": "DipDup Metadata datasource config", "properties": { - "kind": { - "const": "tzip_metadata", - "title": "kind", - "type": "string", - "description": "always 'tzip_metadata'" - }, - "network": { - "$ref": "#/$defs/TzipMetadataNetwork", - "title": "network", - "description": "Network name, e.g. mainnet, ghostnet, etc." - }, - "url": { - "default": "https://metadata.dipdup.net", - "title": "url", - "type": "string", - "description": "GraphQL API URL, e.g. https://metadata.dipdup.net" - }, "http": { "anyOf": [ { @@ -2670,8 +2665,25 @@ } ], "default": null, - "title": "http", - "description": "HTTP client configuration" + "description": "HTTP client configuration", + "title": "http" + }, + "kind": { + "const": "tzip_metadata", + "description": "always 'tzip_metadata'", + "title": "kind", + "type": "string" + }, + "network": { + "$ref": "#/$defs/TzipMetadataNetwork", + "description": "Network name, e.g. mainnet, ghostnet, etc.", + "title": "network" + }, + "url": { + "default": "https://metadata.dipdup.net", + "description": "GraphQL API URL, e.g. https://metadata.dipdup.net", + "title": "url", + "type": "string" } }, "required": [ @@ -2701,9 +2713,63 @@ "type": "string" } }, + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "description": "DipDup project configuration file", "properties": { + "advanced": { + "$ref": "#/$defs/AdvancedConfig", + "description": "Advanced config", + "title": "advanced" + }, + "api": { + "anyOf": [ + { + "$ref": "#/$defs/ApiConfig" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Management API config", + "title": "api" + }, + "contracts": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/$defs/EvmContractConfig" + }, + { + "$ref": "#/$defs/TezosContractConfig" + }, + { + "$ref": "#/$defs/StarknetContractConfig" + } + ] + }, + "description": "Mapping of contract aliases and contract configs", + "title": "contracts", + "type": "object" + }, + "custom": { + "description": "User-defined configuration to use in callbacks", + "title": "custom", + "type": "object" + }, + "database": { + "anyOf": [ + { + "$ref": "#/$defs/SqliteDatabaseConfig" + }, + { + "$ref": "#/$defs/PostgresDatabaseConfig" + } + ], + "description": "Database config", + "title": "database" + }, "datasources": { "additionalProperties": { "anyOf": [ @@ -2739,39 +2805,30 @@ } ] }, + "description": "Mapping of datasource aliases and datasource configs", "title": "datasources", - "type": "object", - "description": "Mapping of datasource aliases and datasource configs" + "type": "object" }, - "database": { + "hasura": { "anyOf": [ { - "$ref": "#/$defs/SqliteDatabaseConfig" + "$ref": "#/$defs/HasuraConfig" }, { - "$ref": "#/$defs/PostgresDatabaseConfig" + "type": "null" } ], - "title": "database", - "description": "Database config" + "default": null, + "description": "Hasura integration config", + "title": "hasura" }, - "contracts": { + "hooks": { "additionalProperties": { - "anyOf": [ - { - "$ref": "#/$defs/EvmContractConfig" - }, - { - "$ref": "#/$defs/TezosContractConfig" - }, - { - "$ref": "#/$defs/StarknetContractConfig" - } - ] + "$ref": "#/$defs/HookConfig" }, - "title": "contracts", - "type": "object", - "description": "Mapping of contract aliases and contract configs" + "description": "Mapping of hook aliases and hook configs", + "title": "hooks", + "type": "object" }, "indexes": { "additionalProperties": { @@ -2811,110 +2868,48 @@ } ] }, + "description": "Mapping of index aliases and index configs", "title": "indexes", - "type": "object", - "description": "Mapping of index aliases and index configs" - }, - "templates": { - "additionalProperties": { - "anyOf": [ - { - "$ref": "#/$defs/TezosBigMapsIndexConfig" - }, - { - "$ref": "#/$defs/TezosEventsIndexConfig" - }, - { - "$ref": "#/$defs/TezosHeadIndexConfig" - }, - { - "$ref": "#/$defs/TezosOperationsIndexConfig" - }, - { - "$ref": "#/$defs/TezosOperationsUnfilteredIndexConfig" - }, - { - "$ref": "#/$defs/TezosTokenTransfersIndexConfig" - }, - { - "$ref": "#/$defs/TezosTokenBalancesIndexConfig" - }, - { - "$ref": "#/$defs/EvmEventsIndexConfig" - }, - { - "$ref": "#/$defs/EvmTransactionsIndexConfig" - }, - { - "$ref": "#/$defs/StarknetEventsIndexConfig" - } - ] - }, - "title": "templates", - "type": "object", - "description": "Mapping of template aliases and index templates" + "type": "object" }, "jobs": { "additionalProperties": { "$ref": "#/$defs/JobConfig" }, + "description": "Mapping of job aliases and job configs", "title": "jobs", - "type": "object", - "description": "Mapping of job aliases and job configs" - }, - "hooks": { - "additionalProperties": { - "$ref": "#/$defs/HookConfig" - }, - "title": "hooks", - "type": "object", - "description": "Mapping of hook aliases and hook configs" - }, - "advanced": { - "$ref": "#/$defs/AdvancedConfig", - "title": "advanced", - "description": "Advanced config" - }, - "custom": { - "title": "custom", - "type": "object", - "description": "User-defined configuration to use in callbacks" - }, - "spec_version": { - "$ref": "#/$defs/ToStr", - "title": "spec_version", - "description": "Version of config specification, currently always `3.0`" - }, - "package": { - "title": "package", - "type": "string", - "description": "Name of indexer's Python package, existing or not" + "type": "object" }, - "hasura": { + "logging": { "anyOf": [ { - "$ref": "#/$defs/HasuraConfig" + "additionalProperties": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "type": "object" }, { - "type": "null" - } - ], - "default": null, - "title": "hasura", - "description": "Hasura integration config" - }, - "sentry": { - "anyOf": [ - { - "$ref": "#/$defs/SentryConfig" + "type": "string" }, { - "type": "null" + "type": "integer" } ], - "default": null, - "title": "sentry", - "description": "Sentry integration config" + "default": "INFO", + "description": "Modify logging verbosity", + "title": "logging" + }, + "package": { + "description": "Name of indexer's Python package, existing or not", + "title": "package", + "type": "string" }, "prometheus": { "anyOf": [ @@ -2926,51 +2921,68 @@ } ], "default": null, - "title": "prometheus", - "description": "Prometheus integration config" + "description": "Prometheus integration config", + "title": "prometheus" }, - "api": { + "sentry": { "anyOf": [ { - "$ref": "#/$defs/ApiConfig" + "$ref": "#/$defs/SentryConfig" }, { "type": "null" } ], "default": null, - "title": "api", - "description": "Management API config" + "description": "Sentry integration config", + "title": "sentry" }, - "logging": { - "anyOf": [ - { - "additionalProperties": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ] + "spec_version": { + "$ref": "#/$defs/ToStr", + "description": "Version of config specification, currently always `3.0`", + "title": "spec_version" + }, + "templates": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/$defs/TezosBigMapsIndexConfig" }, - "type": "object" - }, - { - "type": "string" - }, - { - "type": "integer" - } - ], - "default": "INFO", - "title": "logging", - "description": "Modify logging verbosity" + { + "$ref": "#/$defs/TezosEventsIndexConfig" + }, + { + "$ref": "#/$defs/TezosHeadIndexConfig" + }, + { + "$ref": "#/$defs/TezosOperationsIndexConfig" + }, + { + "$ref": "#/$defs/TezosOperationsUnfilteredIndexConfig" + }, + { + "$ref": "#/$defs/TezosTokenTransfersIndexConfig" + }, + { + "$ref": "#/$defs/TezosTokenBalancesIndexConfig" + }, + { + "$ref": "#/$defs/EvmEventsIndexConfig" + }, + { + "$ref": "#/$defs/EvmTransactionsIndexConfig" + }, + { + "$ref": "#/$defs/StarknetEventsIndexConfig" + } + ] + }, + "description": "Mapping of template aliases and index templates", + "title": "templates", + "type": "object" } }, "required": [], "title": "DipDup", - "type": "object", - "$schema": "http://json-schema.org/draft-07/schema#" + "type": "object" } \ No newline at end of file diff --git a/scripts/docs.py b/scripts/docs.py index 24e70d18a..954b98bd9 100755 --- a/scripts/docs.py +++ b/scripts/docs.py @@ -493,7 +493,7 @@ def dump_jsonschema() -> None: schema_dict = DipDupConfig.json_schema() schema_path = Path(__file__).parent.parent / 'schemas' / 'dipdup-3.0.json' - schema_path.write_bytes(orjson.dumps(schema_dict, option=orjson.OPT_INDENT_2)) + schema_path.write_bytes(orjson.dumps(schema_dict, option=orjson.OPT_INDENT_2 | orjson.OPT_SORT_KEYS)) @main.command('dump-references', help='Dump Sphinx references to ugly Markdown files') diff --git a/src/dipdup/config/__init__.py b/src/dipdup/config/__init__.py index 627a91ee4..4ca618ab8 100644 --- a/src/dipdup/config/__init__.py +++ b/src/dipdup/config/__init__.py @@ -90,7 +90,7 @@ def _valid_url(v: str, ws: bool) -> str: _logger = logging.getLogger(__name__) -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class SqliteDatabaseConfig: """ SQLite connection config @@ -124,7 +124,7 @@ def connection_timeout(self) -> int: return 1 -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class PostgresDatabaseConfig: """Postgres database connection config @@ -176,7 +176,7 @@ def hasura_connection_parameters(self) -> dict[str, Any]: } -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class HttpConfig: """Advanced configuration of HTTP client @@ -210,7 +210,7 @@ class HttpConfig: alias: str | None = None -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class ResolvedHttpConfig: __doc__ = HttpConfig.__doc__ @@ -289,7 +289,7 @@ class IndexDatasourceConfig(DatasourceConfig): ... -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class HandlerConfig(CallbackMixin, ParentMixin['IndexConfig']): """Base class for index handlers @@ -301,7 +301,7 @@ def __post_init__(self) -> None: ParentMixin.__post_init__(self) -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class IndexTemplateConfig(NameMixin): """Index template config @@ -320,7 +320,7 @@ class IndexTemplateConfig(NameMixin): last_level: int = 0 -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class IndexConfig(ABC, NameMixin, ParentMixin['ResolvedIndexConfigU']): """Index config @@ -361,7 +361,7 @@ def strip(cls, config_dict: dict[str, Any]) -> None: datasource.pop('buffer_size', None) -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class HasuraConfig: """Config for the Hasura integration. @@ -400,7 +400,7 @@ def headers(self) -> dict[str, str]: return {} -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class JobConfig(NameMixin): """Job schedule config @@ -427,7 +427,7 @@ def __post_init__(self) -> None: NameMixin.__post_init__(self) -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class SentryConfig: """Config for Sentry integration. @@ -447,7 +447,7 @@ class SentryConfig: debug: bool = False -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class PrometheusConfig: """Config for Prometheus integration. @@ -461,7 +461,7 @@ class PrometheusConfig: update_interval: float = 1.0 -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class HookConfig(CallbackMixin): """Hook config @@ -486,7 +486,7 @@ def iter_imports(self, package: str) -> Iterator[tuple[str, str]]: yield package, obj -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class SystemHookConfig(HookConfig): __doc__ = HookConfig.__doc__ @@ -520,7 +520,7 @@ class SystemHookConfig(HookConfig): } -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class ApiConfig: """Management API config @@ -533,7 +533,7 @@ class ApiConfig: # NOTE: Should be the only place where extras are allowed -@dataclass(config=ConfigDict(extra='allow'), kw_only=True) +@dataclass(config=ConfigDict(extra='allow', defer_build=True), kw_only=True) class AdvancedConfig: """This section allows users to tune some system-wide options, either experimental or unsuitable for generic configurations. @@ -557,7 +557,7 @@ class AdvancedConfig: alt_operation_matcher: bool = False -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class DipDupConfig: """DipDup project configuration file @@ -634,6 +634,9 @@ def load( ) try: + # from pydantic.dataclasses import rebuild_dataclass + # rebuild_dataclass(cls, force=True) + config = TypeAdapter(cls).validate_python(config_json) except ConfigurationError: raise @@ -1157,15 +1160,6 @@ def _set_names(self) -> None: IndexConfigU = ResolvedIndexConfigU | IndexTemplateConfig -def _reload_dataclass(cls: type[Any]) -> type[Any]: - """Reload dataclass to apply new annotations""" - try: - return dataclass(cls, config=cls.__pydantic_config__, kw_only=True) - # NOTE: The first attempt fails with "dictionary changed size" due to how deeply fucked up this hack is. - except RuntimeError: - return dataclass(cls, config=cls.__pydantic_config__, kw_only=True) - - def _patch_annotations() -> None: """Patch dataclass annotations in runtime to allow using aliases in config files. @@ -1181,7 +1175,7 @@ def _patch_annotations() -> None: (self.__name__, self), ) - for name, submodule in submodules: + for _, submodule in submodules: if not submodule.__name__.startswith('dipdup.config'): continue @@ -1203,17 +1197,10 @@ def _patch_annotations() -> None: body, after = body.split(']', 1) unwrapped = f'{before}str | {body}{after}' - if annotation != unwrapped: + if unwrapped != annotation: value.__annotations__[name] = unwrapped - - setattr( - submodule, - attr, - _reload_dataclass(value), - ) - - # NOTE: Finally, reload the root config itself. - self.DipDupConfig = _reload_dataclass(DipDupConfig) # type: ignore[attr-defined] + value.__pydantic_fields__[name].annotation = unwrapped # type: ignore[assignment] + value.__dataclass_fields__[name].type = unwrapped _patch_annotations() diff --git a/src/dipdup/config/_mixin.py b/src/dipdup/config/_mixin.py index 197cc05a8..270e88ca4 100644 --- a/src/dipdup/config/_mixin.py +++ b/src/dipdup/config/_mixin.py @@ -21,7 +21,7 @@ from collections.abc import Iterator -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class NameMixin: def __post_init__(self) -> None: self._name: str | None = None @@ -33,7 +33,7 @@ def name(self) -> str: return self._name -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class CodegenMixin(ABC): """Base for pattern config classes containing methods required for codegen""" @@ -70,7 +70,7 @@ def locate_arguments(self) -> dict[str, type | None]: ParentT = TypeVar('ParentT') -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class ParentMixin(Generic[ParentT]): """`parent` field for index and template configs""" @@ -88,7 +88,7 @@ def parent(self, value: ParentT) -> None: self._parent = value -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class CallbackMixin(CodegenMixin): """Mixin for callback configs @@ -102,7 +102,7 @@ def __post_init__(self) -> None: raise ConfigurationError('`callback` field must be a valid Python module name') -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class SubgroupIndexMixin: """`subgroup_index` field to track index of operation in group diff --git a/src/dipdup/config/abi_etherscan.py b/src/dipdup/config/abi_etherscan.py index 79520a1aa..5a815b5e8 100644 --- a/src/dipdup/config/abi_etherscan.py +++ b/src/dipdup/config/abi_etherscan.py @@ -11,7 +11,7 @@ DEFAULT_ETHERSCAN_URL = 'https://api.etherscan.io/api' -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class AbiEtherscanDatasourceConfig(AbiDatasourceConfig): """Etherscan datasource config diff --git a/src/dipdup/config/coinbase.py b/src/dipdup/config/coinbase.py index 39a4829c7..fe194af3f 100644 --- a/src/dipdup/config/coinbase.py +++ b/src/dipdup/config/coinbase.py @@ -10,7 +10,7 @@ from dipdup.config import HttpConfig -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class CoinbaseDatasourceConfig(DatasourceConfig): """Coinbase datasource config diff --git a/src/dipdup/config/evm.py b/src/dipdup/config/evm.py index 5259b73be..246dfef47 100644 --- a/src/dipdup/config/evm.py +++ b/src/dipdup/config/evm.py @@ -45,7 +45,7 @@ def _validate_evm_address(v: str) -> str: type EvmAddress = Annotated[Hex, AfterValidator(_validate_evm_address)] -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class EvmContractConfig(ContractConfig): """EVM contract config @@ -69,7 +69,7 @@ def get_address(self) -> str: return self.address -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class EvmIndexConfig(IndexConfig, ABC): """EVM index that use Subsquid Network as a datasource diff --git a/src/dipdup/config/evm_events.py b/src/dipdup/config/evm_events.py index 73f3f590e..aedb92fe3 100644 --- a/src/dipdup/config/evm_events.py +++ b/src/dipdup/config/evm_events.py @@ -22,7 +22,7 @@ from dipdup.subscriptions import Subscription -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class EvmEventsHandlerConfig(HandlerConfig): """Subsquid event handler @@ -50,7 +50,7 @@ def iter_arguments(self) -> Iterator[tuple[str, str]]: yield 'event', f'EvmEvent[{event_cls}]' -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class EvmEventsIndexConfig(EvmIndexConfig): """Subsquid datasource config diff --git a/src/dipdup/config/evm_node.py b/src/dipdup/config/evm_node.py index 246ef966c..090ec6d42 100644 --- a/src/dipdup/config/evm_node.py +++ b/src/dipdup/config/evm_node.py @@ -11,7 +11,7 @@ from dipdup.config import WsUrl -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class EvmNodeDatasourceConfig(IndexDatasourceConfig): """EVM node datasource config diff --git a/src/dipdup/config/evm_subsquid.py b/src/dipdup/config/evm_subsquid.py index 1f7094610..266b57e27 100644 --- a/src/dipdup/config/evm_subsquid.py +++ b/src/dipdup/config/evm_subsquid.py @@ -10,7 +10,7 @@ from dipdup.config import Url -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class EvmSubsquidDatasourceConfig(IndexDatasourceConfig): """Subsquid datasource config diff --git a/src/dipdup/config/evm_transactions.py b/src/dipdup/config/evm_transactions.py index 77af0f3e1..956685206 100644 --- a/src/dipdup/config/evm_transactions.py +++ b/src/dipdup/config/evm_transactions.py @@ -22,7 +22,7 @@ from collections.abc import Iterator -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class EvmTransactionsHandlerConfig(HandlerConfig, CodegenMixin): """Subsquid transaction handler @@ -82,7 +82,7 @@ def typed_contract(self) -> EvmContractConfig | None: return None -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class EvmTransactionsIndexConfig(EvmIndexConfig): """Index that uses Subsquid Network as a datasource for transactions diff --git a/src/dipdup/config/http.py b/src/dipdup/config/http.py index e6d62df15..6b3cfcf0c 100644 --- a/src/dipdup/config/http.py +++ b/src/dipdup/config/http.py @@ -9,7 +9,7 @@ from dipdup.config import HttpConfig -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class HttpDatasourceConfig(DatasourceConfig): """Generic HTTP datasource config diff --git a/src/dipdup/config/ipfs.py b/src/dipdup/config/ipfs.py index 670f6a746..148ce6df1 100644 --- a/src/dipdup/config/ipfs.py +++ b/src/dipdup/config/ipfs.py @@ -11,7 +11,7 @@ DEFAULT_IPFS_URL = 'https://ipfs.io/ipfs' -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class IpfsDatasourceConfig(DatasourceConfig): """IPFS datasource config diff --git a/src/dipdup/config/starknet.py b/src/dipdup/config/starknet.py index df4a48935..c8de9573f 100644 --- a/src/dipdup/config/starknet.py +++ b/src/dipdup/config/starknet.py @@ -45,7 +45,7 @@ def _validate_starknet_address(v: str) -> str: type StarknetAddress = Annotated[Hex, AfterValidator(_validate_starknet_address)] -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class StarknetContractConfig(ContractConfig): """Starknet contract config @@ -66,7 +66,7 @@ def get_address(self) -> str: return self.address -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class StarknetIndexConfig(IndexConfig, ABC): """Starknet index that use Subsquid Network as a datasource diff --git a/src/dipdup/config/starknet_events.py b/src/dipdup/config/starknet_events.py index 7532d3797..d226842a4 100644 --- a/src/dipdup/config/starknet_events.py +++ b/src/dipdup/config/starknet_events.py @@ -19,7 +19,7 @@ from collections.abc import Iterator -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class StarknetEventsHandlerConfig(HandlerConfig): """Subsquid event handler @@ -47,7 +47,7 @@ def iter_arguments(self) -> Iterator[tuple[str, str]]: yield 'event', f'StarknetEvent[{event_cls}]' -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class StarknetEventsIndexConfig(StarknetIndexConfig): """Starknet events index config diff --git a/src/dipdup/config/starknet_node.py b/src/dipdup/config/starknet_node.py index 710a9bd29..944f7b24d 100644 --- a/src/dipdup/config/starknet_node.py +++ b/src/dipdup/config/starknet_node.py @@ -11,7 +11,7 @@ from dipdup.config import WsUrl -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class StarknetNodeDatasourceConfig(IndexDatasourceConfig): """Starknet node datasource config diff --git a/src/dipdup/config/starknet_subsquid.py b/src/dipdup/config/starknet_subsquid.py index 56b46d25a..22df90303 100644 --- a/src/dipdup/config/starknet_subsquid.py +++ b/src/dipdup/config/starknet_subsquid.py @@ -10,7 +10,7 @@ from dipdup.config import Url -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class StarknetSubsquidDatasourceConfig(IndexDatasourceConfig): """Subsquid datasource config diff --git a/src/dipdup/config/tezos.py b/src/dipdup/config/tezos.py index d1c158335..707cfe5a5 100644 --- a/src/dipdup/config/tezos.py +++ b/src/dipdup/config/tezos.py @@ -49,7 +49,7 @@ def _validate_tezos_address(v: str) -> str: type TezosAddress = Annotated[str, AfterValidator(_validate_tezos_address)] -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosContractConfig(ContractConfig): """Tezos contract config. @@ -76,7 +76,7 @@ def resolved_code_hash(self) -> int | None: return self.code_hash -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosIndexConfig(IndexConfig): """TzKT index config diff --git a/src/dipdup/config/tezos_big_maps.py b/src/dipdup/config/tezos_big_maps.py index bdbb4a7c7..0777a1ea3 100644 --- a/src/dipdup/config/tezos_big_maps.py +++ b/src/dipdup/config/tezos_big_maps.py @@ -24,7 +24,7 @@ from dipdup.subscriptions import Subscription -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosBigMapsHandlerConfig(HandlerConfig): """Big map handler config @@ -67,7 +67,7 @@ def iter_arguments(self) -> Iterator[tuple[str, str]]: yield self.format_big_map_diff_argument(self.path) -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosBigMapsIndexConfig(TezosIndexConfig): """Big map index config diff --git a/src/dipdup/config/tezos_events.py b/src/dipdup/config/tezos_events.py index 284b28811..1c39d4d3d 100644 --- a/src/dipdup/config/tezos_events.py +++ b/src/dipdup/config/tezos_events.py @@ -21,7 +21,7 @@ from dipdup.subscriptions import Subscription -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosEventsHandlerConfig(HandlerConfig): """Event handler config @@ -49,7 +49,7 @@ def iter_arguments(self) -> Iterator[tuple[str, str]]: yield 'event', f'TezosEvent[{event_cls}]' -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosEventsUnknownEventHandlerConfig(HandlerConfig): """Unknown event handler config @@ -72,7 +72,7 @@ def iter_arguments(self) -> Iterator[tuple[str, str]]: TezosEventsHandlerConfigU = TezosEventsHandlerConfig | TezosEventsUnknownEventHandlerConfig -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosEventsIndexConfig(TezosIndexConfig): """Event index config diff --git a/src/dipdup/config/tezos_head.py b/src/dipdup/config/tezos_head.py index 4745655e4..f727a2d2d 100644 --- a/src/dipdup/config/tezos_head.py +++ b/src/dipdup/config/tezos_head.py @@ -15,7 +15,7 @@ from collections.abc import Iterator -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosTzktHeadHandlerConfig(HandlerConfig): """Head block handler config @@ -32,7 +32,7 @@ def iter_arguments(self) -> Iterator[tuple[str, str]]: yield 'head', 'TezosHeadBlockData' -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosHeadIndexConfig(TezosIndexConfig): """Head block index config diff --git a/src/dipdup/config/tezos_operations.py b/src/dipdup/config/tezos_operations.py index 3102b6609..702282d28 100644 --- a/src/dipdup/config/tezos_operations.py +++ b/src/dipdup/config/tezos_operations.py @@ -110,7 +110,7 @@ def format_untyped_operation_argument( return arg_name, 'TezosOperationData' -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosOperationsHandlerTransactionPatternConfig(TezosOperationsPatternConfig, SubgroupIndexMixin): """Transaction handler pattern config @@ -170,7 +170,7 @@ def typed_contract(self) -> TezosContractConfig | None: return None -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosOperationsHandlerOriginationPatternConfig(TezosOperationsPatternConfig, SubgroupIndexMixin): """Origination handler pattern config @@ -219,7 +219,7 @@ def typed_contract(self) -> TezosContractConfig | None: return None -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosOperationsHandlerSmartRollupExecutePatternConfig(TezosOperationsPatternConfig, SubgroupIndexMixin): """Operation handler pattern config @@ -256,7 +256,7 @@ def typed_contract(self) -> TezosContractConfig | None: return None -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosOperationsHandlerSmartRollupCementPatternConfig(TezosOperationsPatternConfig, SubgroupIndexMixin): """Operation handler pattern config @@ -293,7 +293,7 @@ def typed_contract(self) -> TezosContractConfig | None: return None -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosOperationsIndexConfig(TezosIndexConfig): """Operation index config @@ -368,7 +368,7 @@ def strip(cls, config_dict: dict[str, Any]) -> None: ) -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosOperationsHandlerConfig(HandlerConfig): """Operation handler config @@ -401,7 +401,7 @@ def iter_arguments(self) -> Iterator[tuple[str, str]]: yield arg, arg_type -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosOperationsUnfilteredHandlerConfig(HandlerConfig): """Handler of unfiltered operation index @@ -418,7 +418,7 @@ def iter_arguments(self) -> Iterator[tuple[str, str]]: yield 'operation', 'TezosOperationData' -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosOperationsUnfilteredIndexConfig(TezosIndexConfig): """Operation index config diff --git a/src/dipdup/config/tezos_token_balances.py b/src/dipdup/config/tezos_token_balances.py index a4836d153..3dbdbe0f4 100644 --- a/src/dipdup/config/tezos_token_balances.py +++ b/src/dipdup/config/tezos_token_balances.py @@ -20,7 +20,7 @@ from dipdup.subscriptions import Subscription -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosTokenBalancesHandlerConfig(HandlerConfig): """Token balance handler config @@ -44,7 +44,7 @@ def iter_arguments(self) -> Iterator[tuple[str, str]]: yield 'token_balance', 'TezosTokenBalanceData' -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosTokenBalancesIndexConfig(TezosIndexConfig): """Token balance index config diff --git a/src/dipdup/config/tezos_token_transfers.py b/src/dipdup/config/tezos_token_transfers.py index c5f7b99c0..bd76a29b7 100644 --- a/src/dipdup/config/tezos_token_transfers.py +++ b/src/dipdup/config/tezos_token_transfers.py @@ -20,7 +20,7 @@ from dipdup.subscriptions import Subscription -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosTokenTransfersHandlerConfig(HandlerConfig): """Token transfer handler config @@ -47,7 +47,7 @@ def iter_arguments(self) -> Iterator[tuple[str, str]]: yield 'token_transfer', 'TezosTokenTransferData' -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosTokenTransfersIndexConfig(TezosIndexConfig): """Token transfer index config diff --git a/src/dipdup/config/tezos_tzkt.py b/src/dipdup/config/tezos_tzkt.py index b0bb8a8b2..fa9160454 100644 --- a/src/dipdup/config/tezos_tzkt.py +++ b/src/dipdup/config/tezos_tzkt.py @@ -22,7 +22,7 @@ MAX_BATCH_SIZE = 10000 -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TezosTzktDatasourceConfig(IndexDatasourceConfig): """TzKT datasource config diff --git a/src/dipdup/config/tzip_metadata.py b/src/dipdup/config/tzip_metadata.py index 69d164b2a..1a26ab5e7 100644 --- a/src/dipdup/config/tzip_metadata.py +++ b/src/dipdup/config/tzip_metadata.py @@ -12,7 +12,7 @@ DEFAULT_TZIP_METADATA_URL = 'https://metadata.dipdup.net' -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class TzipMetadataDatasourceConfig(DatasourceConfig): """DipDup Metadata datasource config diff --git a/src/dipdup/project.py b/src/dipdup/project.py index 0695d73dd..fa09729c3 100644 --- a/src/dipdup/project.py +++ b/src/dipdup/project.py @@ -114,7 +114,7 @@ def get_package_answers(package: str | None = None) -> Answers | None: return answers_from_replay(replay_path) -@dataclass(config=ConfigDict(extra='forbid'), kw_only=True) +@dataclass(config=ConfigDict(extra='forbid', defer_build=True), kw_only=True) class ReplayConfig: spec_version: ToStr replay: Answers