Răsfoiți Sursa

book: update event_graph docs

Dastan-glitch 3 ani în urmă
părinte
comite
194cd2e1ff

+ 3 - 5
doc/src/misc/event_graph/event_graph.md

@@ -50,9 +50,7 @@ any nodes in the network to possess it, so A does not need to send an `inv`.
 3. For each $B_i$ in $\{B_1, \dots, B_n\}$:
 3. For each $B_i$ in $\{B_1, \dots, B_n\}$:
     1. Create an `inv` representing the event.
     1. Create an `inv` representing the event.
     2. Broadcast to all connected nodes `p2p.broadcast(inv)`.
     2. Broadcast to all connected nodes `p2p.broadcast(inv)`.
-4. A waits for 3 nodes to respond back with the `inv` confirming they received it.
-5. Until A receives the `inv` confirms, it will wait for 1 minute and then
-   resend the `event` message.
+
 
 
 Upon receiving an `inv`:
 Upon receiving an `inv`:
 
 
@@ -60,8 +58,8 @@ Upon receiving an `inv`:
 2. The node receives `getevent`, and sends `event` back.
 2. The node receives `getevent`, and sends `event` back.
 
 
 So in this diagram, A will send `event` to $B_1, \dots, B_6$. Each $B_i$ will respond
 So in this diagram, A will send `event` to $B_1, \dots, B_6$. Each $B_i$ will respond
-back to A with `inv`, and A will stop sending `event`. Each one of $C_1, \dots, C_3$
-also receive `inv`, and since they don't have the event, they will send back to $B_3$,
+back to A with `inv`. Each one of $C_1, \dots, C_3$ also receive `inv`, 
+and since they don't have the event, they will send back to $B_3$,
 a `getevent` message. $B_3$ will send them the `event`.
 a `getevent` message. $B_3$ will send them the `event`.
 
 
 ## Genesis Event
 ## Genesis Event

+ 2 - 3
doc/src/misc/event_graph/network_protocol.md

@@ -34,12 +34,11 @@ Event object data. This is either sent when a new event is created, or in respon
 |-------------- | -------------------- | -------------------------- |
 |-------------- | -------------------- | -------------------------- |
 | parents	  	| `Vec<EventId>`       | Parent events      		|
 | parents	  	| `Vec<EventId>`       | Parent events      		|
 | timestamp 	| `u64`                | Event timestamp    		|
 | timestamp 	| `u64`                | Event timestamp    		|
-| action    	| `u8`                 | Type of event      		|
-| data      	| `Vec<u8>`            | Event specific data		|
+| action    	| `T`                  | Event specific data      	|
 
 
 ## getheads
 ## getheads
 
 
-This message is *only* sent the first time a node connects to the network.
+This message is sent at fixed intervals when connecting to the network.
 It uses this message to synchronize with the current network state.
 It uses this message to synchronize with the current network state.
 
 
 Once updated, a node uses the messages above to stay synchronized.
 Once updated, a node uses the messages above to stay synchronized.