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
`@ethereumjs/e2store` provides utilities for working with Ethereum data storage formats, including E2HS, Era1, and Era files. These formats are commonly used for storing historical blockchain data, beacon states, and block data in an efficient, provable, and standardized way.
-[Export History as Era1](#export-history-as-era1)
20
+
-[E2HS](#e2hs)
21
+
-[Format E2HS](#format-e2hs)
22
+
-[Read Tuples from E2HS](#read-tuples-from-e2hs)
23
+
-[Read E2HS Tuple at Index](#read-e2hs-tuple-at-index)
24
+
-[Era1](#era1)
25
+
-[Export History as Era1](#export-history-as-era1)
19
26
-[Read Era1 file](#read-era1-file)
20
-
-[Read Era file](#read-era-file)
27
+
-[Era](#era)
28
+
-[Read Era file](#read-era-file)
29
+
-[Common Use Cases](#common-use-cases)
21
30
-[EthereumJS](#ethereumjs)
22
31
-[License](#license)
23
32
@@ -37,23 +46,69 @@ All helpers are re-exported from the root level and deep imports are not necessa
37
46
import { formatEntry } from"@ethereumjs/e2store"
38
47
```
39
48
40
-
### Export History as Era1
49
+
### E2HS
50
+
51
+
E2HS is a format for storing historical blockchain data along with proofs. It provides efficient access to block headers, bodies, and receipts, and can be used to bootstrap a Portal History Network DB.
52
+
53
+
#### Format E2HS
54
+
55
+
```ts
56
+
import { formatE2HS } from"@ethereumjs/e2store"
57
+
58
+
// Format data into E2HS format
59
+
// data is an array of block tuple data and an epoch index
Era1 files store historical data in epochs of 8192 blocks, making it efficient to access large ranges of historical data. Era1 block tuples contain a header, body, receipts, and total difficulty. The data can be verified by reconstructing the epoch accumulator, and validating again the accumulator root, also contained in the era1 file.
41
94
42
-
Export history in epochs of 8192 blocks as Era1 files
95
+
#### Export History as Era1
96
+
97
+
Export history from an EthereumJS client DB in epochs of 8192 blocks as Era1 files:
1.**Historical Data Access**: Use E2HS and Era1 formats to efficiently access historical blockchain data
175
+
2.**Beacon Chain Analysis**: Read and analyze beacon chain states and blocks using Era files
176
+
3.**Data Export**: Export historical data in standardized formats for analysis or archival
177
+
4.**Portal History Network**: Bootstrap a Portal History Network DB using E2HS
178
+
5.**Execution Client Sync**: Sync an execution client without devp2p using Era1 or E2HS files
179
+
109
180
## EthereumJS
110
181
111
182
See our organizational [documentation](https://ethereumjs.readthedocs.io) for an introduction to `EthereumJS` as well as information on current standards and best practices. If you want to join for work or carry out improvements on the libraries, please review our [contribution guidelines](https://ethereumjs.readthedocs.io/en/latest/contributing.html) first.
0 commit comments