Tezos Dappetizer
  • Quick Start
  • How-to Guides
    • Using PostgreSQL
    • Exposing API with Hasura
  • Reference
    • Decorator-based Indexing
      • Indexing Entrypoint Call
      • Indexing Storage Change
      • Indexing Bigmap Update
      • Indexing Incoming Transaction
    • Interface-based Indexing
    • Configuration
    • Command Line
    • Usage Statistics
  • Technical Concepts
    • Indexing Cycle
    • Indexer Modules
  • Token Indexer
    • Introduction
    • Running Standalone in Docker
  • API Docs
  • dappetizer GitLab
Powered by GitBook
On this page
  • Reference
  • Example configuration file

Was this helpful?

  1. Reference

Configuration

PreviousInterface-based IndexingNextCommand Line

Last updated 3 years ago

Was this helpful?

The configuration for Dappetizer can be specified as a JavaScript or JSON file format. The file name is implicitly dappetizer.config.ts, dappetizer.config.js, dappetizer.config.json, or it can also be passed as a .

Reference

Available configuration properties are documented in API docs on type or .

Example configuration file

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

const config: DappetizerConfigUsingDb = {
    modules: [
        {
            id: './my-indexer-module.js',
            config: { foo: 123 }, 
        },
    ],
    networks: {
        mainnet: {
            indexing: {
                fromBlockLevel: 1268684,
                contracts: [{
                    addresses: ['KT191reDVKrLxU9rjTSxg53wRqj6zh8pnHgr'],
                    name: 'MyContract',
                }],
            },
            tezosNode: {
                url: 'https://mainnet-tezos.giganode.io',
            },
        },
        testnet: {
            indexing: {
                fromBlockLevel: 858123,
                contracts: [{
                    addresses: ['KT1TxqZ8QtKvLu3V3JH7Gx58n7Co8pgtpQU5'],
                    name: 'MyContract',
                }],
            },
            tezosNode: {
                url: 'https://testnet-tezos.giganode.io',
            },
        },
    },
    database: {
        type: 'postgres',
        host: 'localhost',
        port: 5432,
        username: 'postgres',
        password: '***',
        database: 'postgres',
        schema: 'my_indexer',
    },
};

export default config;
dappetizer.config.js
module.exports = {
    modules: [
        {
            id: './my-indexer-module.js',
            config: { foo: 123 }, 
        },
    ],
    networks: {
        mainnet: {
            indexing: {
                fromBlockLevel: 1268684,
                contracts: [{
                    addresses: ['KT191reDVKrLxU9rjTSxg53wRqj6zh8pnHgr'],
                    name: 'MyContract',
                }],
            },
            tezosNode: {
                url: 'https://mainnet-tezos.giganode.io',
            },
        },
        testnet: {
            indexing: {
                fromBlockLevel: 858123,
                contracts: [{
                    addresses: ['KT1TxqZ8QtKvLu3V3JH7Gx58n7Co8pgtpQU5'],
                    name: 'MyContract',
                }],
            },
            tezosNode: {
                url: 'https://testnet-tezos.giganode.io',
            },
        },
    },
    database: {
        type: 'postgres',
        host: 'localhost',
        port: 5432,
        username: 'postgres',
        password: '***',
        database: 'postgres',
        schema: 'my_indexer',
    },
};
dappetizer.config.json
{
    "modules": [
        {
            "id": "./my-indexer-module.js",
            "config": { "foo": 123 }
        },
    ],
    "networks": {
        "mainnet": {
            "indexing": {
                "fromBlockLevel": 1268684,
                "contracts": [{
                    "addresses": ["KT191reDVKrLxU9rjTSxg53wRqj6zh8pnHgr"],
                    "name": "MyContract",
                }],
            },
            "tezosNode": {
                "url": "https://mainnet-tezos.giganode.io",
            },
        },
        "testnet": {
            "indexing": {
                "fromBlockLevel": 858123,
                "contracts": [{
                    "addresses": ["KT1TxqZ8QtKvLu3V3JH7Gx58n7Co8pgtpQU5"],
                    "name": "MyContract",
                }],
            },
            "tezosNode": {
                "url": "https://testnet-tezos.giganode.io",
            },
        },
    },
    "database": {
        "type": "postgres",
        "host": "localhost",
        "port": 5432,
        "username": "postgres",
        "password": "***",
        "database": "postgres",
        "schema": "my_indexer"
    }
}

command-line parameter
DappetizerConfigUsingDb
DappetizerConfig