You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+86-19
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,9 @@ As of July 5, 2024, the initial open-source version of the Hemera Indexer offers
17
17
18
18
## Features Offered
19
19
20
-
##### Export the following entities
20
+
#### Exportable Entities
21
+
22
+
The system can export the following entities:
21
23
22
24
- Blocks
23
25
- Transactions
@@ -33,13 +35,80 @@ As of July 5, 2024, the initial open-source version of the Hemera Indexer offers
33
35
- DA Transactions
34
36
- User Operations
35
37
36
-
##### Into the following formats
38
+
#### Supported Export Formats
39
+
40
+
The data can be exported into the following formats:
37
41
38
42
- Postgresql SQL
39
43
- JSONL
40
44
- CSV
41
45
42
-
##### Additional features
46
+
#### Output Types and Entity Types Explanation
47
+
48
+
##### Entity Types
49
+
50
+
Entity Types are high-level categories that group related data models. They are defined in the `EntityType` enum and can be combined using bitwise operations.
51
+
52
+
##### Key Points:
53
+
- Specified using the `-E` or `--entity-types` option
54
+
- Examples: EXPLORER_BASE, EXPLORER_TOKEN, EXPLORER_TRACE, etc.
55
+
- Multiple types can be combined using commas
56
+
57
+
##### Output Types
58
+
59
+
Output Types correspond to more detailed data models and are typically associated with specific Entity Types.
60
+
61
+
##### Key Points:
62
+
- Specified using the `-O` or `--output-types` option
63
+
- Examples: Block, Transaction, Log, Token, AddressTokenBalance, etc.
64
+
- Takes precedence over Entity Types if specified
65
+
- Directly corresponds to data class names in the code (Domain)
66
+
67
+
##### Relationship between Entity Types and Output Types
68
+
69
+
1. Entity Types are used to generate a set of Output Types:
70
+
- The `generate_output_types` function maps Entity Types to their corresponding Output Types.
71
+
- Each Entity Type yields a set of related data classes (Output Types).
72
+
73
+
2. When specifying Output Types directly:
74
+
- It overrides the Entity Type selection.
75
+
- Allows for more granular control over the exported data.
76
+
77
+
#### Output Types and Data Classes
78
+
79
+
It's important to note that when using the `--output-types` option, you should specify the names that directly correspond to the data class names in the code. For example:
These names should match exactly with the data class definitions in your codebase. The Output Types are essentially the same as the data class names, allowing for precise selection of the data models you wish to export.
86
+
87
+
#### Usage Examples
88
+
89
+
1. Using Entity Types:
90
+
```
91
+
--entity-types EXPLORER_BASE,EXPLORER_TOKEN
92
+
```
93
+
This will generate Output Types including Block, Transaction, Log, Token, ERC20TokenTransfer, etc.
94
+
95
+
2. Using Output Types:
96
+
```
97
+
--output-types Block,Transaction,Token
98
+
```
99
+
This will only generate the specified Output Types, regardless of Entity Types.
100
+
101
+
#### Note
102
+
103
+
When developing or using this system, consider the following:
104
+
- Entity Types provide a broader, category-based selection of data.
105
+
- Output Types offer more precise control over the exact data models to be exported.
106
+
- The choice between using Entity Types or Output Types depends on the specific requirements of the data export task.
107
+
108
+
109
+
These names should match exactly with the data class definitions in your codebase. The Output Types are essentially the same as the data class names, allowing for precise selection of the data models you wish to export.
110
+
111
+
#### Additional features
43
112
44
113
- Ability to select arbitrary block ranges for more flexible data indexing
45
114
- Option to choose any entities for targeted data extraction
@@ -232,23 +301,22 @@ Follow the instructions about how to set up a PostgreSQL database here: [Setup P
232
301
233
302
Configure the `OUTPUT` or `--output` parameter according to your PostgreSQL role information. Check out [Configure Hemera Indexer](#output-or---output) for details.
234
303
235
-
E.g. `postgresql+psycopg2://${YOUR_USER}:${YOUR_PASSWORD}@${YOUR_HOST}:5432/${YOUR_DATABASE}`.
304
+
E.g. `postgresql://${YOUR_USER}:${YOUR_PASSWORD}@${YOUR_HOST}:5432/${YOUR_DATABASE}`.
236
305
237
306
#### Run
238
307
239
308
Please check out [Configure Hemera Indexer](#configure-hemera-indexer) on how to configure the indexer.
You will be able to find those results in the `output` folder of your current location.
@@ -367,7 +434,7 @@ The URI of the web3 debug rpc provider, e.g. `file://$HOME/Library/Ethereum/geth
367
434
#### `POSTGRES_URL` or `--postgres-url` or `-pg`
368
435
369
436
[**Required**]
370
-
The PostgreSQL connection URL that the Hemera Indexer used to maintain its state. e.g. `postgresql+psycopg2://user:[email protected]:5432/postgres`.
437
+
The PostgreSQL connection URL that the Hemera Indexer used to maintain its state. e.g. `postgresql://user:[email protected]:5432/postgres`.
371
438
372
439
#### `OUTPUT` or `--output` or `-o`
373
440
@@ -379,19 +446,19 @@ The file location will be relative to your current location if you run from sour
379
446
380
447
e.g.
381
448
382
-
-`postgresql+psycopg2://user:password@localhost:5432/hemera_indexer`: Output will be exported to your postgres.
449
+
-`postgresql://user:password@localhost:5432/hemera_indexer`: Output will be exported to your postgres.
383
450
-`jsonfile://output/json`: Json files will be exported to folder `output/json`
384
451
-`csvfile://output/csv`: Csv files will be exported to folder `output/csv`
385
452
-`console,jsonfile://output/json,csvfile://output/csv`: Multiple destinations are supported.
386
453
387
454
#### `ENTITY_TYPES` or `--entity-types` or `-E`
388
455
389
-
[**Default**: `EXPLORER_BASE,EXPLORER_TOKEN`]
456
+
[**Default**: `EXPLORER_BASE`]
390
457
The list of entity types to export. e.g. `EXPLORER_BASE`, `EXPLORER_TOKEN`, `EXPLORER_TRACE`.
391
458
392
459
#### `OUTPUT_TYPES` or `--output-types` or `-O`
393
460
394
-
The list of output types to export, corresponding to more detailed data models. Specifying this option will prioritize these settings over the entity types specified in -E. Available options include: block, transaction, log, token, address_token_balance, erc20_token_transfer, erc721_token_transfer, erc1155_token_transfer, trace, contract, coin_balance.
461
+
The list of output types to export, corresponding to more detailed data models. Specifying this option will prioritize these settings over the entity types specified in -E. Available options include: Block, Transaction, Log, Token, AddressTokenBalance, etc.
395
462
396
463
You may spawn up multiple Hemera Indexer processes, each of them specifying different output types to accelerate the indexing process. For example, indexing `trace` data may take much longer than other entities, you may want to run a separate process to index `trace` data. Checkout `docker-compose/docker-compose.yaml` for examples.
Copy file name to clipboardExpand all lines: docs/README.md
+24-35
Original file line number
Diff line number
Diff line change
@@ -227,23 +227,22 @@ Follow the instructions about how to set up a PostgreSQL database here: [Setup P
227
227
228
228
Configure the `OUTPUT` or `--output` parameter according to your PostgreSQL role information. Check out [Configure Hemera Indexer](#output-or---output) for details.
229
229
230
-
E.g. `postgresql+psycopg2://${YOUR_USER}:${YOUR_PASSWORD}@${YOUR_HOST}:5432/${YOUR_DATABASE}`.
230
+
E.g. `postgresql://${YOUR_USER}:${YOUR_PASSWORD}@${YOUR_HOST}:5432/${YOUR_DATABASE}`.
231
231
232
232
#### Run
233
233
234
234
Please check out [Configure Hemera Indexer](#configure-hemera-indexer) on how to configure the indexer.
You will be able to find those results in the `output` folder of your current location.
@@ -349,7 +347,19 @@ The URI of the web3 debug rpc provider, e.g. `file://$HOME/Library/Ethereum/geth
349
347
#### `POSTGRES_URL` or `--postgres-url`
350
348
351
349
[**Required**]
352
-
The PostgreSQL connection URL that the Hemera Indexer used to maintain its state. e.g. `postgresql+psycopg2://user:[email protected]:5432/postgres`.
350
+
The PostgreSQL connection URL that the Hemera Indexer used to maintain its state. e.g. `postgresql://user:[email protected]:5432/postgres`.
351
+
352
+
353
+
#### `ENTITY_TYPES` or `--entity-types` or `-E`
354
+
355
+
[**Default**: `EXPLORER_BASE`]
356
+
The list of entity types to export. e.g. `EXPLORER_BASE`, `EXPLORER_TOKEN`, `EXPLORER_TRACE`.
357
+
358
+
#### `OUTPUT_TYPES` or `--output-types` or `-O`
359
+
360
+
The list of output types to export, corresponding to more detailed data models. Specifying this option will prioritize these settings over the entity types specified in -E. Available options include: Block, Transaction, Log, Token, AddressTokenBalance, etc.
361
+
362
+
You may spawn up multiple Hemera Indexer processes, each of them specifying different output types to accelerate the indexing process. For example, indexing `trace` data may take much longer than other entities, you may want to run a separate process to index `trace` data. Checkout `docker-compose/docker-compose.yaml` for examples.
353
363
354
364
#### `OUTPUT` or `--output`
355
365
@@ -361,32 +371,11 @@ The file location will be relative to your current location if you run from sour
361
371
362
372
e.g.
363
373
364
-
-`postgresql+psycopg2://user:password@localhost:5432/hemera_indexer`: Output will be exported to your postgres.
374
+
-`postgresql://user:password@localhost:5432/hemera_indexer`: Output will be exported to your postgres.
365
375
-`jsonfile://output/json`: Json files will be exported to folder `output/json`
366
376
-`csvfile://output/csv`: Csv files will be exported to folder `output/csv`
367
377
-`console,jsonfile://output/json,csvfile://output/csv`: Multiple destinations are supported.
Hemera Indexer will export those entity types to your database and files(if `OUTPUT` is specified).
373
-
Full list of available entity types:
374
-
375
-
-`block`
376
-
-`transaction`
377
-
-`log`
378
-
-`token`
379
-
-`token_transfer`
380
-
-`trace`
381
-
-`contract`
382
-
-`coin_balance`
383
-
-`token_balance`
384
-
-`token_ids`
385
-
386
-
If you didn't specify this parameter, the default entity types will be BLOCK,TRANSACTION,LOG,TOKEN,TOKEN_TRANSFER.
387
-
388
-
You may spawn up multiple Hemera Indexer processes, each of them indexing different entity types to accelerate the indexing process. For example, indexing `trace` data may take much longer than other entities, you may want to run a separate process to index `trace` data. Checkout `docker-compose/docker-compose.yaml` for examples.
0 commit comments