start docs, targets

This commit is contained in:
Boog900 2024-09-19 03:39:48 +01:00
parent e3a918bca5
commit 890f4654f3
No known key found for this signature in database
GPG key ID: 42AB1287CB0041C2
5 changed files with 66 additions and 4 deletions

View file

@ -81,8 +81,7 @@
---
- [🔴 Instrumentation](instrumentation/intro.md)
- [⚪️ Logging](instrumentation/logging.md)
- [⚪️ Data collection](instrumentation/data-collection.md)
- [⚪️ Targets](instrumentation/targets.md)
---

View file

@ -1 +0,0 @@
# ⚪️ Data collection

View file

@ -1,2 +1,6 @@
# Instrumentation
Cuprate is built with [instrumentation](https://en.wikipedia.org/wiki/Instrumentation) in mind.
The [tracing](https://docs.rs/tracing/latest/tracing/) crate is used to provide "structured, event-based diagnostic information".
As described in the tracing crate docs, there are 3 main concepts: spans, events and subscribers. Small explanations for
each will be included in the following chapters, however you should probably read the tracing docs.

View file

@ -0,0 +1,60 @@
# Targets
The target is described in the `tracing `docs as:
> a string that categorizes part of the system where the span or event occurred.
By default, the `tracing` crate will use the module path as the target, we override this to make it easier for users
to filter logs.
`tracing-subscriber` allows filtering logs based on target prefixes: [Targets](https://docs.rs/tracing-subscriber/0.3.18/tracing_subscriber/filter/targets/struct.Targets.html#).
To reduce potential friction by using custom targets we mimic what module paths would look like by using `::`.
``
### P2P
| Target | Description |
|-------------------------------|---------------------------------------------------------|
| `p2p` | Anything to do with the peer to peer network. |
| `p2p::address_book` | The address book of P2P peers. |
| `p2p::connection` | Anything to do with P2P connections. |
| `p2p::connection::levin` | The levin protocol parser. |
| `p2p::connection::handshaker` | The handshaker handles doing handshakes with new peers. |
| `p2p::connection::task` | The task that maintains the peer connection. |
| `p2p::peer_set` | Contains connected peers. |
| `p2p::outbound_maintainer` | Maintains the outbound connection count. |
| `p2p::inbound_server` | Handles incoming P2P connections. |
| `p2p::block_downloader` | Downloads blocks when we fall behind. |
### Dandelion
| Target | Description |
|---------------------------|---------------------------------|
| `dandelion` | Anything to do with dandelion++ |
| `dandelion::pool_manager` | The dandelion pool manager. |
| `dandelion::router` | The dandelion router. |
### Consensus
| Target | Description |
|-----------------------------|--------------------------------|
| `consensus` | Anything to do with consensus. |
| `consensus::block_verifier` | Block verification. |
| `consensus::tx_verifier` | Transaction verification. |
### Storage
| Target | Description |
|-----------------------|----------------------------------|
| `storage` | Anything to do with storage. |
| `storage::service` | The storage service abstraction. |
| `storage::blockchain` | Blockchain storage. |
| `storage::txpool` | Txpool storage. |
### cuprated
| Target | Description |
|--------------|----------------------------------|
| `blockchain` | |
| `txpool` | |
| | |

BIN
p2p_state.bin Normal file

Binary file not shown.