Skip to content

Commit 82c2e04

Browse files
feat(da-indexer): update da-indexer docs (#1213)
* Update README.md * Update da-indexer/README.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent a31cd64 commit 82c2e04

File tree

1 file changed

+127
-16
lines changed

1 file changed

+127
-16
lines changed

da-indexer/README.md

+127-16
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@ DA Indexer Service
33

44
The DA Indexer service collects blobs from different DA solutions (currently only Celestia and EigenDA) and provides a convenient API for fetching blob data. In addition to indexing blobs, this service can be configured to fetch L2 batch metadata corresponding to a specific blob (currently only available for Celestia).
55

6-
## Celestia
7-
The Celestia indexer runs on top of the [Celestia light node](https://docs.celestia.org/how-to-guides/light-node). It is worth noting that the indexer collects only blobs and some block metadata, it does not collect full blocks, transactions, etc.
8-
9-
## EigenDA
10-
The EigenDA indexer runs on top of the EigenDA disperser. It is worth mentioning that the disperser does not store blobs older than two weeks, so these blobs will be unavailable.
6+
This service supports three primary use cases:
7+
* [Celestia Blob Indexer](#celestia-blob-indexer)
8+
* [EigenDA Blob Indexer](#eigenda-blob-indexer)
9+
* [L2 Batch Metadata](#l2-batch-metadata)
1110

1211
## Env
1312

1413
### General
1514
| Variable | Description | Default value |
1615
|---------------------------------------------------------|--------------------------------------------------------|----------------------------------|
17-
| DA_INDEXER__DATABASE__CONNECT__URL | Postgres URL to stats db | '' |
16+
| DA_INDEXER__DATABASE__CONNECT__URL | Postgres URL to db | '' |
1817
| DA_INDEXER__DATABASE__CREATE_DATABASE | Boolean. Creates database on start | false |
1918
| DA_INDEXER__DATABASE__RUN_MIGRATIONS | Boolean. Runs migrations on start | false |
2019
| DA_INDEXER__INDEXER__CONCURRENCY | Number of jobs processed concurrently | |
@@ -45,23 +44,135 @@ The EigenDA indexer runs on top of the EigenDA disperser. It is worth mentioning
4544
| DA_INDEXER__INDEXER__DA__SAVE_BATCH_SIZE | The number of blobs to save per db transaction | |
4645
| DA_INDEXER__INDEXER__DA__PRUNING_BLOCK_THRESHOLD | The threshold above which blobs might be unavailable | |
4746

48-
### L2 Batch Metadata
49-
To fetch L2 batch metadata, the service must be aware of the L2s that use Celestia as a DA layer and the namespaces they utilize. This information is configured in a separate file, with its path specified in the `DA_INDEXER__L2_ROUTER__ROUTES_PATH` environment variable. Indexer and database configuration are optional if the `DA_INDEXER__L2_ROUTER__ROUTES_PATH` environment variable is set. An example of the routes config is shown below:
47+
## Celestia Blob Indexer
48+
The Celestia indexer runs on top of the [Celestia light node](https://docs.celestia.org/how-to-guides/light-node). It is worth noting that the indexer collects only blobs and some block metadata, it does not collect full blocks, transactions, etc.
49+
50+
### Config example
51+
```env
52+
DA_INDEXER__DATABASE__CONNECT__URL=postgres://postgres:postgres@database:5432/blockscout
53+
DA_INDEXER__DATABASE__CREATE_DATABASE="true"
54+
DA_INDEXER__DATABASE__RUN_MIGRATIONS="true"
55+
56+
DA_INDEXER__INDEXER__DA__TYPE="Celestia"
57+
DA_INDEXER__INDEXER__DA__RPC__URL="http://celestia-light-node:26658"
58+
DA_INDEXER__INDEXER__CONCURRENCY=15
59+
```
60+
61+
### API
62+
63+
**GET: `/api/v1/celestia/blob`**
64+
65+
Query Params:
66+
67+
- **height** (required) - The number of Celestia block that contains the requested Celestia blob
68+
- **commitment** (required) - The commitment of Celestia blob in hex or base64
69+
- **skipData** (optional) - If true, the response will contain only blob metadata without the blob itself
70+
71+
Response:
72+
```json
73+
{
74+
"height":"3610160",
75+
"namespace":"00000000000000000000000000000000000000115d4fedc8915bb3e875",
76+
"commitment":"y7dYpzDxhAiYZOvetTASeLO2ceiWJ8CYI5HeABddAlc=",
77+
"timestamp":"1734016259",
78+
"size":"305",
79+
"data":"G9IBAGRAT6spnZHRugDjkwAbcJ5g4r7yZDzDDRTW5gUA51AA7K5Bc1nYYbrobaLpDg9LWmxA1eJli3TQtF3wW87Ot9vC9wZQHWz9XDl5cQt+YqHkSPT/r5tBVNyjzS5cOvD23x9Jh8IkO81w2PyDfFEyUajff4nTvObifASr3rT92Qity9zjGBNDt7YjSQbq7aQflXLyUvjAk/ZpufxfSsLCn9f5ArcBBuZW2VOHoiyN6pwCCn+9fkM6BgBkmkhAIcmhvui8NQ2SvaAQXdm9SwLZ16HVQyIo1QK37qRwNiYAZJoom7hQUjhwAQXAYl8nGb+m63TDydVUMnwOQRZbS8fx5/qQiHd1T0b2yBN8n1kKxUQP/45Hzh4aoE7qbaiEo2iGk8aQSjy2prVvvq85bwA="
80+
}
81+
```
82+
83+
## EigenDA Blob Indexer
84+
The EigenDA indexer runs on top of the EigenDA disperser. It is worth mentioning that the disperser does not store blobs older than two weeks, so these blobs will be unavailable.
85+
86+
### Config example
87+
```env
88+
DA_INDEXER__DATABASE__CONNECT__URL=postgres://postgres:postgres@database:5432/blockscout
89+
DA_INDEXER__DATABASE__CREATE_DATABASE="true"
90+
DA_INDEXER__DATABASE__RUN_MIGRATIONS="true"
91+
92+
DA_INDEXER__INDEXER__CONCURRENCY=5
93+
94+
DA_INDEXER__INDEXER__DA__TYPE="EigenDA"
95+
DA_INDEXER__INDEXER__DA__DISPERSER_URL="https://disperser-holesky.eigenda.xyz:443"
96+
DA_INDEXER__INDEXER__DA__EIGENDA_ADDRESS="0xD4A7E1Bd8015057293f0D0A557088c286942e84b"
97+
DA_INDEXER__INDEXER__DA__EIGENDA_CREATION_BLOCK=1168412
98+
DA_INDEXER__INDEXER__DA__SAVE_BATCH_SIZE=20
99+
DA_INDEXER__INDEXER__DA__PRUNING_BLOCK_THRESHOLD=1000
100+
101+
DA_INDEXER__INDEXER__DA__RPC__URL="https://ethereum-holesky-rpc.publicnode.com"
102+
DA_INDEXER__INDEXER__DA__RPC__BATCH_SIZE=1000
103+
```
104+
105+
### API
106+
**GET: `/api/v1/eigenda/blob`**
107+
108+
Query Params:
109+
110+
- **batchHeaderHash** (required) - The hash of the batch header
111+
- **blobIndex** (required) - The index of the blob in the batch
112+
- **skipData** (optional) - If true, the response will contain only blob metadata without the blob itself
113+
114+
Response:
115+
```json
116+
{
117+
"batchHeaderHash": "49be2c7f2a26ef1574b78333fd5e7aa26f870cb7882d6676e084a7e396b5268e",
118+
"batchId": "120158",
119+
"blobIndex": 2,
120+
"l1ConfirmationBlock": "3116005",
121+
"l1ConfirmationTxHash": "0x69016622a1cefaf8b6fa378ff8e6e9368e51fa27571952a2cf3f26ad5cf8185f",
122+
"size": "262144",
123+
"data": "AJggbiH/w4XEv3+3RtGyM4cP0kQVzrB8P2/T+gxAUmQAXPOZT7QohOhfoEtw+wJ+qOQbH7Foj+jTXnmG08rbggAKUEzY0ctZ56ci5KQeSfZpPdeU6f7AejfPi14ZHh3LAD7bWnfEOv3kr2mFSy37YGpHZGomwkpuJxSf2ZaI/uoAWHh08qF+wnKJbdSCh0nKsxsLHRZVamtZ3GbKRlGM+wAz60WWy/LhkGHBVOeFSvw7n1CsDiCDw0yrXQxORxEYANfnsX2vhtxbVKoJioWl++OmVHfAhNvfe5rLX4GefNgAwQ9rtNK5B9wE/Fa5zP+6ruphMMjpMqi4L00THdlphwCq4agCDYgUm69vKPoPaowW73nS/lTCQ=="
124+
}
125+
```
126+
127+
128+
## L2 Batch Metadata
129+
This service can be used to fetch L2 batch metadata using the Celestia blob identifier. This service is designed for external use and is not required for indexing purposes.
130+
To fetch L2 batch metadata, the service must be aware of the L2s that use Celestia as a DA layer and the namespaces they utilize. This information is configured in a separate file, with its path specified in the `DA_INDEXER__L2_ROUTER__ROUTES_PATH` environment variable. Indexer and database configuration are optional if the `DA_INDEXER__L2_ROUTER__ROUTES_PATH` environment variable is set.
131+
132+
### Config example
133+
```env
134+
DA_INDEXER__L2_ROUTER__ROUTES_PATH=/app/celestia_routes.toml
135+
```
50136
```toml
137+
# /app/celestia_routes.toml
138+
139+
[routes.0x00000000000000000000000000000000000000ca1de12a9905be97beaf]
140+
l2_chain_type = "Arbitrum"
141+
l2_chain_id = 123
142+
l2_api_url = "http://localhost:4000"
143+
l2_blockscout_url = "http://arbitrum.blockscout.com"
144+
51145
[routes.0x00000000000000000000000000000000000000000008e5f679bf7116cb]
52146
l2_chain_type = "Optimism"
53147
l2_chain_id = 123420111
54148
l2_api_url = "https://opcelestia-raspberry.gelatoscout.com/"
55149
l2_blockscout_url = "https://opcelestia-raspberry.gelatoscout.com/"
150+
request_timeout = 30
151+
request_retries = 1
152+
```
56153

57-
[routes.0x00000000000000000000000000000000000000ca1de12a1f4dbe943b6b]
58-
l2_chain_type = "Arbitrum"
59-
l2_chain_id = 123
60-
l2_api_url = "http://localhost:3001"
61-
l2_blockscout_url = "http://arbitrum.blockscout.com"
62-
l1_chain_id = 456 # optional
63-
request_timeout = 30 # optional
64-
request_retries = 2 # optional
154+
### API
155+
**GET: `/api/v1/celestia/l2BatchMetadata`**
156+
157+
Query Params:
158+
159+
- **height** (required) - The number of Celestia block that contains the requested Celestia blob
160+
- **namespace** (required) - The namespace of Celestia blob in hex or base64
161+
- **commitment** (required) - The commitment of Celestia blob in hex or base64
162+
163+
Response:
164+
```json
165+
{
166+
"l2ChainId": 123420111,
167+
"l2BatchId": "309555",
168+
"l2StartBlock": "10760977",
169+
"l2EndBlock": "10762344",
170+
"l2BatchTxCount": 1579,
171+
"l2BlockscoutUrl": "https://opcelestia-raspberry.gelatoscout.com/batches/309555",
172+
"l1TxHash": "0x704b1d4a9934e2123d2d431ff060f4739f478351a95d84e4775e55c08262f2f2",
173+
"l1TxTimestamp": "1724516808",
174+
"relatedBlobs": []
175+
}
65176
```
66177

67178
## Dev

0 commit comments

Comments
 (0)