Skip to content

Commit 8e0caec

Browse files
authored
Docs Cleanup / Cautious Restructuring / README ToCs (#4010)
* A somewhat more useful EVM EIP activation example (now with 7702 being active by default) * Same for VM * Add prominent v10 README header additions * Add README ToC, eventually restructure (binarytree) * Add README ToC, eventually restructure (block) * Add README ToC, eventually restructure (blockchain) * Add README ToC, eventually restructure (common) * Add README ToC, eventually restructure (devp2p) * Add README ToC, eventually restructure (era) * Add README ToC, eventually restructure (ethash) * Some EVM README section reordering * Add README ToC, eventually restructure (EVM) * Add README ToC, eventually restructure (genesis) * Add README ToC, eventually restructure (mpt) * Add README ToC, eventually restructure (rlp) * Add README ToC, eventually restructure (statemanager) * Add README ToC, eventually restructure (tx) * Add sub-ToC for tx types * Add README ToC, eventually restructure (util) * Add README ToC, eventually restructure (verkle) * Add README ToC, eventually restructure (vm) * Add README ToC, eventually restructure (wallet) * Undo robot nonsense
1 parent c6deb4e commit 8e0caec

File tree

19 files changed

+448
-233
lines changed

19 files changed

+448
-233
lines changed

packages/binarytree/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# @ethereumjs/binarytree
1+
# @ethereumjs/binarytree `v10`
22

33
[![NPM Package][binarytree-npm-badge]][binarytree-npm-link]
44
[![GitHub Issues][binarytree-issues-badge]][binarytree-issues-link]
@@ -13,6 +13,12 @@
1313
1414
This package is currently in early alpha and is a work in progress. It is not intended for use in production environments, but rather for research and development purposes. Any help in improving the package is very much welcome.
1515

16+
## Table of Contents
17+
18+
- [Installation](#installation)
19+
- [EthereumJS](#ethereumjs)
20+
- [License](#license)
21+
1622
## Installation
1723

1824
To obtain the latest version, simply install the project using `npm`:

packages/block/README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# @ethereumjs/block
1+
# @ethereumjs/block `v10`
22

33
[![NPM Package][block-npm-badge]][block-npm-link]
44
[![GitHub Issues][block-issues-badge]][block-issues-link]
@@ -9,6 +9,17 @@
99
| Implements schema and functions related to Ethereum blocks. |
1010
| ----------------------------------------------------------- |
1111

12+
## Table of Contents
13+
14+
- [Installation](#installation)
15+
- [Getting Started](#getting-started)
16+
- [EIP Integrations](#eip-integrations)
17+
- [Consensus Types](#consensus-types)
18+
- [Browser](#browser)
19+
- [API](#api)
20+
- [Testing](#testing)
21+
- [EthereumJS](#ethereumjs)
22+
- [License](#license)
1223

1324
## Installation
1425

@@ -20,9 +31,9 @@ npm install @ethereumjs/block
2031

2132
**Note:** If you want to work with `EIP-4844` related functionality, you will have additional initialization steps for the **KZG setup**, see related section below.
2233

23-
## Usage
34+
## Getting Started
2435

25-
### Introduction
36+
### Instantiation
2637

2738
There are several standalone functions to instantiate a `Block`:
2839

@@ -82,7 +93,9 @@ try {
8293

8394
This library by default uses JavaScript implementations for the basic standard crypto primitives like hashing or signature verification (for included txs). See `@ethereumjs/common` [README](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common) for instructions on how to replace with e.g. a more performant WASM implementation by using a shared `common` instance.
8495

85-
### EIP-1559 Blocks
96+
## EIP Integrations
97+
98+
### Blocks with an EIP-1559 Fee Market
8699

87100
By default (since `Hardfork.London`) blocks created with this library are [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) compatible.
88101

@@ -141,7 +154,7 @@ try {
141154
}
142155
```
143156

144-
### EIP-4895 Beacon Chain Withdrawals Blocks
157+
### Blocks with EIP-4895 Beacon Chain Withdrawals
145158

146159
Starting with the `v4.1.0` release there is support for [EIP-4895](https://eips.ethereum.org/EIPS/eip-4895) beacon chain withdrawals (`Hardfork.Shanghai` or higher). To create a block containing system-level withdrawals, the `withdrawals` data option together with a matching `withdrawalsRoot` can be used:
147160

@@ -182,7 +195,7 @@ console.log(`Block with ${block.withdrawals!.length} withdrawal(s) created`)
182195

183196
Validation of the withdrawals trie can be manually triggered with the newly introduced async `Block.withdrawalsTrieIsValid()` method.
184197

185-
### EIP-4844 Shard Blob Transaction Blocks
198+
### Blocks with EIP-4844 Shard Blob Transactions
186199

187200
This library supports the blob transaction type introduced with [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844) (`Hardfork.Cancun` or higher), see the following example:
188201

packages/blockchain/README.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# @ethereumjs/blockchain
1+
# @ethereumjs/blockchain `v10`
22

33
[![NPM Package][blockchain-npm-badge]][blockchain-npm-link]
44
[![GitHub Issues][blockchain-issues-badge]][blockchain-issues-link]
@@ -9,6 +9,18 @@
99
| A module to store and interact with blocks. |
1010
| ------------------------------------------- |
1111

12+
## Table of Contents
13+
14+
- [Installation](#installation)
15+
- [Getting Started](#getting-started)
16+
- [EIP Integrations](#eip-integrations)
17+
- [Consensus Types](#consensus-types)
18+
- [Browser](#browser)
19+
- [API](#api)
20+
- [Testing](#testing)
21+
- [EthereumJS](#ethereumjs)
22+
- [License](#license)
23+
1224
## Installation
1325

1426
To obtain the latest version, simply install the project using `npm`:
@@ -19,7 +31,7 @@ npm install @ethereumjs/blockchain
1931

2032
**Note:** If you want to work with `EIP-4844` related functionality, you will have additional initialization steps for the **KZG setup**, see related section below.
2133

22-
## Usage
34+
## Getting Started
2335

2436
### Introduction
2537

@@ -29,7 +41,7 @@ New blocks can be added to the blockchain. Validation ensures that the block for
2941

3042
The library also supports reorg scenarios e.g. by allowing to add a new block with `Blockchain.putBlock()` which follows a different canonical path to the head than given by the current canonical head block.
3143

32-
## Example
44+
## Examples
3345

3446
The following is an example to instantiate a simple Blockchain object, put blocks into the blockchain and then iterate through the blocks added:
3547

@@ -88,6 +100,10 @@ const main = async () => {
88100
void main()
89101
```
90102

103+
More examples can be found in the [examples](./examples/) folder.
104+
105+
## Setup
106+
91107
### Block Storage
92108

93109
For storing blocks different backends can be used. The database needs to conform to the [DB](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/db.ts) interface provided in the `@ethereumjs/util` package (since this is used in other places as well).

packages/common/README.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# @ethereumjs/common
1+
# @ethereumjs/common `v10`
22

33
[![NPM Package][common-npm-badge]][common-npm-link]
44
[![GitHub Issues][common-issues-badge]][common-issues-link]
@@ -9,6 +9,21 @@
99
| Resources common to all EthereumJS implementations. |
1010
| --------------------------------------------------- |
1111

12+
## Table of Contents
13+
14+
- [Installation](#installation)
15+
- [Getting Started](#getting-started)
16+
- [Custom Cryptography Primitives (WASM)](#custom-cryptography-primitives-wasm)
17+
- [Browser](#browser)
18+
- [API](#api)
19+
- [Events](#events)
20+
- [Chains and Genesis](#chains-and-genesis)
21+
- [Working with Private/Custom Chains](#working-with-privatecustom-chains)
22+
- [Hardfork Support and Usage](#hardfork-support-and-usage)
23+
- [Supported EIPs](#supported-eips)
24+
- [EthereumJS](#ethereumjs)
25+
- [License](#license)
26+
1227
## Installation
1328

1429
To obtain the latest version, simply require the project using `npm`:
@@ -17,7 +32,7 @@ To obtain the latest version, simply require the project using `npm`:
1732
npm install @ethereumjs/common
1833
```
1934

20-
## Usage
35+
## Getting Started
2136

2237
### import / require
2338

@@ -71,7 +86,7 @@ const commonWithCustomChainId = createCustomCommon({ chainId: 1234 }, Mainnet)
7186
console.log(`The current chain ID is ${commonWithCustomChainId.chainId()}`)
7287
```
7388

74-
### Custom Cryptography Primitives (WASM)
89+
## Custom Cryptography Primitives (WASM)
7590

7691
All EthereumJS packages use cryptographic primitives from the audited `ethereum-cryptography` library by default. These primitives, including `keccak256`, `sha256`, and elliptic curve signature methods, are all written in native JavaScript and therefore have the potential downside of being less performant than alternative cryptography modules written in other languages and then compiled to WASM. If cryptography performance is a bottleneck in your usage of the EthereumJS libraries, you can provide your own primitives to the `Common` constructor and they will be used in place of the defaults. Depending on how your preferred primitives are implemented, you may need to write wrapper methods around them so they conform to the interface exposed by the [`common.customCrypto` property](./src/types.ts).
7792

@@ -170,9 +185,7 @@ The `Common` class has a public property `events` which contains an `EventEmitte
170185
| ----------------- | ---------------------------------------------------------- |
171186
| `hardforkChanged` | Emitted when a hardfork change occurs in the Common object |
172187

173-
## Setup
174-
175-
### Chains
188+
### Chains and Genesis
176189

177190
The `chain` can be set in the constructor like this:
178191

@@ -255,7 +268,7 @@ common.setForkHashes(genesisHash)
255268
console.log(`The London forkhash for this custom chain is ${common.forkHash('london')}`)
256269
```
257270

258-
### Hardforks
271+
## Hardfork Support and Usage
259272

260273
The `hardfork` can be set in constructor like this:
261274

@@ -309,7 +322,7 @@ See one of the hardfork configurations in the `hardforks.ts` file
309322
for an overview. For consistency, the chain start (`chainstart`) is considered an own
310323
hardfork.
311324

312-
### EIPs
325+
## Supported EIPs
313326

314327
EIPs are native citizens within the library and can be activated like this:
315328

@@ -356,10 +369,6 @@ The following EIPs are currently supported:
356369
- [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) - Set EOA account code (Prague)
357370
- [EIP-7709](https://eips.ethereum.org/EIPS/eip-7709) - Read BLOCKHASH from storage and update cost (Verkle)
358371

359-
### Bootstrap Nodes
360-
361-
You can use `common.bootstrapNodes()` function to get nodes for a specific chain/network.
362-
363372
## EthereumJS
364373

365374
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.

packages/devp2p/README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
1-
# @ethereumjs/devp2p
1+
# @ethereumjs/devp2p `v10`
22

33
[![NPM Status][devp2p-npm-badge]][devp2p-npm-link]
44
[![GitHub Issues][devp2p-issues-badge]][devp2p-issues-link]
55
[![Actions Status][devp2p-actions-badge]][devp2p-actions-link]
66
[![Coverage Status][devp2p-coverage-badge]][devp2p-coverage-link]
77
[![Discord][discord-badge]][discord-link]
88

9-
## Introduction
10-
119
This library bundles different components for lower-level peer-to-peer connection and message exchange:
1210

1311
- Distributed Peer Table (DPT) / v4 Node Discovery / DNS Discovery
1412
- RLPx Transport Protocol
1513
- Ethereum Wire Protocol (ETH/68)
1614

17-
## Usage
15+
## Table of Contents
16+
17+
- [Getting Started](#getting-started)
18+
- [Examples](#examples)
19+
- [API](#api)
20+
- [Distributed Peer Table (DPT) / Node Discovery](#distributed-peer-table-dpt--node-discovery)
21+
- [RLPx Transport Protocol](#rlpx-transport-protocol)
22+
- [Ethereum Wire Protocol (ETH)](#ethereum-wire-protocol-eth)
23+
- [Debugging](#debugging)
24+
- [Developer](#developer)
25+
- [General References](#general-references)
26+
- [EthereumJS](#ethereumjs)
27+
- [License](#license)
28+
29+
## Getting Started
1830

1931
All components of this library have a public `events` property containing an `EventEmitter` object (using [EventEmitter3](https://github.com/primus/eventemitter3))
2032
and make heavy use of the Node.js network stack.
@@ -43,7 +55,7 @@ Run an example with:
4355
DEBUG=ethjs,devp2p:* node -r tsx/register ./examples/peer-communication.cts
4456
```
4557

46-
## Docs
58+
## API
4759

4860
For a complete API reference see the generated [documentation](./docs).
4961

packages/era/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# @ethereumjs/era
1+
# @ethereumjs/era `v10`
22

33
[![NPM Package][era-npm-badge]][era-npm-link]
44
[![GitHub Issues][era-issues-badge]][era-issues-link]
@@ -9,6 +9,13 @@
99
| A collection of utility functions for Ethereum. |
1010
| ----------------------------------------------- |
1111

12+
## Table of Contents
13+
14+
- [Installation](#installation)
15+
- [Usage](#usage)
16+
- [EthereumJS](#ethereumjs)
17+
- [License](#license)
18+
1219
## Installation
1320

1421
To obtain the latest version, simply require the project using `npm`:

packages/ethash/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# @ethereumjs/ethash
1+
# @ethereumjs/ethash `v10`
22

33
[![NPM Package][ethash-npm-badge]][ethash-npm-link]
44
[![GitHub Issues][ethash-issues-badge]][ethash-issues-link]
@@ -9,6 +9,14 @@
99
| [Ethash](https://github.com/ethereum/wiki/wiki/Ethash) implementation in TypeScript. |
1010
| ------------------------------------------------------------------------------------ |
1111

12+
## Table of Contents
13+
14+
- [Installation](#installation)
15+
- [Usage](#usage)
16+
- [API](#api)
17+
- [EthereumJS](#ethereumjs)
18+
- [License](#license)
19+
1220
## Installation
1321

1422
To obtain the latest version, simply require the project using `npm`:
@@ -106,7 +114,7 @@ Using ESM will give you additional advantages over CJS beyond browser usage like
106114

107115
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.
108116

109-
# LICENSE
117+
## License
110118

111119
[MPL-2.0](<https://tldrlegal.com/license/mozilla-public-license-2.0-(mpl-2)>)
112120

0 commit comments

Comments
 (0)