mirror of
https://github.com/Cuprate/cuprate.git
synced 2024-12-22 03:29:25 +00:00
start docs, targets
This commit is contained in:
parent
e3a918bca5
commit
890f4654f3
5 changed files with 66 additions and 4 deletions
|
@ -81,8 +81,7 @@
|
|||
---
|
||||
|
||||
- [🔴 Instrumentation](instrumentation/intro.md)
|
||||
- [⚪️ Logging](instrumentation/logging.md)
|
||||
- [⚪️ Data collection](instrumentation/data-collection.md)
|
||||
- [⚪️ Targets](instrumentation/targets.md)
|
||||
|
||||
---
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
# ⚪️ Data collection
|
|
@ -1,2 +1,6 @@
|
|||
# Instrumentation
|
||||
Cuprate is built with [instrumentation](https://en.wikipedia.org/wiki/Instrumentation) in mind.
|
||||
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.
|
60
books/architecture/src/instrumentation/targets.md
Normal file
60
books/architecture/src/instrumentation/targets.md
Normal 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
BIN
p2p_state.bin
Normal file
Binary file not shown.
Loading…
Reference in a new issue