From 535ab6e90bf88c00b3d073b2febdf3153671392c Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 4 Oct 2018 02:43:40 -0400 Subject: [PATCH] updates %jael to save and %ames to give domains (on boot/startup) also defers initial clay merge, renames +turf (utf8 to utf32) to +taft, and removes duplicate +turf (domain) declarations, and updates pinned vere to use them --- .travis/pin-vere-commit.txt | 2 +- app/acme.hoon | 3 --- mar/sole/action.hoon | 2 +- sur/dns.hoon | 3 --- sys/hoon.hoon | 8 +++---- sys/vane/ames.hoon | 16 +++++++++++-- sys/vane/clay.hoon | 18 +++++++------- sys/vane/dill.hoon | 2 +- sys/vane/jael.hoon | 18 ++++++++++++-- sys/zuse.hoon | 48 +++++++++++++++++++++++++++---------- tests/sys/vane/ames.hoon | 2 +- tests/sys/vane/jael.hoon | 2 +- tests/sys/zuse/dawn.hoon | 2 +- 13 files changed, 86 insertions(+), 40 deletions(-) diff --git a/.travis/pin-vere-commit.txt b/.travis/pin-vere-commit.txt index c6dfb2c362..dfd06f42e9 100644 --- a/.travis/pin-vere-commit.txt +++ b/.travis/pin-vere-commit.txt @@ -1 +1 @@ -fc6530fa30adbbe425a72cb048062d646fcb300e \ No newline at end of file +6e77aa110aa3776fed386f5bd8cf3a17d5c7e1bc \ No newline at end of file diff --git a/app/acme.hoon b/app/acme.hoon index cc92dc43c0..8bf24ba134 100644 --- a/app/acme.hoon +++ b/app/acme.hoon @@ -139,9 +139,6 @@ %finalize-order %finalize-trial == -:: +turf: a domain, TLD first -:: -+= turf (list @t) :: +acct: an ACME service account :: += acct diff --git a/mar/sole/action.hoon b/mar/sole/action.hoon index 2b515e6a07..c8d144798c 100644 --- a/mar/sole/action.hoon +++ b/mar/sole/action.hoon @@ -34,7 +34,7 @@ ((sef) jon) :: ++ change (ot ler+(at ni ni ~) ted+(pe 0v0 edit) ~) - ++ char (cu turf so) + ++ char (cu taft so) ++ edit %+ ke *sole-edit |. ~+ %+ fo %nop diff --git a/sur/dns.hoon b/sur/dns.hoon index e01652ab20..2617944d2e 100644 --- a/sur/dns.hoon +++ b/sur/dns.hoon @@ -1,7 +1,4 @@ |% -:: +turf: a domain, TLD first -:: -+= turf (list @t) :: +provider: DNS service provider (gcloud only for now) :: += provider diff --git a/sys/hoon.hoon b/sys/hoon.hoon index 89bc081770..8b24b7f916 100644 --- a/sys/hoon.hoon +++ b/sys/hoon.hoon @@ -4132,7 +4132,7 @@ ?> |((gte b 32) =(10 b)) ?:((lte b 127) 1 ?:((lte b 223) 2 ?:((lte b 239) 3 4))) :: -++ turf :: utf8 to utf32 +++ taft :: utf8 to utf32 |= a/@t ^- @c %+ rap 5 @@ -4156,7 +4156,7 @@ ++ tuba :: utf8 to utf32 tape |= a/tape ^- (list @c) - (rip 5 (turf (rap 3 a))) :: XX horrible + (rip 5 (taft (rap 3 a))) :: XX horrible :: ++ tufa :: utf32 to utf8 tape |= a/(list @c) @@ -4263,7 +4263,7 @@ ?: =(`@`0 a) ~ =+ b=(teff a) - =+ c=(turf (end 3 b a)) + =+ c=(taft (end 3 b a)) =+ d=$(a (rsh 3 b a)) ?: ?| &((gte c 'a') (lte c 'z')) &((gte c '0') (lte c '9')) @@ -5800,7 +5800,7 @@ (stag %p fed:ag) ;~(pfix dot (stag %ta urs:ab)) ;~(pfix sig (stag %t urx:ab)) - ;~(pfix hep (stag %c (cook turf urx:ab))) + ;~(pfix hep (stag %c (cook taft urx:ab))) == ++ nuck ~/ %nuck |= a/nail %. a diff --git a/sys/vane/ames.hoon b/sys/vane/ames.hoon index ceb5a56ae8..427de999bc 100644 --- a/sys/vane/ames.hoon +++ b/sys/vane/ames.hoon @@ -1260,6 +1260,12 @@ =/ wir=wire /our/(scot %p p.p.bon)/her/(scot %p q.p.bon) :_ fox [hen [%pass wir %j %pubs p.p.bon q.p.bon]]~ + :: + %bock + :_ fox [hen %give %turf tuf.fox]~ + :: + %brew + :_ fox [hen [%pass / %j %turf ~]]~ :: %cake :: ~? ?=(^ r.bon) [%cake-woot-bad hen r.bon] @@ -1312,6 +1318,11 @@ :: %mack ?~ +>.sih $(sih [%g %nice ~]) :: XX using old code $(sih [%g %mean `[%mack +>+.sih]]) + :: + %turf + =. tuf.fox turf.sih + :: XX give %turf if already recvd %bar? + [~ +>.$] :: %pubs ?. ?=([%our @ %her @ ~] tea) @@ -1381,7 +1392,8 @@ ^- [p=(list boon) q=fort] ?- -.kyz %barn - [~ fox(gad hen)] + :_ fox(gad hen) + [%bock ~]~ :: %hear (~(gnaw am [now fox]) %good p.kyz q.kyz) @@ -1393,7 +1405,7 @@ (~(gnaw am [now fox]) %dead p.kyz q.kyz) :: %init - :_ fox [%sake p.kyz]~ + :_ fox [[%sake p.kyz] [%brew ~] ~] :: :: XX confirm unused, remove :: diff --git a/sys/vane/clay.hoon b/sys/vane/clay.hoon index 2812b8250e..3c21187942 100644 --- a/sys/vane/clay.hoon +++ b/sys/vane/clay.hoon @@ -3793,15 +3793,17 @@ [mos ..^$] :: $init - :_ %_ ..^$ - fat.ruf - ?< (~(has by fat.ruf) our.req) - (~(put by fat.ruf) our.req [-(hun hen)]:[*room .]) - == - ^- (list move) + =. fat.ruf + ?< (~(has by fat.ruf) our.req) + (~(put by fat.ruf) our.req [-(hun hen)]:[*room .]) + :: ?: ?=(%czar (clan:title our.req)) - ~ - [hen %pass /init-merge %c %merg our.req %base (sein:title our.req) %kids da+now %init]~ + [~ ..^$] + =/ =task:able + [%merg our.req %base (sein:title our.req) %kids da+now %init] + =. cue.ruf (~(put to cue.ruf) [hen task]) + =/ =move [hen %pass /queued-request %b %wait now] + [~[move] ..^$] :: $into =. hez.ruf `hen diff --git a/sys/vane/dill.hoon b/sys/vane/dill.hoon index d7c03ac453..78f5b256ae 100644 --- a/sys/vane/dill.hoon +++ b/sys/vane/dill.hoon @@ -73,7 +73,7 @@ =seed:able:jael :: identity params spon=(unit ship) :: sponsor czar=(map ship [=life =pass]) :: galaxy table - turf=(list (pair @ud (list @ta))) :: domains + turf=(list turf) :: domains == :: [%fake our=ship] :: boot fake :: XX wegh :: diff --git a/sys/vane/jael.hoon b/sys/vane/jael.hoon index 4540f405ef..11b462c121 100644 --- a/sys/vane/jael.hoon +++ b/sys/vane/jael.hoon @@ -74,6 +74,8 @@ ++ state-absolute :: absolute urbit $: pry/(map ship (map ship safe)) :: promises eve=logs :: on-chain events + :: XX reconcile with .dns.eth + tuf=(list turf) :: domains fak/_| :: fake keys == :: ++ state-eth-node :: node config + meta @@ -649,7 +651,7 @@ abet:abet:(deal:(burb our.tac) p.tac [~ q.tac]) :: :: boot from keys - :: {$dawn =seed spon=(unit ship) czar=(map ship [=life =pass]) turf=(list (pair @ud turf))} + :: {$dawn =seed spon=(unit ship) czar=(map ship [=life =pass]) turf=(list turf)} :: %dawn =* our who.seed.tac @@ -666,7 +668,11 @@ %- curd =< abet (pubs:~(feel su our urb sub etn) kyz) :: XX sponsor - :: XX turf + :: XX reconcile with .dns.eth + :: set initial domains + :: + =. tuf.urb turf.tac + :: =. moz %+ weld moz :: order is crucial! @@ -778,6 +784,14 @@ %+ cure our.tac [[%meet who.tac]~ urb] :: + :: XX should be a subscription + :: XX reconcile with .dns.eth + :: request domains + :: [%turf ~] + :: + %turf + +>.$(moz [[hen %give %turf tuf.urb] moz]) + :: :: watch private keys :: {$vein $~} :: diff --git a/sys/zuse.hoon b/sys/zuse.hoon index 973f20d0a6..c06a4ea125 100644 --- a/sys/zuse.hoon +++ b/sys/zuse.hoon @@ -95,6 +95,8 @@ %- unit :: ~: unknown %- unit :: ~ ~: invalid (cask vase) :: marked cargo +:: +++ turf (list @t) :: domain, tld first :: :: :::: ++jstd :: json standards structures :: :::: @@ -460,6 +462,7 @@ == == :: $: %j :: to %jael $% [%pubs our=ship who=ship] :: view public keys + [%turf ~] :: view domains [%vein our=ship] :: view private keys == == :: $: $g :: to %gall @@ -474,11 +477,13 @@ {$mass p/mass} :: memory usage {$rove p/ship q/lane} :: lane change {$send p/lane q/@} :: transmit packet + {$turf p/(list turf)} :: bind to domains {$woot p/ship q/coop} :: reaction message == :: ++ sign :: in result _<- $% $: %j :: from %jael $% [%pubs public:able:jael] :: public keys + [%turf turf=(list turf)] :: bind to domains [%vein =life vein=(map life ring)] :: private keys == == :: $: $g :: from %gall @@ -542,6 +547,8 @@ == :: ++ boon :: fort output $% {$beer p/sock} :: request public keys + {$bock ~} :: bind to domains + {$brew ~} :: request domains {$cake p/sock q/soap r/coop s/duct} :: e2e message result {$maze p/ship q/lane} :: lane change {$mead p/lane q/rock} :: accept packet @@ -581,6 +588,7 @@ ++ fort :: formal state $: $1 :: version gad/duct :: client interface + tuf/(list turf) :: domains hop/@da :: network boot date bad/(set @p) :: bad ships ton/town :: security @@ -1046,7 +1054,7 @@ ++ hiss {p/purl q/moth} :: outbound request ++ hole @t :: session identity ++ hort {p/(unit @ud) q/host} :: http port+host - ++ host (each (list @t) @if) :: http host + ++ host (each turf @if) :: http host ++ hoke %+ each {$localhost ~} :: local host ?($.0.0.0.0 $.127.0.0.1) :: :: +http-config: full http-server configuration @@ -1075,7 +1083,7 @@ [%cert p=(unit [key=wain cert=wain])] :: %turf: add or remove established dns binding :: - [%turf p=?(%put %del) q=(list @t)] + [%turf p=?(%put %del) q=turf] == ++ httq :: raw http request $: p/meth :: method @@ -1993,6 +2001,7 @@ $% [%init p=ship] :: report install unix [%mack p=(unit tang)] :: message n/ack [%pubs public] :: public keys + [%turf turf=(list turf)] :: domains {$vest p/tally} :: balance update [%vein =life vein=(map life ring)] :: private keys {$vine p/(list change)} :: all raw changes @@ -2036,7 +2045,7 @@ =seed:able:jael :: identity params spon=(unit ship) :: sponsor czar=(map ship [=life =pass]) :: galaxy table - turf=(list (pair @ud (list @ta))) :: domains + turf=(list turf) :: domains == :: [%fake our=ship] :: fake boot [%look our=ship src=(each ship purl:eyre)] :: set ethereum source @@ -2046,6 +2055,7 @@ [%nuke ~] :: cancel tracker from [%pubs our=ship who=ship] :: view public keys [%meet our=ship who=ship] :: met after breach + [%turf ~] :: view domains [%vein our=ship] :: view signing keys [%vent our=ship] :: view ethereum events [%vest our=ship] :: view public balance @@ -7968,18 +7978,32 @@ :: ++ turf |= rep=octs - ^- (list [@ud (list @ta)]) + ^- (list ^turf) =/ jon=json (need (de-json:html q.rep)) =/ res=(list [@t @t]) ((ar (ot id+so result+so ~)) jon) - %+ turn res - |= [id=@t result=@t] - :- (slav %ud id) - =/ dom=tape - (decode-results:ethereum result [%string]~) - =/ hot=host:eyre - (scan dom thos:de-purl:html) - ?>(?=(%& -.hot) p.hot) + =/ dom=(list (pair @ud ^turf)) + %+ turn res + |= [id=@t result=@t] + ^- (pair @ud ^turf) + :- (slav %ud id) + =/ dom=tape + (decode-results:ethereum result [%string]~) + =/ hot=host:eyre + (scan dom thos:de-purl:html) + ?>(?=(%& -.hot) p.hot) + :: sort by id, ascending, removing duplicates + :: + =| tuf=(map ^turf @ud) + |- ^- (list ^turf) + ?~ dom + %+ turn + %+ sort ~(tap by tuf) + |=([a=(pair ^turf @ud) b=(pair ^turf @ud)] (lth q.a q.b)) + head + =? tuf !(~(has by tuf) q.i.dom) + (~(put by tuf) q.i.dom p.i.dom) + $(dom t.dom) -- :: +veri:dawn: validate keys, life, discontinuity, &c :: diff --git a/tests/sys/vane/ames.hoon b/tests/sys/vane/ames.hoon index 7a966e3880..14f77e365d 100644 --- a/tests/sys/vane/ames.hoon +++ b/tests/sys/vane/ames.hoon @@ -20,7 +20,7 @@ :* ames-gate now=~1234.5.6 call-args=[hen type=*type %soft %init ~nul] - [hen %pass wir %j %vein ~nul]~ + [[hen %pass wir %j %vein ~nul] [hen %pass / %j %turf ~] ~] == :: results1 diff --git a/tests/sys/vane/jael.hoon b/tests/sys/vane/jael.hoon index a3847e95d0..b36f923c5a 100644 --- a/tests/sys/vane/jael.hoon +++ b/tests/sys/vane/jael.hoon @@ -16,7 +16,7 @@ 0w8O.k5Ry4.QsKQq.1k~uj.DBOU4.numfq.nXOwa.cSk7B.VcHVm. -8~kX.3ALiG.rQjOi.HZ9hj.84b6G.P5pCZ.UtNtt.Lh9TE.2DQJ2 =/ dan - [`seed:able:jael`[~nul 1 key ~] ~ ~ [0 /urbit/org]~] + [`seed:able:jael`[~nul 1 key ~] ~ ~ [/org/urbit ~]] :: =^ results1 jael-gate =/ hen=duct diff --git a/tests/sys/zuse/dawn.hoon b/tests/sys/zuse/dawn.hoon index f5401e29aa..30f0d45548 100644 --- a/tests/sys/zuse/dawn.hoon +++ b/tests/sys/zuse/dawn.hoon @@ -147,7 +147,7 @@ '"}]' == %+ expect-eq - !> [[0 /org/urbit] [1 /org/urbit] [2 /org/urbit] ~] + !> [/org/urbit ~] !> (turf:take:dawn oct) :: ++ test-veri-good