Interface TezosNodeDappetizerConfig

Configures connection to Tezos node to be used to fetch blockchain data. 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: {
tezosNode: {
url: 'https://mainnet-tezos.giganode.io',
retryDelaysMillis: [50, 500, 1_000, 2_000, 4_000],
monitor: {
reconnectIfStuckMillis: 180_000,
chunkCount: {
warn: 100,
fail: 1_000,
},
},
},
... // Other config parts.
},
testnet: {
tezosNode: {
url: 'https://testnet-tezos.giganode.io',
retryDelaysMillis: [50, 500, 1_000, 2_000, 4_000],
monitor: {
reconnectIfStuckMillis: 180_000,
chunkCount: {
warn: 100,
fail: 1_000,
},
},
},
... // Other config parts.
},
},
... // Other config parts.
};

export default config;

Hierarchy

  • TezosNodeDappetizerConfig

Properties

health?: {
    resultCacheMillis?: number;
    timeoutMillis?: number;
    unhealthyAfterMillis?: number;
    watcherCacheMillis?: number;
}

Configures reporting of health status of the Tezos node connection. Tezos node watcher gets HEAD block header and reports respective error if any.

Type declaration

  • Optional resultCacheMillis?: number

    The time in milliseconds for how long the health result (of all HealthStatus-es) is cached.

    Limits

    An integer with minimum 0.

    Default

    5_000

  • Optional timeoutMillis?: number

    The time in milliseconds to wait before a health RPC request times out.

    Limits

    An integer with minimum 1.

    Default

    1_000

  • Optional unhealthyAfterMillis?: number

    The time in milliseconds after which the check reports Unhealthy if health RPC requests keep failing subsequently. Before that, the check reports Degraded. A single successful health RPC request turns the check back to Healthy.

    Limits

    An integer with minimum 0.

    Default

    70_000

  • Optional watcherCacheMillis?: number

    Deprecated

    Use resultCacheMillis instead.

monitor?: {
    chunkCount?: {
        fail?: number;
        warn?: number;
    };
    reconnectIfStuckMillis?: number;
}

Configures connection to Tezos node monitor.

Type declaration

  • Optional chunkCount?: {
        fail?: number;
        warn?: number;
    }

    Tezos node monitor responds with chunks of incomplete JSON. So they need to be joined.

    • Optional fail?: number

      The number of chunks from Tezos node monitor when it fails and the connection is reestablished.

      Limits

      An integer with minimum 1.

      Default

      1_000

    • Optional warn?: number

      The number of chunks from Tezos node monitor when a warning is logged.

      Limits

      An integer with minimum 1.

      Default

      100

  • Optional reconnectIfStuckMillis?: number

    If Tezos node monitor does not send a new item (block or mempool operation group respectively) for specified number of milliseconds, then the connection is considered as stuck and it is restarted.

    Limits

    An integer with minimum 1.

    Default

    180_000 (3 minutes)

retryDelaysMillis?: number[]

The array which configures how many times an RPC request is retried when it fails. An array item is a sleep delay is milliseconds until the retry.

Default

[50, 500, 1_000, 2_000, 4_000]

timeoutMillis?: number

The time in milliseconds to wait before an RPC request times out. Some requests may override it explicitly in the code.

Limits

An integer with minimum 1.

Default

30_000

url: string

The URL of Tezos node RPC to which the indexer should connect. It must be an absolute URL string.

Generated using TypeDoc