custody: add more types

This commit is contained in:
Philip Monk 2019-10-21 15:41:28 -07:00
parent f970e1c264
commit 87f689f443
No known key found for this signature in database
GPG Key ID: B66E1F02604E44EC
7 changed files with 129 additions and 48 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:466901e624c1515a69a63a7cd11fab0afffeb6caef18ac640f8de44b555f3a00
size 16472260
oid sha256:45626297d4766e10dcee72b28655691ffc917f72855c9a0ea0f00caf9f2d4e48
size 16651919

View File

@ -1,7 +1,3 @@
=> |%
+$ config
[url=@ta =from=number:block:able:jael]
--
:- %say
|= [* config ~]
[%azimuth-tracker-poke %watch config]
|= [* [url=@ta ~] ~]
[%azimuth-tracker-poke %watch url]

View File

@ -1,4 +1,5 @@
/+ *custody, *csv
/+ *custody,
*csv
|= [=key=path =loc=path]
%. ~
%- print-rows

View File

@ -1,30 +0,0 @@
/- spider
/+ *threadio, *azimuth, *custody, *csv
=, thread=thread:libthread
^- imp:spider
|= =bowl:mall
=/ m (thread ,~)
^- form:m
=/ url 'http://eth-mainnet.urbit.org:8545'
=/ key-path /=home/(scot %da now.bowl)/keys/txt
=/ loc-path /=home/(scot %da now.bowl)/locations/txt
=/ vases=(list vase)
%+ select
!, *hoon
(need ship.left)
%^ join
(load:keys key-path)
(load:locations loc-path)
!, *hoon
?& !=(~ ship.left)
=(location.left location.right)
=(%master role.left)
==
=/ ships (turn vases |=(=vase !<(ship vase)))
|- ^- form:m
=* loop $
?~ ships
(pure:m)
;< =point:azimuth bind:m (fetch-point url i.ships)
%- (slog >[i.ships owner.own.point]< ~)
loop(ships t.ships)

View File

@ -1,3 +1,6 @@
:: Parse CSV files with a known schema, then perform queries on the
:: results.
::
|%
++ text
%+ cook

View File

@ -34,7 +34,7 @@
::
+$ shard @udshard
+$ copy ?(%a %b %c)
+$ physical-form ?(%usb %dvd %paper)
+$ physical-form ?(%usb %dvd %paper %ledger)
++ parsers
:~ text:csv
(punt fed)
@ -59,8 +59,9 @@
(rash (of-wain:format .^(wain %cx path)) parse)
::
++ load
|= =path
|= now=@da
^- (list vase)
=/ =path /=home/(scot %da now)/keys/txt
(turn (load-forms path) |=(=form !>(form)))
--
::
@ -72,6 +73,7 @@
description=@t
=physical-location
==
::
+$ location @tlocation
+$ physical-location @tphysicallocation
++ parsers
@ -93,12 +95,121 @@
(rash (of-wain:format .^(wain %cx path)) parse)
::
++ load
|= =path
|= now=@da
^- (list vase)
=/ =path /=home/(scot %da now)/locations/txt
(turn (load-forms path) |=(=form !>(form)))
--
::
++ policies !!
++ galaxies !!
++ ships !!
++ galaxies
=< form
|%
+$ form
$: =ship
=policy:policies
==
::
++ parsers
:~ fed
text:csv
==
::
++ parse
%+ cook
|* arg=*
^- (list form)
arg
(parse:csv parsers)
::
++ load-forms
|= =path
^- (list form)
(rash (of-wain:format .^(wain %cx path)) parse)
::
++ load
|= now=@da
^- (list vase)
=/ =path /=home/(scot %da now)/galaxies/txt
(turn (load-forms path) |=(=form !>(form)))
--
::
++ ships
=< form
|%
+$ form
$: =ship
note=@t
==
::
++ parsers
:~ fed
text:csv
==
::
++ parse
%+ cook
|* arg=*
^- (list form)
arg
(parse:csv parsers)
::
++ load-forms
|= =path
^- (list form)
(rash (of-wain:format .^(wain %cx path)) parse)
::
++ load
|= now=@da
^- (list vase)
=/ =path /=home/(scot %da now)/ships/txt
(turn (load-forms path) |=(=form !>(form)))
--
::
++ policies
=< form
|%
+$ form
$: =policy
=lockup
provenance=@t
description=@t
usage=@t
==
::
+$ policy @tpolicy
+$ lockup
$? %'1+4'
%'0+2'
%'0+1'
%'0+3'
%'0+1/3'
%'0'
==
::
++ parsers
:~ text:csv
(parse-enum lockup)
text:csv
text:csv
text:csv
==
::
++ parse
%+ cook
|* arg=*
^- (list form)
arg
(parse:csv parsers)
::
++ load-forms
|= =path
^- (list form)
(rash (of-wain:format .^(wain %cx path)) parse)
::
++ load
|= now=@da
^- (list vase)
=/ =path /=home/(scot %da now)/policies/txt
(turn (load-forms path) |=(=form !>(form)))
--
--

View File

@ -406,9 +406,9 @@
::
:: you'd think this would send an ack for the diff
:: that caused this pump. it would, but we already
:: sent it when we got the diff in +mo-handle-sys. then
:: we'd have to save the network duct and connect it
:: to this returning pump.
:: sent it when we got the diff in +mo-handle-sys-rep.
:: then we'd have to save the network duct and connect
:: it to this returning pump.
::
mo-core
::