This design was originally thought for trin, but I realized that it can extend to Ethereum nodes in general.
I'll base my design on docs I've found useful in the past: Reth and Lighthouse. I believe these are especially relevant as they are software similar to the Portal Clients. Additionally, I'll try to connect these designs with a more standardized approach: Diátaxis.
This framework is based on the idea that technical documentation can be classified into four types:
While this framework doesn't specify the actual structure (where content should be placed), I believe it makes sense to keep these four types of documents separate.
Reth's documentation is available in three locations:
The documentation in the book is primarily focused on users. It includes information on installing Reth, running a node, interacting with the network, and the output of all the --help
commands of the CLI.
reth/docs
contains information relevant to contributors. It covers details about the program's architecture, design, and the contribution process.
The other documentation is somewhat hidden. You need to download the repository and execute cargo doc --open
. Other crates have their documentation on docs.rs. Although Reth also has docs published there, they appear to be outdated compared to locally built documentation. Specific information about certain aspects of the code is included here.
Lighthouse's documentation can be found in The Lighthouse Book. Here, you can find information on using it (from installation to setting up a validator), details about the APIs, advanced usage guides, and information on how to contribute.
While Lighthouse features excellent in-code documentation, there are no documents published on docs.rs.
Let's start with the obvious: in-code comments/docs fulfill the reference role proposed by Diátaxis. They should be published to docs.rs or equivalent platforms for other languages.
The design and architecture documentation found in reth/docs
can be considered explanations.
Tutorials and how-to guides are present in the books. However, the distinction between them is not very well defined.
I propose the following structure for documenting this kind of software:
docs
folder at the root of the repository
This structure allows for the separation of the four types of documentation proposed in Diátaxis, while maintaining related information together.
I encourage a clear distinction between documentation for users and for contributors. Users will rarely be interested in developer documentation. If I want to run a node, I likely won't be interested in learning how to write tests for the client I'm using.
Let's provide an overview of each part:
This documentation is built with tools like cargo doc
. It is written alongside the code and adheres to the principles of writing reference.
This book does not include a reference section. We could maintain this approach or adopt what Reth does by incorporating the output of all --help
commands.
I've chosen not to include a tutorials section here. I don't believe there's anything particularly different about contributing to an Ethereum client. A tutorial here would cover general open-source contribution knowledge, and numerous well-written articles already cover this topic.