From a2273b2e4896d674f5c0b7d6ba56a60663e384c1 Mon Sep 17 00:00:00 2001 From: Simon Paitrault Date: Wed, 13 Mar 2024 10:27:59 +0100 Subject: [PATCH] chore: generate readme for topos-tce Signed-off-by: Simon Paitrault --- crates/topos-tce/README.md | 39 ++++++++++++++++++++++++++++++++++++++ scripts/check_readme.sh | 1 + 2 files changed, 40 insertions(+) create mode 100644 crates/topos-tce/README.md diff --git a/crates/topos-tce/README.md b/crates/topos-tce/README.md new file mode 100644 index 000000000..12e7893c1 --- /dev/null +++ b/crates/topos-tce/README.md @@ -0,0 +1,39 @@ +# topos-tce + +This library is the entry point for the TCE node. It is responsible for setting up the +different components of the TCE node and starting them. + +The TCE node is composed of the following components: +- P2P network: [topos_p2p] +- Reliable Broadcast: [topos_tce_broadcast] +- Synchronizer: [topos_tce_synchronizer] +- Storage: [topos_tce_storage] +- APIs: [topos_tce_api] +- Gatekeeper: [topos_tce_gatekeeper] + +This library exposes a single function `launch` that takes a [TceConfig] and a [CancellationToken] +and returns a [Future] that resolves to an [ExitStatus] when the TCE node is shut down. + +### Interactions + +The `topos_tce` crate is responsible for connecting all the different components of the TCE node +together. Different flow are managed by the `AppContext` struct: + + + + Text changing depending on mode. Light: 'So light!' Dark: 'So dark!' + + +##### P2P layer + +After setting up the P2P layer, the `AppContext` will listen for incoming events and dispatch +them to the different components of the TCE node. + +The [AppContext] is listening for [topos_p2p::Event] on a channel. Based on those events the +[AppContext] will decide to forward them to the [topos_tce_broadcast] after checking for state +in the [topos_tce_storage]. + +The [AppContext] will also send message to [topos_p2p] when the [topos_tce_broadcast] is +producing events, those messages are published on the network to support the Topos Protocol. + + diff --git a/scripts/check_readme.sh b/scripts/check_readme.sh index 6d7e76463..8cc4dac39 100755 --- a/scripts/check_readme.sh +++ b/scripts/check_readme.sh @@ -14,3 +14,4 @@ function check { check crates/topos-tce-broadcast check crates/topos-tce-storage +check crates/topos-tce