You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ Inspect connected peers:
50
50
curl -s http://127.0.0.1:8080/peers
51
51
```
52
52
53
-
Look for `replication_blobs_stored`, `replication_bytes_stored`, duplicate counters, and transport frame counters. The sender derives the blob key from `SHA-256(put-data)` when `-put-content-key` is set; receivers verify SHA-256-shaped keys before storing. Use `/metrics` for JSON counters, `/metrics/prometheus` for Prometheus text format, and `/peers` for a sorted peer snapshot.
53
+
Look for `replication_blobs_stored`, `replication_bytes_stored`, duplicate counters, and transport frame counters. The sender derives the blob key from `SHA-256(put-data)` when `-put-content-key` is set; receivers verify SHA-256-shaped keys before storing. Use `/metrics` for JSON counters, `/metrics/prometheus` for Prometheus text format, and `/peers` for sorted peer metadata including remote address, local address, direction, connection timestamp, and connection age.
54
54
55
55
Or run the whole flow:
56
56
@@ -108,7 +108,7 @@ go run . -listen 127.0.0.1:7070 -replicate -store-dir ./streamhive-data
Copy file name to clipboardExpand all lines: docs/ARCHITECTURE.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ flowchart TD
17
17
18
18
## Layers
19
19
20
-
1.**Transport (`p2p`)** — `TCPTransport` with `context.Context` on `ListenAndAccept` / `Dial`, accept-loop shutdown coordinated with `Close`, optional TLS, optional framed reads via `FrameHandler`, metrics, and peer disconnect hooks.
20
+
1.**Transport (`p2p`)** — `TCPTransport` with `context.Context` on `ListenAndAccept` / `Dial`, accept-loop shutdown coordinated with `Close`, optional TLS, optional framed reads via `FrameHandler`, metrics, peer snapshots, and peer disconnect hooks.
21
21
2.**Framing (`p2p`)** — `SHV1` length-prefixed payloads (`ReadFrame` / `WriteFrame`) with a configurable maximum size (DoS bound). Application-level handshake string: `HandshakeVersionV1`.
22
22
3.**Replication (`replication`)** — typed JSON messages carried inside frames. `blob.put` writes one key/value blob to a receiving `BlobStore`; `blob.has`, `blob.get`, and `blob.missing` provide the inventory/request vocabulary for anti-entropy sync.
23
23
4.**Storage (`storage`)** — `BlobStore` interface with `BlobKeyLister` inventory support, `MemoryStore` for tests/demos, and `FileStore` for durable local blobs; SHA-256 helpers provide stable content-addressed keys.
@@ -137,7 +137,7 @@ Implemented:
137
137
- Message types: `blob.put`, `blob.has`, `blob.get`, and `blob.missing`.
138
138
- Startup anti-entropy for connected `-replicate` peers.
139
139
- Receiver-side storage via `storage.MemoryStore` or durable `storage.FileStore` with `-store-dir`.
140
-
- JSON `/peers` snapshots for connected peer addresses/direction.
140
+
- JSON `/peers` snapshots for connected peer addresses, direction, connection timestamp, and connection age.
141
141
- JSON `/metrics` counters for stored/sent blobs, bytes, duplicates, and replication errors.
- **Peer visibility**: `/peers` returns active connected peers and whether each connection is outbound.
107
+
- **Peer visibility**: `/peers` returns active connected peers with remote address, local address, direction, connection timestamp, and connection age.
108
108
- **Saturation**: JSON `/metrics` fields `active_peers` and `peers_rejected`, or Prometheus samples from `/metrics/prometheus`.
0 commit comments