Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/huge-weeks-dance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@docs/ensnode": minor
---

Added "Startup sequence" page to ENSIndexer docs.
5 changes: 5 additions & 0 deletions docs/ensnode.io/config/integrations/starlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ export function starlight(): AstroIntegration {
},
],
},
{
label: "Concepts",
collapsed: false,
autogenerate: { directory: "ensindexer/concepts" },
},
{
label: "Using ENSIndexer",
collapsed: false,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: ENSIndexer Startup Sequence
description: Learn about the startup sequence of ENSIndexer.
sidebar:
label: Startup Sequence
order: 1
---

Below is an architecture diagram describing ENSIndexer start sequence in detail.
Comment thread
tk-o marked this conversation as resolved.
Outdated

## Ponder app lifecycle

Here is the top-level view on the ENSIndexer start sequence. It's really the overview of the Ponder app lifecycle running inside the ENSIndexer instance. The example assumes that the ENSIndexer was started with the `ENSINDEXER_SCHEMA_NAME` environment variable set to `prod_0`, but the same sequence applies to any ENSIndexer Schema.
Comment thread
tk-o marked this conversation as resolved.
Outdated

<figure>
[![Ponder app lifecycle](/public/ensindexer/startup-sequence/0-overview.png)](/public/ensindexer/startup-sequence/0-overview.png)
Comment thread
tk-o marked this conversation as resolved.
Outdated
</figure>
Comment thread
tk-o marked this conversation as resolved.
Comment thread
tk-o marked this conversation as resolved.

## ENSIndexer Schema migrations
Comment thread
tk-o marked this conversation as resolved.
Outdated

When Ponder app lifecycle reaches the "Execute migrations for the `prod_0` ENSIndexer Schema" step, Ponder will execute all pending migrations for the `prod_0` ENSIndexer Schema.
Comment thread
tk-o marked this conversation as resolved.
Outdated
This ensures that the database schema is up to date before indexing onchain events start.
Comment thread
tk-o marked this conversation as resolved.
Outdated

<figure>
[![Executing ENSIndexer Schema migrations](/public/ensindexer/startup-sequence/1-ensindexer-schema-migrations.png)](/public/ensindexer/startup-sequence/1-ensindexer-schema-migrations.png)
Comment thread
tk-o marked this conversation as resolved.
Outdated
</figure>
Comment thread
tk-o marked this conversation as resolved.
Comment thread
tk-o marked this conversation as resolved.

## Omnichain indexing strategy

When Ponder app lifecycle reaches the "Run omnichain indexing strategy" step, Ponder will start writing data concurrently to Ponder Schema (caching RPC calls) and ENSIndexer Schema (storing indexed data). ENSIndexer app lifecycle "injects" a special "Execute onchain event handlers preconditions" step.
Comment thread
tk-o marked this conversation as resolved.
Outdated

Comment thread
tk-o marked this conversation as resolved.
<figure>
[![Omnichain indexing strategy](/public/ensindexer/startup-sequence/2-omnichain-strategy-execution.png)](/public/ensindexer/startup-sequence/2-omnichain-strategy-execution.png)
Comment thread
tk-o marked this conversation as resolved.
Outdated
</figure>
Comment thread
tk-o marked this conversation as resolved.
Comment thread
tk-o marked this conversation as resolved.

### Init onchain event handlers

The special "Execute onchain event handlers preconditions" step occurs before any onchain event is indexed. This allows ENSIndexer to execute ENSNode Schema migrations and populate ENSNode Metadata table with relevant data before any onchain event handlers are executed.
Comment thread
tk-o marked this conversation as resolved.
Outdated

<figure>
[![Onchain event handlers preconditions](/public/ensindexer/startup-sequence/3-init-onchain-event-handlers.png)](/public/ensindexer/startup-sequence/3-init-onchain-event-handlers.png)
Comment thread
tk-o marked this conversation as resolved.
Outdated
Comment thread
tk-o marked this conversation as resolved.
Outdated
</figure>
Comment thread
tk-o marked this conversation as resolved.
Loading