Options
All
  • Public
  • Public/Protected
  • All
Menu

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',
},
],
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

Index

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'

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

The selective indexing of particular 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

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