mirror of
https://github.com/urbit/shrub.git
synced 2024-11-24 04:58:08 +03:00
Merge branch 'master' into alef-testnet-merge
Untested, has not been run. Uses master pills for now. Will need refreshing.
This commit is contained in:
commit
9a02c64b45
5
Makefile
5
Makefile
@ -1,4 +1,4 @@
|
||||
.PHONY: build build-all install cross release test pills clean
|
||||
.PHONY: build build-all install cross release test pills ropsten-pills clean
|
||||
|
||||
build:
|
||||
nix-build -A urbit -A herb --no-out-link
|
||||
@ -23,6 +23,9 @@ pills:
|
||||
sh/update-brass-pill
|
||||
sh/update-ivory-pill
|
||||
|
||||
ropsten-pills:
|
||||
sh/create-ropsten-pills
|
||||
|
||||
interface:
|
||||
sh/build-interface
|
||||
|
||||
|
3
bin/brass.pill
Normal file
3
bin/brass.pill
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1fcda8a239d9b2128901e952ca30c17a016323ffdd855c97670ac65d47ae4006
|
||||
size 6686327
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6e88a1f867853346975640f78232d1354f02fefb299b1b81bba9f054d842895e
|
||||
size 9117898
|
||||
oid sha256:288a89d1ac85d6a55fe34fc862fbf2358a43781de3f187bcf2e5654cdbb822b0
|
||||
size 1202044
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:24429a991d07acfda85e972f8e0b7353bfc28b70e75152c4b1a73f09765888ef
|
||||
size 10143608
|
||||
oid sha256:58606e40eb62beb0c811e77529211913e3b66e4e824f8efdb55c92c27746fd49
|
||||
size 9082848
|
||||
|
@ -5,7 +5,7 @@ pkgs.stdenv.mkDerivation rec {
|
||||
builder = ./builder.sh;
|
||||
buildInputs = [ herb pkgs.coreutils ];
|
||||
|
||||
URBIT = ubit.meta.exe;
|
||||
URBIT = urbit.meta.exe;
|
||||
PIER = pier;
|
||||
ARVO = arvo;
|
||||
}
|
||||
|
@ -2,10 +2,11 @@
|
||||
|
||||
let
|
||||
|
||||
tlon = import ../pkgs { inherit pkgs; };
|
||||
arvo = tlon.arvo;
|
||||
herb = tlon.herb;
|
||||
urbit = if debug then tlon.urbit-debug else tlon.urbit;
|
||||
tlon = import ../pkgs { inherit pkgs; };
|
||||
arvo = tlon.arvo;
|
||||
arvo-ropsten = tlon.arvo-ropsten;
|
||||
herb = tlon.herb;
|
||||
urbit = if debug then tlon.urbit-debug else tlon.urbit;
|
||||
|
||||
bootbrass = ../../bin/brass.pill;
|
||||
bootsolid = ../../bin/solid.pill;
|
||||
@ -17,6 +18,13 @@ let
|
||||
arvo = null;
|
||||
};
|
||||
|
||||
ropzod = import ./fakeship {
|
||||
inherit pkgs herb urbit;
|
||||
pill = bootsolid;
|
||||
ship = "zod";
|
||||
arvo = arvo-ropsten;
|
||||
};
|
||||
|
||||
zod = import ./fakeship {
|
||||
inherit pkgs herb urbit arvo;
|
||||
pill = bootsolid;
|
||||
@ -48,14 +56,35 @@ rec {
|
||||
pier = zod;
|
||||
};
|
||||
|
||||
brass-ropsten = import ./brass {
|
||||
inherit pkgs herb urbit;
|
||||
arvo = arvo-ropsten;
|
||||
pier = ropzod;
|
||||
};
|
||||
|
||||
ivory = import ./ivory {
|
||||
inherit pkgs herb urbit arvo;
|
||||
pier = zod;
|
||||
};
|
||||
|
||||
<<<<<<< HEAD
|
||||
image = import ./image {
|
||||
inherit pkgs urbit;
|
||||
pill = bootsolid;
|
||||
};
|
||||
|
||||
||||||| merged common ancestors
|
||||
=======
|
||||
ivory-ropsten = import ./ivory {
|
||||
inherit pkgs herb urbit;
|
||||
arvo = arvo-ropsten;
|
||||
pier = ropzod;
|
||||
};
|
||||
|
||||
image = import ./image {
|
||||
inherit pkgs urbit;
|
||||
pill = bootsolid;
|
||||
};
|
||||
|
||||
>>>>>>> master
|
||||
}
|
||||
|
@ -2,33 +2,18 @@
|
||||
|
||||
let
|
||||
|
||||
name = urbit.meta.name;
|
||||
debug = urbit.meta.debug;
|
||||
exe = ''${urbit.meta.exe} "$@"'';
|
||||
|
||||
coredump = ''
|
||||
ulimit -c unlimited
|
||||
|
||||
${exe} || \
|
||||
${pkgs.gdb}/bin/gdb -ex "thread apply all bt" -ex "set pagination 0" -batch \
|
||||
${urbit.meta.bin} \
|
||||
/tmp/cores/core*
|
||||
'';
|
||||
|
||||
entrypoint = pkgs.writeScript "entrypoint.sh" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
${pkgs.coreutils}/bin/ln -sf ${pill} /data/urbit.pill
|
||||
|
||||
${if debug then coredump else exe}
|
||||
${urbit.meta.exe} "$@"
|
||||
'';
|
||||
|
||||
in
|
||||
|
||||
pkgs.dockerTools.buildImage {
|
||||
inherit name;
|
||||
name = urbit.meta.name;
|
||||
|
||||
runAsRoot = ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
@ -39,17 +24,21 @@ pkgs.dockerTools.buildImage {
|
||||
|
||||
${pkgs.dockerTools.shadowSetup}
|
||||
|
||||
mkdir -p /data /tmp/cores
|
||||
mkdir -p /bin /share /data /tmp
|
||||
|
||||
${pkgs.coreutils}/bin/ln -sf ${pill} /share/urbit.pill
|
||||
${pkgs.coreutils}/bin/ln -sf ${entrypoint} /bin/urbit
|
||||
'';
|
||||
|
||||
config = {
|
||||
Entrypoint = entrypoint;
|
||||
Entrypoint = [ "urbit" ];
|
||||
|
||||
WorkingDir = "/data";
|
||||
|
||||
Env = [ "PATH=/bin" ];
|
||||
|
||||
Volumes = {
|
||||
"/data" = {};
|
||||
"/tmp" = {};
|
||||
};
|
||||
|
||||
ExposedPorts = {
|
||||
|
@ -34,6 +34,8 @@ cp $ARVO/app/dojo.hoon ./pier/home/app/ 2>/dev/null || true
|
||||
cp $ARVO/lib/base64.hoon ./pier/home/lib/ 2>/dev/null || true
|
||||
cp $ARVO/lib/server.hoon ./pier/home/lib/ 2>/dev/null || true
|
||||
cp $ARVO/lib/sole.hoon ./pier/home/lib/ 2>/dev/null || true
|
||||
cp $ARVO/lib/xray.hoon ./pier/home/lib/ 2>/dev/null || true
|
||||
cp $ARVO/lib/pprint.hoon ./pier/home/lib/ 2>/dev/null || true
|
||||
mkdir -p ./pier/home/mar/lens/
|
||||
cp $ARVO/mar/lens/* ./pier/home/mar/lens/ 2>/dev/null || true
|
||||
|
||||
|
@ -3,9 +3,9 @@
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
name = "solid";
|
||||
builder = ./builder.sh;
|
||||
buildInputs = [ herb ];
|
||||
buildInputs = [ herb pkgs.coreutils ];
|
||||
|
||||
URBIT = urbit.exe;
|
||||
URBIT = urbit.meta.exe;
|
||||
PIER = pier;
|
||||
ARVO = arvo;
|
||||
}
|
||||
|
26
nix/pkgs/arvo-ropsten/builder.sh
Normal file
26
nix/pkgs/arvo-ropsten/builder.sh
Normal file
@ -0,0 +1,26 @@
|
||||
source $stdenv/setup
|
||||
|
||||
cp -r $src tmp
|
||||
chmod -R u+w tmp
|
||||
|
||||
ZUSE=tmp/sys/zuse.hoon
|
||||
AMES=tmp/sys/vane/ames.hoon
|
||||
ACME=tmp/app/acme.hoon
|
||||
|
||||
# replace the mainnet azimuth contract with the ropsten contract
|
||||
sed --in-place \
|
||||
's/\(\+\+ contracts \)mainnet\-contracts/\1ropsten-contracts/' \
|
||||
$ZUSE
|
||||
|
||||
# increment the %ames protocol version
|
||||
sed -r --in-place \
|
||||
's/^(=\+ protocol\-version=)([0-9])/echo "\1$(echo "(\2+1) % 8" | bc)"/e' \
|
||||
$AMES
|
||||
|
||||
# use the staging API in :acme
|
||||
sed --in-place \
|
||||
's_https://acme-v02.api.letsencrypt.org/directory_https://acme-staging-v02.api.letsencrypt.org/directory_' \
|
||||
$ACME
|
||||
|
||||
cp -r tmp $out
|
||||
chmod -R u+w $out
|
8
nix/pkgs/arvo-ropsten/default.nix
Normal file
8
nix/pkgs/arvo-ropsten/default.nix
Normal file
@ -0,0 +1,8 @@
|
||||
{ pkgs }:
|
||||
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "arvo-ropsten";
|
||||
buildInputs = [ pkgs.bc ];
|
||||
builder = ./builder.sh;
|
||||
src = pkgs.buildRustCrateHelpers.exclude [ ".git" ] ../../../pkg/arvo;
|
||||
}
|
@ -6,6 +6,7 @@ let
|
||||
|
||||
ent = import ./ent { inherit pkgs; };
|
||||
arvo = import ./arvo { inherit pkgs; };
|
||||
arvo-ropsten = import ./arvo-ropsten { inherit pkgs; };
|
||||
herb = import ../../pkg/herb { inherit pkgs; };
|
||||
|
||||
ge-additions = import ./ge-additions {
|
||||
@ -25,4 +26,4 @@ let
|
||||
|
||||
in
|
||||
|
||||
{ inherit ent ge-additions arvo herb urbit urbit-debug; }
|
||||
{ inherit ent ge-additions arvo arvo-ropsten herb urbit urbit-debug; }
|
||||
|
@ -12,8 +12,8 @@ let
|
||||
meta = rec {
|
||||
inherit debug;
|
||||
bin = "${urbit}/bin/${name}";
|
||||
flags = if debug then "-g" else "";
|
||||
exe = "${meta.bin} ${meta.flags}";
|
||||
flags = if debug then [ "-g" ] else [];
|
||||
exe = ''${meta.bin} ${pkgs.lib.strings.concatStringsSep " " meta.flags}'';
|
||||
};
|
||||
|
||||
deps =
|
||||
@ -33,7 +33,7 @@ let
|
||||
# See https://github.com/NixOS/nixpkgs/issues/18995
|
||||
hardeningDisable = if debug then [ "all" ] else [];
|
||||
|
||||
CFLAGS = if debug then "-O3 -g -Werror" else "-O3 -Werror";
|
||||
CFLAGS = "-O3 -g -Werror";
|
||||
MEMORY_DEBUG = debug;
|
||||
CPU_DEBUG = debug;
|
||||
EVENT_TIME_DEBUG = false;
|
||||
|
@ -153,6 +153,7 @@
|
||||
[%request wire request:http outbound-config:iris]
|
||||
[%rule wire %cert (unit [wain wain])]
|
||||
[%wait wire @da]
|
||||
[%flog wire flog:dill]
|
||||
==
|
||||
:: +poke: outgoing app pokes
|
||||
::
|
||||
@ -360,6 +361,15 @@
|
||||
++ emit
|
||||
|= car=card
|
||||
this(mov [[ost.bow car] mov])
|
||||
:: +emil: emit a list of moves
|
||||
::
|
||||
++ emil
|
||||
|= rac=(list card)
|
||||
|- ^+ this
|
||||
?~ rac
|
||||
this
|
||||
=. mov [[ost.bow i.rac] mov]
|
||||
$(rac t.rac)
|
||||
:: +abet: finalize transaction
|
||||
::
|
||||
++ abet
|
||||
@ -380,9 +390,20 @@
|
||||
|= [try=@ud act=@tas =wire]
|
||||
^- ^wire
|
||||
(weld /acme/try/(scot %ud try)/[act] wire)
|
||||
:: +notify: send :hall notification
|
||||
:: +notify: send notification message
|
||||
::
|
||||
++ notify
|
||||
|= [=cord =tang]
|
||||
^- (list card)
|
||||
:- [%flog / %text :(weld (trip dap.bow) ": " (trip cord))]
|
||||
%+ turn
|
||||
`wall`(zing (turn (flop tang) (cury wash [0 80])))
|
||||
|=(=tape [%flog / %text tape])
|
||||
:: +notify: send :hall notification
|
||||
::
|
||||
:: XX disabled due to :hall status
|
||||
::
|
||||
++ notify-disabled
|
||||
|= [=cord =tang]
|
||||
^- card
|
||||
=/ msg=speech:hall
|
||||
@ -472,7 +493,7 @@
|
||||
(join-turf ~(tap in dom.u.rod))
|
||||
'. retrying in ~d7.'
|
||||
==
|
||||
(emit (notify msg ~))
|
||||
(emil (notify msg ~))
|
||||
:: too many certificates for top-level-domain
|
||||
::
|
||||
?: ?=(^ (find "too many certificates already" detail))
|
||||
@ -489,7 +510,7 @@
|
||||
'. retrying in '
|
||||
(scot %dr lul) '.'
|
||||
==
|
||||
(emit (notify msg ~))
|
||||
(emil (notify msg ~))
|
||||
:: XX match more rate-limit conditions
|
||||
:: or backoff by wire
|
||||
::
|
||||
@ -616,7 +637,7 @@
|
||||
::
|
||||
=/ msg=cord
|
||||
(cat 3 'retrying certificate request in ' (scot %dr lul))
|
||||
=. ..this (emit (notify msg ~))
|
||||
=. ..this (emil (notify msg ~))
|
||||
=. ..this (retry:effect try %new-order / lul)
|
||||
:: domains might already be validated
|
||||
::
|
||||
@ -774,7 +795,7 @@
|
||||
:~ 'unable to reach ' (scot %p our.bow)
|
||||
' via http at ' (en-turf:html turf.i.item) ':80'
|
||||
==
|
||||
(emit(next-order ~) (notify msg [(sell !>(rep)) ~]))
|
||||
(emil(next-order ~) (notify msg [(sell !>(rep)) ~]))
|
||||
?: ?=(~ (skip ~(val by dom.u.next-order) |=([@ud valid=?] valid)))
|
||||
new-order:effect
|
||||
(validate-domain:effect +(idx))
|
||||
@ -786,7 +807,7 @@
|
||||
?. =(200 p.rep)
|
||||
?: (lth try 10)
|
||||
(retry:effect try %directory / (min ~m30 (backoff try)))
|
||||
(emit (notify (failure-message directory-base) [(sell !>(rep)) ~]))
|
||||
(emil (notify (failure-message directory-base) [(sell !>(rep)) ~]))
|
||||
=. dir (directory:grab (need (de-json:html q:(need r.rep))))
|
||||
?~(reg.act register:effect this)
|
||||
:: +nonce: accept new nonce and trigger next effect
|
||||
@ -805,7 +826,7 @@
|
||||
?. =(204 p.rep)
|
||||
?: (lth try 10)
|
||||
(retry:effect try %nonce t.wire (min ~m30 (backoff try)))
|
||||
(emit (notify (failure-message nonce.dir) [(sell !>(rep)) ~]))
|
||||
(emil (notify (failure-message nonce.dir) [(sell !>(rep)) ~]))
|
||||
?- nex
|
||||
%register register:effect
|
||||
%new-order new-order:effect
|
||||
@ -822,7 +843,7 @@
|
||||
::
|
||||
?: (lth try 10)
|
||||
(retry:effect try %register / (min ~h1 (backoff try)))
|
||||
(emit (notify (failure-message register.dir) [(sell !>(rep)) ~]))
|
||||
(emil (notify (failure-message register.dir) [(sell !>(rep)) ~]))
|
||||
=/ loc=@t
|
||||
q:(head (skim q.rep |=((pair @t @t) ?=(%location p))))
|
||||
:: XX @da once parser is fixed
|
||||
@ -852,7 +873,7 @@
|
||||
(retry:effect try %new-order / (min ~h1 (backoff try)))
|
||||
:: XX next steps, retrying in ??
|
||||
::
|
||||
(emit (notify (failure-message register.dir) [(sell !>(rep)) ~]))
|
||||
(emil (notify (failure-message register.dir) [(sell !>(rep)) ~]))
|
||||
?> ?=(^ next-order)
|
||||
=/ loc=@t
|
||||
q:(head (skim q.rep |=((pair @t @t) ?=(%location p))))
|
||||
@ -902,7 +923,7 @@
|
||||
(retry:effect try %check-order / (min ~m10 (backoff try)))
|
||||
:: XX next steps, retrying in, delete order ??
|
||||
::
|
||||
(emit (notify (failure-message ego.u.rod) [(sell !>(rep)) ~]))
|
||||
(emil (notify (failure-message ego.u.rod) [(sell !>(rep)) ~]))
|
||||
=/ bod=order:body
|
||||
(order:grab (need (de-json:html q:(need r.rep))))
|
||||
?+ sas.bod
|
||||
@ -916,7 +937,7 @@
|
||||
:: XX possible to retry any reasons?
|
||||
::
|
||||
=< cancel-order:effect
|
||||
(emit (notify 'certificate order failed' [(sell !>(rep)) ~]))
|
||||
(emil (notify 'certificate order failed' [(sell !>(rep)) ~]))
|
||||
:: initial order state
|
||||
::
|
||||
%pending
|
||||
@ -958,7 +979,7 @@
|
||||
:~ 'unable to download certificate. '
|
||||
'please confirm that your urbit has network connectivity.'
|
||||
==
|
||||
(emit (notify msg [(sell !>(rep)) ~]))
|
||||
(emil (notify msg [(sell !>(rep)) ~]))
|
||||
=/ cer=wain (to-wain:format q:(need r.rep))
|
||||
=/ fig=config
|
||||
:: XX expiration date
|
||||
@ -978,7 +999,7 @@
|
||||
:~ 'received https certificate for '
|
||||
(join-turf ~(tap in dom.u.liv))
|
||||
==
|
||||
(emit (notify msg ~))
|
||||
(emil (notify msg ~))
|
||||
:: set renewal timer, install certificate in %eyre
|
||||
::
|
||||
:: Certificates expire after ~d90. We want time for retries and
|
||||
@ -1009,7 +1030,7 @@
|
||||
(retry:effect try %get-authz / (min ~m10 (backoff try)))
|
||||
:: XX next steps, retrying in ??
|
||||
::
|
||||
(emit (notify (failure-message i.pending.aut.u.rod) [(sell !>(rep)) ~]))
|
||||
(emil (notify (failure-message i.pending.aut.u.rod) [(sell !>(rep)) ~]))
|
||||
=/ bod=auth:body
|
||||
(auth:grab (need (de-json:html q:(need r.rep))))
|
||||
=/ cal=trial
|
||||
@ -1054,7 +1075,7 @@
|
||||
'via ' (en-turf:html dom.aut) '. '
|
||||
'please confirm your urbit has network connectivity.'
|
||||
==
|
||||
(emit (notify msg [(sell !>(rep)) ~]))
|
||||
(emil (notify msg [(sell !>(rep)) ~]))
|
||||
=/ bod
|
||||
%- as-octs:mimes:html
|
||||
(rap 3 [tok.cal.aut '.' (pass:thumb:jwk key.act) ~])
|
||||
@ -1069,7 +1090,7 @@
|
||||
(sell !>((some bod)))
|
||||
leaf+"expected:"
|
||||
==
|
||||
(emit (notify 'domain validation value is wrong' tang))
|
||||
(emil (notify 'domain validation value is wrong' tang))
|
||||
finalize-trial:effect
|
||||
:: +finalize-trial:
|
||||
::
|
||||
@ -1091,7 +1112,7 @@
|
||||
(retry:effect try %finalize-trial / (min ~m10 (backoff try)))
|
||||
:: XX next steps, check connectivity, etc. ??
|
||||
::
|
||||
(emit (notify (failure-message ego.cal.aut) [(sell !>(rep)) ~]))
|
||||
(emil (notify (failure-message ego.cal.aut) [(sell !>(rep)) ~]))
|
||||
:: XX get challenge, confirm urn:ietf:params:acme:error:connection
|
||||
::
|
||||
:: =/ err=error:body
|
||||
@ -1101,7 +1122,7 @@
|
||||
=< cancel-order:effect
|
||||
=/ msg=cord
|
||||
'unable to finalize domain validation challenge'
|
||||
(emit (notify msg [(sell !>(rep)) ~]))
|
||||
(emil (notify msg [(sell !>(rep)) ~]))
|
||||
=/ bod=challenge:body
|
||||
(challenge:grab (need (de-json:html q:(need r.rep))))
|
||||
:: XX check for other possible values in 200 response
|
||||
@ -1383,7 +1404,7 @@
|
||||
:~ 'requesting an https certificate for '
|
||||
(join-turf ~(tap in dom))
|
||||
==
|
||||
(emit (notify msg ~))
|
||||
(emil (notify msg ~))
|
||||
:: if registered, create order
|
||||
::
|
||||
?^ reg.act
|
||||
|
@ -298,9 +298,9 @@
|
||||
|= act=sole-action:sole-sur
|
||||
^- (quip move _this)
|
||||
?- -.act
|
||||
$det (edit +.act)
|
||||
$clr [~ this]
|
||||
$ret obey
|
||||
%det (edit +.act)
|
||||
%clr [~ this]
|
||||
%ret obey
|
||||
==
|
||||
:: +edit: apply sole edit
|
||||
::
|
||||
@ -497,8 +497,8 @@
|
||||
++ letter
|
||||
;~ pose
|
||||
(stag %url turl)
|
||||
:(stag %me ;~(pfix vat text))
|
||||
:(stag %text ;~(less mic hax text))
|
||||
(stag %me ;~(pfix vat text))
|
||||
(stag %text ;~(less mic hax text))
|
||||
==
|
||||
:: +turl: url parser
|
||||
::
|
||||
@ -684,7 +684,9 @@
|
||||
=^ moz this
|
||||
?. ?=(^ gyf) [~ this]
|
||||
(bind-glyph u.gyf target)
|
||||
=- [[- moz] this(audience [target ~ ~])]
|
||||
=. audience [target ~ ~]
|
||||
=; =move
|
||||
[[move prompt:sh-out moz] this]
|
||||
::TODO ideally we'd check permission first. attempting this and failing
|
||||
:: gives ugly %chat-hook-reap
|
||||
%^ act %do-join %chat-view
|
||||
|
@ -192,12 +192,11 @@
|
||||
=/ =hoon (ream expression.letter)
|
||||
letter(output (eval bol hoon))
|
||||
=: length.config.u.mailbox +(length.config.u.mailbox)
|
||||
number.envelope.act length.config.u.mailbox
|
||||
number.envelope.act +(length.config.u.mailbox)
|
||||
envelopes.u.mailbox (snoc envelopes.u.mailbox envelope.act)
|
||||
inbox (~(put by inbox) path.act u.mailbox)
|
||||
==
|
||||
:_ this(inbox inbox)
|
||||
(send-diff path.act act)
|
||||
:- (send-diff path.act act)
|
||||
this(inbox (~(put by inbox) path.act u.mailbox))
|
||||
::
|
||||
++ handle-read
|
||||
|= act=chat-action
|
||||
@ -206,11 +205,9 @@
|
||||
=/ mailbox=(unit mailbox) (~(get by inbox) path.act)
|
||||
?~ mailbox
|
||||
[~ this]
|
||||
=: read.config.u.mailbox length.config.u.mailbox
|
||||
inbox (~(put by inbox) path.act u.mailbox)
|
||||
==
|
||||
:_ this(inbox inbox)
|
||||
(send-diff path.act act)
|
||||
=. read.config.u.mailbox length.config.u.mailbox
|
||||
:- (send-diff path.act act)
|
||||
this(inbox (~(put by inbox) path.act u.mailbox))
|
||||
::
|
||||
++ update-subscribers
|
||||
|= [pax=path act=chat-action]
|
||||
|
File diff suppressed because one or more lines are too long
@ -86,6 +86,10 @@
|
||||
[%send-point as=ship point=ship to=address]
|
||||
==
|
||||
::
|
||||
:: internal types
|
||||
::
|
||||
+$ rpc-result [id=@t res=@t]
|
||||
::
|
||||
:: monadic structures
|
||||
::
|
||||
:: in-progress: monad currently in progress
|
||||
@ -231,6 +235,7 @@
|
||||
::
|
||||
:: constants
|
||||
::
|
||||
++ azimuth 0x223c.067f.8cf2.8ae1.73ee.5caf.ea60.ca44.c335.fecb
|
||||
++ ecliptic 0x6ac0.7b7c.4601.b5ce.11de.8dfe.6335.b871.c7c4.dd4d
|
||||
++ delegated-sending 0xf790.8ab1.f1e3.52f8.3c5e.bc75.051c.0565.aeae.a5fb
|
||||
--
|
||||
@ -325,8 +330,7 @@
|
||||
++ fail-command
|
||||
|= err=tang
|
||||
^+ this
|
||||
~& 'command processing failed'
|
||||
::TODO error printing
|
||||
%- (slog [leaf+"command processing failed" err])
|
||||
this(inp ~)
|
||||
::
|
||||
:: done-command: handle result of nonce-fetching monad
|
||||
@ -357,17 +361,22 @@
|
||||
[%eth-get-transaction-count for]
|
||||
^- form:m
|
||||
?. ?=(%s -.json)
|
||||
(glad-fail *tang) ::TODO proper error, "unexpected json"
|
||||
(glad-fail [%leaf "weird nonce json response"]~)
|
||||
%- pure:m
|
||||
(rash p.json ;~(pfix (jest '0x') hex))
|
||||
::
|
||||
++ do-request
|
||||
|= [rid=(unit @t) =request]
|
||||
++ do-json-request
|
||||
|= =json
|
||||
%+ do-hiss %json-rpc-response
|
||||
^- hiss:eyre
|
||||
%+ json-request
|
||||
::TODO vary per network
|
||||
(need (de-purl:html 'http://eth-mainnet.urbit.org:8545'))
|
||||
json
|
||||
::
|
||||
++ do-request
|
||||
|= [rid=(unit @t) =request]
|
||||
%- do-json-request
|
||||
(request-to-json rid request)
|
||||
::
|
||||
++ do-hiss
|
||||
@ -394,17 +403,173 @@
|
||||
;< =response:rpc:jstd bind:m
|
||||
expect-response
|
||||
?. ?=(%result -.response)
|
||||
(glad-fail *tang) ::TODO make pretty error message
|
||||
(glad-fail [%leaf "json result is unexpected ${(trip -.response)}"]~)
|
||||
(pure:m res.response)
|
||||
::
|
||||
++ do-read-expect-result
|
||||
|= [to=address =call-data]
|
||||
=/ m (glad ,[id=@t res=@t])
|
||||
;< ~ bind:m
|
||||
%- do-json-request
|
||||
(read-request `'' to call-data)
|
||||
;< =response:rpc:jstd bind:m
|
||||
expect-response
|
||||
?: ?& ?=(%result -.response)
|
||||
?=(%s -.res.response)
|
||||
==
|
||||
(pure:m [id p.res]:response)
|
||||
(glad-fail ~[leaf+"unexpected result" >response<])
|
||||
::
|
||||
++ do-batch-read-expect-results
|
||||
|= reqs=(list proto-read-request)
|
||||
=/ m (glad (list ,rpc-result))
|
||||
^- form:m
|
||||
;< ~ bind:m
|
||||
%- do-json-request
|
||||
(batch-read-request reqs)
|
||||
;< =response:rpc:jstd bind:m
|
||||
expect-response
|
||||
?. ?=(%batch -.response)
|
||||
(glad-fail ~[leaf+"not a batch response" >response<])
|
||||
=+ ^- [res=(list response:rpc:jstd) bad=(list response:rpc:jstd)]
|
||||
%+ skid bas.response
|
||||
|=([a=@tas *] =(%result a))
|
||||
?. =(~ bad)
|
||||
(glad-fail ~[leaf+"unexpected responses in batch" >bad<])
|
||||
%- pure:m
|
||||
%+ turn res
|
||||
|= =response:rpc:jstd
|
||||
?> ?=(%result -.response)
|
||||
?> ?=(%s -.res.response)
|
||||
[id p.res]:response
|
||||
::
|
||||
:: chain state checks
|
||||
::
|
||||
++ run-checks
|
||||
|= =command
|
||||
=/ m null-glad
|
||||
^- form:m
|
||||
?. ?& ::NOTE ?=(%generate -.command)
|
||||
?=(%invites -.batch.command)
|
||||
==
|
||||
(pure:m ~)
|
||||
(check-invites +.batch.command)
|
||||
::
|
||||
++ check-invites
|
||||
|= [as-who=ship file=path]
|
||||
=/ m null-glad
|
||||
=/ friends=(list [=ship @q =address])
|
||||
(read-invites file)
|
||||
;< ~ bind:m
|
||||
%- are-available
|
||||
(turn friends head)
|
||||
%+ has-invites-for
|
||||
as-who
|
||||
(turn friends head)
|
||||
::
|
||||
++ are-available
|
||||
|= ships=(list ship)
|
||||
=/ m null-glad
|
||||
^- form:m
|
||||
;< responses=(list rpc-result) bind:m
|
||||
%- do-batch-read-expect-results
|
||||
%+ turn ships
|
||||
|= =ship
|
||||
^- proto-read-request
|
||||
:+ `(scot %p ship)
|
||||
azimuth
|
||||
(rights:cal ship)
|
||||
=/ taken=(list ship)
|
||||
%+ murn responses
|
||||
|= rpc-result
|
||||
^- (unit ship)
|
||||
=/ rights=[owner=address *]
|
||||
%+ decode-results res
|
||||
::NOTE using +reap nest-fails
|
||||
[%address %address %address %address %address ~]
|
||||
?: =(0x0 owner.rights) ~
|
||||
`(slav %p id)
|
||||
^- form:m
|
||||
?: =(~ taken)
|
||||
(pure:m ~)
|
||||
%- glad-fail
|
||||
:~ leaf+"some ships already taken:"
|
||||
>taken<
|
||||
==
|
||||
::
|
||||
++ has-invites-for
|
||||
|= [as=ship ships=(list ship)]
|
||||
=/ m null-glad
|
||||
^- form:m
|
||||
=/ counts=(map ship @ud)
|
||||
%+ roll ships
|
||||
|= [s=ship counts=(map ship @ud)]
|
||||
=+ p=(^sein:title s)
|
||||
%+ ~(put by counts) p
|
||||
+((~(gut by counts) p 0))
|
||||
;< pool=@ud bind:m
|
||||
;< rpc-result bind:(glad ,@ud)
|
||||
%+ do-read-expect-result
|
||||
delegated-sending
|
||||
(get-pool:cal as)
|
||||
%- pure:(glad ,@ud)
|
||||
(decode-results res [%uint]~)
|
||||
;< responses=(list rpc-result) bind:m
|
||||
=/ n (glad ,(list rpc-result))
|
||||
^- form:n
|
||||
%- do-batch-read-expect-results
|
||||
%+ turn ~(tap by counts)
|
||||
|= [=ship @ud]
|
||||
^- proto-read-request
|
||||
:+ `(scot %p ship)
|
||||
delegated-sending
|
||||
(pools:cal pool ship)
|
||||
=/ missing=(list [star=ship have=@ud needed=@ud])
|
||||
%+ murn responses
|
||||
|= rpc-result
|
||||
^- (unit [ship @ud @ud])
|
||||
=/ =ship
|
||||
(slav %p id)
|
||||
=/ pool-size=@ud
|
||||
(decode-results res [%uint]~)
|
||||
=/ need=@ud
|
||||
(~(got by counts) ship)
|
||||
?: (gte pool-size need) ~
|
||||
`[ship pool-size need]
|
||||
?: =(~ missing)
|
||||
(pure:m ~)
|
||||
%- glad-fail
|
||||
:~ leaf+"not enough invites from stars:"
|
||||
>missing<
|
||||
==
|
||||
::
|
||||
:: input file reading
|
||||
::
|
||||
++ read-invites
|
||||
|= file=path
|
||||
^- (list [=ship ticket=@q =address])
|
||||
=+ txt=.^((list cord) %cx file)
|
||||
%+ murn txt
|
||||
|= line=cord
|
||||
^- (unit [ship @q address])
|
||||
?: =('' line) ~
|
||||
%- some
|
||||
~| line
|
||||
%+ rash line
|
||||
;~ (glue com)
|
||||
;~(pfix sig fed:ag)
|
||||
;~(pfix sig feq:ag)
|
||||
;~(pfix (jest '0x') hex)
|
||||
==
|
||||
::
|
||||
:: transaction generation logic
|
||||
::
|
||||
++ deal-with-command
|
||||
|= =command
|
||||
=/ m null-glad
|
||||
^- form:m
|
||||
;< ~ bind:m (run-checks command)
|
||||
;< nonce=@ud bind:m (get-next-nonce as.command)
|
||||
^- form:m
|
||||
%- just-do
|
||||
?- -.command
|
||||
%generate
|
||||
@ -547,16 +712,7 @@
|
||||
|= [nonce=@ud =network as=address as-who=ship file=path]
|
||||
^- (list transaction)
|
||||
=/ friends=(list [=ship @q =address])
|
||||
=+ txt=.^((list cord) %cx file)
|
||||
%+ turn txt
|
||||
|= line=cord
|
||||
~| line
|
||||
%+ rash line
|
||||
;~ (glue com)
|
||||
;~(pfix sig fed:ag)
|
||||
;~(pfix sig feq:ag)
|
||||
;~(pfix (jest '0x') hex)
|
||||
==
|
||||
(read-invites file)
|
||||
=| txs=(list transaction)
|
||||
|-
|
||||
?~ friends (flop txs)
|
||||
@ -917,6 +1073,30 @@
|
||||
[%uint `@`point]
|
||||
[%address to]
|
||||
==
|
||||
::
|
||||
:: read calls
|
||||
::
|
||||
++ rights
|
||||
|= =ship
|
||||
^- call-data
|
||||
:- 'rights(uint32)'
|
||||
:~ [%uint `@`ship]
|
||||
==
|
||||
::
|
||||
++ get-pool
|
||||
|= =ship
|
||||
^- call-data
|
||||
:- 'getPool(uint32)'
|
||||
:~ [%uint `@`ship]
|
||||
==
|
||||
::
|
||||
++ pools
|
||||
|= [pool=@ud star=ship]
|
||||
^- call-data
|
||||
:- 'pools(uint32,uint16)'
|
||||
:~ [%uint pool]
|
||||
[%uint `@`star]
|
||||
==
|
||||
--
|
||||
::
|
||||
:: ++ peer-sole
|
||||
|
File diff suppressed because one or more lines are too long
@ -12,7 +12,9 @@
|
||||
==
|
||||
+$ peek-data _!!
|
||||
+$ in-poke-data
|
||||
$% [%dns-auto ames-domains=(list turf)]
|
||||
$% :: XX ames-domains unused, remove
|
||||
::
|
||||
[%dns-auto ames-domains=(list turf)]
|
||||
[%dns-address =address:dns]
|
||||
==
|
||||
+$ out-poke-data
|
||||
@ -93,7 +95,17 @@
|
||||
(pure:m |)
|
||||
loop(try +(try))
|
||||
::
|
||||
++ hall-app-message
|
||||
++ app-message
|
||||
|= [app=term =cord =tang]
|
||||
=/ m (async:stdio ,~)
|
||||
^- form:m
|
||||
=/ msg=tape :(weld (trip app) ": " (trip cord))
|
||||
;< ~ bind:m (flog-text:stdio msg)
|
||||
(flog-tang:stdio tang)
|
||||
::
|
||||
:: XX disabled due to :hall's status
|
||||
::
|
||||
++ hall-app-message-disabled
|
||||
|= [app=term =cord =tang]
|
||||
=/ m (async:stdio ,~)
|
||||
^- form:m
|
||||
@ -125,15 +137,12 @@
|
||||
:: +galaxy-domains
|
||||
::
|
||||
++ galaxy-domains
|
||||
|= ames-domains=(list turf)
|
||||
=/ m (async:stdio ,~)
|
||||
^- form:m
|
||||
;< our=@p bind:m get-identity:stdio
|
||||
:: XX urbit/urbit#1314
|
||||
::
|
||||
:: ;< now=@da bind:m get-time:stdio
|
||||
:: =/ ames-domains=(list turf)
|
||||
:: .^((list turf) %j /(scot %p our)/turf/(scot %da now))
|
||||
;< now=@da bind:m get-time:stdio
|
||||
=/ ames-domains=(list turf)
|
||||
.^((list turf) %j /(scot %p our)/turf/(scot %da now))
|
||||
|- ^- form:m
|
||||
=* loop $
|
||||
?~ ames-domains
|
||||
@ -148,7 +157,7 @@
|
||||
:~ leaf+"XX check via nslookup"
|
||||
leaf+"XX confirm port 80"
|
||||
==
|
||||
;< ~ bind:m (hall-app-message %dns msg)
|
||||
;< ~ bind:m (app-message %dns msg)
|
||||
loop(ames-domains t.ames-domains)
|
||||
::
|
||||
:: +request-by-ip
|
||||
@ -197,7 +206,7 @@
|
||||
::
|
||||
~& %galaxy-only
|
||||
(pure:m state)
|
||||
;< ~ bind:m (galaxy-domains ames-domains.in-poke-data)
|
||||
;< ~ bind:m galaxy-domains
|
||||
(pure:m state)
|
||||
::
|
||||
:: manual dns binding -- by explicit ipv4
|
||||
@ -242,7 +251,7 @@
|
||||
:~ leaf+"XX check via nslookup"
|
||||
leaf+"XX confirm port 80"
|
||||
==
|
||||
;< ~ bind:m (hall-app-message %dns msg)
|
||||
;< ~ bind:m (app-message %dns msg)
|
||||
=? completed.state good (some binding)
|
||||
:: XX save failure?s
|
||||
:: XX unsubscribe?
|
||||
@ -263,12 +272,12 @@
|
||||
?~ error.sign
|
||||
=/ msg=cord
|
||||
(cat 3 'request for DNS sent to ' (scot %p p:collector-app))
|
||||
;< ~ bind:m (hall-app-message %dns msg ~)
|
||||
;< ~ bind:m (app-message %dns msg ~)
|
||||
(pure:m state)
|
||||
:: XX details
|
||||
~& %dns-ip-request-failed
|
||||
%- (slog u.error.sign)
|
||||
(pure:m state)
|
||||
(pure:m state(requested ~))
|
||||
:: re-subscribe if (involuntarily) unsubscribed
|
||||
::
|
||||
%quit
|
||||
@ -284,7 +293,7 @@
|
||||
?~ error.sign
|
||||
=/ msg=cord
|
||||
(cat 3 'awaiting response from ' (scot %p p:collector-app))
|
||||
;< ~ bind:m (hall-app-message %dns msg ~)
|
||||
;< ~ bind:m (app-message %dns msg ~)
|
||||
(pure:m state)
|
||||
:: XX details
|
||||
~& %dns-domain-subscription-failed
|
||||
|
@ -2,9 +2,8 @@
|
||||
:::: /hoon/dojo/app :: ::::
|
||||
:: :: ::
|
||||
/? 309 :: arvo kelvin
|
||||
/- sole, lens :: console structures
|
||||
/+ sole :: console library
|
||||
=, sole
|
||||
/- *sole, lens ::
|
||||
/+ sole, pprint ::
|
||||
:: :: ::
|
||||
:::: :: ::::
|
||||
:: :: ::
|
||||
@ -333,6 +332,12 @@
|
||||
|_ $: hid/bowl :: system state
|
||||
house :: program state
|
||||
== ::
|
||||
::
|
||||
:: pretty-printer aliases
|
||||
::
|
||||
++ xskol `$-(type tank)`type-to-tank:pprint
|
||||
++ xsell `$-(vase tank)`vase-to-tank:pprint
|
||||
::
|
||||
++ he :: per session
|
||||
|_ {moz/(list move) session} ::
|
||||
::
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -58,7 +58,6 @@
|
||||
[%kill wire ~]
|
||||
[%connect wire binding:eyre term]
|
||||
[%http-response http-event:http]
|
||||
[%disconnect binding:eyre]
|
||||
==
|
||||
::
|
||||
+$ poke
|
||||
@ -1245,6 +1244,8 @@
|
||||
::
|
||||
%serve
|
||||
:: XX specialize this check for subfiles
|
||||
?. =(our.bol src.bol)
|
||||
[~ this]
|
||||
?: (~(has by pubs.sat) coll.act)
|
||||
[~ this]
|
||||
=/ files=(list path)
|
||||
@ -1265,9 +1266,25 @@
|
||||
*coin
|
||||
[[our.bol q.byk.bol] /[coll.act]/publish/web]
|
||||
==
|
||||
=/ blog-perms=card
|
||||
:* %perm /perms q.byk.bol
|
||||
/web/publish/[coll.act]
|
||||
%rw `[%black ~] `[%white (ships-to-whom (sy our.bol ~))]
|
||||
==
|
||||
=/ info-perms=card
|
||||
:* %perm /perms q.byk.bol
|
||||
/web/publish/[coll.act]/publish-info
|
||||
%rw `*rule:clay `*rule:clay
|
||||
==
|
||||
%= out
|
||||
moves [[ost.bol %build wir %.y schema] moves.out]
|
||||
builds (~(put in builds.out) wir)
|
||||
::
|
||||
moves
|
||||
:* [ost.bol %build wir %.y schema]
|
||||
[ost.bol blog-perms]
|
||||
[ost.bol info-perms]
|
||||
moves.out
|
||||
==
|
||||
==
|
||||
::
|
||||
[%web %publish @tas @tas %udon ~]
|
||||
@ -1288,10 +1305,22 @@
|
||||
*coin
|
||||
[[our.bol q.byk.bol] /[post]/[coll.act]/publish/web]
|
||||
==
|
||||
=/ post-perms=card
|
||||
:* %perm /perms q.byk.bol
|
||||
/web/publish/[coll.act]/[post]/udon
|
||||
%w `[%white (ships-to-whom (sy our.bol ~))]
|
||||
==
|
||||
=/ comment-perms=card
|
||||
:* %perm /perms q.byk.bol
|
||||
/web/publish/[coll.act]/[post]
|
||||
%w `[%black ~]
|
||||
==
|
||||
%= out
|
||||
moves
|
||||
:* [ost.bol %build post-wir %.y post-schema]
|
||||
[ost.bol %build comments-wir %.y comments-schema]
|
||||
[ost.bol post-perms]
|
||||
[ost.bol comment-perms]
|
||||
moves.out
|
||||
==
|
||||
::
|
||||
@ -1391,6 +1420,13 @@
|
||||
::
|
||||
==
|
||||
::
|
||||
++ quit-collection
|
||||
|= wir=wire
|
||||
^- (quip move _this)
|
||||
=/ pax=path (weld /collection wir)
|
||||
:_ this
|
||||
[ost.bol %peer pax [src.bol %publish] pax]~
|
||||
::
|
||||
++ bound
|
||||
|= [wir=wire success=? binding=binding:eyre]
|
||||
^- (quip move _this)
|
||||
@ -1590,7 +1626,21 @@
|
||||
*coin
|
||||
[[our.bol q.byk.bol] /[col]/publish/web]
|
||||
==
|
||||
:- [[ost.bol %build wir %.y schema] mow]
|
||||
=/ blog-perms=card
|
||||
:* %perm /perms q.byk.bol
|
||||
/web/publish/[col]
|
||||
%rw `[%black ~] `[%white (ships-to-whom (sy our.bol ~))]
|
||||
==
|
||||
=/ info-perms=card
|
||||
:* %perm /perms q.byk.bol
|
||||
/web/publish/[col]/publish-info
|
||||
%rw `*rule:clay `*rule:clay
|
||||
==
|
||||
:- :* [ost.bol %build wir %.y schema]
|
||||
[ost.bol blog-perms]
|
||||
[ost.bol info-perms]
|
||||
mow
|
||||
==
|
||||
[[pax mis] sob]
|
||||
::
|
||||
[%web %publish * * %udon ~]
|
||||
@ -1610,9 +1660,22 @@
|
||||
*coin
|
||||
[[our.bol q.byk.bol] /[pos]/[col]/publish/web]
|
||||
==
|
||||
:- :+ [ost.bol %build post-wir %.y post-schema]
|
||||
=/ post-perms=card
|
||||
:* %perm /perms q.byk.bol
|
||||
/web/publish/[col]/[pos]/udon
|
||||
%w `[%white (ships-to-whom (sy our.bol ~))]
|
||||
==
|
||||
=/ comment-perms=card
|
||||
:* %perm /perms q.byk.bol
|
||||
/web/publish/[col]/[pos]
|
||||
%w `[%black ~]
|
||||
==
|
||||
:- :* [ost.bol %build post-wir %.y post-schema]
|
||||
[ost.bol %build comment-wir %.y comment-schema]
|
||||
[ost.bol post-perms]
|
||||
[ost.bol comment-perms]
|
||||
mow
|
||||
==
|
||||
[[pax mis] sob]
|
||||
::
|
||||
[%web %publish * * * %publish-comment ~]
|
||||
@ -1694,21 +1757,26 @@
|
||||
[~ this]
|
||||
=/ coll=@tas i.wir
|
||||
=/ pax /web/publish/[coll]
|
||||
?. (allowed src.bol %read pax)
|
||||
:_ this
|
||||
[ost.bol %quit ~]~
|
||||
::
|
||||
=/ col=(unit collection) (~(get by pubs.sat) coll)
|
||||
?~ col
|
||||
:_ this
|
||||
[ost.bol %quit ~]~
|
||||
?> (allowed src.bol %read pax)
|
||||
=/ col=collection (~(got by pubs.sat) coll)
|
||||
=/ new=collection
|
||||
u.col(subscribers (~(put in subscribers.u.col) src.bol))
|
||||
col(subscribers (~(put in subscribers.col) src.bol))
|
||||
=/ rum=rumor
|
||||
[%total our.bol coll new]
|
||||
:_ this(pubs.sat (~(put by pubs.sat) coll new))
|
||||
[ost.bol %diff %publish-rumor rum]~
|
||||
::
|
||||
++ reap
|
||||
|= [wir=wire err=(unit tang)]
|
||||
^- (quip move _this)
|
||||
?~ err
|
||||
[~ this]
|
||||
?> ?=([%collection @tas ~] wir)
|
||||
=/ col=@tas i.t.wir
|
||||
%- (slog [leaf+"failed to subscribe to blog: {<col>}"]~)
|
||||
:- ~
|
||||
this(outgoing.sat (~(del by outgoing.sat) wir))
|
||||
::
|
||||
++ diff-publish-rumor
|
||||
|= [wir=wire rum=rumor]
|
||||
^- (quip move _this)
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -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]
|
||||
|
@ -6,7 +6,7 @@
|
||||
/+ *generators
|
||||
:- %ask
|
||||
|= [[now=@da eny=@uvJ bec=beak] ~ ~]
|
||||
^- (sole-result [%dns-auto (list turf)])
|
||||
^- (sole-result [%dns-auto ~])
|
||||
=* our p.bec
|
||||
=/ rac (clan:title our)
|
||||
::
|
||||
@ -23,7 +23,4 @@
|
||||
%+ print leaf+msg3
|
||||
%+ print leaf+msg2
|
||||
(print leaf+msg1 no-product)
|
||||
::
|
||||
=/ ames-domains=(list turf)
|
||||
.^((list turf) %j /(scot %p our)/turf/(scot %da now))
|
||||
(produce [%dns-auto ames-domains])
|
||||
(produce [%dns-auto ~])
|
||||
|
@ -1,13 +0,0 @@
|
||||
:: Load legacy messages from backup
|
||||
::
|
||||
:::: /gen/hall/load-old/hoon
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
::::
|
||||
::
|
||||
:- %say
|
||||
|= $: {now/@da eny/@uvJ byk/beak}
|
||||
{{man/knot ~} ~}
|
||||
==
|
||||
[%load-legacy man]
|
@ -1,13 +0,0 @@
|
||||
:: Load channel messages from backup
|
||||
::
|
||||
:::: /hoon/load/hall/gen
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
::::
|
||||
::
|
||||
:- %say
|
||||
|= $: {now/@da eny/@uvJ byk/beak}
|
||||
{{man/knot ~} ~}
|
||||
==
|
||||
[%hall-load man]
|
@ -1,13 +0,0 @@
|
||||
:: Enable channel logging to clay
|
||||
::
|
||||
:::: /hoon/log/hall/gen
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
::::
|
||||
::
|
||||
:- %say
|
||||
|= $: {now/@da eny/@uvJ byk/beak}
|
||||
{{man/knot ~} ~}
|
||||
==
|
||||
[%hall-log man]
|
@ -1,13 +0,0 @@
|
||||
:: Save channel messages to backup
|
||||
::
|
||||
:::: /hoon/save/hall/gen
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
::::
|
||||
::
|
||||
:- %say
|
||||
|= $: {now/@da eny/@uvJ byk/beak}
|
||||
{{man/knot ~} ~}
|
||||
==
|
||||
[%hall-save man]
|
@ -1,13 +0,0 @@
|
||||
:: Disable channel logging to clay
|
||||
::
|
||||
:::: /hoon/unlog/hall/gen
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
::::
|
||||
::
|
||||
:- %say
|
||||
|= $: {now/@da eny/@uvJ byk/beak}
|
||||
{{man/knot ~} ~}
|
||||
==
|
||||
[%hall-unlog man]
|
@ -1,157 +0,0 @@
|
||||
/- *chat, hall
|
||||
/+ hall-json
|
||||
|%
|
||||
++ msg-to-json
|
||||
=, enjs:format
|
||||
|= upd=update
|
||||
^- json
|
||||
?> ?=(%messages -.upd)
|
||||
%+ frond %update
|
||||
%- pairs
|
||||
:~
|
||||
:- %messages
|
||||
%- pairs
|
||||
:~
|
||||
[%circle (circ:enjs:hall-json cir.upd)]
|
||||
[%start (numb start.upd)]
|
||||
[%end (numb end.upd)]
|
||||
[%envelopes [%a (turn env.upd enve:enjs:hall-json)]]
|
||||
==
|
||||
==
|
||||
::
|
||||
++ config-to-json
|
||||
|= str=streams
|
||||
=, enjs:format
|
||||
^- json
|
||||
%+ frond %chat
|
||||
%- pairs
|
||||
:~
|
||||
::
|
||||
[%inbox (conf:enjs:hall-json inbox.str)]
|
||||
::
|
||||
:- %configs
|
||||
%- pairs
|
||||
%+ turn ~(tap by configs.str)
|
||||
|= [cir=circle:hall con=(unit config:hall)]
|
||||
^- [@t json]
|
||||
:- (crip (circ:en-tape:hall-json cir))
|
||||
?~(con ~ (conf:enjs:hall-json u.con))
|
||||
::
|
||||
:- %circles :- %a
|
||||
%+ turn ~(tap in circles.str)
|
||||
|= nom=name:hall
|
||||
[%s nom]
|
||||
::
|
||||
:- %peers
|
||||
%- pairs
|
||||
%+ turn ~(tap by peers.str)
|
||||
|= [cir=circle:hall per=(set @p)]
|
||||
^- [@t json]
|
||||
:- (crip (circ:en-tape:hall-json cir))
|
||||
[%a (turn ~(tap in per) ship)]
|
||||
::
|
||||
==
|
||||
::
|
||||
++ numbers-to-json
|
||||
|= num=(list [circle:hall @ud])
|
||||
^- json
|
||||
=, enjs:format
|
||||
%+ frond %chat
|
||||
%- pairs
|
||||
:~
|
||||
::
|
||||
:: %config
|
||||
:- %numbers
|
||||
:- %a
|
||||
%+ turn num
|
||||
|= [cir=circle:hall len=@ud]
|
||||
^- json
|
||||
%- pairs
|
||||
:~
|
||||
[%circle (circ:enjs:hall-json cir)]
|
||||
[%length (numb len)]
|
||||
==
|
||||
==
|
||||
::
|
||||
++ update-to-json
|
||||
|= upd=update
|
||||
^- json
|
||||
=, enjs:format
|
||||
%+ frond %update
|
||||
%- pairs
|
||||
:~
|
||||
::
|
||||
:: %inbox
|
||||
?: =(%inbox -.upd)
|
||||
?> ?=(%inbox -.upd)
|
||||
[%inbox (conf:enjs:hall-json con.upd)]
|
||||
::
|
||||
:: %message
|
||||
?: =(%message -.upd)
|
||||
?> ?=(%message -.upd)
|
||||
:- %message
|
||||
%- pairs
|
||||
:~
|
||||
[%circle (circ:enjs:hall-json cir.upd)]
|
||||
[%envelope (enve:enjs:hall-json env.upd)]
|
||||
==
|
||||
::
|
||||
:: %messages
|
||||
?: =(%messages -.upd)
|
||||
?> ?=(%messages -.upd)
|
||||
:- %messages
|
||||
%- pairs
|
||||
:~
|
||||
[%circle (circ:enjs:hall-json cir.upd)]
|
||||
[%start (numb start.upd)]
|
||||
[%end (numb end.upd)]
|
||||
[%envelopes [%a (turn env.upd enve:enjs:hall-json)]]
|
||||
==
|
||||
::
|
||||
:: %config
|
||||
?: =(%config -.upd)
|
||||
?> ?=(%config -.upd)
|
||||
:- %config
|
||||
%- pairs
|
||||
:~
|
||||
[%circle (circ:enjs:hall-json cir.upd)]
|
||||
[%config (conf:enjs:hall-json con.upd)]
|
||||
==
|
||||
::
|
||||
:: %circles
|
||||
?: =(%circles -.upd)
|
||||
?> ?=(%circles -.upd)
|
||||
:- %circles
|
||||
%- pairs
|
||||
:~
|
||||
:- %circles
|
||||
:- %a
|
||||
%+ turn ~(tap in cir.upd)
|
||||
|= nom=name:hall
|
||||
[%s nom]
|
||||
==
|
||||
::
|
||||
:: %peers
|
||||
?: =(%peers -.upd)
|
||||
?> ?=(%peers -.upd)
|
||||
:- %peers
|
||||
%- pairs
|
||||
:~
|
||||
[%circle (circ:enjs:hall-json cir.upd)]
|
||||
[%peers [%a (turn ~(tap in per.upd) ship:enjs:format)]]
|
||||
==
|
||||
::
|
||||
:: %delete
|
||||
?: =(%delete -.upd)
|
||||
?> ?=(%delete -.upd)
|
||||
:- %delete
|
||||
%- pairs
|
||||
:~
|
||||
[%circle (circ:enjs:hall-json cir.upd)]
|
||||
==
|
||||
::
|
||||
:: %noop
|
||||
[*@t *^json]
|
||||
==
|
||||
::
|
||||
--
|
@ -1,610 +0,0 @@
|
||||
::
|
||||
:::: /lib/hall-json/hoon
|
||||
::
|
||||
/- hall
|
||||
=, hall
|
||||
::
|
||||
|_ bol/bowl:gall
|
||||
++ en-tape ::: sur to tape
|
||||
|%
|
||||
++ circ ::: circle
|
||||
|= a/circle
|
||||
:(weld (scow %p hos.a) "/" (trip nom.a))
|
||||
::
|
||||
++ rang ::: range
|
||||
|= a/range
|
||||
?~ a ~
|
||||
;: weld
|
||||
"/" (scow hed.u.a)
|
||||
?~ tal.u.a ~
|
||||
(scow u.tal.u.a)
|
||||
==
|
||||
::
|
||||
++ sorc ::: source
|
||||
|= a/source
|
||||
(weld (circ cir.a) (rang ran.a))
|
||||
--
|
||||
::
|
||||
++ de-tape ::: tape to sur (parse)
|
||||
|%
|
||||
++ circ ::: circle
|
||||
;~((glue net) ;~(pfix sig fed:ag) urs:ab)
|
||||
::
|
||||
++ pont
|
||||
;~ pfix net
|
||||
%+ sear
|
||||
|= a/coin
|
||||
^- (unit place)
|
||||
?+ a ~
|
||||
[%$ %da @da] `p.a
|
||||
[%$ %ud @ud] `p.a
|
||||
==
|
||||
nuck:so
|
||||
==
|
||||
::
|
||||
++ sorc
|
||||
;~(plug circ (punt ;~(plug pont (punt pont))))
|
||||
--
|
||||
::
|
||||
++ enjs ::: sur to json
|
||||
=, enjs:format
|
||||
|%
|
||||
::TODO these first few should probably make their way
|
||||
:: into the stdlib...
|
||||
++ sa ::: set as array
|
||||
|* {a/(set) b/$-(* json)}
|
||||
^- json
|
||||
[%a (turn ~(tap in a) b)]
|
||||
::
|
||||
++ mo ::: map as object
|
||||
|* {a/(map) b/$-(* @t) c/$-(* json)}
|
||||
^- json
|
||||
=- (pairs (turn ~(tap by a) -))
|
||||
|* {k/* v/*} [(b k) (c v)]
|
||||
::
|
||||
++ dank ::: tank
|
||||
|= a=^tank
|
||||
?: ?=($leaf -.a) (frond %leaf (tape p.a))
|
||||
:: TODO: No idea what a plum is, but it was recently added
|
||||
::
|
||||
?: ?=($plum -.a) (frond %plum [%o ~])
|
||||
%+ frond -.a
|
||||
%- pairs
|
||||
?- -.a
|
||||
$palm
|
||||
:+ :- %style
|
||||
%- pairs :~
|
||||
mid+(tape p.p.a)
|
||||
cap+(tape q.p.a)
|
||||
open+(tape r.p.a)
|
||||
close+(tape s.p.a)
|
||||
==
|
||||
lines+a+(turn q.a dank)
|
||||
~
|
||||
$rose
|
||||
:+ :- %style
|
||||
%- pairs :~
|
||||
mid+(tape p.p.a)
|
||||
open+(tape q.p.a)
|
||||
close+(tape r.p.a)
|
||||
==
|
||||
lines+a+(turn q.a dank)
|
||||
~
|
||||
==
|
||||
::
|
||||
++ cord ::: string from cord
|
||||
|= a/@t
|
||||
s+a
|
||||
::
|
||||
++ mabe ::: null or value
|
||||
|* {a/(unit) b/$-(* json)}
|
||||
^- json
|
||||
?~(a ~ (b u.a))
|
||||
::
|
||||
::: ||
|
||||
::: || %query-models
|
||||
::: ||
|
||||
::: models relating to queries, their results and updates.
|
||||
::+|
|
||||
::
|
||||
++ pici ::: prize-client
|
||||
|= a/prize-client
|
||||
^- json
|
||||
%- pairs :~
|
||||
:- %gys
|
||||
=- (pairs ~(tap by (~(run by gys.a) -)))
|
||||
|=((set (set circle)) (sa +< audi))
|
||||
::
|
||||
nis+(mo nis.a (cury scot %p) cord)
|
||||
==
|
||||
::
|
||||
++ ruci ::: rumor-client
|
||||
|= a/rumor-client
|
||||
^- json
|
||||
%+ frond -.a
|
||||
?- -.a
|
||||
$glyph (digy +.a)
|
||||
$nick (dini +.a)
|
||||
==
|
||||
::
|
||||
++ pack ::: package
|
||||
|= a/package
|
||||
^- json
|
||||
%- pairs :~
|
||||
nes+a+(turn nes.a enve) ::TODO maybe map
|
||||
cos+(loby cos.a)
|
||||
pes+(crow pes.a)
|
||||
==
|
||||
::
|
||||
++ digy ::: diff-glyph
|
||||
|= a/diff-glyph
|
||||
^- json
|
||||
%- pairs :~
|
||||
bin+b+bin.a
|
||||
gyf+s+gyf.a
|
||||
aud+(audi aud.a)
|
||||
==
|
||||
::
|
||||
++ dini ::: diff-nick
|
||||
|= a/diff-nick
|
||||
^- json
|
||||
(pairs who+(ship who.a) nic+s+nic.a ~)
|
||||
::
|
||||
++ ruso ::: rumor-story
|
||||
|= a/rumor-story
|
||||
^- json
|
||||
%+ frond -.a
|
||||
?+ -.a !!
|
||||
$new (conf cof.a)
|
||||
:: $bear not needed
|
||||
$config (pairs cir+(circ cir.a) dif+(dico dif.a) ~)
|
||||
$status %- pairs :~
|
||||
cir+(circ cir.a)
|
||||
who+(ship who.a)
|
||||
dif+(disa dif.a)
|
||||
==
|
||||
$remove b+&
|
||||
$gram (enve nev.a)
|
||||
==
|
||||
::
|
||||
++ dico ::: diff-config
|
||||
|= a/diff-config
|
||||
^- json
|
||||
%+ frond -.a
|
||||
?- -.a
|
||||
$full (conf cof.a)
|
||||
$source (pairs add+b+add.a src+(sorc src.a) ~)
|
||||
$caption s+cap.a
|
||||
$usage (pairs add+b+add.a tas+(sa tas.a cord) ~)
|
||||
$filter (filt fit.a)
|
||||
$secure s+sec.a
|
||||
$permit (pairs add+b+add.a sis+(sa sis.a ship) ~)
|
||||
$remove b+&
|
||||
$read (numb red.a)
|
||||
==
|
||||
::
|
||||
++ disa ::: diff-status
|
||||
|= a/diff-status
|
||||
^- json
|
||||
%+ frond -.a
|
||||
?- -.a
|
||||
$full (stat sat.a)
|
||||
$presence s+pec.a
|
||||
$human (dihu dif.a)
|
||||
$remove b+&
|
||||
==
|
||||
::
|
||||
++ dihu ::: diff-human
|
||||
|= a/diff-human
|
||||
^- json
|
||||
%+ frond -.a
|
||||
?- -.a
|
||||
$full (huma man.a)
|
||||
$handle (frond %han (mabe han.a cord))
|
||||
$true (frond %tru (mabe tru.a trun))
|
||||
==
|
||||
::
|
||||
::: ||
|
||||
::: || %circles
|
||||
::: ||
|
||||
::: messaging targets and their metadata
|
||||
::+|
|
||||
::
|
||||
++ circ ::: circle
|
||||
|= a/circle
|
||||
^- json
|
||||
s+(crip (circ:en-tape a))
|
||||
::
|
||||
++ loby ::: lobby
|
||||
|= a/lobby
|
||||
%- pairs :~
|
||||
loc+(conf loc.a)
|
||||
rem+(mo rem.a (cork circ:en-tape crip) conf)
|
||||
==
|
||||
::
|
||||
++ conf ::: config
|
||||
|= a/config
|
||||
^- json
|
||||
%- pairs :~
|
||||
src+(sa src.a sorc)
|
||||
cap+s+cap.a
|
||||
tag+(sa tag.a cord)
|
||||
fit+(filt fit.a)
|
||||
con+(cont con.a)
|
||||
red+(numb red.a)
|
||||
==
|
||||
::
|
||||
++ sorc ::: source
|
||||
|= a/source
|
||||
^- json
|
||||
s+(crip (sorc:en-tape a))
|
||||
::
|
||||
++ filt ::: filter
|
||||
|= a/filter
|
||||
^- json
|
||||
(pairs cas+b+cas.a utf+b+utf.a ~)
|
||||
::
|
||||
++ cont ::: control
|
||||
|= a/control
|
||||
^- json
|
||||
(pairs sec+s+sec.a sis+(sa sis.a ship) ~)
|
||||
::
|
||||
++ crow ::: crowd
|
||||
|= a/crowd
|
||||
^- json
|
||||
%- pairs :~
|
||||
loc+(grop loc.a)
|
||||
rem+(mo rem.a (cork circ:en-tape crip) grop)
|
||||
==
|
||||
::
|
||||
++ grop ::: group
|
||||
|= a/group
|
||||
^- json
|
||||
(mo a (cury scot %p) stat)
|
||||
::
|
||||
++ stat ::: status
|
||||
|= a/status
|
||||
^- json
|
||||
(pairs pec+s+pec.a man+(huma man.a) ~)
|
||||
::
|
||||
++ huma ::: human
|
||||
|= a/human
|
||||
^- json
|
||||
(pairs han+(mabe han.a cord) tru+(mabe tru.a trun) ~)
|
||||
::
|
||||
++ trun ::: truename
|
||||
|= a/truename
|
||||
^- json
|
||||
(pairs fir+s+fir.a mid+(mabe mid.a cord) las+s+las.a ~)
|
||||
::
|
||||
::: ||
|
||||
::: || %message-data
|
||||
::: ||
|
||||
::: structures for containing main message data
|
||||
::+|
|
||||
::
|
||||
++ enve ::: envelope
|
||||
|= a/envelope
|
||||
^- json
|
||||
(pairs num+(numb num.a) gam+(gram gam.a) ~)
|
||||
::
|
||||
++ gram ::: telegram
|
||||
|= a/telegram
|
||||
^- json
|
||||
%- pairs :~
|
||||
aut+(ship aut.a)
|
||||
::TODO can we avoid this code duplication somehow?
|
||||
uid+s+(scot %uv uid.a)
|
||||
aud+(audi aud.a)
|
||||
wen+(time wen.a)
|
||||
sep+(spec sep.a)
|
||||
==
|
||||
::
|
||||
++ thot ::: thought
|
||||
|= a/thought
|
||||
^- json
|
||||
%- pairs :~
|
||||
uid+s+(scot %uv uid.a)
|
||||
aud+(audi aud.a)
|
||||
wen+(time wen.a)
|
||||
sep+(spec sep.a)
|
||||
==
|
||||
::
|
||||
++ spec ::: speech
|
||||
|= a/speech
|
||||
^- json
|
||||
:: only %url has just a single piece of data.
|
||||
?: ?=($url -.a)
|
||||
(frond %url s+(crip (apix:en-purl:html url.a)))
|
||||
%+ frond -.a
|
||||
%- pairs
|
||||
?- -.a
|
||||
$lin ~[pat+b+pat.a msg+s+msg.a]
|
||||
$exp ~[exp+s+exp.a res+a+(turn res.a tank)]
|
||||
$ire ~[top+s+(scot %uv top.a) sep+(spec sep.a)] ::TODO @uv as number?
|
||||
$fat ~[tac+(atta tac.a) sep+(spec sep.a)]
|
||||
$inv ~[inv+b+inv.a cir+(circ cir.a)]
|
||||
$app ~[app+s+app.a sep+(spec sep.a)]
|
||||
==
|
||||
::
|
||||
++ atta ::: attache
|
||||
|= a/attache
|
||||
^- json
|
||||
%+ frond -.a
|
||||
?- -.a
|
||||
$name (pairs nom+s+nom.a tac+(atta tac.a) ~)
|
||||
$text s+(of-wain:format +.a)
|
||||
$tank a+(turn +.a tank)
|
||||
==
|
||||
::
|
||||
::: ||
|
||||
::: || %message-metadata
|
||||
::: ||
|
||||
::: structures for containing message metadata
|
||||
::+|
|
||||
::
|
||||
++ audi ::: audience
|
||||
|= a/audience
|
||||
^- json
|
||||
(sa a circ)
|
||||
--
|
||||
::
|
||||
++ dejs ::: json to sur
|
||||
=, dejs-soft:format
|
||||
|%
|
||||
::TODO these first few should maybe make their way
|
||||
:: into the stdlib...
|
||||
++ re ::: recursive reparsers
|
||||
|* {gar/* sef/_|.(fist)}
|
||||
|= jon/json
|
||||
^- (unit _gar)
|
||||
=- ~! gar ~! (need -) -
|
||||
((sef) jon)
|
||||
::
|
||||
++ as ::: array as set
|
||||
|* a/fist
|
||||
(cu ~(gas in *(set _(need *a))) (ar a))
|
||||
::
|
||||
++ dank ::: tank
|
||||
^- $-(json (unit tank))
|
||||
%+ re *tank |. ~+
|
||||
%- of :~
|
||||
leaf+sa
|
||||
palm+(ot style+(ot mid+sa cap+sa open+sa close+sa ~) lines+(ar dank) ~)
|
||||
rose+(ot style+(ot mid+sa open+sa close+sa ~) lines+(ar dank) ~)
|
||||
==
|
||||
::
|
||||
::: ||
|
||||
::: || %query-models
|
||||
::: ||
|
||||
::: models relating to queries, their results and updates.
|
||||
::+|
|
||||
::
|
||||
++ pici ::: prize-client
|
||||
^- $-(json (unit prize-client))
|
||||
%- ot :~
|
||||
gys+(om (as (as circ)))
|
||||
nis+(op fed:ag so)
|
||||
==
|
||||
::
|
||||
++ ruci ::: rumor-client
|
||||
^- $-(json (unit rumor-client))
|
||||
%- of :~
|
||||
glyph+digy
|
||||
nick+dini
|
||||
==
|
||||
::
|
||||
++ pack ::: package
|
||||
^- $-(json (unit package))
|
||||
%- ot :~
|
||||
nes+(ar enve)
|
||||
cos+loby
|
||||
pes+crow
|
||||
==
|
||||
::
|
||||
++ digy ::: diff-glyph
|
||||
^- $-(json (unit diff-glyph))
|
||||
(ot bin+bo gyf+so aud+audi ~)
|
||||
::
|
||||
++ dini ::: diff-nick
|
||||
^- $-(json (unit diff-nick))
|
||||
(ot who+(su fed:ag) nic+so ~)
|
||||
::
|
||||
++ ruso ::: rumor-story
|
||||
^- $-(json (unit rumor-story))
|
||||
%- of :~
|
||||
new+conf
|
||||
:: bear not needed
|
||||
config+(ot cir+circ dif+dico ~)
|
||||
status+(ot cir+circ who+(su fed:ag) dif+disa ~)
|
||||
remove+ul
|
||||
gram+(ot src+circ nev+enve ~)
|
||||
==
|
||||
::
|
||||
++ dico ::: diff-config
|
||||
^- $-(json (unit diff-config))
|
||||
%- of :~
|
||||
full+conf
|
||||
source+(ot add+bo src+sorc ~)
|
||||
usage+(ot add+bo tas+(as so) ~)
|
||||
caption+so
|
||||
filter+filt
|
||||
secure+secu
|
||||
permit+(ot add+bo sis+(as (su fed:ag)) ~)
|
||||
remove+ul
|
||||
==
|
||||
::
|
||||
++ disa ::: diff-status
|
||||
^- $-(json (unit diff-status))
|
||||
%- of :~
|
||||
full+(ot pec+pres man+huma ~)
|
||||
presence+pres
|
||||
human+dihu
|
||||
remove+ul
|
||||
==
|
||||
::
|
||||
++ dihu ::: diff-human
|
||||
^- $-(json (unit diff-human))
|
||||
%- of :~
|
||||
full+huma
|
||||
handle+(mu so)
|
||||
true+(mu trun)
|
||||
==
|
||||
::
|
||||
::: ||
|
||||
::: || %circles
|
||||
::: ||
|
||||
::: messaging targets and their metadata.
|
||||
::+|
|
||||
::
|
||||
::TODO maybe just an object?
|
||||
++ circ ::: circle
|
||||
^- $-(json (unit circle))
|
||||
(su circ:de-tape)
|
||||
::
|
||||
++ loby ::: lobby
|
||||
^- $-(json (unit lobby))
|
||||
(ot loc+conf rem+(op circ:de-tape conf) ~)
|
||||
::
|
||||
++ conf ::: config
|
||||
^- $-(json (unit config))
|
||||
%- ot :~
|
||||
src+(as sorc)
|
||||
cap+so
|
||||
tag+(as so)
|
||||
fit+filt
|
||||
con+cont
|
||||
red+ni
|
||||
==
|
||||
::
|
||||
::TODO maybe just an object?
|
||||
++ sorc ::: source
|
||||
^- $-(json (unit source))
|
||||
(su sorc:de-tape)
|
||||
::
|
||||
++ filt ::: filter
|
||||
^- $-(json (unit filter))
|
||||
(ot cas+bo utf+bo ~)
|
||||
::
|
||||
++ cont ::: control
|
||||
^- $-(json (unit control))
|
||||
(ot sec+secu sis+(as (su fed:ag)) ~)
|
||||
::
|
||||
++ secu ::: security
|
||||
^- $-(json (unit security))
|
||||
(su (perk %channel %village %journal %mailbox %custom ~))
|
||||
::
|
||||
++ crow ::: crowd
|
||||
^- $-(json (unit crowd))
|
||||
(ot loc+grop rem+(op circ:de-tape grop) ~)
|
||||
::
|
||||
++ grop ::: group
|
||||
^- $-(json (unit group))
|
||||
(op fed:ag stat)
|
||||
::
|
||||
++ stat ::: status
|
||||
^- $-(json (unit status))
|
||||
(ot pec+pres man+huma ~)
|
||||
::
|
||||
++ pres ::: presence
|
||||
^- $-(json (unit presence))
|
||||
(su (perk %gone %idle %hear %talk ~))
|
||||
::
|
||||
++ huma ::: human
|
||||
^- $-(json (unit human))
|
||||
(ot han+(mu so) tru+(mu trun) ~)
|
||||
::
|
||||
++ trun ::: truename
|
||||
^- $-(json (unit truename))
|
||||
(ot fir+so mid+(mu so) las+so ~)
|
||||
::
|
||||
::: ||
|
||||
::: || %message-data
|
||||
::: ||
|
||||
::: structures for containing main message data.
|
||||
::+|
|
||||
::
|
||||
++ enve ::: envelope
|
||||
^- $-(json (unit envelope))
|
||||
(ot num+ni gam+gram ~)
|
||||
::
|
||||
++ gram ::: telegram
|
||||
^- $-(json (unit telegram))
|
||||
%- ot :~
|
||||
aut+(su fed:ag)
|
||||
::TODO can we do anything about this duplication?
|
||||
uid+seri
|
||||
aud+audi
|
||||
wen+di
|
||||
sep+spec
|
||||
==
|
||||
::
|
||||
++ thot ::: thought
|
||||
^- $-(json (unit thought))
|
||||
%- ot :~
|
||||
uid+seri
|
||||
aud+audi
|
||||
wen+di
|
||||
sep+spec
|
||||
==
|
||||
::
|
||||
++ spec ::: speech
|
||||
^- $-(json (unit speech))
|
||||
%+ re *speech |. ~+
|
||||
%- of :~
|
||||
lin+(ot pat+bo msg+so ~)
|
||||
url+(su aurf:de-purl:html)
|
||||
exp+eval
|
||||
ire+(ot top+seri sep+spec ~)
|
||||
fat+(ot tac+atta sep+spec ~)
|
||||
inv+(ot inv+bo cir+circ ~)
|
||||
app+(ot app+so sep+spec ~)
|
||||
==
|
||||
::
|
||||
++ eval ::: %exp speech
|
||||
::: extract contents of an %exp speech, evaluating
|
||||
::: the {exp} if there is no {res} yet.
|
||||
::
|
||||
|= a/json
|
||||
^- (unit {cord (list tank)})
|
||||
=+ exp=((ot exp+so ~) a)
|
||||
?~ exp ~
|
||||
:+ ~ u.exp
|
||||
=+ res=((ot res+(ar dank) ~) a)
|
||||
?^ res u.res
|
||||
:: XX revisit
|
||||
::
|
||||
:: this double-virtualizes and clams to disable .^
|
||||
:: the subject of the eval should include [our now eny]
|
||||
::
|
||||
;; (list tank)
|
||||
=< +>
|
||||
%+ mong
|
||||
:- mute
|
||||
|.([(sell (slap !>(..^zuse) (ream u.exp)))]~)
|
||||
|=(^ ~)
|
||||
::
|
||||
++ atta ::: attache
|
||||
^- $-(json (unit attache))
|
||||
%+ re *attache |. ~+
|
||||
%- of :~
|
||||
name+(ot nom+so tac+atta ~)
|
||||
text+(cu to-wain:format so)
|
||||
tank+(ar dank)
|
||||
==
|
||||
::
|
||||
::: ||
|
||||
::: || %message-metadata
|
||||
::: ||
|
||||
:: structures for containing message metadata.
|
||||
::+|
|
||||
::
|
||||
++ seri ::: serial
|
||||
^- $-(json (unit serial))
|
||||
(ci (slat %uv) so)
|
||||
::
|
||||
++ audi ::: audience
|
||||
^- $-(json (unit audience))
|
||||
(as circ)
|
||||
--
|
||||
--
|
@ -1,199 +0,0 @@
|
||||
::
|
||||
/? 310
|
||||
/- hall
|
||||
=, eyre
|
||||
=>
|
||||
|%
|
||||
++ audience (map partner (pair envelope delivery)) :: destination+state
|
||||
++ bouquet (set flavor) :: complete aroma
|
||||
++ delivery :: delivery state
|
||||
$? $pending :: undelivered
|
||||
$received :: delivered
|
||||
$rejected :: undeliverable
|
||||
$released :: sent one-way
|
||||
$accepted :: fully processed
|
||||
== ::
|
||||
++ envelope (pair ? (unit partner)) :: visible sender
|
||||
++ flavor path :: content flavor
|
||||
++ passport :: foreign flow
|
||||
$% {$twitter p/@t} :: twitter
|
||||
== ::
|
||||
++ presence ?($gone $hear $talk) :: status type
|
||||
++ speech :: narrative action
|
||||
$% {$lan p/knot q/@t} :: local announce
|
||||
{$exp p/@t} :: hoon line
|
||||
{$non ~} :: no content (yo)
|
||||
{$ext p/@tas q/*} :: extended action
|
||||
{$fat p/torso q/speech} :: attachment
|
||||
{$url p/purf} :: parsed url
|
||||
{$ire p/serial q/speech} :: in-reply-to
|
||||
{$lin p/? q/@t} :: no/@ text line
|
||||
{$mor p/(list speech)} :: multiplex
|
||||
{$app p/@tas q/@t} :: app message
|
||||
$: $api :: api message
|
||||
service/@tas :: service name
|
||||
id/@t :: id on the service
|
||||
id-url/purf :: link to id
|
||||
summary/@t :: summary of event
|
||||
body/@t :: body of event
|
||||
url/purf :: link to event
|
||||
meta/json :: other data for web
|
||||
== ::
|
||||
== ::
|
||||
++ serial @uvH :: unique identity
|
||||
++ partner (each station passport) :: interlocutor
|
||||
++ statement (trel @da bouquet speech) :: when this
|
||||
++ station (pair ship knot) :: domestic flow
|
||||
++ telegram (pair ship thought) :: who which whom what
|
||||
++ thought (trel serial audience statement) :: which whom what
|
||||
++ torso :: attachment
|
||||
$% {$name (pair @t torso)} :: named attachment
|
||||
{$text (list @t)} :: text lines
|
||||
{$tank (list tank)} :: tank list
|
||||
== ::
|
||||
--
|
||||
|%
|
||||
++ from-json
|
||||
=, dejs-soft:format
|
||||
|: $:{a/^json} ^- (list telegram:hall)
|
||||
=- %- zing
|
||||
%+ turn
|
||||
(need ((ar (ot ship+(su fed:ag) thought+thot ~)) a))
|
||||
convert-telegram
|
||||
|%
|
||||
++ of
|
||||
|* a/(pole {@tas fist})
|
||||
|= b/^json
|
||||
%. ((of:dejs-soft:format a) b)
|
||||
%- slog
|
||||
?+ b ~
|
||||
{$o *}
|
||||
%+ murn `(list {@tas fist})`a
|
||||
|= {c/term d/fist} ^- (unit tank)
|
||||
=+ (~(get by p.b) c)
|
||||
?~ - ~
|
||||
=+ (d u)
|
||||
?~ - (some >[c u]<)
|
||||
~
|
||||
==
|
||||
++ op :: parse keys of map
|
||||
|* {fel/rule wit/fist}
|
||||
%+ cu malt
|
||||
%+ ci
|
||||
|= a/(map cord _(need *wit))
|
||||
^- (unit (list _[(wonk *fel) (need *wit)]))
|
||||
(zl (turn ~(tap by a) (head-rush fel)))
|
||||
(om wit)
|
||||
::
|
||||
++ as :: array as set
|
||||
|* a/fist
|
||||
(cu ~(gas in *(set _(need *a))) (ar a))
|
||||
::
|
||||
++ ke :: callbacks
|
||||
|* {gar/* sef/_|.(fist)}
|
||||
|= jon/^json
|
||||
^- (unit _gar)
|
||||
=- ~! gar ~! (need -) -
|
||||
((sef) jon)
|
||||
::
|
||||
++ lake |*(a/_* $-(^json (unit a)))
|
||||
++ head-rush
|
||||
|* a/rule
|
||||
|* {cord *}
|
||||
=+ nit=(rush +<- a)
|
||||
?~ nit ~
|
||||
(some [u.nit +>->])
|
||||
::
|
||||
++ thot
|
||||
^- $-(^json (unit thought))
|
||||
%- ot :~
|
||||
serial+`$-(^json (unit serial))`(ci (slat %uv) so)
|
||||
audience+`$-(^json (unit audience))`audi
|
||||
statement+`$-(^json (unit statement))`stam
|
||||
==
|
||||
::
|
||||
++ audi `$-(^json (unit audience))`(op parn memb)
|
||||
++ auri (op parn (ci (soft presence) so))
|
||||
++ memb ^- $-(^json (unit (pair envelope delivery)))
|
||||
(ot envelope+lope delivery+(ci (soft delivery) so) ~)
|
||||
++ lope (ot visible+bo sender+(mu (su parn)) ~)
|
||||
::
|
||||
++ parn
|
||||
^- $-(nail (like partner))
|
||||
%+ pick
|
||||
;~((glue net) ;~(pfix sig fed:ag) urs:ab)
|
||||
%+ sear (soft passport)
|
||||
;~((glue net) sym urs:ab) :: XX [a-z0-9_]{1,15}
|
||||
::
|
||||
++ stam (ot date+di bouquet+(as (ar so)) speech+spec ~)
|
||||
++ spec
|
||||
%+ ke *speech |. ~+
|
||||
%- of :~
|
||||
lin+(ot say+bo txt+so ~)
|
||||
url+(ot txt+(su aurf:de-purl:html) ~)
|
||||
exp+(ot txt+so ~)
|
||||
app+(ot txt+so src+so ~)
|
||||
fat+(ot tor+tors taf+spec ~)
|
||||
ext+(ot nom+so txe+blob ~)
|
||||
non+ul
|
||||
mor+(ar spec)
|
||||
:: inv+(ot ship+(su fed:ag) party+(su urs:ab) ~)
|
||||
==
|
||||
++ tors
|
||||
%+ ke *torso |. ~+
|
||||
%- of :~
|
||||
name+(ot nom+so mon+tors ~)
|
||||
text+(cu to-wain:format so)
|
||||
tank+(ot dat+(cu (list tank) blob) ~)
|
||||
==
|
||||
::
|
||||
++ blob (cu cue (su fel:de-base64:mimes:html))
|
||||
::
|
||||
::
|
||||
++ convert-telegram
|
||||
|= t/telegram
|
||||
^- (list telegram:hall)
|
||||
=+ aud=(convert-audience q.q.t)
|
||||
%+ turn (convert-speech r.r.q.t)
|
||||
|= s/speech:hall
|
||||
[p.t p.q.t aud p.r.q.t s]
|
||||
::
|
||||
++ convert-audience
|
||||
|= a/audience
|
||||
^- audience:hall
|
||||
%- sy
|
||||
^- (list circle:hall)
|
||||
%+ murn ~(tap in ~(key by a))
|
||||
|= p/partner
|
||||
^- (unit circle:hall)
|
||||
?- -.p
|
||||
%& :+ ~ p.p.p
|
||||
?: ?| =(q.p.p 'porch')
|
||||
=(q.p.p 'court')
|
||||
=(q.p.p 'floor')
|
||||
==
|
||||
%inbox
|
||||
q.p.p
|
||||
%| ~
|
||||
==
|
||||
::
|
||||
++ convert-speech
|
||||
|= s/speech
|
||||
^- (list speech:hall)
|
||||
?+ -.s ~&([%ignoring -.s] ~)
|
||||
$lin [%lin !p.s q.s]~
|
||||
$url [%url p.s]~
|
||||
$exp [%exp p.s ~]~
|
||||
$ire %+ turn (convert-speech q.s)
|
||||
|= i/speech:hall
|
||||
[%ire p.s i]
|
||||
$app [%app p.s [%lin | q.s]]~
|
||||
$fat ?: &(?=($exp -.q.s) ?=($tank -.p.s))
|
||||
[%exp p.q.s +.p.s]~
|
||||
=+ ses=(convert-speech q.s)
|
||||
=? ses =(0 (lent ses)) [%lin | '']~
|
||||
[[%fat p.s (snag 0 ses)] (slag 1 ses)]
|
||||
$mor (zing (turn p.s convert-speech))
|
||||
==
|
||||
--
|
||||
--
|
@ -1,286 +0,0 @@
|
||||
::
|
||||
:::: /lib/hall/hoon
|
||||
::
|
||||
/- *hall
|
||||
::
|
||||
::::
|
||||
::
|
||||
|_ bol/bowl:gall
|
||||
::
|
||||
::TODO add to zuse?
|
||||
++ true-self
|
||||
|= [our/ship now/@da who/ship]
|
||||
?. ?=($earl (clan:title who)) who
|
||||
(sein:title our now who)
|
||||
::
|
||||
++ above
|
||||
|= [our/ship now/@da who/ship]
|
||||
?: ?=($czar (clan:title who)) ~zod
|
||||
(sein:title our now who)
|
||||
::
|
||||
++ said-url :: app url
|
||||
|= url/purl:eyre
|
||||
:^ ost.bol %poke /said-url
|
||||
:+ [our.bol %hall] %hall-action
|
||||
^- action
|
||||
:+ %phrase
|
||||
[[our.bol %inbox] ~ ~]
|
||||
[%app dap.bol %lin | (crip (en-purl:html url))]~ :: XX
|
||||
::
|
||||
++ said :: app message
|
||||
|= mes/(list tank)
|
||||
:- %hall-action
|
||||
^- action
|
||||
:- %phrase
|
||||
:- [[our.bol %inbox] ~ ~]
|
||||
|- ^- (list speech)
|
||||
?~ mes ~
|
||||
:_ $(mes t.mes)
|
||||
^- speech
|
||||
[%app dap.bol %lin | (crip ~(ram re i.mes))]
|
||||
::
|
||||
++ uniq
|
||||
^- {serial _eny.bol}
|
||||
[(shaf %serial eny.bol) (shax eny.bol)]
|
||||
::
|
||||
::TODO add to zuse?
|
||||
++ simple-wrap
|
||||
|= {txt/tape wyd/@ud}
|
||||
^- (list tape)
|
||||
?~ txt ~
|
||||
=+ ^- {end/@ud nex/?}
|
||||
?: (lte (lent txt) wyd) [(lent txt) &]
|
||||
=+ ace=(find " " (flop (scag +(wyd) `tape`txt)))
|
||||
?~ ace [wyd |]
|
||||
[(sub wyd u.ace) &]
|
||||
:- (tufa (scag end `(list @)`txt))
|
||||
$(txt (slag ?:(nex +(end) end) `tape`txt))
|
||||
::
|
||||
++ range-to-path
|
||||
:: msg range to path
|
||||
::
|
||||
:: turns a range structure into a path used for
|
||||
:: subscriptions.
|
||||
::
|
||||
|= ran/range
|
||||
^- path
|
||||
?~ ran ~
|
||||
:- (place-to-knot hed.u.ran)
|
||||
?~ tal.u.ran ~
|
||||
[(place-to-knot u.tal.u.ran) ~]
|
||||
::
|
||||
++ place-to-knot
|
||||
:: msg pointer to path component
|
||||
::
|
||||
:: turns a place structure into a knot for use in
|
||||
:: subscription paths.
|
||||
::
|
||||
|= pla/place
|
||||
^- knot
|
||||
?. ?=($sd -.pla) (scot -.pla +.pla)
|
||||
(cat 3 '-' (scot %ud (abs:si +.pla)))
|
||||
::
|
||||
++ path-to-range
|
||||
:: path to msg range
|
||||
::
|
||||
:: turns the tail of a subscription path into a
|
||||
:: range structure, skipping over non-range terms.
|
||||
::
|
||||
|= pax/path
|
||||
^- range
|
||||
?~ pax ~
|
||||
=/ hes/(unit place) (rush i.pax placer)
|
||||
:: skip past non-number parts of path.
|
||||
?~ hes $(pax t.pax)
|
||||
:+ ~ u.hes
|
||||
?~ t.pax ~
|
||||
(rush i.t.pax placer)
|
||||
::
|
||||
++ placer
|
||||
:: parse a range place
|
||||
;~ pose
|
||||
(stag %ud dem:ag)
|
||||
::
|
||||
=- (stag %da (sear - crub:so))
|
||||
|= a/dime
|
||||
^- (unit @da)
|
||||
?:(?=($da p.a) `q.a ~)
|
||||
::
|
||||
%+ stag %sd
|
||||
%+ cook (cury new:si |)
|
||||
;~(pfix hep dem:ag)
|
||||
==
|
||||
::
|
||||
++ change-glyphs :: ...
|
||||
::
|
||||
|= {gys/(jug char audience) bin/? gyf/char aud/audience}
|
||||
^+ gys
|
||||
:: simple bind.
|
||||
?: bin (~(put ju gys) gyf aud)
|
||||
:: unbind all of glyph.
|
||||
?~ aud (~(del by gys) gyf)
|
||||
:: unbind single.
|
||||
(~(del ju gys) gyf aud)
|
||||
::
|
||||
++ change-nicks
|
||||
:: change nick map
|
||||
::
|
||||
:: changes a nickname in a map, adding if it doesn't
|
||||
:: yet exist, removing if the nickname is empty.
|
||||
::
|
||||
|= {nis/(map ship cord) who/ship nic/cord}
|
||||
^+ nis
|
||||
?: =(nic '')
|
||||
(~(del by nis) who)
|
||||
(~(put by nis) who nic)
|
||||
::
|
||||
++ change-config
|
||||
:: applies a config diff to the given config.
|
||||
::
|
||||
|= {cof/config dif/diff-config}
|
||||
^+ cof
|
||||
?- -.dif
|
||||
$full cof.dif
|
||||
$caption cof(cap cap.dif)
|
||||
$filter cof(fit fit.dif)
|
||||
$remove cof
|
||||
$read cof(red red.dif)
|
||||
::
|
||||
$usage
|
||||
%= cof
|
||||
tag
|
||||
%. tas.dif
|
||||
?: add.dif
|
||||
~(uni in tag.cof)
|
||||
~(dif in tag.cof)
|
||||
==
|
||||
::
|
||||
$source
|
||||
%= cof
|
||||
src
|
||||
%. src.dif
|
||||
?: add.dif
|
||||
~(put in src.cof)
|
||||
~(del in src.cof)
|
||||
==
|
||||
::
|
||||
$permit
|
||||
%= cof
|
||||
sis.con
|
||||
%. sis.dif
|
||||
?: add.dif
|
||||
~(uni in sis.con.cof)
|
||||
~(dif in sis.con.cof)
|
||||
==
|
||||
::
|
||||
$secure
|
||||
%= cof
|
||||
sec.con
|
||||
sec.dif
|
||||
::
|
||||
sis.con
|
||||
?. .= ?=(?($white $green) sec.dif)
|
||||
?=(?($white $green) sec.con.cof)
|
||||
~
|
||||
sis.con.cof
|
||||
==
|
||||
==
|
||||
::
|
||||
++ change-status
|
||||
:: applies a status diff to the given status.
|
||||
::
|
||||
|= {sat/status dif/diff-status}
|
||||
^+ sat
|
||||
?- -.dif
|
||||
$full sat.dif
|
||||
$presence sat(pec pec.dif)
|
||||
$remove sat
|
||||
::
|
||||
$human
|
||||
%= sat
|
||||
man
|
||||
?- -.dif.dif
|
||||
$full man.dif.dif
|
||||
$true [han.man.sat tru.dif.dif]
|
||||
$handle [han.dif.dif tru.man.sat]
|
||||
==
|
||||
==
|
||||
==
|
||||
::
|
||||
::TODO annotate all!
|
||||
++ depa :: de-pathing core
|
||||
=> |% ++ grub * :: result
|
||||
++ weir (list coin) :: parsed wire
|
||||
++ fist $-(weir grub) :: reparser instance
|
||||
--
|
||||
|%
|
||||
::
|
||||
++ al
|
||||
|* {hed/$-(coin *) tal/fist}
|
||||
|= wir/weir ^+ [*hed *tal]
|
||||
?~ wir !!
|
||||
[(hed i.wir) (tal t.wir)]
|
||||
::
|
||||
++ at
|
||||
|* typ/{@tas (pole @tas)}
|
||||
=+ [i-typ t-typ]=typ
|
||||
|= wer/weir
|
||||
^- (tup:dray:wired i-typ t-typ) :: ie, (tup %p %tas ~) is {@p @tas}
|
||||
?~ wer !!
|
||||
?~ t-typ
|
||||
?^ t.wer !!
|
||||
((do i-typ) i.wer)
|
||||
:- ((do i-typ) i.wer)
|
||||
(^$(typ t-typ) t.wer)
|
||||
::
|
||||
++ mu :: true unit
|
||||
|* wit/fist
|
||||
|= wer/weir
|
||||
?~(wer ~ (some (wit wer)))
|
||||
::
|
||||
++ af :: object as frond
|
||||
|* buk/(pole {cord fist})
|
||||
|= wer/weir
|
||||
?> ?=({{$$ $tas @tas} *} wer)
|
||||
?~ buk !!
|
||||
=+ [[tag wit] t-buk]=buk
|
||||
?: =(tag q.p.i.wer)
|
||||
[tag ~|(tag+`@tas`tag (wit t.wer))]
|
||||
?~ t-buk ~|(bad-tag+`@tas`q.p.i.wer !!)
|
||||
(^$(buk t-buk) wer)
|
||||
::
|
||||
++ or
|
||||
=+ typ=$:|-($@(@tas {@tas $}))
|
||||
|@ ++ $
|
||||
|= con/coin
|
||||
::^- _(snag *@ (turn (limo typ) |*(a/@tas [a (odo:raid:wired a)])))
|
||||
?> ?=($$ -.con)
|
||||
=/ i-typ ?@(typ typ -.typ)
|
||||
?: =(i-typ p.p.con)
|
||||
:- i-typ
|
||||
^- (odo:raid:wired i-typ)
|
||||
q.p.con
|
||||
?@ typ ~|(%bad-odor !!)
|
||||
(^$(typ +.typ) con)
|
||||
--
|
||||
::
|
||||
++ do
|
||||
|* typ/@tas
|
||||
=/ typecheck `@tas`typ
|
||||
|= con/coin
|
||||
^- (odo:raid:wired typ)
|
||||
?. ?=($$ -.con) ~|(%not-dime !!)
|
||||
?. =(typ p.p.con) ~|(bad-odor+`@tas`p.p.con !!)
|
||||
q.p.con
|
||||
::
|
||||
++ ul :: null
|
||||
|=(wer/weir ?~(wer ~ !!))
|
||||
::
|
||||
++ un
|
||||
|* wit/$-(coin *)
|
||||
|= wer/weir ^+ *wit
|
||||
?~ wer !!
|
||||
?^ t.wer !!
|
||||
(wit i.wer)
|
||||
--
|
||||
--
|
1195
pkg/arvo/lib/pprint.hoon
Normal file
1195
pkg/arvo/lib/pprint.hoon
Normal file
File diff suppressed because it is too large
Load Diff
@ -344,6 +344,35 @@
|
||||
::
|
||||
:: ----
|
||||
::
|
||||
:: Output
|
||||
::
|
||||
++ flog
|
||||
|= =flog:dill
|
||||
=/ m (async ,~)
|
||||
^- form:m
|
||||
(send-raw-card %flog / flog)
|
||||
::
|
||||
++ flog-text
|
||||
|= =tape
|
||||
=/ m (async ,~)
|
||||
^- form:m
|
||||
(flog %text tape)
|
||||
::
|
||||
++ flog-tang
|
||||
|= =tang
|
||||
=/ m (async ,~)
|
||||
^- form:m
|
||||
=/ =wall
|
||||
(zing (turn (flop tang) (cury wash [0 80])))
|
||||
|- ^- form:m
|
||||
=* loop $
|
||||
?~ wall
|
||||
(pure:m ~)
|
||||
;< ~ bind:m (flog-text i.wall)
|
||||
loop(wall t.wall)
|
||||
::
|
||||
:: ----
|
||||
::
|
||||
:: Apps
|
||||
::
|
||||
++ poke-app
|
||||
|
1867
pkg/arvo/lib/xray.hoon
Normal file
1867
pkg/arvo/lib/xray.hoon
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,74 +0,0 @@
|
||||
::
|
||||
:::: /mar/hall/action/hoon
|
||||
::
|
||||
/- hall
|
||||
/+ hall-json
|
||||
::
|
||||
|_ act/action:hall
|
||||
::
|
||||
++ grab ::: convert from
|
||||
|%
|
||||
++ noun action:hall ::: from %noun
|
||||
++ json ::: from %json
|
||||
=, dejs:hall-json
|
||||
=, dejs-soft:format
|
||||
|= a/json
|
||||
^- action:hall
|
||||
=- (need ((of -) a))
|
||||
:~ create+(ot nom+so des+so sec+secu ~)
|
||||
design+(ot nom+so cof+conf ~)
|
||||
delete+(ot nom+so why+(mu so) ~)
|
||||
depict+(ot nom+so des+so ~)
|
||||
filter+(ot nom+so fit+filt ~)
|
||||
permit+(ot nom+so inv+bo sis+(as (su fed:ag)) ~)
|
||||
source+(ot nom+so sub+bo srs+(as sorc) ~)
|
||||
read+(ot nom+so red+ni ~)
|
||||
usage+(ot nom+so add+bo tas+(as so) ~)
|
||||
newdm+(ot sis+(as (su fed:ag)) ~)
|
||||
::
|
||||
convey+(ar thot)
|
||||
phrase+(ot aud+audi ses+(ar spec:dejs:hall-json) ~)
|
||||
::
|
||||
notify+(ot aud+audi pes+(mu pres) ~)
|
||||
naming+(ot aud+audi man+huma ~)
|
||||
::
|
||||
glyph+(ot gyf+so aud+audi bin+bo ~)
|
||||
nick+(ot who+(su fed:ag) nic+so ~)
|
||||
::
|
||||
public+(ot add+bo cir+circ ~)
|
||||
==
|
||||
--
|
||||
::
|
||||
++ grow ::: convert to
|
||||
|%
|
||||
++ json ::: to %json
|
||||
=, enjs:hall-json
|
||||
=, enjs:format
|
||||
%+ frond -.act
|
||||
::: only %convey has just a single piece of data.
|
||||
?: ?=($convey -.act) a+(turn tos.act thot)
|
||||
%- pairs
|
||||
?- -.act
|
||||
$create ~[nom+s+nom.act des+s+des.act sec+s+sec.act]
|
||||
$design ~[nom+s+nom.act cof+(conf cof.act)]
|
||||
$delete ~[nom+s+nom.act why+(mabe why.act cord:enjs)]
|
||||
$depict ~[nom+s+nom.act des+s+des.act]
|
||||
$filter ~[nom+s+nom.act fit+(filt fit.act)]
|
||||
$permit ~[nom+s+nom.act inv+b+inv.act sis+(sa sis.act ship)]
|
||||
$source ~[nom+s+nom.act sub+b+sub.act srs+(sa srs.act sorc)]
|
||||
$read ~[nom+s+nom.act red+(numb red.act)]
|
||||
$usage ~[nom+s+nom.act add+b+add.act tas+(sa tas.act cord:enjs)]
|
||||
$newdm ~[sis+(sa sis.act ship)]
|
||||
::
|
||||
$phrase ~[aud+(audi aud.act) ses+a+(turn ses.act spec:enjs)]
|
||||
::
|
||||
$notify ~[aud+(audi aud.act) pes+(mabe pes.act cord:enjs)]
|
||||
$naming ~[aud+(audi aud.act) man+(huma man.act)]
|
||||
::
|
||||
$glyph ~[gyf+s+gyf.act aud+(sa aud.act circ) bin+b+bin.act]
|
||||
$nick ~[who+(ship who.act) nic+s+nic.act]
|
||||
::
|
||||
$public ~[add+b+add.act cir+(circ cir.act)]
|
||||
==
|
||||
--
|
||||
--
|
@ -1,40 +0,0 @@
|
||||
::
|
||||
:::: /mar/hall/command/hoon
|
||||
::
|
||||
/? 310
|
||||
/- hall
|
||||
/+ hall-json
|
||||
::
|
||||
=, hall
|
||||
|_ cod/command
|
||||
::
|
||||
++ grab :: convert from
|
||||
|%
|
||||
++ noun command :: from %noun
|
||||
++ json :: from %json
|
||||
=, dejs:hall-json
|
||||
=, dejs-soft:format
|
||||
|= a/json
|
||||
^- command:hall
|
||||
=- (need ((of -) a))
|
||||
:~ publish+(ar thot)
|
||||
present+(ot nos+(as so) dif+disa ~)
|
||||
:: bearing not needed
|
||||
==
|
||||
--
|
||||
::
|
||||
++ grow :: convert to
|
||||
|%
|
||||
++ json :: to %json
|
||||
=, enjs:hall-json
|
||||
=, enjs:format
|
||||
%+ frond -.cod
|
||||
:: only %publish has just a single piece of data.
|
||||
?: ?=($publish -.cod) a+(turn tos.cod thot)
|
||||
%- pairs
|
||||
?+ -.cod !!
|
||||
$present ~[nos+(sa nos.cod cord:enjs:hall-json) dif+(disa dif.cod)]
|
||||
:: bearing nto needed
|
||||
==
|
||||
--
|
||||
--
|
@ -1,42 +0,0 @@
|
||||
::
|
||||
:::: /mar/hall/prize/hoon
|
||||
::
|
||||
/- hall
|
||||
/+ hall-json
|
||||
::
|
||||
|_ piz/prize:hall
|
||||
::
|
||||
++ grab ::: convert from
|
||||
|%
|
||||
++ noun prize:hall ::: from %noun
|
||||
++ json ::: from %json
|
||||
=, dejs:hall-json
|
||||
=, dejs-soft:format
|
||||
|= a/json
|
||||
^- prize:hall
|
||||
=- (need ((of -) a))
|
||||
:~ client+pici
|
||||
circles+(as so)
|
||||
public+(as circ)
|
||||
:: burden not needed
|
||||
:: report not needed
|
||||
circle+pack
|
||||
==
|
||||
--
|
||||
::
|
||||
++ grow ::: convert to
|
||||
|%
|
||||
++ json ::: to %json
|
||||
=, enjs:hall-json
|
||||
=, enjs:format
|
||||
%+ frond -.piz
|
||||
?+ -.piz !!
|
||||
$client (pici +.piz)
|
||||
$circles (sa cis.piz cord:enjs:hall-json)
|
||||
$public (sa cis.piz circ)
|
||||
:: burden not needed
|
||||
:: report not needed
|
||||
$circle (pack +.piz)
|
||||
==
|
||||
--
|
||||
--
|
@ -1,40 +0,0 @@
|
||||
::
|
||||
:::: /mar/hall/rumor/hoon
|
||||
::
|
||||
/- hall
|
||||
/+ hall-json
|
||||
::
|
||||
|_ rum/rumor:hall
|
||||
::
|
||||
++ grab ::: convert from
|
||||
|%
|
||||
++ noun rumor:hall ::: from %noun
|
||||
++ json ::: from %json
|
||||
=, dejs:hall-json
|
||||
=, dejs-soft:format
|
||||
|= a/json
|
||||
^- rumor:hall
|
||||
=- (need ((of -) a))
|
||||
:~ client+ruci
|
||||
circles+(ot add+bo cir+so ~)
|
||||
public+(ot add+bo cir+circ ~)
|
||||
:: burden not needed
|
||||
circle+ruso
|
||||
==
|
||||
--
|
||||
::
|
||||
++ grow ::: convert to
|
||||
|%
|
||||
++ json ::: to %json
|
||||
=, enjs:hall-json
|
||||
=, enjs:format
|
||||
%+ frond -.rum
|
||||
?+ -.rum !!
|
||||
$client (ruci rum.rum)
|
||||
$circles (pairs add+b+add.rum cir+s+cir.rum ~)
|
||||
$public (pairs add+b+add.rum cir+(circ cir.rum) ~)
|
||||
:: burden not needed
|
||||
$circle (ruso rum.rum)
|
||||
==
|
||||
--
|
||||
--
|
@ -1,41 +0,0 @@
|
||||
::
|
||||
:::: /mar/hall/telegrams/hoon
|
||||
::
|
||||
/- hall
|
||||
/+ hall-json
|
||||
::
|
||||
|_ gaz/(list telegram:hall)
|
||||
::
|
||||
++ grab ::: convert from
|
||||
|%
|
||||
++ noun (list telegram:hall) ::: from %noun
|
||||
::
|
||||
++ mime ::: from %mime
|
||||
|= ^mime
|
||||
(json (rash q.q apex:de-json:html))
|
||||
::
|
||||
++ json ::: from %json
|
||||
=, dejs-soft:format
|
||||
|= a/json
|
||||
^- (list telegram:hall)
|
||||
(need ((ar gram:dejs:hall-json) a))
|
||||
--
|
||||
::
|
||||
++ grow ::: convert to
|
||||
|%
|
||||
++ mime ::: to %mime
|
||||
:- /text/json
|
||||
(as-octs:mimes:html (crip (en-json:html json)))
|
||||
::
|
||||
++ json a+(turn gaz gram:enjs:hall-json) ::: to %json
|
||||
--
|
||||
::
|
||||
++ grad
|
||||
|%
|
||||
++ form %hall-telegrams
|
||||
++ diff |=((list telegram:hall) +<)
|
||||
++ pact |=((list telegram:hall) +<)
|
||||
++ join |= {(list telegram:hall) (list telegram:hall)}
|
||||
`(unit mime)`~
|
||||
--
|
||||
--
|
@ -1,45 +0,0 @@
|
||||
/- hall
|
||||
::
|
||||
|%
|
||||
+$ diff
|
||||
$% [%hall-rumor rumor:hall]
|
||||
[%chat-update update]
|
||||
[%chat-config streams]
|
||||
[%json json]
|
||||
==
|
||||
::
|
||||
+$ poke
|
||||
$% [%hall-action action:hall]
|
||||
[%launch-action [@tas path @t]]
|
||||
==
|
||||
::
|
||||
+$ streams
|
||||
$: :: inbox config
|
||||
::
|
||||
inbox=config:hall
|
||||
:: names and configs of all circles we know about
|
||||
::
|
||||
configs=(map circle:hall (unit config:hall))
|
||||
:: messages for all circles we know about
|
||||
::
|
||||
messages=(map circle:hall (list envelope:hall))
|
||||
::
|
||||
::
|
||||
circles=(set name:hall)
|
||||
::
|
||||
::
|
||||
peers=(map circle:hall (set @p))
|
||||
==
|
||||
::
|
||||
+$ update
|
||||
$% [%inbox con=config:hall]
|
||||
[%message cir=circle:hall env=envelope:hall]
|
||||
[%messages cir=circle:hall start=@ud end=@ud env=(list envelope:hall)]
|
||||
[%config cir=circle:hall con=config:hall]
|
||||
[%circles cir=(set name:hall)]
|
||||
[%peers cir=circle:hall per=(set @p)]
|
||||
[%delete cir=circle:hall]
|
||||
==
|
||||
::
|
||||
+$ action [%actions lis=(list action:hall)]
|
||||
--
|
@ -20,6 +20,7 @@
|
||||
[%sources wire ~]
|
||||
[%new-event wire =ship =udiff:point:able:jael]
|
||||
[%listen wire whos=(set ship) =source:jael]
|
||||
[%flog wire flog:dill]
|
||||
==
|
||||
::
|
||||
:: Possible async responses
|
||||
|
@ -319,7 +319,8 @@
|
||||
?. ((sane %tas) lal) ~
|
||||
%+ biff ((soft path) p.q.caq)
|
||||
|= pax/path
|
||||
=^ yav worm.vane (~(spot wa worm.vane) 15 caq)
|
||||
=^ xav worm.vane (~(spot wa worm.vane) 7 caq)
|
||||
=^ yav worm.vane (~(spot wa worm.vane) 3 xav)
|
||||
%+ bind (song yav)
|
||||
|= {hil/mill vel/worm}
|
||||
[%& [%pass pax lal hil] vel]
|
||||
@ -336,7 +337,8 @@
|
||||
%+ biff ((soft @) p.q.caq)
|
||||
|= lal/@tas
|
||||
?. ((sane %tas) lal) ~
|
||||
=^ yav worm.vane (~(spot wa worm.vane) 7 caq)
|
||||
=^ xav worm.vane (~(spot wa worm.vane) 3 caq)
|
||||
=^ yav worm.vane (~(spot wa worm.vane) 3 xav)
|
||||
%+ bind (song yav)
|
||||
|= {hil/mill vel/worm}
|
||||
[%& [%slip lal hil] vel]
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -299,8 +299,7 @@
|
||||
:: Foreign desk data.
|
||||
::
|
||||
++ rung
|
||||
$: rit=rift :: rift of 1st contact
|
||||
rus=(map desk rede) :: neighbor desks
|
||||
$: rus=(map desk rede) :: neighbor desks
|
||||
==
|
||||
::
|
||||
:: Hash of a commit, for lookup in the object store (hut.ran)
|
||||
@ -534,12 +533,6 @@
|
||||
$: @tas :: by any
|
||||
$>(%crud vane-task) :: XX strange
|
||||
== == ::
|
||||
--
|
||||
::
|
||||
:: Old state types for ++load
|
||||
::
|
||||
=> |%
|
||||
+$ raft-1 raft
|
||||
-- =>
|
||||
:: %utilities
|
||||
::
|
||||
@ -2664,8 +2657,6 @@
|
||||
:: save foreign +rede
|
||||
::
|
||||
=/ run (~(gut by hoy.ruf) her *rung)
|
||||
=? rit.run =(0 rit.run)
|
||||
(fall (rift-scry her) *rift)
|
||||
=/ rug (~(put by rus.run) syd red)
|
||||
ruf(hoy (~(put by hoy.ruf) her run(rus rug)))
|
||||
:: save domestic +room
|
||||
@ -2675,19 +2666,6 @@
|
||||
dos.rom (~(put by dos.rom.ruf) syd [qyx dom per pew]:red)
|
||||
==
|
||||
::
|
||||
:: +rift-scry: for a +rift
|
||||
::
|
||||
++ rift-scry
|
||||
|= who=ship
|
||||
^- (unit rift)
|
||||
=; rit
|
||||
?~(rit ~ u.rit)
|
||||
;; (unit (unit rift))
|
||||
%- (sloy-light ski)
|
||||
=/ pur=spur
|
||||
/(scot %p who)
|
||||
[[151 %noun] %j our %rift da+now pur]
|
||||
::
|
||||
:: Handle `%sing` requests
|
||||
::
|
||||
++ aver
|
||||
@ -4383,16 +4361,209 @@
|
||||
==
|
||||
::
|
||||
++ load
|
||||
!:
|
||||
=> |%
|
||||
+$ axle [%1 ruf-1=raft]
|
||||
+$ axle
|
||||
$% [%1 ruf-1=raft-1]
|
||||
[%2 ruf-2=raft]
|
||||
==
|
||||
+$ raft-1
|
||||
$: rom=room
|
||||
hoy=(map ship rung-1)
|
||||
ran=rang
|
||||
mon=(map term beam)
|
||||
hez=(unit duct)
|
||||
cez=(map @ta crew)
|
||||
cue=(qeu [=duct =task:able])
|
||||
act=active-write-1
|
||||
==
|
||||
::
|
||||
+$ rung-1
|
||||
$: rit=rift
|
||||
rus=(map desk rede-1)
|
||||
==
|
||||
::
|
||||
+$ rede-1
|
||||
$: lim=@da
|
||||
ref=(unit rind-1)
|
||||
qyx=cult
|
||||
dom=dome
|
||||
per=regs
|
||||
pew=regs
|
||||
==
|
||||
::
|
||||
+$ rind-1
|
||||
$: nix=@ud
|
||||
bom=(map @ud {p/duct q/rave})
|
||||
fod=(map duct @ud)
|
||||
haw=(map mood (unit cage))
|
||||
pud=update-qeu-1
|
||||
pur=request-map-1
|
||||
==
|
||||
::
|
||||
+$ update-qeu-1
|
||||
$: waiting=(qeu [inx=@ud rut=(unit rand)])
|
||||
$= eval-data
|
||||
%- unit
|
||||
$: inx=@ud
|
||||
rut=(unit rand)
|
||||
form=(eval-form-1 (unit [lim=@da dome rang]))
|
||||
==
|
||||
==
|
||||
::
|
||||
+$ request-map-1
|
||||
(map inx=@ud [=rand (eval-form-1 cage)])
|
||||
::
|
||||
+$ active-write-1
|
||||
%- unit
|
||||
$: hen=duct
|
||||
req=task:able
|
||||
$= eval-data
|
||||
$% [%commit form=(eval-form-1 [dome rang])]
|
||||
[%merge form=(eval-form-1 [(set path) dome rang])]
|
||||
[%mount form=(eval-form-1 [(pair term beam) (map path mime)])]
|
||||
==
|
||||
==
|
||||
::
|
||||
++ eval-form-1
|
||||
|* a=mold
|
||||
,[effects=(list move) form=(clad-form-1 a)]
|
||||
::
|
||||
++ clad-form-1
|
||||
|* a=mold
|
||||
$-([@da rang sign-1] (clad-output-1 a))
|
||||
::
|
||||
++ clad-output-1
|
||||
|* a=mold
|
||||
$~ [~ ~ %done *a]
|
||||
$: notes=(list [path note])
|
||||
effects=(list move)
|
||||
$= next
|
||||
$% [%wait ~]
|
||||
[%cont self=(clad-form-1 a)]
|
||||
[%fail err=(pair term tang)]
|
||||
[%done value=a]
|
||||
==
|
||||
==
|
||||
::
|
||||
++ sign-1
|
||||
$~ [%b %wake ~]
|
||||
$% $: %y
|
||||
$% [%init-clad ~]
|
||||
== ==
|
||||
$: %a
|
||||
$> $? %send
|
||||
%woot
|
||||
==
|
||||
gift:able:ames
|
||||
==
|
||||
$: %b
|
||||
$% $>(%wake gift:able:behn)
|
||||
$>(%writ gift:able)
|
||||
== ==
|
||||
$: %c
|
||||
$> $? %mere
|
||||
%note
|
||||
%writ
|
||||
==
|
||||
gift:able
|
||||
==
|
||||
$: %f
|
||||
$>(%made gift:able:ford)
|
||||
==
|
||||
$: %j
|
||||
[%public-keys =public-keys-result-1]
|
||||
==
|
||||
$: @tas
|
||||
$>(%crud vane-task)
|
||||
== ==
|
||||
::
|
||||
+$ public-keys-result-1
|
||||
$% [%full points=(map ship point:able:jael)]
|
||||
[%diff who=ship =diff:point:able:jael]
|
||||
==
|
||||
::
|
||||
++ upgrade-1
|
||||
|= ruf=raft-1
|
||||
^- axle
|
||||
:- %2
|
||||
%= ruf
|
||||
act
|
||||
?~ act.ruf
|
||||
~
|
||||
:- ~
|
||||
%= u.act.ruf
|
||||
eval-data
|
||||
?- -.eval-data.u.act.ruf
|
||||
%commit
|
||||
:- %commit
|
||||
%- (upgrade-clad-1 ,[dome rang])
|
||||
form.eval-data.u.act.ruf
|
||||
::
|
||||
%merge
|
||||
:- %merge
|
||||
%- (upgrade-clad-1 ,[(set path) dome rang])
|
||||
form.eval-data.u.act.ruf
|
||||
::
|
||||
%mount
|
||||
:- %mount
|
||||
%- (upgrade-clad-1 ,[(pair term beam) (map path mime)])
|
||||
form.eval-data.u.act.ruf
|
||||
==
|
||||
==
|
||||
::
|
||||
hoy
|
||||
^- (map ship rung)
|
||||
%- ~(urn by hoy.ruf)
|
||||
|= [her=ship rift rus=(map desk rede-1)]
|
||||
^- rung
|
||||
%- ~(urn by rus)
|
||||
|= [syd=desk red=rede-1]
|
||||
^- rede
|
||||
?~ ref.red
|
||||
red
|
||||
%= red
|
||||
u.ref
|
||||
^- rind
|
||||
%= u.ref.red
|
||||
pud
|
||||
^- update-qeu
|
||||
?~ eval-data.pud.u.ref.red
|
||||
pud.u.ref.red
|
||||
%= pud.u.ref.red
|
||||
form.u.eval-data
|
||||
%- (upgrade-clad-1 ,(unit [lim=@da dome rang]))
|
||||
form.u.eval-data.pud.u.ref.red
|
||||
==
|
||||
::
|
||||
pur
|
||||
%- ~(urn by pur.u.ref.red)
|
||||
|= [inx=@ud =rand form=(eval-form-1 ,cage)]
|
||||
[rand ((upgrade-clad-1 ,cage) form)]
|
||||
==
|
||||
==
|
||||
==
|
||||
::
|
||||
++ upgrade-clad-1
|
||||
|* a=mold
|
||||
|= e-form=(eval-form-1 a)
|
||||
:- effects.e-form
|
||||
^+ *form:(clad ,a)
|
||||
|= cin=clad-input
|
||||
?: ?=([%j %public-keys %breach *] sign.cin)
|
||||
[~ ~ %wait ~]
|
||||
=/ res (form.e-form cin)
|
||||
?: ?=(%cont -.next.res)
|
||||
res(self.next ..$(form.e-form self.next.res))
|
||||
res
|
||||
--
|
||||
:: |= *
|
||||
:: ..^$
|
||||
:: XX switch back
|
||||
::
|
||||
|= old=axle
|
||||
^+ ..^$
|
||||
?> ?=(%1 -.old)
|
||||
%_(..^$ ruf ruf-1.old)
|
||||
=? old ?=(%1 -.old)
|
||||
(upgrade-1 ruf-1.old)
|
||||
?> ?=(%2 -.old)
|
||||
%_(..^$ ruf ruf-2.old)
|
||||
::
|
||||
++ scry :: inspect
|
||||
|= {fur/(unit (set monk)) ren/@tas why/shop syd/desk lot/coin tyl/path}
|
||||
@ -4422,7 +4593,7 @@
|
||||
?: ?=(%& -.u.u.-) ``p.u.u.-
|
||||
~
|
||||
::
|
||||
++ stay [%1 ruf]
|
||||
++ stay [%2 ruf]
|
||||
++ take :: accept response
|
||||
|= [tea=wire hen=duct hin=(hypo sign)]
|
||||
^+ [*(list move) ..^$]
|
||||
@ -4516,13 +4687,9 @@
|
||||
::
|
||||
?: ?=([%sinks ~] tea)
|
||||
?> ?=(%public-keys +<.q.hin)
|
||||
?: ?=(%full -.public-keys-result.q.hin)
|
||||
[~ ..^$]
|
||||
?. ?=(%rift -.diff.public-keys-result.q.hin)
|
||||
?. ?=(%breach -.public-keys-result.q.hin)
|
||||
[~ ..^$]
|
||||
=/ who who.public-keys-result.q.hin
|
||||
=/ to-rift to.diff.public-keys-result.q.hin
|
||||
::
|
||||
?: =(our who)
|
||||
[~ ..^$]
|
||||
:: Cancel subscriptions
|
||||
@ -4531,8 +4698,6 @@
|
||||
(~(get by hoy.ruf) who)
|
||||
?~ foreign-desk
|
||||
[~ ..^$]
|
||||
?: (gte rit.u.foreign-desk to-rift)
|
||||
[~ ..^$]
|
||||
=/ cancel-ducts=(list duct)
|
||||
%- zing ^- (list (list duct))
|
||||
%+ turn ~(tap by rus.u.foreign-desk)
|
||||
@ -4665,18 +4830,4 @@
|
||||
?~ -
|
||||
`[paf %ins %mime -:!>(*mime) u.mim]
|
||||
`[paf %mut %mime -:!>(*mime) u.mim]
|
||||
::
|
||||
:: +rift-scry: for a +rift
|
||||
::
|
||||
++ rift-scry
|
||||
~% %rift-scry ..is ~
|
||||
|= who=ship
|
||||
^- (unit rift)
|
||||
=; lyf
|
||||
?~(lyf ~ u.lyf)
|
||||
;; (unit (unit rift))
|
||||
%- (sloy-light ski)
|
||||
=/ pur=spur
|
||||
/(scot %p who)
|
||||
[[151 %noun] %j our %rift da+now pur]
|
||||
--
|
||||
|
@ -1410,7 +1410,7 @@
|
||||
::
|
||||
%subscribe
|
||||
::
|
||||
=/ channel-wire=path
|
||||
=/ channel-wire=wire
|
||||
/channel/subscription/[channel-id]/(scot %ud request-id.i.requests)
|
||||
::
|
||||
=. gall-moves
|
||||
@ -1429,7 +1429,7 @@
|
||||
$(requests t.requests)
|
||||
::
|
||||
%unsubscribe
|
||||
=/ channel-wire=path
|
||||
=/ channel-wire=wire
|
||||
/channel/subscription/[channel-id]/(scot %ud subscription-id.i.requests)
|
||||
::
|
||||
=/ usession (~(get by session.channel-state.state) channel-id)
|
||||
@ -1475,7 +1475,7 @@
|
||||
:: produce a list of moves which cancels every gall subscription
|
||||
::
|
||||
%+ turn ~(tap by subscriptions.session)
|
||||
|= [channel-wire=path ship=@p app=term =path duc=^duct]
|
||||
|= [channel-wire=wire ship=@p app=term =path duc=^duct]
|
||||
^- move
|
||||
::
|
||||
[duc %pass channel-wire [%g %deal [our ship] app %pull ~]]
|
||||
@ -1672,7 +1672,7 @@
|
||||
:: produce a list of moves which cancels every gall subscription
|
||||
::
|
||||
%+ turn ~(tap by subscriptions.session)
|
||||
|= [channel-wire=path ship=@p app=term =path duc=^duct]
|
||||
|= [channel-wire=wire ship=@p app=term =path duc=^duct]
|
||||
^- move
|
||||
::
|
||||
[duc %pass channel-wire [%g %deal [our ship] app %pull ~]]
|
||||
|
@ -261,7 +261,9 @@
|
||||
=/ cub (nol:nu:crub:crypto key.seed.tac)
|
||||
%+ ~(put by pos.zim.pki)
|
||||
our
|
||||
=/ spon-ship ?~(spon.tac ~ `ship.i.spon.tac)
|
||||
=/ spon-ship
|
||||
=/ flopped-spon (flop spon.tac)
|
||||
?~(flopped-spon ~ `ship.i.flopped-spon)
|
||||
[1 lyf.seed.tac (my [lyf.seed.tac [1 pub:ex:cub]] ~) spon-ship]
|
||||
:: our initial private key
|
||||
::
|
||||
@ -803,15 +805,38 @@
|
||||
|- ^+ ..feel
|
||||
?~ pointl
|
||||
..feel
|
||||
=. ..feel
|
||||
:: if changing rift upward, then signal a breach
|
||||
::
|
||||
=? ..feel
|
||||
=/ point
|
||||
(~(get by pos.zim) who.i.pointl)
|
||||
?& ?=(^ point)
|
||||
(gth rift.point.i.pointl rift.u.point)
|
||||
==
|
||||
%+ public-keys-give
|
||||
(subscribers-on-ship who.i.pointl)
|
||||
[%full (my i.pointl ~)]
|
||||
$(pointl t.pointl)
|
||||
[%breach who.i.pointl]
|
||||
%+ public-keys-give
|
||||
(subscribers-on-ship who.i.pointl)
|
||||
[%full (my i.pointl ~)]
|
||||
?: ?=(%breach -.public-keys-result)
|
||||
:: we calculate our own breaches based on our local state
|
||||
::
|
||||
..feel
|
||||
=* who who.public-keys-result
|
||||
=/ a-diff=diff:point diff.public-keys-result
|
||||
=/ maybe-point (~(get by pos.zim) who)
|
||||
=/ =point (fall maybe-point *point)
|
||||
:: if changing rift upward, then signal a breach
|
||||
::
|
||||
=? ..feel
|
||||
?& ?=(%rift -.a-diff)
|
||||
(gth to.a-diff rift.point)
|
||||
==
|
||||
%+ public-keys-give
|
||||
(subscribers-on-ship who)
|
||||
[%breach who]
|
||||
::
|
||||
=. point
|
||||
?- -.a-diff
|
||||
%spon point(sponsor to.a-diff)
|
||||
@ -825,6 +850,7 @@
|
||||
[crypto-suite pass]:to.a-diff
|
||||
==
|
||||
==
|
||||
::
|
||||
=. pos.zim (~(put by pos.zim) who point)
|
||||
%+ public-keys-give
|
||||
(subscribers-on-ship who)
|
||||
|
@ -1990,6 +1990,7 @@
|
||||
+$ public-keys-result
|
||||
$% [%full points=(map ship point)]
|
||||
[%diff who=ship =diff:point]
|
||||
[%breach who=ship]
|
||||
==
|
||||
:: ::
|
||||
++ gift :: out result <-$
|
||||
@ -1997,9 +1998,9 @@
|
||||
[%mass p=mass] :: memory usage report
|
||||
[%done error=(unit error:ames)] :: ames message (n)ack
|
||||
[%boon payload=*] :: ames response
|
||||
[%turf turf=(list turf)] :: domains
|
||||
[%private-keys =life vein=(map life ring)] :: private keys
|
||||
[%public-keys =public-keys-result] :: ethereum changes
|
||||
[%turf turf=(list turf)] :: domains
|
||||
== ::
|
||||
:: +seed: private boot parameters
|
||||
::
|
||||
|
@ -16,15 +16,10 @@
|
||||
++ test-first-order
|
||||
=/ dom=(set turf) (sy /org/urbit/zod ~)
|
||||
=^ moves app (~(poke-acme-order app *bowl:gall *acme:app) dom)
|
||||
=/ msg 'requesting an https certificate for zod.urbit.org'
|
||||
;: weld
|
||||
%+ expect-eq
|
||||
!> :~ =- [ost.bow.app [%poke / -]]
|
||||
=- [[~zod %hall] %hall-action %phrase (sy [~zod %inbox] ~) -]
|
||||
~[[%app %$ [%lin & msg]]]
|
||||
[ost.bow.app %wait /acme/try/1/directory +(now.bow.app)]
|
||||
==
|
||||
!> moves
|
||||
!> 2
|
||||
!> (lent moves)
|
||||
::
|
||||
%+ expect-eq
|
||||
!> [~ dom]
|
||||
|
@ -29,9 +29,27 @@ export class Message extends Component {
|
||||
</span>
|
||||
);
|
||||
} else if ('url' in letter) {
|
||||
let imgMatch =
|
||||
/(jpg|img|png|gif|tiff|jpeg|JPG|IMG|PNG|TIFF|GIF|webp|WEBP|webm|WEBM)$/
|
||||
.exec(letter.url);
|
||||
let contents = letter.url;
|
||||
if (imgMatch) {
|
||||
contents = (
|
||||
<img
|
||||
src={letter.url}
|
||||
style={{
|
||||
width: "50%",
|
||||
maxWidth: "250px"
|
||||
}}
|
||||
></img>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<a className="body-regular-400 v-top" href={letter.url}>
|
||||
{letter.url}
|
||||
<a className="body-regular-400 v-top"
|
||||
href={letter.url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer">
|
||||
{contents}
|
||||
</a>
|
||||
);
|
||||
} else if ('me' in letter) {
|
||||
|
@ -21,7 +21,7 @@ export class Sidebar extends Component {
|
||||
|
||||
render() {
|
||||
const { props, state } = this;
|
||||
let station = props.match.params.ship + props.match.params.station;
|
||||
let station = `/${props.match.params.ship}/${props.match.params.station}`;
|
||||
|
||||
let sidebarItems = Object.keys(props.inbox)
|
||||
.map((box) => {
|
||||
@ -42,7 +42,7 @@ export class Sidebar extends Component {
|
||||
};
|
||||
})
|
||||
.sort((a, b) => {
|
||||
return b.wen - a.wen;
|
||||
return b.when - a.when;
|
||||
})
|
||||
.map((obj) => {
|
||||
let unread = props.unreads[obj.box];
|
||||
|
@ -367,6 +367,8 @@ export class Post extends Component {
|
||||
titleOriginal: post.info.title,
|
||||
bodyOriginal: post.raw,
|
||||
post: post,
|
||||
title: post.info.title,
|
||||
body: post.raw,
|
||||
pathData: [
|
||||
{ text: "Home", url: "/~publish/recent" },
|
||||
{ text: blog.info.title, url: blogUrl },
|
||||
|
2
pkg/urbit/configure
vendored
2
pkg/urbit/configure
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
URBIT_VERSION="0.9.0.rc-4"
|
||||
URBIT_VERSION="0.9.2"
|
||||
|
||||
deps=" \
|
||||
curl gmp sigsegv argon2 ed25519 ent h2o scrypt sni uv murmur3 secp256k1 \
|
||||
|
@ -298,7 +298,7 @@ _main_getopt(c3_i argc, c3_c** argv)
|
||||
&& u3_Host.ops_u.url_c == 0
|
||||
&& u3_Host.ops_u.git == c3n ) {
|
||||
u3_Host.ops_u.url_c =
|
||||
"https://bootstrap.urbit.org/urbit-" URBIT_VERSION ".pill";
|
||||
"https://bootstrap.urbit.org/urbit-v" URBIT_VERSION ".pill";
|
||||
}
|
||||
else if ( u3_Host.ops_u.nuu == c3y
|
||||
&& u3_Host.ops_u.url_c == 0
|
||||
|
@ -119,17 +119,23 @@ _box_detach(u3a_box* box_u)
|
||||
_box_count(-(box_u->siz_w));
|
||||
|
||||
if ( nex_p ) {
|
||||
c3_assert(u3to(u3a_fbox, nex_p)->pre_p == fre_p);
|
||||
if ( u3to(u3a_fbox, nex_p)->pre_p != fre_p ) {
|
||||
c3_assert(!"loom: corrupt");
|
||||
}
|
||||
u3to(u3a_fbox, nex_p)->pre_p = pre_p;
|
||||
}
|
||||
if ( pre_p ) {
|
||||
c3_assert(u3to(u3a_fbox, pre_p)->nex_p == fre_p);
|
||||
if( u3to(u3a_fbox, pre_p)->nex_p != fre_p ) {
|
||||
c3_assert(!"loom: corrupt");
|
||||
}
|
||||
u3to(u3a_fbox, pre_p)->nex_p = nex_p;
|
||||
}
|
||||
else {
|
||||
c3_w sel_w = _box_slot(box_u->siz_w);
|
||||
|
||||
c3_assert(fre_p == u3R->all.fre_p[sel_w]);
|
||||
if ( fre_p != u3R->all.fre_p[sel_w] ) {
|
||||
c3_assert(!"loom: corrupt");
|
||||
}
|
||||
u3R->all.fre_p[sel_w] = nex_p;
|
||||
}
|
||||
}
|
||||
@ -468,14 +474,18 @@ _ca_willoc(c3_w len_w, c3_w ald_w, c3_w alp_w)
|
||||
siz_w += pad_w;
|
||||
_box_count(-(box_u->siz_w));
|
||||
{
|
||||
if ( (0 != u3to(u3a_fbox, *pfr_p)->pre_p) &&
|
||||
(u3to(u3a_fbox, u3to(u3a_fbox, *pfr_p)->pre_p)->nex_p
|
||||
!= (*pfr_p)) )
|
||||
{
|
||||
c3_assert((0 == u3to(u3a_fbox, *pfr_p)->pre_p) ||
|
||||
(u3to(u3a_fbox, u3to(u3a_fbox, *pfr_p)->pre_p)->nex_p
|
||||
== (*pfr_p)));
|
||||
c3_assert(!"loom: corrupt");
|
||||
}
|
||||
|
||||
c3_assert((0 == u3to(u3a_fbox, *pfr_p)->nex_p) ||
|
||||
(u3to(u3a_fbox, u3to(u3a_fbox, *pfr_p)->nex_p)->pre_p
|
||||
== (*pfr_p)));
|
||||
if( (0 != u3to(u3a_fbox, *pfr_p)->nex_p) &&
|
||||
(u3to(u3a_fbox, u3to(u3a_fbox, *pfr_p)->nex_p)->pre_p
|
||||
!= (*pfr_p)) )
|
||||
{
|
||||
c3_assert(!"loom: corrupt");
|
||||
}
|
||||
|
||||
if ( 0 != u3to(u3a_fbox, *pfr_p)->nex_p ) {
|
||||
@ -1560,7 +1570,7 @@ void
|
||||
u3a_luse(u3_noun som)
|
||||
{
|
||||
if ( 0 == u3a_use(som) ) {
|
||||
u3l_log("luse: insane %d 0x%x\r\n", som, som);
|
||||
fprintf(stderr, "loom: insane %d 0x%x\r\n", som, som);
|
||||
abort();
|
||||
}
|
||||
if ( _(u3du(som)) ) {
|
||||
@ -1608,7 +1618,7 @@ u3a_mark_ptr(void* ptr_v)
|
||||
c3_ws use_ws = (c3_ws)box_u->use_w;
|
||||
|
||||
if ( use_ws == 0 ) {
|
||||
u3l_log("%p is bogus\r\n", ptr_v);
|
||||
fprintf(stderr, "%p is bogus\r\n", ptr_v);
|
||||
siz_w = 0;
|
||||
}
|
||||
else {
|
||||
@ -1642,7 +1652,6 @@ u3a_mark_mptr(void* ptr_v)
|
||||
c3_w pad_w = ptr_w[-1];
|
||||
c3_w* org_w = ptr_w - (pad_w + 1);
|
||||
|
||||
// u3l_log("free %p %p\r\n", org_w, ptr_w);
|
||||
return u3a_mark_ptr(org_w);
|
||||
}
|
||||
|
||||
@ -1877,8 +1886,8 @@ u3a_sweep(void)
|
||||
|
||||
#ifdef U3_CPU_DEBUG
|
||||
if ( fre_w != u3R->all.fre_w ) {
|
||||
u3l_log("fre discrepancy (%x): %x, %x, %x\r\n", u3R->par_p,
|
||||
fre_w, u3R->all.fre_w, (u3R->all.fre_w - fre_w));
|
||||
fprintf(stderr, "fre discrepancy (%x): %x, %x, %x\r\n", u3R->par_p,
|
||||
fre_w, u3R->all.fre_w, (u3R->all.fre_w - fre_w));
|
||||
}
|
||||
#endif
|
||||
neg_w = (end_w - fre_w);
|
||||
|
@ -148,10 +148,10 @@ u3e_fault(void* adr_v, c3_i ser_i)
|
||||
if ( 0 != (u3P.dit_w[blk_w] & (1 << bit_w)) ) {
|
||||
fprintf(stderr, "strange page: %d, at %p, off %x\r\n",
|
||||
pag_w, adr_w, off_w);
|
||||
abort();
|
||||
c3_assert(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
c3_assert(0 == (u3P.dit_w[blk_w] & (1 << bit_w)));
|
||||
u3P.dit_w[blk_w] |= (1 << bit_w);
|
||||
|
||||
if ( -1 == mprotect((void *)(u3_Loom + (pag_w << u3a_page)),
|
||||
@ -185,14 +185,14 @@ _ce_image_open(u3e_image* img_u)
|
||||
|
||||
snprintf(ful_c, 8192, "%s/.urb/chk/%s.bin", u3P.dir_c, img_u->nam_c);
|
||||
if ( -1 == (img_u->fid_i = open(ful_c, mod_i, 0666)) ) {
|
||||
u3l_log("loom: open %s: %s\r\n", ful_c, strerror(errno));
|
||||
fprintf(stderr, "loom: open %s: %s\r\n", ful_c, strerror(errno));
|
||||
return c3n;
|
||||
}
|
||||
else {
|
||||
struct stat buf_u;
|
||||
|
||||
if ( -1 == fstat(img_u->fid_i, &buf_u) ) {
|
||||
u3l_log("loom: stat %s: %s\r\n", ful_c, strerror(errno));
|
||||
fprintf(stderr, "loom: stat %s: %s\r\n", ful_c, strerror(errno));
|
||||
c3_assert(0);
|
||||
return c3n;
|
||||
}
|
||||
@ -206,7 +206,7 @@ _ce_image_open(u3e_image* img_u)
|
||||
}
|
||||
else {
|
||||
if ( siz_d != (pgs_d << (c3_d)(u3a_page + 2)) ) {
|
||||
u3l_log("%s: corrupt size %" PRIx64 "\r\n", ful_c, siz_d);
|
||||
fprintf(stderr, "%s: corrupt size %" PRIx64 "\r\n", ful_c, siz_d);
|
||||
return c3n;
|
||||
}
|
||||
img_u->pgs_w = (c3_w) pgs_d;
|
||||
@ -276,13 +276,13 @@ _ce_patch_create(u3_ce_patch* pat_u)
|
||||
|
||||
snprintf(ful_c, 8192, "%s/.urb/chk/control.bin", u3P.dir_c);
|
||||
if ( -1 == (pat_u->ctl_i = open(ful_c, O_RDWR | O_CREAT | O_EXCL, 0600)) ) {
|
||||
u3l_log("loom: patch open control.bin: %s\r\n", strerror(errno));
|
||||
fprintf(stderr, "loom: patch open control.bin: %s\r\n", strerror(errno));
|
||||
c3_assert(0);
|
||||
}
|
||||
|
||||
snprintf(ful_c, 8192, "%s/.urb/chk/memory.bin", u3P.dir_c);
|
||||
if ( -1 == (pat_u->mem_i = open(ful_c, O_RDWR | O_CREAT | O_EXCL, 0600)) ) {
|
||||
u3l_log("loom: patch open memory.bin: %s\r\n", strerror(errno));
|
||||
fprintf(stderr, "loom: patch open memory.bin: %s\r\n", strerror(errno));
|
||||
c3_assert(0);
|
||||
}
|
||||
}
|
||||
@ -314,12 +314,12 @@ _ce_patch_verify(u3_ce_patch* pat_u)
|
||||
c3_w mem_w[1 << u3a_page];
|
||||
|
||||
if ( -1 == lseek(pat_u->mem_i, (i_w << (u3a_page + 2)), SEEK_SET) ) {
|
||||
u3l_log("loom: patch seek: %s\r\n", strerror(errno));
|
||||
fprintf(stderr, "loom: patch seek: %s\r\n", strerror(errno));
|
||||
c3_assert(0);
|
||||
return c3n;
|
||||
}
|
||||
if ( -1 == read(pat_u->mem_i, mem_w, (1 << (u3a_page + 2))) ) {
|
||||
u3l_log("loom: patch read: %s\r\n", strerror(errno));
|
||||
fprintf(stderr, "loom: patch read: %s\r\n", strerror(errno));
|
||||
c3_assert(0);
|
||||
return c3n;
|
||||
}
|
||||
@ -327,8 +327,8 @@ _ce_patch_verify(u3_ce_patch* pat_u)
|
||||
c3_w nug_w = u3r_mug_words(mem_w, (1 << u3a_page));
|
||||
|
||||
if ( mug_w != nug_w ) {
|
||||
u3l_log("_ce_patch_verify: mug mismatch %d/%d; (%x, %x)\r\n",
|
||||
pag_w, i_w, mug_w, nug_w);
|
||||
fprintf(stderr, "loom: patch mug mismatch %d/%d; (%x, %x)\r\n",
|
||||
pag_w, i_w, mug_w, nug_w);
|
||||
c3_assert(0);
|
||||
return c3n;
|
||||
}
|
||||
@ -623,7 +623,7 @@ _ce_patch_apply(u3_ce_patch* pat_u)
|
||||
c3_w ret_w;
|
||||
ret_w = ftruncate(u3P.nor_u.fid_i, u3P.nor_u.pgs_w << (u3a_page + 2));
|
||||
if (ret_w){
|
||||
u3l_log("loom: patch apply truncate north: %s\r\n", strerror(errno));
|
||||
fprintf(stderr, "loom: patch apply truncate north: %s\r\n", strerror(errno));
|
||||
c3_assert(0);
|
||||
}
|
||||
}
|
||||
@ -633,7 +633,7 @@ _ce_patch_apply(u3_ce_patch* pat_u)
|
||||
c3_w ret_w;
|
||||
ret_w = ftruncate(u3P.sou_u.fid_i, u3P.sou_u.pgs_w << (u3a_page + 2));
|
||||
if (ret_w){
|
||||
u3l_log("loom: patch apply truncate south: %s\r\n", strerror(errno));
|
||||
fprintf(stderr, "loom: patch apply truncate south: %s\r\n", strerror(errno));
|
||||
c3_assert(0);
|
||||
}
|
||||
}
|
||||
@ -643,7 +643,7 @@ _ce_patch_apply(u3_ce_patch* pat_u)
|
||||
(-1 == lseek(u3P.nor_u.fid_i, 0, SEEK_SET)) ||
|
||||
(-1 == lseek(u3P.sou_u.fid_i, 0, SEEK_SET)) )
|
||||
{
|
||||
u3l_log("loom: patch apply seek 0: %s\r\n", strerror(errno));
|
||||
fprintf(stderr, "loom: patch apply seek 0: %s\r\n", strerror(errno));
|
||||
c3_assert(0);
|
||||
}
|
||||
|
||||
@ -663,16 +663,16 @@ _ce_patch_apply(u3_ce_patch* pat_u)
|
||||
}
|
||||
|
||||
if ( -1 == read(pat_u->mem_i, mem_w, (1 << (u3a_page + 2))) ) {
|
||||
u3l_log("loom: patch apply read: %s\r\n", strerror(errno));
|
||||
fprintf(stderr, "loom: patch apply read: %s\r\n", strerror(errno));
|
||||
c3_assert(0);
|
||||
}
|
||||
else {
|
||||
if ( -1 == lseek(fid_i, (off_w << (u3a_page + 2)), SEEK_SET) ) {
|
||||
u3l_log("loom: patch apply seek: %s\r\n", strerror(errno));
|
||||
fprintf(stderr, "loom: patch apply seek: %s\r\n", strerror(errno));
|
||||
c3_assert(0);
|
||||
}
|
||||
if ( -1 == write(fid_i, mem_w, (1 << (u3a_page + 2))) ) {
|
||||
u3l_log("loom: patch apply write: %s\r\n", strerror(errno));
|
||||
fprintf(stderr, "loom: patch apply write: %s\r\n", strerror(errno));
|
||||
c3_assert(0);
|
||||
}
|
||||
}
|
||||
@ -694,7 +694,7 @@ _ce_image_blit(u3e_image* img_u,
|
||||
lseek(img_u->fid_i, 0, SEEK_SET);
|
||||
for ( i_w=0; i_w < img_u->pgs_w; i_w++ ) {
|
||||
if ( -1 == read(img_u->fid_i, ptr_w, (1 << (u3a_page + 2))) ) {
|
||||
u3l_log("loom: image blit read: %s\r\n", strerror(errno));
|
||||
fprintf(stderr, "loom: image blit read: %s\r\n", strerror(errno));
|
||||
c3_assert(0);
|
||||
}
|
||||
#if 0
|
||||
@ -726,7 +726,7 @@ _ce_image_fine(u3e_image* img_u,
|
||||
c3_w mem_w, fil_w;
|
||||
|
||||
if ( -1 == read(img_u->fid_i, buf_w, (1 << (u3a_page + 2))) ) {
|
||||
u3l_log("loom: image fine read: %s\r\n", strerror(errno));
|
||||
fprintf(stderr, "loom: image fine read: %s\r\n", strerror(errno));
|
||||
c3_assert(0);
|
||||
}
|
||||
mem_w = u3r_mug_words(ptr_w, (1 << u3a_page));
|
||||
@ -735,11 +735,11 @@ _ce_image_fine(u3e_image* img_u,
|
||||
if ( mem_w != fil_w ) {
|
||||
c3_w pag_w = (ptr_w - u3_Loom) >> u3a_page;
|
||||
|
||||
u3l_log("mismatch: page %d, mem_w %x, fil_w %x, K %x\r\n",
|
||||
pag_w,
|
||||
mem_w,
|
||||
fil_w,
|
||||
u3K.mug_w[pag_w]);
|
||||
fprintf(stderr, "mismatch: page %d, mem_w %x, fil_w %x, K %x\r\n",
|
||||
pag_w,
|
||||
mem_w,
|
||||
fil_w,
|
||||
u3K.mug_w[pag_w]);
|
||||
abort();
|
||||
}
|
||||
ptr_w += stp_ws;
|
||||
@ -781,12 +781,9 @@ u3e_save(void)
|
||||
}
|
||||
|
||||
// u3a_print_memory(stderr, "sync: save", 4096 * pat_u->con_u->pgs_w);
|
||||
|
||||
_ce_patch_sync(pat_u);
|
||||
|
||||
// u3l_log("_ce_patch_verify\r\n");
|
||||
_ce_patch_verify(pat_u);
|
||||
|
||||
// u3l_log("_ce_patch_apply\r\n");
|
||||
_ce_patch_apply(pat_u);
|
||||
|
||||
#ifdef U3_SNAPSHOT_VALIDATION
|
||||
@ -804,14 +801,9 @@ u3e_save(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
// u3l_log("_ce_image_sync\r\n");
|
||||
_ce_image_sync(&u3P.nor_u);
|
||||
_ce_image_sync(&u3P.sou_u);
|
||||
|
||||
// u3l_log("_ce_patch_delete\r\n");
|
||||
_ce_patch_delete();
|
||||
|
||||
// u3l_log("_ce_patch_free\r\n");
|
||||
_ce_patch_free(pat_u);
|
||||
}
|
||||
|
||||
@ -846,16 +838,10 @@ u3e_live(c3_o nuu_o, c3_c* dir_c)
|
||||
/* Load any patch files; apply them to images.
|
||||
*/
|
||||
if ( 0 != (pat_u = _ce_patch_open()) ) {
|
||||
u3l_log("boot: _ce_patch_apply\r\n");
|
||||
_ce_patch_apply(pat_u);
|
||||
|
||||
u3l_log("boot: _ce_image_sync\r\n");
|
||||
_ce_image_sync(&u3P.nor_u);
|
||||
_ce_image_sync(&u3P.sou_u);
|
||||
|
||||
u3l_log("boot: _ce_patch_delete\r\n");
|
||||
_ce_patch_delete();
|
||||
u3l_log("boot: _ce_patch_free\r\n");
|
||||
_ce_patch_free(pat_u);
|
||||
}
|
||||
|
||||
|
@ -919,7 +919,7 @@ u3_term_get_blew(c3_l tid_l)
|
||||
c3_l col_l, row_l;
|
||||
|
||||
struct winsize siz_u;
|
||||
if ( (c3y == u3_Host.ops_u.tem) &&
|
||||
if ( (c3n == u3_Host.ops_u.tem) &&
|
||||
uty_u && (0 == ioctl(uty_u->fid_i, TIOCGWINSZ, &siz_u)) )
|
||||
{
|
||||
col_l = siz_u.ws_col;
|
||||
|
@ -306,6 +306,7 @@ _worker_grab(u3_noun sac, u3_noun ovo, u3_noun vir)
|
||||
tot_w += u3a_maid(fil_u, "effects", u3a_mark_noun(vir));
|
||||
|
||||
u3a_print_memory(fil_u, "total marked", tot_w);
|
||||
u3a_print_memory(fil_u, "free lists", u3a_idle(u3R));
|
||||
u3a_print_memory(fil_u, "sweep", u3a_sweep());
|
||||
|
||||
fflush(fil_u);
|
||||
@ -340,10 +341,6 @@ _worker_send(u3_noun job)
|
||||
static void
|
||||
_worker_send_replace(c3_d evt_d, u3_noun job)
|
||||
{
|
||||
u3l_log("worker_send_replace %" PRIu64 " %s\r\n",
|
||||
evt_d,
|
||||
u3r_string(u3h(u3t(u3t(job)))));
|
||||
|
||||
_worker_send(u3nt(c3__work,
|
||||
u3i_chubs(1, &evt_d),
|
||||
u3ke_jam(u3nc(u3V.mug_l, job))));
|
||||
@ -623,6 +620,15 @@ _worker_work_live(c3_d evt_d, u3_noun job)
|
||||
rec_o = c3y;
|
||||
pri = 0;
|
||||
}
|
||||
// reclaim memory from persistent caches periodically
|
||||
//
|
||||
// XX this is a hack to work two things
|
||||
// - bytecode caches grow rapidly and can't be simply capped
|
||||
// - we don't make very effective use of our free lists
|
||||
//
|
||||
else {
|
||||
rec_o = _(0 == (evt_d % 1000ULL));
|
||||
}
|
||||
|
||||
// notify daemon of memory pressure via "fake" effect
|
||||
//
|
||||
@ -906,6 +912,21 @@ _worker_poke(void* vod_p, u3_noun mat)
|
||||
}
|
||||
}
|
||||
|
||||
/* _worker_static_grab(): garbage collect, checking for profiling. RETAIN.
|
||||
*/
|
||||
static void
|
||||
_worker_static_grab(void)
|
||||
{
|
||||
c3_assert( u3R == &(u3H->rod_u) );
|
||||
|
||||
fprintf(stderr, "work: measuring memory:\r\n");
|
||||
u3a_print_memory(stderr, "total marked", u3m_mark(stderr));
|
||||
u3a_print_memory(stderr, "free lists", u3a_idle(u3R));
|
||||
u3a_print_memory(stderr, "sweep", u3a_sweep());
|
||||
fprintf(stderr, "\r\n");
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
/* u3_worker_boot(): send startup message to manager.
|
||||
*/
|
||||
void
|
||||
@ -935,6 +956,18 @@ u3_worker_boot(void)
|
||||
u3l_log("work: play %" PRIu64 "\r\n", nex_d);
|
||||
|
||||
_worker_send(u3nc(c3__play, dat));
|
||||
|
||||
// measure/print static memory usage if < 1/2 of the loom is available
|
||||
//
|
||||
{
|
||||
c3_w pen_w = u3a_open(u3R);
|
||||
|
||||
if ( !(pen_w > (1 << 28)) ) {
|
||||
fprintf(stderr, "\r\n");
|
||||
u3a_print_memory(stderr, "work: contiguous free space", pen_w);
|
||||
_worker_static_grab();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* main(): main() when run as urbit-worker
|
||||
|
11
sh/create-ropsten-pills
Executable file
11
sh/create-ropsten-pills
Executable file
@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
sha=$(git rev-parse $(git branch --show-current))
|
||||
|
||||
brass=$(nix-build nix/ops -A brass-ropsten --no-out-link)
|
||||
ivory=$(nix-build nix/ops -A ivory-ropsten --no-out-link)
|
||||
|
||||
cp $brass ./brass-ropsten-${sha:0:5}.pill
|
||||
cp $ivory ./ivory-ropsten-${sha:0:5}.pill
|
17
sh/image
17
sh/image
@ -6,13 +6,6 @@ say() {
|
||||
echo "$1" >&2
|
||||
}
|
||||
|
||||
git_sha="$(git rev-parse HEAD)"
|
||||
git_sha="${git_sha:0:8}"
|
||||
|
||||
git_branch="$(git branch --show-current)"
|
||||
|
||||
git_tag="${git_branch}-${git_sha}"
|
||||
|
||||
say "Building nix/ops/image..."
|
||||
nix_out="$(nix-build nix/ops -A image --no-out-link "$@")"
|
||||
|
||||
@ -20,11 +13,5 @@ say "Loading $nix_out into Docker..."
|
||||
nix_name="$(docker load --quiet --input $nix_out)"
|
||||
nix_name="${nix_name#Loaded image: }"
|
||||
|
||||
say "Re-tagging with git metadata..."
|
||||
image_repo="$(docker images $nix_name --format '{{.Repository}}')"
|
||||
image_name="${image_repo}:${git_tag}"
|
||||
docker tag $nix_name $image_name
|
||||
|
||||
# Output only the new tag on stdout for subsequent pipes/tooling.
|
||||
say $nix_name
|
||||
echo $image_name
|
||||
# Output only the tag on stdout for subsequent pipes/tooling.
|
||||
echo $nix_name
|
||||
|
Loading…
Reference in New Issue
Block a user