Configures actual indexing. This is used as a part of DappetizerConfigUsingDb.

Example

Sample usage (all properties specified explicitly) within dappetizer.config.ts file:

import { DappetizerConfigUsingDb } from '@tezos-dappetizer/database';

const config: DappetizerConfigUsingDb = {
networks: {
mainnet: {
indexing: {
fromBlockLevel: 1796556,
toBlockLevel: 2000000,
contracts: [
{
addresses: ['KT191reDVKrLxU9rjTSxg53wRqj6zh8pnHgr'],
name: 'TezosDomains',
},
],
smartRollups: [
{
addresses: ['sr1LhGA2zC9VcYALSifpRBCgDiQfDSQ6bb4x'],
name: 'TezosDomains',
},
],
contractBoost: {
type: 'tzkt',
tzktUrl: 'https://api.custom-tzkt.io/',
},
retryDelaysMillis: [100, 1_000, 5_000, 60_000],
retryIndefinitely: true,
blockQueueSize: 5,
health: {
lastSuccessAge: {
degradedMillis: 300_000,
unhealthyMillis: 600_000,
},
},
},
... // Other config parts.
},
testnet: {
indexing: {
fromBlockLevel: 856123,
toBlockLevel: 1200000,
contracts: [
{
addresses: ['KT1TxqZ8QtKvLu3V3JH7Gx58n7Co8pgtpQU5'],
name: 'TezosDomains',
},
],
contractBoost: {
type: 'tzkt',
tzktUrl: 'https://api.custom-tzkt.io/',
},
retryDelaysMillis: [100, 1_000, 5_000, 60_000],
retryIndefinitely: true,
blockQueueSize: 5,
health: {
lastSuccessAge: {
degradedMillis: 300_000,
unhealthyMillis: 600_000,
},
},
},
... // Other config parts.
},
},
... // Other config parts.
};

export default config;

Hierarchy

  • IndexingDappetizerConfig

Properties

blockQueueSize?: number

The size of the queue for preloading blocks from Tezos node RPC for faster indexing.

Limits

An integer with a minimum 1.

Default

5

contractBoost?: {
    apiUrl?: string;
    type?: "disabled" | "tzkt";
}

Boost causes Dappetizer to only index blocks where the configured contracts are used.

Type declaration

  • Optional apiUrl?: string

    The REST API endpoint of the TzKT instance that should be used for the boost.

    Limits

    An absolute URL string.

    Default

    'https://api.tzkt.io/' (only for mainnet) or undefined (otherwise in order to avoid inconsistencies)

  • Optional type?: "disabled" | "tzkt"

    Specifies what type of boost should be used.

    Default

    'disabled'

contractCacheMillis?: number

The time in milliseconds for how long Contract instances are cached. The expiration is sliding according to the last contract usage. The caching is needed because contract are downloaded from Tezos node which takes quite some time.

Limits

An integer with minimum 0.

Default

600_000

contracts?: {
    addresses: NonEmptyArray<string>;
    name?: string;
}[]

The selective indexing of particular smart contracts. If an non-empty array is specified, then ContractIndexer-s from all IndexerModule-s are executed only when particular contracts are encountered.

Default

undefined

fromBlockLevel: number

The level of Tezos block from which the indexing should start.

Limits

An integer with a minimum 0.

headLevelOffset?: number

The offset to delay HEAD block level. It is useful for Tenderbake protocols with many reorganizations on HEAD block.

Limits

An integer with a minimum 0.

Default

1

health?: {
    lastSuccessAge?: {
        degradedMillis?: number;
        unhealthyMillis?: number;
    };
}

Configures reporting of health status of the indexing.

Type declaration

  • Optional lastSuccessAge?: {
        degradedMillis?: number;
        unhealthyMillis?: number;
    }

    The maximum age of the last successfully indexed block when indexing is considered Healthy. If it gets older, then the related health check is changed to Degraded, then Unhealthy.

    • Optional degradedMillis?: number

      The age in milliseconds when related health check turns Degraded.

      Limits

      An integer with minimum 1.

      Default

      300_000

    • Optional unhealthyMillis?: number

      The age in milliseconds when related health check turns Unhealthy.

      Limits

      An integer with minimum 1.

      Default

      600_000

retryDelaysMillis?: number[]

The array which configures how many times the entire block indexing is retried when it fails. An array item is a sleep delay is milliseconds until the retry.

Default

[100, 1_000, 5_000, 60_000]

retryIndefinitely?: boolean

Indicates if the entire block indexing should be retried indefinitely when it fails The sleep delay between retries is the last one from retryDelaysMillis or zero.

Default

true

smartRollups?: {
    addresses: NonEmptyArray<string>;
    name?: string;
}[]

The selective indexing of particular smart rollups. If an non-empty array is specified, then SmartRollupIndexer-s from all IndexerModule-s are executed only when particular contracts are encountered.

Default

[]

toBlockLevel?: number

The last level of Tezos block which should be indexed. If undefined then indexing continues with fresh new blocks from Tezos monitor.

Limits

An integer with a minimum fromBlockLevel.

Default

undefined

Generated using TypeDoc