on master help sign in
Update out-of-date code and explanations for `sur/graph-store.hoon`
commitc0efb8c4330541567f5aaffaf0674d9050443f3c authorYaseen <yaseen.nvt@gmail.com> dateWed 7 Apr 2021, 12:42 (6 years ago) parent7fd12af
1 file changed+22−29
userspace/graph-store/sur-file-walkthrough.md+22−29
userspace/graph-store/sur-file-walkthrough.md+22−29
@@ -149,15 +149,18 @@ Here's `sur/graph-store.hoon`
149149+$ node [=post children=internal-graph]
150150+$ graphs (map resource marked-graph)
151151::
152++$ tag-queries (jug term resource)
153+::
154++$ update-log ((mop time logged-update) gth)
155++$ update-logs (map resource update-log)
156+::
157+::
152158+$ internal-graph
153159 $~ [%empty ~]
154160 $% [%graph p=graph]
155161 [%empty ~]
156162 ==
157163::
158−+$ tag-queries (jug term resource)
159−::
160−::
161164+$ network
162165 $: =graphs
163166 =tag-queries
@@ -166,18 +169,12 @@ Here's `sur/graph-store.hoon`
166169 validators=(set mark)
167170 ==
168171::
169−+$ update
170− $% [%0 p=time q=update-0]
171− ==
172−::
173−+$ update-log ((mop time logged-update) gth)
174−+$ update-logs (map resource update-log)
172++$ update [p=time q=action]
175173::
176−+$ logged-update
177− $% [%0 p=time q=logged-update-0]
178− ==
174++$ logged-update [p=time q=logged-action]
175+
179176::
180−+$ logged-update-0
177++$ logged-action
181178 $% [%add-graph =resource =graph mark=(unit mark) overwrite=?]
182179 [%add-nodes =resource nodes=(map index node)]
183180 [%remove-nodes =resource indices=(set index)]
@@ -185,10 +182,8 @@ Here's `sur/graph-store.hoon`
185182 [%remove-signatures =uid =signatures]
186183 ==
187184::
188−
189−
190−+$ update-0
191− $% logged-update-0
185++$ action
186+ $% logged-action
192187 [%remove-graph =resource]
193188 ::
194189 [%add-tag =term =resource]
@@ -216,6 +211,7 @@ Here's `sur/graph-store.hoon`
216211:: %yes: May add a node or remove node
217212+$ permission-level
218213 ?(%no %self %yes)
214+::
219215```
220216
221217### Graph, Node, and Related Objects
@@ -273,11 +269,9 @@ Here are some helpful Wikipedia pages for more info on what this data type repre
273269
274270### Update (Part 1)
275271```
276−+$ update
277− $% [%0 p=time q=update-0]
278− ==
272++$ update [p=time q=action]
279273::
280−+$ logged-update-0
274++$ logged-action
281275 $% [%add-graph =resource =graph mark=(unit mark) overwrite=?]
282276 [%add-nodes =resource nodes=(map index node)]
283277 [%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
285279 [%remove-signatures =uid =signatures]
286280 ==
287281::
288−+$ update-0
289− $% logged-update-0
282++$ action
283+ $% logged-action
290284 [%remove-graph =resource]
291285 ::
292286 [%add-tag =term =resource]
@@ -302,21 +296,20 @@ Here are some helpful Wikipedia pages for more info on what this data type repre
302296 [%tags tags=(set term)]
303297 [%tag-queries =tag-queries]
304298 ==
305−--
299+::
306300```
307301
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.
309303
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)
311305
312306### Update (Part 2)
313307```
314308+$ update-log ((mop time logged-update) gth)
315309+$ update-logs (map resource update-log)
316310::
317−+$ logged-update
318− $% [%0 p=time q=logged-update-0]
319− ==
311+::
312++$ logged-update [p=time q=logged-action]
320313::
321314```
322315