on master help sign in
Update out-of-date code and explanations for `sur/graph-store.hoon`
c0efb8cYaseen
userspace/graph-store/sur-file-walkthrough.md+22−29
@@ -149,15 +149,18 @@ Here's `sur/graph-store.hoon`
149+$ node [=post children=internal-graph]
149+$ node [=post children=internal-graph]
150+$ graphs (map resource marked-graph)
150+$ graphs (map resource marked-graph)
151::
151::
152++$ tag-queries (jug term resource)
153+::
154++$ update-log ((mop time logged-update) gth)
155++$ update-logs (map resource update-log)
156+::
157+::
152+$ internal-graph
158+$ internal-graph
153 $~ [%empty ~]
159 $~ [%empty ~]
154 $% [%graph p=graph]
160 $% [%graph p=graph]
155 [%empty ~]
161 [%empty ~]
156 ==
162 ==
157::
163::
158−+$ tag-queries (jug term resource)
159−::
160−::
161+$ network
164+$ network
162 $: =graphs
165 $: =graphs
163 =tag-queries
166 =tag-queries
@@ -166,18 +169,12 @@ Here's `sur/graph-store.hoon`
166 validators=(set mark)
169 validators=(set mark)
167 ==
170 ==
168::
171::
169−+$ update
172++$ update [p=time q=action]
170− $% [%0 p=time q=update-0]
171− ==
172−::
173−+$ update-log ((mop time logged-update) gth)
174−+$ update-logs (map resource update-log)
175::
173::
176−+$ logged-update
174++$ logged-update [p=time q=logged-action]
177− $% [%0 p=time q=logged-update-0]
175+
178− ==
179::
176::
180−+$ logged-update-0
177++$ logged-action
181 $% [%add-graph =resource =graph mark=(unit mark) overwrite=?]
178 $% [%add-graph =resource =graph mark=(unit mark) overwrite=?]
182 [%add-nodes =resource nodes=(map index node)]
179 [%add-nodes =resource nodes=(map index node)]
183 [%remove-nodes =resource indices=(set index)]
180 [%remove-nodes =resource indices=(set index)]
@@ -185,10 +182,8 @@ Here's `sur/graph-store.hoon`
185 [%remove-signatures =uid =signatures]
182 [%remove-signatures =uid =signatures]
186 ==
183 ==
187::
184::
188−
185++$ action
189−
190−+$ update-0
191− $% logged-update-0
186+ $% logged-action
192 [%remove-graph =resource]
187 [%remove-graph =resource]
193 ::
188 ::
194 [%add-tag =term =resource]
189 [%add-tag =term =resource]
@@ -216,6 +211,7 @@ Here's `sur/graph-store.hoon`
216:: %yes: May add a node or remove node
211:: %yes: May add a node or remove node
217+$ permission-level
212+$ permission-level
218 ?(%no %self %yes)
213 ?(%no %self %yes)
214+::
219```
215```
220
216
221### Graph, Node, and Related Objects
217### Graph, Node, and Related Objects
@@ -273,11 +269,9 @@ Here are some helpful Wikipedia pages for more info on what this data type repre
273
269
274### Update (Part 1)
270### Update (Part 1)
275```
271```
276−+$ update
272++$ update [p=time q=action]
277− $% [%0 p=time q=update-0]
278− ==
279::
273::
280−+$ logged-update-0
274++$ logged-action
281 $% [%add-graph =resource =graph mark=(unit mark) overwrite=?]
275 $% [%add-graph =resource =graph mark=(unit mark) overwrite=?]
282 [%add-nodes =resource nodes=(map index node)]
276 [%add-nodes =resource nodes=(map index node)]
283 [%remove-nodes =resource indices=(set index)]
277 [%remove-nodes =resource indices=(set index)]
@@ -285,8 +279,8 @@ Here are some helpful Wikipedia pages for more info on what this data type repre
285 [%remove-signatures =uid =signatures]
279 [%remove-signatures =uid =signatures]
286 ==
280 ==
287::
281::
288−+$ update-0
282++$ action
289− $% logged-update-0
283+ $% logged-action
290 [%remove-graph =resource]
284 [%remove-graph =resource]
291 ::
285 ::
292 [%add-tag =term =resource]
286 [%add-tag =term =resource]
@@ -302,21 +296,20 @@ Here are some helpful Wikipedia pages for more info on what this data type repre
302 [%tags tags=(set term)]
296 [%tags tags=(set term)]
303 [%tag-queries =tag-queries]
297 [%tag-queries =tag-queries]
304 ==
298 ==
305−--
299+::
306```
300```
307
301
308−The `update` type is what is used to interact with Graph Store. It is used both to update subscribers with data (outgoing data) and to write to Graph Store itself (incoming data). The first six actions are sent as pokes to graph-store in the form of a `graph-update`, which is an alias for `update` above. All actions defined here allow you to create/read/update/delete various objects in a running Graph Store gall agent. An `update-0` encapsulates all `logged-update-0` (i.e. any `logged-update-0` is an `update-0` but not necessarily the other way around). The last three actions are scries which allow you to ask a Graph Store agent for its current state regarding the three entries.
302+The `update` type is what is used to interact with Graph Store. It is used both to update subscribers with data (outgoing data) and to write to Graph Store itself (incoming data). All actions are meant to be sent as pokes to Graph Store in the form of a `action` (encapsulated by a `graph-update`), except for the last three actions ,`%keys`, `%tags`, and `%tag-queries`, which must be sent scry requests. All actions defined here allow you to create/read/update/delete various objects in a running Graph Store gall agent. An `action` encapsulates all `logged-action`; any `logged-action` is an `action`, but not necessarily the other way around.
309
303
310−If you want to check out a relevant code listing to see how graph store handles these pokes, see [`app/graph-store.hoon#L221-L227`](https://github.com/urbit/urbit/blob/e2ad6e3e9219c8bfad62f27f05c7cac94c9effa8/pkg/arvo/app/graph-store.hoon#L221-L227)
304+If you want to check out a relevant code listing to see how graph store handles these pokes, check out the `graph-update` arm in the poke handler at [`app/graph-store.hoon`](https://github.com/urbit/urbit/blob/e2ad6e3e9219c8bfad62f27f05c7cac94c9effa8/pkg/arvo/app/graph-store.hoon#L221-L227)
311
305
312### Update (Part 2)
306### Update (Part 2)
313```
307```
314+$ update-log ((mop time logged-update) gth)
308+$ update-log ((mop time logged-update) gth)
315+$ update-logs (map resource update-log)
309+$ update-logs (map resource update-log)
316::
310::
311+::
317−+$ logged-update
312++$ logged-update [p=time q=logged-action]
318− $% [%0 p=time q=logged-update-0]
319− ==
320::
313::
321```
314```
322
315