mirror of
https://github.com/urbit/shrub.git
synced 2024-10-26 21:09:47 +03:00
Merge branch 'next/kelvin/411' into next/hoon/138
This commit is contained in:
commit
8b1e66c6a1
14
.github/workflows/shared.yml
vendored
14
.github/workflows/shared.yml
vendored
@ -55,7 +55,9 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
lfs: true
|
||||||
|
|
||||||
# We only want the extra nix config on linux, where it is necessary
|
# We only want the extra nix config on linux, where it is necessary
|
||||||
# for the docker build. We don't want in on Mac, where it isn't but
|
# for the docker build. We don't want in on Mac, where it isn't but
|
||||||
@ -77,7 +79,6 @@ jobs:
|
|||||||
- if: ${{ matrix.os == 'ubuntu-latest' }}
|
- if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||||
name: run urbit-tests
|
name: run urbit-tests
|
||||||
run: |
|
run: |
|
||||||
cp -RL tests pkg/arvo/tests
|
|
||||||
if [[ "${{ inputs.next }}" == "next/kelvin/"* ]]; then
|
if [[ "${{ inputs.next }}" == "next/kelvin/"* ]]; then
|
||||||
next=$(echo ${{ inputs.next }} | sed 's/[^0-9]//g')
|
next=$(echo ${{ inputs.next }} | sed 's/[^0-9]//g')
|
||||||
base="https://bootstrap.urbit.org/vere/next/kelvin/${next}"
|
base="https://bootstrap.urbit.org/vere/next/kelvin/${next}"
|
||||||
@ -91,7 +92,8 @@ jobs:
|
|||||||
url="$(echo ${base}/v${vere}/vere-v${vere}-linux-x86_64)"
|
url="$(echo ${base}/v${vere}/vere-v${vere}-linux-x86_64)"
|
||||||
echo $vere
|
echo $vere
|
||||||
echo $url
|
echo $url
|
||||||
# put in .jam so it doesn't crash when it gets -A'd in
|
curl -Lo urbit "$url"
|
||||||
curl -Lo pkg/arvo/vere.jam "$url"
|
chmod +x urbit
|
||||||
chmod +x pkg/arvo/vere.jam
|
git add urbit
|
||||||
nix-build -A urbit-tests
|
|
||||||
|
nix flake check --keep-build-log -L
|
||||||
|
@ -31,15 +31,6 @@ them. "It would be cool if.." probably does not, in itself, constitute a good
|
|||||||
feature request; instead, try to be specific about what you're requesting, and
|
feature request; instead, try to be specific about what you're requesting, and
|
||||||
what your desired feature would accomplish.
|
what your desired feature would accomplish.
|
||||||
|
|
||||||
### Feature Branch Names
|
|
||||||
|
|
||||||
Every branch that you intend to put up for review must adhere to the form
|
|
||||||
`i/<N>/<...>`, where `<N>` is the number of the issue that the branch
|
|
||||||
corresponds to and `<...>` is an optional short description of the branch to aid
|
|
||||||
in readability. If `<...>` is omitted, the `/` should be omitted as well, which
|
|
||||||
makes `i/<N>` a well-formed branch name. These feature branches should be based
|
|
||||||
off of `develop`.
|
|
||||||
|
|
||||||
### Commits
|
### Commits
|
||||||
|
|
||||||
Commits should generally be relevant, atomic, and have descriptions formatted in
|
Commits should generally be relevant, atomic, and have descriptions formatted in
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:8c0fb3cb223a884bb10dc2877c2dcbc597d7ba54392c8cdc73ac152626888cc9
|
oid sha256:feaae0eece54db3e92122263706c283674af581d14ffde8a29fb24e1873a35b1
|
||||||
size 6379473
|
size 6453015
|
||||||
|
76
flake.lock
Normal file
76
flake.lock
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1687709756,
|
||||||
|
"narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1688465017,
|
||||||
|
"narHash": "sha256-xzFcCnzPOgQaX7Acprfqo+tqHJ2UKWC38pXrcqvdXHU=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "0d5682acc109add20f70440269587a1b169cc2fe",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"id": "nixpkgs",
|
||||||
|
"type": "indirect"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"tools": "tools"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tools": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1687273483,
|
||||||
|
"narHash": "sha256-41X9PWXGM7lFzPiIj4dw3i8bgMvpT85iYHSeyIxPJcc=",
|
||||||
|
"owner": "urbit",
|
||||||
|
"repo": "tools",
|
||||||
|
"rev": "2ad116fdb539e4116dc18d86772a241415cc1ef4",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "urbit",
|
||||||
|
"repo": "tools",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
75
flake.nix
Normal file
75
flake.nix
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
tools = {
|
||||||
|
flake = false;
|
||||||
|
url = "github:urbit/tools";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, flake-utils, tools }:
|
||||||
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
|
let
|
||||||
|
usableTools = pkgs.runCommand "patched-tools" { } ''
|
||||||
|
cp -r ${tools} $out
|
||||||
|
chmod +w -R $out
|
||||||
|
patchShebangs $out
|
||||||
|
'';
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
bootFakeShip = { pill, arvo }:
|
||||||
|
pkgs.runCommand "fake-pier" { } ''
|
||||||
|
${./urbit} --pier $out -F zod -B ${pill} -l -x -t -A ${arvo}
|
||||||
|
'';
|
||||||
|
fakePier = bootFakeShip {
|
||||||
|
pill = ./bin/solid.pill;
|
||||||
|
arvo = "${./pkg}/arvo";
|
||||||
|
};
|
||||||
|
testPier = bootFakeShip {
|
||||||
|
pill = ./bin/solid.pill;
|
||||||
|
arvo = pkgs.runCommand "test-arvo" {} ''
|
||||||
|
cp -r ${./pkg} $out
|
||||||
|
chmod +w -R $out
|
||||||
|
cp -r ${./tests} $out/arvo/tests
|
||||||
|
cp -r ${./test-desk.bill} $out/arvo/desk.bill
|
||||||
|
'' + "/arvo";
|
||||||
|
};
|
||||||
|
buildPillThread = pill:
|
||||||
|
pkgs.writeTextFile {
|
||||||
|
name = "";
|
||||||
|
text = ''
|
||||||
|
=/ m (strand ,vase)
|
||||||
|
;< [=ship =desk =case] bind:m get-beak
|
||||||
|
;< ~ bind:m (poke [ship %dojo] %lens-command !>([%$ [%dojo '+${pill}'] [%output-pill '${pill}/pill']]))
|
||||||
|
;< ~ bind:m (poke [ship %hood] %drum-exit !>(~))
|
||||||
|
(pure:m !>(~))
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
buildPill = pill:
|
||||||
|
pkgs.runCommand ("${pill}.pill") { buildInputs = [ pkgs.netcat ]; } ''
|
||||||
|
cp -r ${fakePier} pier
|
||||||
|
chmod +w -R pier
|
||||||
|
${./urbit} -d pier
|
||||||
|
${usableTools}/pkg/click/click -k -p -i ${buildPillThread pill} pier
|
||||||
|
|
||||||
|
# Sleep to let urbit spin down properly
|
||||||
|
sleep 5
|
||||||
|
|
||||||
|
cp pier/.urb/put/${pill}.pill $out
|
||||||
|
'';
|
||||||
|
|
||||||
|
in {
|
||||||
|
checks = {
|
||||||
|
testFakeShip = import ./nix/test-fake-ship.nix {
|
||||||
|
inherit pkgs;
|
||||||
|
pier = testPier;
|
||||||
|
click = usableTools + "/pkg/click/click";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
packages = {
|
||||||
|
inherit fakePier testPier;
|
||||||
|
brass = buildPill "brass";
|
||||||
|
ivory = buildPill "ivory";
|
||||||
|
solid = buildPill "solid";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
@ -1,34 +0,0 @@
|
|||||||
# The build system where packages will be _built_.
|
|
||||||
{ system ? builtins.currentSystem
|
|
||||||
# The host system where packages will _run_.
|
|
||||||
, crossSystem ? null
|
|
||||||
# Additional sources.json overrides.
|
|
||||||
, sources ? { }
|
|
||||||
# Additional nixpkgs.config overrides.
|
|
||||||
, config ? { }
|
|
||||||
# Additional nixpkgs.overlays.
|
|
||||||
, overlays ? [ ]
|
|
||||||
# Overlays to apply to the last package set in cross compilation.
|
|
||||||
, crossOverlays ? [ ] }:
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
finalSources = import ./sources.nix { } // sources;
|
|
||||||
|
|
||||||
pkgs = import finalSources.nixpkgs {
|
|
||||||
inherit system config crossSystem crossOverlays;
|
|
||||||
|
|
||||||
overlays = [
|
|
||||||
# Make prev.sources available to subsequent overlays.
|
|
||||||
(_final: _prev: { sources = finalSources; })
|
|
||||||
# General unguarded (native) overrides for nixpkgs.
|
|
||||||
(import ./overlays/native.nix)
|
|
||||||
# Specific overrides guarded by the host platform.
|
|
||||||
(import ./overlays/musl.nix)
|
|
||||||
(import ./overlays/arm.nix)
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
in pkgs // {
|
|
||||||
pkgsStatic = pkgs.pkgsStatic.extend (import ./overlays/static.nix);
|
|
||||||
}
|
|
@ -1,72 +0,0 @@
|
|||||||
{ lib, stdenvNoCC, curl }:
|
|
||||||
|
|
||||||
{ arvo ? null, pill, ship, arguments ? [ "-l" ] }:
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
args = arguments ++ [ "-d" "-F" "${ship}" "-B" "${pill}" ]
|
|
||||||
++ lib.optionals (arvo != null) [ "-A" "${arvo}" ];
|
|
||||||
|
|
||||||
in stdenvNoCC.mkDerivation {
|
|
||||||
name = "fake-${ship}";
|
|
||||||
|
|
||||||
buildInputs = [ curl ];
|
|
||||||
|
|
||||||
phases = [ "buildPhase" "installPhase " ];
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
set -xeuo pipefail
|
|
||||||
|
|
||||||
${arvo}/vere.jam ${lib.concatStringsSep " " args} -c ./pier
|
|
||||||
|
|
||||||
cleanup () {
|
|
||||||
if [ -f ./pier/.vere.lock ]; then
|
|
||||||
kill $(< ./pier/.vere.lock) || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
set +x
|
|
||||||
}
|
|
||||||
|
|
||||||
trap cleanup EXIT
|
|
||||||
|
|
||||||
port=$(cat ./pier/.http.ports | grep loopback | tr -s ' ' '\n' | head -n 1)
|
|
||||||
|
|
||||||
lensd() {
|
|
||||||
curl -f -s \
|
|
||||||
--data "{\"source\":{\"dojo\":\"$1\"},\"sink\":{\"stdout\":null}}" \
|
|
||||||
"http://localhost:$port" | xargs printf %s | sed 's/\\n/\n/g'
|
|
||||||
}
|
|
||||||
|
|
||||||
lensa() {
|
|
||||||
curl -f -s \
|
|
||||||
--data "{\"source\":{\"dojo\":\"$2\"},\"sink\":{\"app\":\"$1\"}}" \
|
|
||||||
"http://localhost:$port" | xargs printf %s | sed 's/\\n/\n/g'
|
|
||||||
}
|
|
||||||
|
|
||||||
check () {
|
|
||||||
[ 3 -eq "$(lensd 3)" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
if check && sleep 10 && check; then
|
|
||||||
header "boot success"
|
|
||||||
lensa hood '+hood/exit'
|
|
||||||
while [ -f ./pier/.vere.lock ]; do
|
|
||||||
echo "waiting for pier to shut down"
|
|
||||||
sleep 5
|
|
||||||
done
|
|
||||||
else
|
|
||||||
header "boot failure"
|
|
||||||
kill $(< ./pier/.vere.lock) || true
|
|
||||||
set +x
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
set +x
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
ls
|
|
||||||
ls -a ./pier
|
|
||||||
mv ./pier $out
|
|
||||||
'';
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
# Functions that are expected run on the native (non-cross) system.
|
|
||||||
|
|
||||||
{ callPackage }:
|
|
||||||
|
|
||||||
rec {
|
|
||||||
bootFakeShip = callPackage ./boot-fake-ship.nix { };
|
|
||||||
|
|
||||||
testFakeShip = callPackage ./test-fake-ship.nix { inherit bootFakeShip; };
|
|
||||||
|
|
||||||
fetchGitHubLFS = callPackage ./fetch-github-lfs.nix { };
|
|
||||||
|
|
||||||
makeReleaseTarball = callPackage ./make-release-tarball.nix { };
|
|
||||||
}
|
|
@ -1,107 +0,0 @@
|
|||||||
{ lib, stdenvNoCC, runCommandLocal, cacert, curl, jq }:
|
|
||||||
|
|
||||||
{ src
|
|
||||||
# `name` shouldn't use `baseNameOf` otherwise we'll
|
|
||||||
# get `is not allowed to refer to a store path` errors.
|
|
||||||
, name ? baseNameOf src, owner ? "urbit", repo ? "urbit"
|
|
||||||
, preferLocalBuild ? true }:
|
|
||||||
|
|
||||||
assert builtins.isPath src;
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
# Parse the first 7 characters of the supplied `src` path for the required
|
|
||||||
# `version` key as defined by the lfs specification:
|
|
||||||
# https://github.com/git-lfs/git-lfs/blob/master/docs/spec.md
|
|
||||||
#
|
|
||||||
# If `version` exists we assume we're dealing with a lfs pointer and parse
|
|
||||||
# the `oid` and `size` from the pointer and write these into a JSON object.
|
|
||||||
#
|
|
||||||
# If the first 7 characters are unrecognised we assume the path is a binary
|
|
||||||
# file and set both `oid` and `size` to `null`.
|
|
||||||
#
|
|
||||||
# The `oid` and `size` are then JSON decoded into an expression to use
|
|
||||||
# as the fixed-output derivation's `sha256 = oid`, and to form a download
|
|
||||||
# operation payload to request the actual lfs blob's real url.
|
|
||||||
pointer = builtins.fromJSON (builtins.readFile
|
|
||||||
(runCommandLocal "lfs-pointer-${name}" { } ''
|
|
||||||
oid="null"
|
|
||||||
size="null"
|
|
||||||
|
|
||||||
if [[ "$(head -c 7 "${src}")" != "version" ]]; then
|
|
||||||
header "lfs ${src} is a binary blob, skipping"
|
|
||||||
else
|
|
||||||
header "reading lfs pointer from ${src}"
|
|
||||||
|
|
||||||
contents=($(awk '{print $2}' "${src}"))
|
|
||||||
oid="''${contents[1]#sha256:}"
|
|
||||||
size="''${contents[2]}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat <<EOF > "$out"
|
|
||||||
{"oid": "$oid", "size": $size}
|
|
||||||
EOF
|
|
||||||
''));
|
|
||||||
|
|
||||||
downloadUrl =
|
|
||||||
"https://github.com/${owner}/${repo}.git/info/lfs/objects/batch";
|
|
||||||
|
|
||||||
# Encode `oid` and `size` into a download operation per:
|
|
||||||
# https://github.com/git-lfs/git-lfs/blob/master/docs/api/batch.md
|
|
||||||
#
|
|
||||||
# This is done using toJSON to avoid bash quotation issues.
|
|
||||||
downloadPayload = builtins.toJSON {
|
|
||||||
operation = "download";
|
|
||||||
objects = [ pointer ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Define a fixed-output derivation using the lfs pointer's `oid` as the
|
|
||||||
# expected sha256 output hash, if `oid` is not null.
|
|
||||||
#
|
|
||||||
|
|
||||||
# 1. Request the actual url of the binary file from the lfs batch api.
|
|
||||||
# 2. Download the binary file contents to `$out`.
|
|
||||||
download = stdenvNoCC.mkDerivation {
|
|
||||||
name = "lfs-blob-${name}";
|
|
||||||
nativeBuildInputs = [ curl jq ];
|
|
||||||
phases = [ "installPhase" ];
|
|
||||||
installPhase = ''
|
|
||||||
curl=(
|
|
||||||
curl
|
|
||||||
--location
|
|
||||||
--max-redirs 20
|
|
||||||
--retry 3
|
|
||||||
--disable-epsv
|
|
||||||
--cookie-jar cookies
|
|
||||||
$NIX_CURL_FLAGS
|
|
||||||
)
|
|
||||||
|
|
||||||
header "reading lfs metadata from ${downloadUrl}"
|
|
||||||
|
|
||||||
href=$("''${curl[@]}" \
|
|
||||||
-d '${downloadPayload}' \
|
|
||||||
-H 'Accept: application/vnd.git-lfs+json' \
|
|
||||||
'${downloadUrl}' \
|
|
||||||
| jq -r '.objects[0].actions.download.href')
|
|
||||||
|
|
||||||
header "download lfs data from remote"
|
|
||||||
|
|
||||||
# Pozor/Achtung: the href contains credential and signature information,
|
|
||||||
# so we avoid echoing it to stdout/err.
|
|
||||||
"''${curl[@]}" -s --output "$out" "$href"
|
|
||||||
'';
|
|
||||||
|
|
||||||
impureEnvVars = lib.fetchers.proxyImpureEnvVars;
|
|
||||||
|
|
||||||
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
|
||||||
|
|
||||||
outputHashAlgo = "sha256";
|
|
||||||
outputHashMode = "flat";
|
|
||||||
outputHash = pointer.oid;
|
|
||||||
|
|
||||||
inherit preferLocalBuild;
|
|
||||||
};
|
|
||||||
|
|
||||||
# If `pointer.oid` is null then supplied the `src` must be a binary
|
|
||||||
# blob and can be returned directly.
|
|
||||||
in if pointer.oid == null || pointer.size == null then src else download
|
|
@ -1,30 +0,0 @@
|
|||||||
{ lib, stdenvNoCC, coreutils }:
|
|
||||||
|
|
||||||
{ name, extension ? "tgz", contents # { target = source, ... }
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
transforms = builtins.concatStringsSep " " (lib.mapAttrsToList
|
|
||||||
(target: source: ''--transform "s,${source},${target},"'') contents);
|
|
||||||
|
|
||||||
sources = builtins.concatStringsSep " "
|
|
||||||
(lib.mapAttrsToList (_target: source: "${source}") contents);
|
|
||||||
|
|
||||||
in stdenvNoCC.mkDerivation {
|
|
||||||
name = "${name}.${extension}";
|
|
||||||
phases = [ "buildPhase" ];
|
|
||||||
|
|
||||||
nativeBuildInputs = [ coreutils ];
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
tar -vczf $out \
|
|
||||||
--owner=0 --group=0 --mode=u+rw,uga+r \
|
|
||||||
--absolute-names \
|
|
||||||
--hard-dereference \
|
|
||||||
${transforms} \
|
|
||||||
${sources}
|
|
||||||
'';
|
|
||||||
|
|
||||||
preferLocalBuild = true;
|
|
||||||
}
|
|
@ -1,188 +0,0 @@
|
|||||||
{ lib, stdenvNoCC, curl, python3, bootFakeShip }:
|
|
||||||
|
|
||||||
{ arvo ? null, pill, ship ? "bus", doCheck ? true }:
|
|
||||||
|
|
||||||
stdenvNoCC.mkDerivation {
|
|
||||||
name = "test-${ship}";
|
|
||||||
|
|
||||||
src = bootFakeShip { inherit arvo pill ship; };
|
|
||||||
|
|
||||||
phases = [ "unpackPhase" "buildPhase" "checkPhase" ];
|
|
||||||
|
|
||||||
buildInputs = [ curl python3 ];
|
|
||||||
|
|
||||||
unpackPhase = ''
|
|
||||||
cp -R $src ./pier
|
|
||||||
chmod -R u+rw ./pier
|
|
||||||
'';
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
set -x
|
|
||||||
|
|
||||||
${arvo}/vere.jam -d ./pier 2> urbit-output
|
|
||||||
|
|
||||||
# Sledge Hammer!
|
|
||||||
# See: https://github.com/travis-ci/travis-ci/issues/4704#issuecomment-348435959
|
|
||||||
python3 -c $'import os\n[os.set_blocking(i, True) for i in range(3)]\n'
|
|
||||||
|
|
||||||
port=$(cat ./pier/.http.ports | grep loopback | tr -s ' ' '\n' | head -n 1)
|
|
||||||
|
|
||||||
lensd() {
|
|
||||||
# -f elided, this can hit server-side timeouts
|
|
||||||
curl -s \
|
|
||||||
--data "{\"source\":{\"dojo\":\"$1\"},\"sink\":{\"stdout\":null}}" \
|
|
||||||
"http://localhost:$port" | xargs printf %s | sed 's/\\n/\n/g'
|
|
||||||
}
|
|
||||||
|
|
||||||
lensa() {
|
|
||||||
# -f elided, this can hit server-side timeouts
|
|
||||||
curl -s \
|
|
||||||
--data "{\"source\":{\"dojo\":\"$2\"},\"sink\":{\"app\":\"$1\"}}" \
|
|
||||||
"http://localhost:$port" | xargs printf %s | sed 's/\\n/\n/g'
|
|
||||||
}
|
|
||||||
|
|
||||||
tail -F urbit-output >&2 &
|
|
||||||
|
|
||||||
tailproc=$!
|
|
||||||
|
|
||||||
cleanup () {
|
|
||||||
kill $(cat ./pier/.vere.lock) || true
|
|
||||||
kill "$tailproc" 2>/dev/null || true
|
|
||||||
|
|
||||||
set +x
|
|
||||||
}
|
|
||||||
|
|
||||||
trap cleanup EXIT
|
|
||||||
|
|
||||||
# measure initial memory usage
|
|
||||||
#
|
|
||||||
lensd '~& ~ ~& %init-mass-start ~'
|
|
||||||
lensa hood '+hood/mass'
|
|
||||||
lensd '~& ~ ~& %init-mass-end ~'
|
|
||||||
|
|
||||||
# run the unit tests
|
|
||||||
#
|
|
||||||
lensd '~& ~ ~& %test-unit-start ~'
|
|
||||||
lensd '-test %/tests ~'
|
|
||||||
lensd '~& ~ ~& %test-unit-end ~'
|
|
||||||
|
|
||||||
# use the :test app to build all agents, generators, and marks
|
|
||||||
#
|
|
||||||
lensa hood '+hood/start %test'
|
|
||||||
|
|
||||||
lensd '~& ~ ~& %test-agents-start ~'
|
|
||||||
lensa test '%agents'
|
|
||||||
lensd '~& ~ ~& %test-agents-end ~'
|
|
||||||
|
|
||||||
lensd '~& ~ ~& %test-generators-start ~'
|
|
||||||
lensa test '%generators'
|
|
||||||
lensd '~& ~ ~& %test-generators-end ~'
|
|
||||||
|
|
||||||
lensd '~& ~ ~& %test-marks-start ~'
|
|
||||||
lensa test '%marks'
|
|
||||||
lensd '~& ~ ~& %test-marks-end ~'
|
|
||||||
|
|
||||||
# measure memory usage post tests
|
|
||||||
#
|
|
||||||
lensd '~& ~ ~& %test-mass-start ~'
|
|
||||||
lensa hood '+hood/mass'
|
|
||||||
lensd '~& ~ ~& %test-mass-end ~'
|
|
||||||
|
|
||||||
# defragment the loom
|
|
||||||
#
|
|
||||||
lensd '~& ~ ~& %pack-start ~'
|
|
||||||
lensa hood '+hood/pack'
|
|
||||||
lensd '~& ~ ~& %pack-end ~'
|
|
||||||
|
|
||||||
# reclaim space within arvo
|
|
||||||
#
|
|
||||||
lensd '~& ~ ~& %trim-start ~'
|
|
||||||
lensa hood '+hood/trim'
|
|
||||||
lensd '~& ~ ~& %trim-end ~'
|
|
||||||
|
|
||||||
# measure memory usage pre |meld
|
|
||||||
#
|
|
||||||
lensd '~& ~ ~& %trim-mass-start ~'
|
|
||||||
lensa hood '+hood/mass'
|
|
||||||
lensd '~& ~ ~& %trim-mass-end ~'
|
|
||||||
|
|
||||||
# globally deduplicate
|
|
||||||
#
|
|
||||||
lensd '~& ~ ~& %meld-start ~'
|
|
||||||
lensa hood '+hood/meld'
|
|
||||||
lensd '~& ~ ~& %meld-end ~'
|
|
||||||
|
|
||||||
# measure memory usage post |meld
|
|
||||||
#
|
|
||||||
lensd '~& ~ ~& %meld-mass-start ~'
|
|
||||||
lensa hood '+hood/mass'
|
|
||||||
lensd '~& ~ ~& %meld-mass-end ~'
|
|
||||||
|
|
||||||
lensa hood '+hood/exit'
|
|
||||||
|
|
||||||
cleanup
|
|
||||||
|
|
||||||
# Collect output
|
|
||||||
cp urbit-output test-output-unit
|
|
||||||
cp urbit-output test-output-agents
|
|
||||||
cp urbit-output test-output-generators
|
|
||||||
cp urbit-output test-output-marks
|
|
||||||
|
|
||||||
sed -i '0,/test-unit-start/d' test-output-unit
|
|
||||||
sed -i '/test-unit-end/,$d' test-output-unit
|
|
||||||
|
|
||||||
sed -i '0,/test-agents-start/d' test-output-agents
|
|
||||||
sed -i '/test-agents-end/,$d' test-output-agents
|
|
||||||
|
|
||||||
sed -i '0,/test-generators-start/d' test-output-generators
|
|
||||||
sed -i '/test-generators-end/,$d' test-output-generators
|
|
||||||
|
|
||||||
sed -i '0,/test-marks-start/d' test-output-marks
|
|
||||||
sed -i '/test-marks-end/,$d' test-output-marks
|
|
||||||
|
|
||||||
mkdir -p $out
|
|
||||||
|
|
||||||
cp test-output-* $out/
|
|
||||||
|
|
||||||
set +x
|
|
||||||
'';
|
|
||||||
|
|
||||||
checkPhase = ''
|
|
||||||
hdr () {
|
|
||||||
echo =====$(sed 's/./=/g' <<< "$1")=====
|
|
||||||
echo ==== $1 ====
|
|
||||||
echo =====$(sed 's/./=/g' <<< "$1")=====
|
|
||||||
}
|
|
||||||
|
|
||||||
for f in $(find "$out/" -type f); do
|
|
||||||
hdr "$(basename $f)"
|
|
||||||
cat "$f"
|
|
||||||
done
|
|
||||||
|
|
||||||
fail=0
|
|
||||||
|
|
||||||
for f in $(find "$out/" -type f); do
|
|
||||||
if egrep "((FAILED|CRASHED)|warn:) " $f >/dev/null; then
|
|
||||||
if [[ $fail -eq 0 ]]; then
|
|
||||||
hdr "Test Failures"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "ERROR Test failure in $(basename $f)"
|
|
||||||
|
|
||||||
((fail++))
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [[ $fail -eq 0 ]]; then
|
|
||||||
hdr "Success"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit "$fail"
|
|
||||||
'';
|
|
||||||
|
|
||||||
inherit doCheck;
|
|
||||||
|
|
||||||
# Fix 'bind: operation not permitted' when nix.useSandbox = true on darwin.
|
|
||||||
# See https://github.com/NixOS/nix/blob/5f6840fbb49ae5b534423bd8a4360646ee93dbaf/src/libstore/build.cc#L2961
|
|
||||||
__darwinAllowLocalNetworking = true;
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
final: prev:
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
isAarch64 = prev.stdenv.hostPlatform.isAarch64;
|
|
||||||
isDarwin = prev.stdenv.isDarwin;
|
|
||||||
|
|
||||||
in prev.lib.optionalAttrs (isAarch64 && !isDarwin) {
|
|
||||||
libsigsegv = prev.libsigsegv.overrideAttrs (attrs: {
|
|
||||||
preConfigure = (prev.preConfigure or "") + ''
|
|
||||||
sed -i 's/^CFG_FAULT=$/CFG_FAULT=fault-linux-arm.h/' configure
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
final: prev:
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
isMusl = prev.stdenv.hostPlatform.isMusl;
|
|
||||||
|
|
||||||
optionalList = xs: if xs == null then [ ] else xs;
|
|
||||||
|
|
||||||
overrideStdenv = pkg: pkg.override { stdenv = prev.gcc9Stdenv; };
|
|
||||||
|
|
||||||
in prev.lib.optionalAttrs isMusl {
|
|
||||||
libsigsegv = prev.libsigsegv.overrideAttrs (attrs: {
|
|
||||||
preConfigure = (attrs.preConfigure or "") + ''
|
|
||||||
sed -i 's/^CFG_FAULT=$/CFG_FAULT=fault-linux-i386.h/' configure
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
|
|
||||||
secp256k1 = prev.secp256k1.overrideAttrs (attrs: {
|
|
||||||
nativeBuildInputs = (attrs.nativeBuildInputs or [ ])
|
|
||||||
++ [ prev.buildPackages.stdenv.cc ];
|
|
||||||
});
|
|
||||||
|
|
||||||
rhash = overrideStdenv prev.rhash;
|
|
||||||
|
|
||||||
numactl = overrideStdenv prev.numactl;
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
final: prev:
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
optionalList = xs: if xs == null then [ ] else xs;
|
|
||||||
|
|
||||||
in {
|
|
||||||
h2o = prev.h2o.overrideAttrs (_attrs: {
|
|
||||||
version = final.sources.h2o.rev;
|
|
||||||
src = final.sources.h2o;
|
|
||||||
outputs = [ "out" "dev" "lib" ];
|
|
||||||
meta.platforms = prev.lib.platforms.linux ++ prev.lib.platforms.darwin;
|
|
||||||
});
|
|
||||||
|
|
||||||
libsigsegv = prev.libsigsegv.overrideAttrs (attrs: {
|
|
||||||
patches = optionalList attrs.patches ++ [
|
|
||||||
../pkgs/libsigsegv/disable-stackvma_fault-linux-arm.patch
|
|
||||||
../pkgs/libsigsegv/disable-stackvma_fault-linux-i386.patch
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
curlUrbit = prev.curlMinimal.override {
|
|
||||||
http2Support = false;
|
|
||||||
scpSupport = false;
|
|
||||||
gssSupport = false;
|
|
||||||
ldapSupport = false;
|
|
||||||
brotliSupport = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# lies, all lies
|
|
||||||
openssl-static-osx = prev.openssl;
|
|
||||||
zlib-static-osx = prev.zlib;
|
|
||||||
|
|
||||||
lmdb = prev.lmdb.overrideAttrs (attrs: {
|
|
||||||
patches =
|
|
||||||
optionalList attrs.patches ++ prev.lib.optional prev.stdenv.isDarwin [
|
|
||||||
../pkgs/lmdb/darwin-fsync.patch
|
|
||||||
];
|
|
||||||
});
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
final: prev:
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/pull/97047/files
|
|
||||||
# Will make pkgs.stdenv.isStatic available indepedent of the platform.
|
|
||||||
# isStatic = prev.stdenv.hostPlatform.isStatic;
|
|
||||||
|
|
||||||
configureFlags = attrs: {
|
|
||||||
configureFlags = (attrs.configureFlags or [ ])
|
|
||||||
++ [ "--disable-shared" "--enable-static" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
enableStatic = pkg: pkg.overrideAttrs configureFlags;
|
|
||||||
|
|
||||||
in {
|
|
||||||
gmp = enableStatic prev.gmp;
|
|
||||||
|
|
||||||
curlUrbit = enableStatic (prev.curlUrbit.override { openssl = final.openssl-static-osx; zlib = final.zlib-static-osx; });
|
|
||||||
|
|
||||||
libuv = enableStatic prev.libuv;
|
|
||||||
|
|
||||||
libffi = enableStatic prev.libffi;
|
|
||||||
|
|
||||||
openssl-static-osx = prev.openssl.override {
|
|
||||||
static = true;
|
|
||||||
withPerl = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
zlib-static-osx = if final.stdenv.isDarwin then prev.zlib.static else prev.zlib;
|
|
||||||
|
|
||||||
secp256k1 = enableStatic prev.secp256k1;
|
|
||||||
|
|
||||||
lmdb = prev.lmdb.overrideAttrs (old:
|
|
||||||
configureFlags old // {
|
|
||||||
postPatch = ''
|
|
||||||
sed '/^ILIBS\t/s/liblmdb\$(SOEXT)//' -i Makefile
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
{ lib, stdenvNoCC, marsSources }:
|
|
||||||
|
|
||||||
stdenvNoCC.mkDerivation {
|
|
||||||
name = "arvo";
|
|
||||||
|
|
||||||
src = marsSources;
|
|
||||||
|
|
||||||
outputs = [ "out" "goerli" ];
|
|
||||||
|
|
||||||
phases = [ "mainnetPhase" "goerliPhase" ];
|
|
||||||
|
|
||||||
mainnetPhase = ''
|
|
||||||
ln -s ${marsSources.out}/arvo $out
|
|
||||||
'';
|
|
||||||
|
|
||||||
goerliPhase = ''
|
|
||||||
ln -s ${marsSources.goerli}/arvo $goerli
|
|
||||||
'';
|
|
||||||
|
|
||||||
preferLocalBuild = true;
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
{ stdenvNoCC, xxd, cacert }:
|
|
||||||
|
|
||||||
stdenvNoCC.mkDerivation {
|
|
||||||
name = "ca-bundle";
|
|
||||||
|
|
||||||
nativeBuildInputs = [ cacert xxd ];
|
|
||||||
|
|
||||||
phases = [ "installPhase" ];
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
if ! [ -f "$SSL_CERT_FILE" ]; then
|
|
||||||
header "$SSL_CERT_FILE doesn't exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir include
|
|
||||||
|
|
||||||
cat $SSL_CERT_FILE > include/ca-bundle.crt
|
|
||||||
xxd -i include/ca-bundle.crt > ca-bundle.h
|
|
||||||
|
|
||||||
mkdir -p $out/include
|
|
||||||
|
|
||||||
mv ca-bundle.h $out/include
|
|
||||||
'';
|
|
||||||
|
|
||||||
preferLocalBuild = true;
|
|
||||||
}
|
|
@ -1,112 +0,0 @@
|
|||||||
{ urbit, curl, libcap, coreutils, bashInteractive, dockerTools, writeScriptBin, amesPort ? 34343 }:
|
|
||||||
let
|
|
||||||
startUrbit = writeScriptBin "start-urbit" ''
|
|
||||||
#!${bashInteractive}/bin/bash
|
|
||||||
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
# set defaults
|
|
||||||
amesPort=${toString amesPort}
|
|
||||||
|
|
||||||
# check args
|
|
||||||
for i in "$@"
|
|
||||||
do
|
|
||||||
case $i in
|
|
||||||
-p=*|--port=*)
|
|
||||||
amesPort="''${i#*=}"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# If the container is not started with the `-i` flag
|
|
||||||
# then STDIN will be closed and we need to start
|
|
||||||
# Urbit/vere with the `-t` flag.
|
|
||||||
ttyflag=""
|
|
||||||
if [ ! -t 0 ]; then
|
|
||||||
echo "Running with no STDIN"
|
|
||||||
ttyflag="-t"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if there is a keyfile, if so boot a ship with its name, and then remove the key
|
|
||||||
if [ -e *.key ]; then
|
|
||||||
# Get the name of the key
|
|
||||||
keynames="*.key"
|
|
||||||
keys=( $keynames )
|
|
||||||
keyname=''${keys[0]}
|
|
||||||
mv $keyname /tmp
|
|
||||||
|
|
||||||
# Boot urbit with the key, exit when done booting
|
|
||||||
urbit $ttyflag -w $(basename $keyname .key) -k /tmp/$keyname -c $(basename $keyname .key) -p $amesPort -x
|
|
||||||
|
|
||||||
# Remove the keyfile for security
|
|
||||||
rm /tmp/$keyname
|
|
||||||
rm *.key || true
|
|
||||||
elif [ -e *.comet ]; then
|
|
||||||
cometnames="*.comet"
|
|
||||||
comets=( $cometnames )
|
|
||||||
cometname=''${comets[0]}
|
|
||||||
rm *.comet
|
|
||||||
|
|
||||||
urbit $ttyflag -c $(basename $cometname .comet) -p $amesPort -x
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Find the first directory and start urbit with the ship therein
|
|
||||||
dirnames="*/"
|
|
||||||
dirs=( $dirnames )
|
|
||||||
dirname=''${dirnames[0]}
|
|
||||||
|
|
||||||
exec urbit $ttyflag -p $amesPort $dirname
|
|
||||||
'';
|
|
||||||
|
|
||||||
getUrbitCode = writeScriptBin "get-urbit-code" ''
|
|
||||||
#!${bashInteractive}/bin/bash
|
|
||||||
|
|
||||||
raw=$(curl -s -X POST -H "Content-Type: application/json" \
|
|
||||||
-d '{ "source": { "dojo": "+code" }, "sink": { "stdout": null } }' \
|
|
||||||
http://127.0.0.1:12321)
|
|
||||||
|
|
||||||
# trim \n" from the end
|
|
||||||
trim="''${raw%\\n\"}"
|
|
||||||
|
|
||||||
# trim " from the start
|
|
||||||
code="''${trim#\"}"
|
|
||||||
|
|
||||||
echo "$code"
|
|
||||||
'';
|
|
||||||
|
|
||||||
resetUrbitCode = writeScriptBin "reset-urbit-code" ''
|
|
||||||
#!${bashInteractive}/bin/bash
|
|
||||||
|
|
||||||
curl=$(curl -s -X POST -H "Content-Type: application/json" \
|
|
||||||
-d '{ "source": { "dojo": "+hood/code %reset" }, "sink": { "app": "hood" } }' \
|
|
||||||
http://127.0.0.1:12321)
|
|
||||||
|
|
||||||
if [[ $? -eq 0 ]]
|
|
||||||
then
|
|
||||||
echo "OK"
|
|
||||||
else
|
|
||||||
echo "Curl error: $?"
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
in dockerTools.buildImage {
|
|
||||||
name = "urbit";
|
|
||||||
tag = "v${urbit.version}";
|
|
||||||
contents = [ bashInteractive urbit curl startUrbit getUrbitCode resetUrbitCode coreutils ];
|
|
||||||
runAsRoot = ''
|
|
||||||
#!${bashInteractive}
|
|
||||||
mkdir -p /urbit
|
|
||||||
mkdir -p /tmp
|
|
||||||
${libcap}/bin/setcap 'cap_net_bind_service=+ep' /bin/urbit
|
|
||||||
'';
|
|
||||||
config = {
|
|
||||||
Cmd = [ "/bin/start-urbit" ];
|
|
||||||
Env = [ "PATH=/bin" ];
|
|
||||||
WorkingDir = "/urbit";
|
|
||||||
Volumes = {
|
|
||||||
"/urbit" = {};
|
|
||||||
};
|
|
||||||
Expose = [ "80/tcp" "${toString amesPort}/udp" ];
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
{ lib, stdenv, enableParallelBuilding ? true }:
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
name = "ent";
|
|
||||||
src = lib.cleanSource ../../../pkg/ent;
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
patchShebangs ./configure
|
|
||||||
'';
|
|
||||||
|
|
||||||
installFlags = [ "PREFIX=$(out)" ];
|
|
||||||
|
|
||||||
inherit enableParallelBuilding;
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
{ lib, stdenvNoCC, python }:
|
|
||||||
|
|
||||||
# Avoid using `python.withPackages` as it creates a wrapper script to set
|
|
||||||
# PYTHONPATH, and the script is used verbatim as a python shebang.
|
|
||||||
#
|
|
||||||
# Unfortunately Darwin does not allow scripts as a shebang - so to get a
|
|
||||||
# cross platform python interpreter with appropriate site-packages setup
|
|
||||||
# we use `wrapPython/Packages` which handles these cases correctly.
|
|
||||||
|
|
||||||
stdenvNoCC.mkDerivation {
|
|
||||||
name = "herb";
|
|
||||||
src = ../../../pkg/herb/herb;
|
|
||||||
|
|
||||||
nativeBuildInputs = [ python.pkgs.wrapPython ];
|
|
||||||
buildInputs = [ python python.pkgs.requests ];
|
|
||||||
pythonPath = [ python.pkgs.requests ];
|
|
||||||
|
|
||||||
phases = [ "installPhase" "fixupPhase" ];
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
cp $src $out/bin/herb
|
|
||||||
chmod +x $out/bin/herb
|
|
||||||
'';
|
|
||||||
|
|
||||||
postFixup = ''
|
|
||||||
wrapPythonPrograms
|
|
||||||
'';
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
--- a/CMakeLists.txt
|
|
||||||
+++ b/CMakeLists.txt
|
|
||||||
@@ -5,6 +5,8 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "")
|
|
||||||
set(CMAKE_BUILD_TYPE Release)
|
|
||||||
endif("${CMAKE_BUILD_TYPE}" STREQUAL "")
|
|
||||||
|
|
||||||
+option(BUILD_SHARED_LIBS "Build shared libraries" ON)
|
|
||||||
+
|
|
||||||
include(GNUInstallDirs)
|
|
||||||
|
|
||||||
# Warning: don't use the UB sanitizer in production builds. It can introduce timing side-channels
|
|
||||||
@@ -31,10 +33,12 @@ endif(NOT DISABLE_DOCS)
|
|
||||||
configure_file(config.h.in config.h)
|
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
||||||
|
|
||||||
+if(BUILD_SHARED_LIBS)
|
|
||||||
add_library(aes_siv SHARED aes_siv.c)
|
|
||||||
target_include_directories(aes_siv PUBLIC ${OPENSSL_INCLUDE_DIR})
|
|
||||||
target_link_libraries(aes_siv ${OPENSSL_CRYPTO_LIBRARY})
|
|
||||||
set_target_properties(aes_siv PROPERTIES VERSION "1.0.1" SOVERSION 1)
|
|
||||||
+endif()
|
|
||||||
|
|
||||||
add_library(aes_siv_static STATIC aes_siv.c)
|
|
||||||
target_include_directories(aes_siv_static PUBLIC ${OPENSSL_INCLUDE_DIR})
|
|
||||||
@@ -63,7 +67,9 @@ endif(ENABLE_SANITIZER)
|
|
||||||
add_executable(bench EXCLUDE_FROM_ALL bench.c)
|
|
||||||
target_link_libraries(bench aes_siv_static)
|
|
||||||
|
|
||||||
+if(BUILD_SHARED_LIBS)
|
|
||||||
install(TARGETS aes_siv LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
+endif()
|
|
||||||
install(TARGETS aes_siv_static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
install(FILES aes_siv.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
|||||||
{ stdenv, sources, cmake, openssl, enableParallelBuilding ? true }:
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
name = "libaes_siv";
|
|
||||||
version = sources.libaes_siv.rev;
|
|
||||||
src = sources.libaes_siv;
|
|
||||||
patches = [ ./cmakefiles_static.patch ];
|
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake ];
|
|
||||||
buildInputs = [ openssl ];
|
|
||||||
|
|
||||||
cmakeFlags = [
|
|
||||||
"-DBUILD_SHARED_LIBS=OFF"
|
|
||||||
];
|
|
||||||
|
|
||||||
inherit enableParallelBuilding;
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
--- a/src/fault-linux-arm.h
|
|
||||||
+++ b/src/fault-linux-arm.h
|
|
||||||
@@ -17,6 +17,8 @@
|
|
||||||
|
|
||||||
#include "fault-posix-ucontext.h"
|
|
||||||
|
|
||||||
+#define HAVE_STACKVMA 0
|
|
||||||
+
|
|
||||||
#if defined(__aarch64__) || defined(__ARM_64BIT_STATE) || defined(__ARM_PCS_AAPCS64) /* 64-bit */
|
|
||||||
|
|
||||||
/* See glibc/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h.
|
|
@ -1,11 +0,0 @@
|
|||||||
--- a/src/fault-linux-i386.h
|
|
||||||
+++ b/src/fault-linux-i386.h
|
|
||||||
@@ -18,6 +18,8 @@
|
|
||||||
|
|
||||||
#include "fault-posix-ucontext.h"
|
|
||||||
|
|
||||||
+#define HAVE_STACKVMA 0
|
|
||||||
+
|
|
||||||
#if defined __x86_64__
|
|
||||||
/* 64 bit registers */
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
|||||||
diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c
|
|
||||||
index fe65e30..0070215 100644
|
|
||||||
--- a/libraries/liblmdb/mdb.c
|
|
||||||
+++ b/libraries/liblmdb/mdb.c
|
|
||||||
@@ -2526,7 +2526,7 @@ mdb_env_sync(MDB_env *env, int force)
|
|
||||||
rc = ErrCode();
|
|
||||||
} else
|
|
||||||
#endif
|
|
||||||
- if (MDB_FDATASYNC(env->me_fd))
|
|
||||||
+ if (fcntl(env->me_fd, F_FULLFSYNC, 0))
|
|
||||||
rc = ErrCode();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,46 +0,0 @@
|
|||||||
{ lib, stdenvNoCC, bc }:
|
|
||||||
|
|
||||||
stdenvNoCC.mkDerivation {
|
|
||||||
name = "sources";
|
|
||||||
src = lib.cleanSource ../../../pkg;
|
|
||||||
|
|
||||||
buildInputs = [ bc ];
|
|
||||||
|
|
||||||
outputs = [ "out" "goerli" ];
|
|
||||||
|
|
||||||
phases = [ "mainnetPhase" "goerliPhase" ];
|
|
||||||
|
|
||||||
mainnetPhase = ''
|
|
||||||
cp -r $src $out
|
|
||||||
chmod -R u+w $out
|
|
||||||
'';
|
|
||||||
|
|
||||||
goerliPhase = ''
|
|
||||||
cp -r $src tmp
|
|
||||||
chmod -R u+w tmp
|
|
||||||
|
|
||||||
ZUSE=tmp/arvo/sys/zuse.hoon
|
|
||||||
AMES=tmp/arvo/sys/vane/ames.hoon
|
|
||||||
ACME=tmp/arvo/app/acme.hoon
|
|
||||||
|
|
||||||
# Replace the mainnet azimuth contract with the goerli contract
|
|
||||||
sed --in-place \
|
|
||||||
's/\(\+\+ contracts \)mainnet\-contracts/\1goerli-contracts/' \
|
|
||||||
$ZUSE
|
|
||||||
|
|
||||||
# Increment the %ames protocol version
|
|
||||||
sed -r --in-place \
|
|
||||||
's_^(=/ protocol\-version=\?\(.*\) %)([0-7])_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 $goerli
|
|
||||||
chmod -R u+w $goerli
|
|
||||||
'';
|
|
||||||
|
|
||||||
preferLocalBuild = true;
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
{ stdenv, sources }:
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
pname = "murmur3";
|
|
||||||
version = sources.murmur3.rev;
|
|
||||||
src = sources.murmur3;
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
$CC -fPIC -O3 -o murmur3.o -c $src/murmur3.c
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/{lib,include}
|
|
||||||
$AR rcs $out/lib/libmurmur3.a murmur3.o
|
|
||||||
cp $src/*.h $out/include/
|
|
||||||
'';
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
{ lib, stdenvNoCC, fetchGitHubLFS, bootFakeShip, solid, urbit, arvo, curl
|
|
||||||
, withGoerli ? false }:
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
lfs = fetchGitHubLFS { src = ../../../bin/brass.pill; };
|
|
||||||
|
|
||||||
in {
|
|
||||||
build = import ./builder.nix {
|
|
||||||
inherit stdenvNoCC urbit curl;
|
|
||||||
|
|
||||||
name = "brass" + lib.optionalString withGoerli "-goerli";
|
|
||||||
builder = ./brass.sh;
|
|
||||||
arvo = if withGoerli then arvo.goerli else arvo;
|
|
||||||
pier = bootFakeShip {
|
|
||||||
inherit urbit;
|
|
||||||
|
|
||||||
pill = solid.lfs;
|
|
||||||
ship = "zod";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
} // lib.optionalAttrs (!withGoerli) { inherit lfs; }
|
|
@ -1,40 +0,0 @@
|
|||||||
source $stdenv/setup
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
cp -r $src ./pier
|
|
||||||
chmod -R u+rw ./pier
|
|
||||||
|
|
||||||
urbit -d ./pier
|
|
||||||
|
|
||||||
cleanup () {
|
|
||||||
if [ -f ./pier/.vere.lock ]; then
|
|
||||||
kill $(< ./pier/.vere.lock) || true
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
trap cleanup EXIT
|
|
||||||
|
|
||||||
header "running +brass"
|
|
||||||
|
|
||||||
port=$(cat ./pier/.http.ports | grep loopback | tr -s ' ' '\n' | head -n 1)
|
|
||||||
|
|
||||||
lensa() {
|
|
||||||
# -f elided, this can hit server-side timeouts
|
|
||||||
curl -s \
|
|
||||||
--data "{\"source\":{\"dojo\":\"$2\"},\"sink\":{\"app\":\"$1\"}}" \
|
|
||||||
"http://localhost:$port" | xargs printf %s | sed 's/\\n/\n/g'
|
|
||||||
}
|
|
||||||
|
|
||||||
lensf() {
|
|
||||||
# -f elided, this can hit server-side timeouts
|
|
||||||
d=$(echo $1 | sed 's/\./\//g')
|
|
||||||
curl -sJO \
|
|
||||||
--data "{\"source\":{\"dojo\":\"$2\"},\"sink\":{\"output-pill\":\"$d\"}}" \
|
|
||||||
"http://localhost:$port"
|
|
||||||
}
|
|
||||||
|
|
||||||
lensf brass.pill '+brass'
|
|
||||||
lensa hood '+hood/exit'
|
|
||||||
|
|
||||||
stopNest
|
|
@ -1,16 +0,0 @@
|
|||||||
{ stdenvNoCC, urbit, arvo, curl, name, builder, pier }:
|
|
||||||
|
|
||||||
stdenvNoCC.mkDerivation {
|
|
||||||
name = "${name}.pill";
|
|
||||||
src = pier;
|
|
||||||
buildInputs = [ curl urbit ];
|
|
||||||
dontUnpack = true;
|
|
||||||
|
|
||||||
buildPhase = builtins.readFile builder;
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mv ${name}.pill $out
|
|
||||||
'';
|
|
||||||
|
|
||||||
ARVO = arvo;
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
{ lib, stdenvNoCC, fetchGitHubLFS, bootFakeShip, solid, urbit, arvo, curl, xxd
|
|
||||||
, withGoerli ? false }:
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
lfs = fetchGitHubLFS { src = ../../../bin/ivory.pill; };
|
|
||||||
|
|
||||||
in {
|
|
||||||
build = import ./builder.nix {
|
|
||||||
inherit stdenvNoCC urbit curl;
|
|
||||||
|
|
||||||
name = "ivory" + lib.optionalString withGoerli "-goerli";
|
|
||||||
builder = ./ivory.sh;
|
|
||||||
arvo = if withGoerli then arvo.goerli else arvo;
|
|
||||||
pier = bootFakeShip {
|
|
||||||
inherit urbit;
|
|
||||||
|
|
||||||
pill = solid.lfs;
|
|
||||||
ship = "zod";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# The hexdump of the `.lfs` pill contents as a C header.
|
|
||||||
header = stdenvNoCC.mkDerivation {
|
|
||||||
name = "ivory-header";
|
|
||||||
src = lfs;
|
|
||||||
nativeBuildInputs = [ xxd ];
|
|
||||||
phases = [ "installPhase" ];
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
file=u3_Ivory.pill
|
|
||||||
|
|
||||||
header "writing $file"
|
|
||||||
|
|
||||||
mkdir -p $out/include
|
|
||||||
cat $src > $file
|
|
||||||
xxd -i $file > $out/include/ivory_impl.h
|
|
||||||
'';
|
|
||||||
|
|
||||||
preferLocalBuild = true;
|
|
||||||
};
|
|
||||||
} // lib.optionalAttrs (!withGoerli) { inherit lfs; }
|
|
@ -1,40 +0,0 @@
|
|||||||
source $stdenv/setup
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
cp -r $src ./pier
|
|
||||||
chmod -R u+rw ./pier
|
|
||||||
|
|
||||||
urbit -d ./pier
|
|
||||||
|
|
||||||
cleanup () {
|
|
||||||
if [ -f ./pier/.vere.lock ]; then
|
|
||||||
kill $(< ./pier/.vere.lock) || true
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
trap cleanup EXIT
|
|
||||||
|
|
||||||
header "running +ivory"
|
|
||||||
|
|
||||||
port=$(cat ./pier/.http.ports | grep loopback | tr -s ' ' '\n' | head -n 1)
|
|
||||||
|
|
||||||
lensa() {
|
|
||||||
# -f elided, this can hit server-side timeouts
|
|
||||||
curl -s \
|
|
||||||
--data "{\"source\":{\"dojo\":\"$2\"},\"sink\":{\"app\":\"$1\"}}" \
|
|
||||||
"http://localhost:$port" | xargs printf %s | sed 's/\\n/\n/g'
|
|
||||||
}
|
|
||||||
|
|
||||||
lensf() {
|
|
||||||
# -f elided, this can hit server-side timeouts
|
|
||||||
d=$(echo $1 | sed 's/\./\//g')
|
|
||||||
curl -sJO \
|
|
||||||
--data "{\"source\":{\"dojo\":\"$2\"},\"sink\":{\"output-pill\":\"$d\"}}" \
|
|
||||||
"http://localhost:$port"
|
|
||||||
}
|
|
||||||
|
|
||||||
lensf ivory.pill '+ivory'
|
|
||||||
lensa hood '+hood/exit'
|
|
||||||
|
|
||||||
stopNest
|
|
@ -1,23 +0,0 @@
|
|||||||
{ stdenvNoCC, fetchGitHubLFS, bootFakeShip, solid, urbit, arvo, curl }:
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
lfs = fetchGitHubLFS { src = ../../../bin/solid.pill; };
|
|
||||||
|
|
||||||
in {
|
|
||||||
inherit lfs;
|
|
||||||
|
|
||||||
build = import ./builder.nix {
|
|
||||||
inherit stdenvNoCC urbit arvo curl;
|
|
||||||
|
|
||||||
name = "solid";
|
|
||||||
builder = ./solid.sh;
|
|
||||||
pier = bootFakeShip {
|
|
||||||
inherit urbit;
|
|
||||||
|
|
||||||
arvo = null;
|
|
||||||
pill = solid.lfs;
|
|
||||||
ship = "zod";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,99 +0,0 @@
|
|||||||
source $stdenv/setup
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
ARVO=${ARVO?:ARVO location is unset}
|
|
||||||
|
|
||||||
cp -r $src ./pier
|
|
||||||
chmod -R u+rw ./pier
|
|
||||||
|
|
||||||
urbit -d ./pier
|
|
||||||
|
|
||||||
cleanup () {
|
|
||||||
if [ -f ./pier/.vere.lock ]; then
|
|
||||||
kill $(< ./pier/.vere.lock) || true
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
trap cleanup EXIT
|
|
||||||
|
|
||||||
port=$(cat ./pier/.http.ports | grep loopback | tr -s ' ' '\n' | head -n 1)
|
|
||||||
|
|
||||||
lensa() {
|
|
||||||
# -f elided, this can hit server-side timeouts
|
|
||||||
curl -s \
|
|
||||||
--data "{\"source\":{\"dojo\":\"$2\"},\"sink\":{\"app\":\"$1\"}}" \
|
|
||||||
"http://localhost:$port" | xargs printf %s | sed 's/\\n/\n/g'
|
|
||||||
}
|
|
||||||
|
|
||||||
lensf() {
|
|
||||||
# -f elided, this can hit server-side timeouts
|
|
||||||
d=$(echo $1 | sed 's/\./\//g')
|
|
||||||
curl -sJO \
|
|
||||||
--data "{\"source\":{\"dojo\":\"$2\"},\"sink\":{\"output-pill\":\"$d\"}}" \
|
|
||||||
"http://localhost:$port"
|
|
||||||
}
|
|
||||||
|
|
||||||
header "updating %base"
|
|
||||||
|
|
||||||
# Update pill strategy to ensure correct staging
|
|
||||||
lensa hood "+hood/mount /=base="
|
|
||||||
|
|
||||||
until [ -d ./pier/base ]; do
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
|
|
||||||
# Update :lens, :dojo and dependencies
|
|
||||||
# FIXME: reduce this list
|
|
||||||
cp $ARVO/app/lens.hoon ./pier/base/app/
|
|
||||||
cp $ARVO/app/dojo.hoon ./pier/base/app/
|
|
||||||
cp $ARVO/lib/plume.hoon ./pier/base/lib/
|
|
||||||
cp $ARVO/lib/server.hoon ./pier/base/lib/
|
|
||||||
cp $ARVO/lib/sole.hoon ./pier/base/lib/
|
|
||||||
cp $ARVO/lib/xray.hoon ./pier/base/lib/
|
|
||||||
cp $ARVO/lib/pprint.hoon ./pier/base/lib/
|
|
||||||
|
|
||||||
mkdir -p ./pier/base/mar/lens/
|
|
||||||
|
|
||||||
cp $ARVO/mar/lens/* ./pier/base/mar/lens/
|
|
||||||
|
|
||||||
cp $ARVO/sur/lens.hoon ./pier/base/sur/
|
|
||||||
cp $ARVO/sur/plum.hoon ./pier/base/sur/
|
|
||||||
cp $ARVO/sur/sole.hoon ./pier/base/sur/
|
|
||||||
cp $ARVO/sur/xray.hoon ./pier/base/sur/
|
|
||||||
|
|
||||||
# Update +solid and its dependencies
|
|
||||||
cp $ARVO/lib/pill.hoon ./pier/base/lib/
|
|
||||||
cp $ARVO/gen/solid.hoon ./pier/base/gen/
|
|
||||||
|
|
||||||
chmod -R u+rw ./pier/base/
|
|
||||||
|
|
||||||
lensa hood "+hood/commit %base"
|
|
||||||
lensa hood "+hood/unmount %base"
|
|
||||||
|
|
||||||
# FIXME: horrible hack to ensure the update is applied first
|
|
||||||
sleep 10
|
|
||||||
|
|
||||||
header "updating %stage"
|
|
||||||
|
|
||||||
# Stage new desk for pill contents
|
|
||||||
lensa hood '+hood/merge %stage our %base'
|
|
||||||
lensa hood "+hood/mount /=stage="
|
|
||||||
|
|
||||||
until [ -d ./pier/stage ]; do
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
|
|
||||||
rm -rf ./pier/stage
|
|
||||||
cp -r $ARVO ./pier/stage
|
|
||||||
chmod -R u+rw ./pier/stage
|
|
||||||
|
|
||||||
lensa hood "+hood/commit %stage"
|
|
||||||
lensa hood "+hood/unmount %stage"
|
|
||||||
|
|
||||||
header "running +solid"
|
|
||||||
|
|
||||||
lensf solid.pill '+solid /=stage=/sys, =dub &'
|
|
||||||
lensa hood '+hood/exit'
|
|
||||||
|
|
||||||
stopNest
|
|
@ -1,28 +0,0 @@
|
|||||||
{ stdenv, sources, enableParallelBuilding ? true }:
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
pname = "softfloat3";
|
|
||||||
version = sources.softfloat3.rev;
|
|
||||||
src = sources.softfloat3;
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
for f in $(find build -type f -name 'Makefile'); do
|
|
||||||
substituteInPlace $f \
|
|
||||||
--replace 'gcc' '$(CC)' \
|
|
||||||
--replace 'ar crs' '$(AR) crs'
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
|
|
||||||
preBuild = ''
|
|
||||||
cd build/Linux-x86_64-GCC
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/{lib,include}
|
|
||||||
cp $src/source/include/*.h $out/include/
|
|
||||||
cp softfloat.a $out/lib/libsoftfloat3.a
|
|
||||||
'';
|
|
||||||
|
|
||||||
inherit enableParallelBuilding;
|
|
||||||
}
|
|
||||||
|
|
@ -1,85 +0,0 @@
|
|||||||
{ lib, stdenv, coreutils, pkgconfig # build/env
|
|
||||||
, cacert, ca-bundle, ivory # codegen
|
|
||||||
, curlUrbit, ent, gmp, h2o, libsigsegv, libuv, lmdb # libs
|
|
||||||
, murmur3, openssl, openssl-static-osx, softfloat3 #
|
|
||||||
, urcrypt, zlib, zlib-static-osx #
|
|
||||||
, enableStatic ? stdenv.hostPlatform.isStatic # opts
|
|
||||||
, enableDebug ? false
|
|
||||||
, verePace ? ""
|
|
||||||
, doCheck ? true
|
|
||||||
, enableParallelBuilding ? true
|
|
||||||
, dontStrip ? true }:
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
src = lib.cleanSource ../../../pkg/urbit;
|
|
||||||
|
|
||||||
version = builtins.readFile "${src}/version";
|
|
||||||
|
|
||||||
# See https://github.com/urbit/urbit/issues/5561
|
|
||||||
oFlags =
|
|
||||||
if stdenv.isDarwin
|
|
||||||
then (if enableDebug then [ "-O0" "-g" ] else [ "-O3" ])
|
|
||||||
else [ (if enableDebug then "-O0" else "-O3") "-g" ];
|
|
||||||
|
|
||||||
in stdenv.mkDerivation {
|
|
||||||
inherit src version;
|
|
||||||
|
|
||||||
pname = "urbit" + lib.optionalString enableDebug "-debug"
|
|
||||||
+ lib.optionalString enableStatic "-static";
|
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
cacert
|
|
||||||
ca-bundle
|
|
||||||
curlUrbit
|
|
||||||
ent
|
|
||||||
gmp
|
|
||||||
h2o
|
|
||||||
ivory.header
|
|
||||||
libsigsegv
|
|
||||||
libuv
|
|
||||||
lmdb
|
|
||||||
murmur3
|
|
||||||
(if stdenv.isDarwin && enableStatic then openssl-static-osx else openssl)
|
|
||||||
softfloat3
|
|
||||||
urcrypt
|
|
||||||
(if stdenv.isDarwin && enableStatic then zlib-static-osx else zlib)
|
|
||||||
];
|
|
||||||
|
|
||||||
# Ensure any `/usr/bin/env bash` shebang is patched.
|
|
||||||
postPatch = ''
|
|
||||||
patchShebangs ./configure
|
|
||||||
'';
|
|
||||||
|
|
||||||
checkTarget = "test";
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
cp ./build/urbit $out/bin/urbit
|
|
||||||
'';
|
|
||||||
|
|
||||||
dontDisableStatic = enableStatic;
|
|
||||||
|
|
||||||
configureFlags = if enableStatic
|
|
||||||
then [ "--disable-shared" "--enable-static" ]
|
|
||||||
else [];
|
|
||||||
|
|
||||||
CFLAGS = oFlags ++ lib.optionals (!enableDebug) [ "-Werror" ];
|
|
||||||
|
|
||||||
MEMORY_DEBUG = enableDebug;
|
|
||||||
CPU_DEBUG = enableDebug;
|
|
||||||
EVENT_TIME_DEBUG = false;
|
|
||||||
VERE_PACE = if enableStatic then verePace else "";
|
|
||||||
|
|
||||||
# See https://github.com/NixOS/nixpkgs/issues/18995
|
|
||||||
hardeningDisable = lib.optionals enableDebug [ "all" ];
|
|
||||||
|
|
||||||
inherit enableParallelBuilding doCheck dontStrip;
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
debug = enableDebug;
|
|
||||||
arguments = lib.optionals enableDebug [ "-g" ];
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
{ stdenv, autoreconfHook, pkgconfig
|
|
||||||
, libaes_siv, openssl, openssl-static-osx, secp256k1
|
|
||||||
, enableStatic ? stdenv.hostPlatform.isStatic }:
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
name = "urcrypt";
|
|
||||||
src = ../../../pkg/urcrypt;
|
|
||||||
|
|
||||||
# XX why are these required for darwin?
|
|
||||||
dontDisableStatic = enableStatic;
|
|
||||||
|
|
||||||
configureFlags = if enableStatic
|
|
||||||
then [ "--disable-shared" "--enable-static" ]
|
|
||||||
else [];
|
|
||||||
|
|
||||||
nativeBuildInputs =
|
|
||||||
[ autoreconfHook pkgconfig ];
|
|
||||||
|
|
||||||
propagatedBuildInputs =
|
|
||||||
[ openssl secp256k1 libaes_siv ];
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"openssl": {
|
|
||||||
"branch": "1_1_1n",
|
|
||||||
"homepage": "https://www.openssl.org/",
|
|
||||||
"pmnsh": {
|
|
||||||
"include": "build/include",
|
|
||||||
"lib": "build",
|
|
||||||
"prepare": "./config --prefix=`mkdir -p build && readlink -f ./build` --libdir=. no-shared no-tests",
|
|
||||||
"make": "install_dev"
|
|
||||||
},
|
|
||||||
"owner": "openssl",
|
|
||||||
"repo": "openssl",
|
|
||||||
"rev": "OpenSSL_1_1_1n",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_1_1_1n.tar.gz",
|
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/refs/tags/<rev>.tar.gz"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,95 +0,0 @@
|
|||||||
{
|
|
||||||
"curl": {
|
|
||||||
"branch": "master",
|
|
||||||
"description": "A command line tool and library for transferring data with URL syntax",
|
|
||||||
"homepage": "http://curl.se/",
|
|
||||||
"pmnsh": {
|
|
||||||
"compat": {
|
|
||||||
"openbsd": {
|
|
||||||
"prepare": "autoreconf -vfi && ./configure --disable-shared --disable-ldap --disable-rtsp --without-brotli --without-libidn2 --without-libpsl --without-nghttp2 --with-openssl=`readlink -f ../openssl/build`"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"include": "include",
|
|
||||||
"lib": "lib/.libs",
|
|
||||||
"prepare": "autoreconf -vfi && ./configure --disable-shared --disable-ldap --disable-rtsp --without-brotli --without-libidn2 --without-libpsl --without-nghttp2 --with-openssl",
|
|
||||||
"make": "-C lib libcurl.la"
|
|
||||||
},
|
|
||||||
"owner": "curl",
|
|
||||||
"repo": "curl",
|
|
||||||
"rev": "curl-7_77_0",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/curl/curl/archive/curl-7_77_0.tar.gz",
|
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
|
||||||
},
|
|
||||||
"lmdb": {
|
|
||||||
"branch": "mdb.master",
|
|
||||||
"description": "LMDB library",
|
|
||||||
"homepage": "http://www.lmdb.tech/",
|
|
||||||
"pmnsh": {
|
|
||||||
"strip": 2,
|
|
||||||
"make": "liblmdb.a"
|
|
||||||
},
|
|
||||||
"owner": "LMDB",
|
|
||||||
"repo": "lmdb",
|
|
||||||
"rev": "48a7fed59a8aae623deff415dda27097198ca0c1",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/LMDB/lmdb/archive/48a7fed59a8aae623deff415dda27097198ca0c1.tar.gz",
|
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
|
||||||
},
|
|
||||||
"secp256k1": {
|
|
||||||
"branch": "master",
|
|
||||||
"description": "Optimized C library for ECDSA signatures and secret/public key operations on curve secp256k1.",
|
|
||||||
"homepage": null,
|
|
||||||
"owner": "bitcoin-core",
|
|
||||||
"pmnsh": {
|
|
||||||
"include": "include",
|
|
||||||
"lib": ".libs",
|
|
||||||
"make": "libsecp256k1.la",
|
|
||||||
"prepare": "./autogen.sh && ./configure --disable-shared --enable-benchmark=no --enable-exhaustive-tests=no --enable-experimental --enable-module-ecdh --enable-module-recovery --enable-module-schnorrsig --enable-tests=yes CFLAGS=-DSECP256K1_API="
|
|
||||||
},
|
|
||||||
"repo": "secp256k1",
|
|
||||||
"rev": "5dcc6f8dbdb1850570919fc9942d22f728dbc0af",
|
|
||||||
"sha256": "x9qG2S6tBSRseWaFIN9N2fRpY1vkv8idT3d3rfJnmaU",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/bitcoin-core/secp256k1/archive/5dcc6f8dbdb1850570919fc9942d22f728dbc0af.tar.gz",
|
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
|
||||||
},
|
|
||||||
"uv": {
|
|
||||||
"branch": "v1.x",
|
|
||||||
"description": "Cross-platform asynchronous I/O",
|
|
||||||
"homepage": "http://libuv.org/",
|
|
||||||
"pmnsh": {
|
|
||||||
"include": "include",
|
|
||||||
"lib": ".libs",
|
|
||||||
"prepare": "./autogen.sh && ./configure --disable-shared",
|
|
||||||
"make": "libuv.la",
|
|
||||||
"compat": {
|
|
||||||
"m1brew": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"owner": "libuv",
|
|
||||||
"repo": "libuv",
|
|
||||||
"rev": "v1.40.0",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/libuv/libuv/archive/v1.40.0.tar.gz",
|
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
|
||||||
},
|
|
||||||
"ent": {
|
|
||||||
"pmnsh": {
|
|
||||||
"prepare": "./configure"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"urcrypt": {
|
|
||||||
"pmnsh": {
|
|
||||||
"compat": {
|
|
||||||
"openbsd": {
|
|
||||||
"make": "install prefix=`readlink -f .` exec_prefix=`readlink -f .`",
|
|
||||||
"include": "include",
|
|
||||||
"lib": "lib"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"prepare": "./autogen.sh && ./configure --disable-shared PKG_CONFIG_PATH=../secp256k1 CFLAGS=\"-I../secp256k1/include -I../libaes_siv\" LDFLAGS=-L../libaes_siv",
|
|
||||||
"make": "install"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
123
nix/sources.json
123
nix/sources.json
@ -1,123 +0,0 @@
|
|||||||
{
|
|
||||||
"h2o": {
|
|
||||||
"branch": "master",
|
|
||||||
"description": "H2O - the optimized HTTP/1, HTTP/2, HTTP/3 server",
|
|
||||||
"homepage": "https://h2o.examp1e.net",
|
|
||||||
"owner": "h2o",
|
|
||||||
"pmnsh": {
|
|
||||||
"compat": {
|
|
||||||
"mingw": {
|
|
||||||
"prepare": "cmake -G\"MSYS Makefiles\" -DCMAKE_INSTALL_PREFIX=. ."
|
|
||||||
},
|
|
||||||
"openbsd": {
|
|
||||||
"prepare": "cmake -DOPENSSL_ROOT_DIR=`readlink -f ../openssl/build` ."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"include": "include",
|
|
||||||
"make": "libh2o",
|
|
||||||
"prepare": "cmake ."
|
|
||||||
},
|
|
||||||
"repo": "h2o",
|
|
||||||
"rev": "v2.2.6",
|
|
||||||
"sha256": "0qni676wqvxx0sl0pw9j0ph7zf2krrzqc1zwj73mgpdnsr8rsib7",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/h2o/h2o/archive/v2.2.6.tar.gz",
|
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
|
||||||
},
|
|
||||||
"libaes_siv": {
|
|
||||||
"branch": "master",
|
|
||||||
"description": null,
|
|
||||||
"homepage": null,
|
|
||||||
"owner": "dfoxfranke",
|
|
||||||
"pmnsh": {
|
|
||||||
"compat": {
|
|
||||||
"m1brew": {
|
|
||||||
"make": "install CFLAGS=$(pkg-config --cflags openssl)",
|
|
||||||
"prepare": "cmake ."
|
|
||||||
},
|
|
||||||
"mingw": {
|
|
||||||
"make": "aes_siv_static",
|
|
||||||
"prepare": "cmake -G\"MSYS Makefiles\" -DDISABLE_DOCS:BOOL=ON ."
|
|
||||||
},
|
|
||||||
"openbsd": {
|
|
||||||
"make": "aes_siv_static",
|
|
||||||
"prepare": "cmake -DDISABLE_DOCS:BOOL=ON -DOPENSSL_ROOT_DIR=`readlink -f ../openssl/build` ."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"repo": "libaes_siv",
|
|
||||||
"rev": "9681279cfaa6e6399bb7ca3afbbc27fc2e19df4b",
|
|
||||||
"sha256": "1g4wy0m5wpqx7z6nillppkh5zki9fkx9rdw149qcxh7mc5vlszzi",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/dfoxfranke/libaes_siv/archive/9681279cfaa6e6399bb7ca3afbbc27fc2e19df4b.tar.gz",
|
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
|
||||||
},
|
|
||||||
"murmur3": {
|
|
||||||
"branch": "master",
|
|
||||||
"description": null,
|
|
||||||
"homepage": null,
|
|
||||||
"owner": "urbit",
|
|
||||||
"pmnsh": {
|
|
||||||
"make": "static"
|
|
||||||
},
|
|
||||||
"repo": "murmur3",
|
|
||||||
"rev": "71a75d57ca4e7ca0f7fc2fd84abd93595b0624ca",
|
|
||||||
"sha256": "0k7jq2nb4ad9ajkr6wc4w2yy2f2hkwm3nkbj2pklqgwsg6flxzwg",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/urbit/murmur3/archive/71a75d57ca4e7ca0f7fc2fd84abd93595b0624ca.tar.gz",
|
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
|
||||||
},
|
|
||||||
"niv": {
|
|
||||||
"branch": "master",
|
|
||||||
"description": "Easy dependency management for Nix projects",
|
|
||||||
"homepage": "https://github.com/nmattia/niv",
|
|
||||||
"owner": "nmattia",
|
|
||||||
"repo": "niv",
|
|
||||||
"rev": "9d35b9e4837ab88517210b1701127612c260eccf",
|
|
||||||
"sha256": "0q50xhnm8g2yfyakrh0nly4swyygxpi0a8cb9gp65wcakcgvzvdh",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/nmattia/niv/archive/9d35b9e4837ab88517210b1701127612c260eccf.tar.gz",
|
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
|
||||||
"branch": "master",
|
|
||||||
"description": "Nix Packages collection",
|
|
||||||
"homepage": "",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "376d67e1cd05d5ac8a64a3f47f17b80fb6394792",
|
|
||||||
"sha256": "1l4ai1dppwdbkkjbvnavsivr5kx00b3q8640pilpnifskfmfc8mp",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/NixOS/nixpkgs/archive/376d67e1cd05d5ac8a64a3f47f17b80fb6394792.tar.gz",
|
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
|
||||||
},
|
|
||||||
"softfloat3": {
|
|
||||||
"branch": "master",
|
|
||||||
"description": null,
|
|
||||||
"homepage": null,
|
|
||||||
"owner": "urbit",
|
|
||||||
"pmnsh": {
|
|
||||||
"compat": {
|
|
||||||
"m1brew": {
|
|
||||||
"lib": "build/template-FAST_INT64",
|
|
||||||
"make": "-C build/template-FAST_INT64 libsoftfloat3.a"
|
|
||||||
},
|
|
||||||
"mingw": {
|
|
||||||
"lib": "build/Win64-MinGW-w64",
|
|
||||||
"make": "-C build/Win64-MinGW-w64 libsoftfloat3.a"
|
|
||||||
},
|
|
||||||
"openbsd": {
|
|
||||||
"lib": "build/template-FAST_INT64",
|
|
||||||
"make": "-C build/template-FAST_INT64 libsoftfloat3.a"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"include": "source/include"
|
|
||||||
},
|
|
||||||
"repo": "berkeley-softfloat-3",
|
|
||||||
"rev": "ec4c7e31b32e07aad80e52f65ff46ac6d6aad986",
|
|
||||||
"sha256": "1lz4bazbf7lns1xh8aam19c814a4n4czq5xsq5rmi9sgqw910339",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/urbit/berkeley-softfloat-3/archive/ec4c7e31b32e07aad80e52f65ff46ac6d6aad986.tar.gz",
|
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
|
||||||
}
|
|
||||||
}
|
|
174
nix/sources.nix
174
nix/sources.nix
@ -1,174 +0,0 @@
|
|||||||
# This file has been generated by Niv.
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
#
|
|
||||||
# The fetchers. fetch_<type> fetches specs of type <type>.
|
|
||||||
#
|
|
||||||
|
|
||||||
fetch_file = pkgs: name: spec:
|
|
||||||
let
|
|
||||||
name' = sanitizeName name + "-src";
|
|
||||||
in
|
|
||||||
if spec.builtin or true then
|
|
||||||
builtins_fetchurl { inherit (spec) url sha256; name = name'; }
|
|
||||||
else
|
|
||||||
pkgs.fetchurl { inherit (spec) url sha256; name = name'; };
|
|
||||||
|
|
||||||
fetch_tarball = pkgs: name: spec:
|
|
||||||
let
|
|
||||||
name' = sanitizeName name + "-src";
|
|
||||||
in
|
|
||||||
if spec.builtin or true then
|
|
||||||
builtins_fetchTarball { name = name'; inherit (spec) url sha256; }
|
|
||||||
else
|
|
||||||
pkgs.fetchzip { name = name'; inherit (spec) url sha256; };
|
|
||||||
|
|
||||||
fetch_git = name: spec:
|
|
||||||
let
|
|
||||||
ref =
|
|
||||||
if spec ? ref then spec.ref else
|
|
||||||
if spec ? branch then "refs/heads/${spec.branch}" else
|
|
||||||
if spec ? tag then "refs/tags/${spec.tag}" else
|
|
||||||
abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!";
|
|
||||||
in
|
|
||||||
builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; };
|
|
||||||
|
|
||||||
fetch_local = spec: spec.path;
|
|
||||||
|
|
||||||
fetch_builtin-tarball = name: throw
|
|
||||||
''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`.
|
|
||||||
$ niv modify ${name} -a type=tarball -a builtin=true'';
|
|
||||||
|
|
||||||
fetch_builtin-url = name: throw
|
|
||||||
''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`.
|
|
||||||
$ niv modify ${name} -a type=file -a builtin=true'';
|
|
||||||
|
|
||||||
#
|
|
||||||
# Various helpers
|
|
||||||
#
|
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695
|
|
||||||
sanitizeName = name:
|
|
||||||
(
|
|
||||||
concatMapStrings (s: if builtins.isList s then "-" else s)
|
|
||||||
(
|
|
||||||
builtins.split "[^[:alnum:]+._?=-]+"
|
|
||||||
((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
# The set of packages used when specs are fetched using non-builtins.
|
|
||||||
mkPkgs = sources: system:
|
|
||||||
let
|
|
||||||
sourcesNixpkgs =
|
|
||||||
import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; };
|
|
||||||
hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
|
|
||||||
hasThisAsNixpkgsPath = <nixpkgs> == ./.;
|
|
||||||
in
|
|
||||||
if builtins.hasAttr "nixpkgs" sources
|
|
||||||
then sourcesNixpkgs
|
|
||||||
else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then
|
|
||||||
import <nixpkgs> {}
|
|
||||||
else
|
|
||||||
abort
|
|
||||||
''
|
|
||||||
Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or
|
|
||||||
add a package called "nixpkgs" to your sources.json.
|
|
||||||
'';
|
|
||||||
|
|
||||||
# The actual fetching function.
|
|
||||||
fetch = pkgs: name: spec:
|
|
||||||
|
|
||||||
if ! builtins.hasAttr "type" spec then
|
|
||||||
abort "ERROR: niv spec ${name} does not have a 'type' attribute"
|
|
||||||
else if spec.type == "file" then fetch_file pkgs name spec
|
|
||||||
else if spec.type == "tarball" then fetch_tarball pkgs name spec
|
|
||||||
else if spec.type == "git" then fetch_git name spec
|
|
||||||
else if spec.type == "local" then fetch_local spec
|
|
||||||
else if spec.type == "builtin-tarball" then fetch_builtin-tarball name
|
|
||||||
else if spec.type == "builtin-url" then fetch_builtin-url name
|
|
||||||
else
|
|
||||||
abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}";
|
|
||||||
|
|
||||||
# If the environment variable NIV_OVERRIDE_${name} is set, then use
|
|
||||||
# the path directly as opposed to the fetched source.
|
|
||||||
replace = name: drv:
|
|
||||||
let
|
|
||||||
saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name;
|
|
||||||
ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}";
|
|
||||||
in
|
|
||||||
if ersatz == "" then drv else
|
|
||||||
# this turns the string into an actual Nix path (for both absolute and
|
|
||||||
# relative paths)
|
|
||||||
if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}";
|
|
||||||
|
|
||||||
# Ports of functions for older nix versions
|
|
||||||
|
|
||||||
# a Nix version of mapAttrs if the built-in doesn't exist
|
|
||||||
mapAttrs = builtins.mapAttrs or (
|
|
||||||
f: set: with builtins;
|
|
||||||
listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set))
|
|
||||||
);
|
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295
|
|
||||||
range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1);
|
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257
|
|
||||||
stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1));
|
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269
|
|
||||||
stringAsChars = f: s: concatStrings (map f (stringToCharacters s));
|
|
||||||
concatMapStrings = f: list: concatStrings (map f list);
|
|
||||||
concatStrings = builtins.concatStringsSep "";
|
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331
|
|
||||||
optionalAttrs = cond: as: if cond then as else {};
|
|
||||||
|
|
||||||
# fetchTarball version that is compatible between all the versions of Nix
|
|
||||||
builtins_fetchTarball = { url, name ? null, sha256 }@attrs:
|
|
||||||
let
|
|
||||||
inherit (builtins) lessThan nixVersion fetchTarball;
|
|
||||||
in
|
|
||||||
if lessThan nixVersion "1.12" then
|
|
||||||
fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
|
|
||||||
else
|
|
||||||
fetchTarball attrs;
|
|
||||||
|
|
||||||
# fetchurl version that is compatible between all the versions of Nix
|
|
||||||
builtins_fetchurl = { url, name ? null, sha256 }@attrs:
|
|
||||||
let
|
|
||||||
inherit (builtins) lessThan nixVersion fetchurl;
|
|
||||||
in
|
|
||||||
if lessThan nixVersion "1.12" then
|
|
||||||
fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
|
|
||||||
else
|
|
||||||
fetchurl attrs;
|
|
||||||
|
|
||||||
# Create the final "sources" from the config
|
|
||||||
mkSources = config:
|
|
||||||
mapAttrs (
|
|
||||||
name: spec:
|
|
||||||
if builtins.hasAttr "outPath" spec
|
|
||||||
then abort
|
|
||||||
"The values in sources.json should not have an 'outPath' attribute"
|
|
||||||
else
|
|
||||||
spec // { outPath = replace name (fetch config.pkgs name spec); }
|
|
||||||
) config.sources;
|
|
||||||
|
|
||||||
# The "config" used by the fetchers
|
|
||||||
mkConfig =
|
|
||||||
{ sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null
|
|
||||||
, sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile)
|
|
||||||
, system ? builtins.currentSystem
|
|
||||||
, pkgs ? mkPkgs sources system
|
|
||||||
}: rec {
|
|
||||||
# The sources, i.e. the attribute set of spec name to spec
|
|
||||||
inherit sources;
|
|
||||||
|
|
||||||
# The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers
|
|
||||||
inherit pkgs;
|
|
||||||
};
|
|
||||||
|
|
||||||
in
|
|
||||||
mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }
|
|
125
nix/test-fake-ship.nix
Normal file
125
nix/test-fake-ship.nix
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
{ click, pier, pkgs }:
|
||||||
|
|
||||||
|
let
|
||||||
|
poke = ''
|
||||||
|
=>
|
||||||
|
|%
|
||||||
|
++ take-poke-ack
|
||||||
|
|= =wire
|
||||||
|
=/ m (strand ,?)
|
||||||
|
^- form:m
|
||||||
|
|= tin=strand-input:strand
|
||||||
|
?+ in.tin `[%skip ~]
|
||||||
|
~ `[%wait ~]
|
||||||
|
[~ %agent * %poke-ack *]
|
||||||
|
?. =(wire wire.u.in.tin)
|
||||||
|
`[%skip ~]
|
||||||
|
?~ p.sign.u.in.tin
|
||||||
|
`[%done %.y]
|
||||||
|
`[%done %.n]
|
||||||
|
==
|
||||||
|
++ poke
|
||||||
|
|= [=dock =cage]
|
||||||
|
=/ m (strand ,?)
|
||||||
|
^- form:m
|
||||||
|
=/ =card:agent:gall [%pass /poke %agent dock %poke cage]
|
||||||
|
;< ~ bind:m (send-raw-card card)
|
||||||
|
(take-poke-ack /poke)
|
||||||
|
--
|
||||||
|
|
||||||
|
'';
|
||||||
|
testThread = dojoCommand:
|
||||||
|
pkgs.writeTextFile {
|
||||||
|
name = "${dojoCommand}.hoon";
|
||||||
|
text = ''
|
||||||
|
${poke}
|
||||||
|
=/ m (strand ,vase)
|
||||||
|
;< [=ship =desk =case] bind:m get-beak
|
||||||
|
;< ok=? bind:m (poke [ship %dojo] %lens-command !>([%$ [%dojo '${dojoCommand}'] [%stdout ~]]))
|
||||||
|
(pure:m !>(ok))
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
appThread = generator: app:
|
||||||
|
pkgs.writeTextFile {
|
||||||
|
name = ":${app}|${generator}.hoon";
|
||||||
|
text = ''
|
||||||
|
${poke}
|
||||||
|
=/ m (strand ,vase)
|
||||||
|
;< [=ship =desk =case] bind:m get-beak
|
||||||
|
;< ok=? bind:m (poke [ship %dojo] %lens-command !>([%$ [%dojo '+${app}/${generator}'] [%app %${app}]]))
|
||||||
|
(pure:m !>(ok))
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
pokeApp = hoon: mark: app:
|
||||||
|
pkgs.writeTextFile {
|
||||||
|
name = ":${app} &${mark} ${hoon}.hoon";
|
||||||
|
text = ''
|
||||||
|
${poke}
|
||||||
|
=/ m (strand ,vase)
|
||||||
|
;< [=ship =desk =case] bind:m get-beak
|
||||||
|
;< ok=? bind:m (poke [ship %${app}] %${mark} !>(${hoon}))
|
||||||
|
(pure:m !>(ok))
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in pkgs.stdenvNoCC.mkDerivation {
|
||||||
|
name = "test-urbit";
|
||||||
|
|
||||||
|
src = pier;
|
||||||
|
|
||||||
|
phases = [ "unpackPhase" "buildPhase" "checkPhase" ];
|
||||||
|
|
||||||
|
nativeBuildInputs = [ pkgs.netcat ];
|
||||||
|
|
||||||
|
unpackPhase = ''
|
||||||
|
cp -R $src ./pier
|
||||||
|
chmod -R u+rw ./pier
|
||||||
|
'';
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
set -x
|
||||||
|
set -e
|
||||||
|
|
||||||
|
${../urbit} -d ./pier 1>&2 2> $out
|
||||||
|
|
||||||
|
tail -F $out >&2 &
|
||||||
|
|
||||||
|
${click} -k -p -i ${appThread "mass" "hood"} ./pier
|
||||||
|
|
||||||
|
sleep 2
|
||||||
|
|
||||||
|
${click} -k -p -i ${testThread "-test %/tests ~"} ./pier
|
||||||
|
|
||||||
|
${click} -k -p -i ${pokeApp "%agents" "noun" "test"} ./pier
|
||||||
|
${click} -k -p -i ${pokeApp "%generators" "noun" "test"} ./pier
|
||||||
|
${click} -k -p -i ${pokeApp "%marks" "noun" "test"} ./pier
|
||||||
|
|
||||||
|
${click} -k -p -i ${appThread "mass" "hood"} ./pier
|
||||||
|
sleep 2
|
||||||
|
|
||||||
|
${click} -k -p -i ${pokeApp "~" "helm-pack" "hood"} ./pier
|
||||||
|
|
||||||
|
${click} -k -p -i ${appThread "trim" "hood"} ./pier
|
||||||
|
|
||||||
|
${click} -k -p -i ${appThread "mass" "hood"} ./pier
|
||||||
|
|
||||||
|
${click} -k -p -i ${appThread "meld" "hood"} ./pier
|
||||||
|
|
||||||
|
${click} -k -p -i ${appThread "mass" "hood"} ./pier
|
||||||
|
|
||||||
|
${click} -k -p -i ${appThread "exit" "hood"} ./pier
|
||||||
|
|
||||||
|
set +x
|
||||||
|
'';
|
||||||
|
|
||||||
|
checkPhase = ''
|
||||||
|
if egrep "((FAILED|CRASHED|Failed)|warn:)" $out >/dev/null; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
doCheck = true;
|
||||||
|
|
||||||
|
# Fix 'bind: operation not permitted' when nix.useSandbox = true on darwin.
|
||||||
|
# See https://github.com/NixOS/nix/blob/5f6840fbb49ae5b534423bd8a4360646ee93dbaf/src/libstore/build.cc#L2961
|
||||||
|
__darwinAllowLocalNetworking = true;
|
||||||
|
}
|
@ -460,7 +460,7 @@
|
|||||||
:- ~
|
:- ~
|
||||||
^- octs
|
^- octs
|
||||||
=; pro=json
|
=; pro=json
|
||||||
(as-octt:mimes:html (en-json:html (sign:jws key.act pro bod)))
|
(as-octs:mimes:html (en:json:html (sign:jws key.act pro bod)))
|
||||||
:- %o %- my :~
|
:- %o %- my :~
|
||||||
nonce+s+non
|
nonce+s+non
|
||||||
url+s+(crip (en-purl:html url))
|
url+s+(crip (en-purl:html url))
|
||||||
@ -487,7 +487,7 @@
|
|||||||
::
|
::
|
||||||
?. =(400 p.rep) |
|
?. =(400 p.rep) |
|
||||||
?~ r.rep |
|
?~ r.rep |
|
||||||
=/ jon=(unit json) (de-json:html q.u.r.rep)
|
=/ jon=(unit json) (de:json:html q.u.r.rep)
|
||||||
?~ jon |
|
?~ jon |
|
||||||
=('urn:ietf:params:acme:error:badNonce' type:(error:grab u.jon))
|
=('urn:ietf:params:acme:error:badNonce' type:(error:grab u.jon))
|
||||||
:: +rate-limited: handle Acme service rate-limits
|
:: +rate-limited: handle Acme service rate-limits
|
||||||
@ -496,7 +496,7 @@
|
|||||||
|= [try=@ud act=@tas spur=wire bod=(unit octs)]
|
|= [try=@ud act=@tas spur=wire bod=(unit octs)]
|
||||||
^+ this
|
^+ this
|
||||||
=/ jon=(unit json)
|
=/ jon=(unit json)
|
||||||
?~(bod ~ (de-json:html q.u.bod))
|
?~(bod ~ (de:json:html q.u.bod))
|
||||||
?~ jon
|
?~ jon
|
||||||
:: no details, back way off
|
:: no details, back way off
|
||||||
:: XX specifically based on wire
|
:: XX specifically based on wire
|
||||||
@ -839,7 +839,7 @@
|
|||||||
?: (lth try 10)
|
?: (lth try 10)
|
||||||
(retry:effect try %directory / (min ~m30 (backoff try)))
|
(retry:effect try %directory / (min ~m30 (backoff try)))
|
||||||
(emil (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))))
|
=. dir (directory:grab (need (de:json:html q:(need r.rep))))
|
||||||
?~(reg.act register:effect this)
|
?~(reg.act register:effect this)
|
||||||
:: +nonce: accept new nonce and trigger next effect
|
:: +nonce: accept new nonce and trigger next effect
|
||||||
::
|
::
|
||||||
@ -883,7 +883,7 @@
|
|||||||
?~ r.rep
|
?~ r.rep
|
||||||
(scot %da now.bow)
|
(scot %da now.bow)
|
||||||
=/ bod=acct:body
|
=/ bod=acct:body
|
||||||
(acct:grab (need (de-json:html q.u.r.rep)))
|
(acct:grab (need (de:json:html q.u.r.rep)))
|
||||||
?> ?=(%valid sas.bod)
|
?> ?=(%valid sas.bod)
|
||||||
wen.bod
|
wen.bod
|
||||||
=. reg.act `[wen loc]
|
=. reg.act `[wen loc]
|
||||||
@ -913,7 +913,7 @@
|
|||||||
:: XX check status
|
:: XX check status
|
||||||
::
|
::
|
||||||
=/ bod=order:body
|
=/ bod=order:body
|
||||||
(order:grab (need (de-json:html q:(need r.rep))))
|
(order:grab (need (de:json:html q:(need r.rep))))
|
||||||
=/ dom=(set turf) ~(key by dom.u.next-order)
|
=/ dom=(set turf) ~(key by dom.u.next-order)
|
||||||
:: XX maybe generate key here?
|
:: XX maybe generate key here?
|
||||||
::
|
::
|
||||||
@ -956,7 +956,7 @@
|
|||||||
::
|
::
|
||||||
(emil (notify (failure-message ego.u.rod) [(sell !>(rep)) ~]))
|
(emil (notify (failure-message ego.u.rod) [(sell !>(rep)) ~]))
|
||||||
=/ bod=order:body
|
=/ bod=order:body
|
||||||
(order:grab (need (de-json:html q:(need r.rep))))
|
(order:grab (need (de:json:html q:(need r.rep))))
|
||||||
?+ sas.bod
|
?+ sas.bod
|
||||||
~& [%check-order-status-unknown sas.bod]
|
~& [%check-order-status-unknown sas.bod]
|
||||||
this
|
this
|
||||||
@ -1063,7 +1063,7 @@
|
|||||||
::
|
::
|
||||||
(emil (notify (failure-message i.pending.aut.u.rod) [(sell !>(rep)) ~]))
|
(emil (notify (failure-message i.pending.aut.u.rod) [(sell !>(rep)) ~]))
|
||||||
=/ bod=auth:body
|
=/ bod=auth:body
|
||||||
(auth:grab (need (de-json:html q:(need r.rep))))
|
(auth:grab (need (de:json:html q:(need r.rep))))
|
||||||
=/ cal=trial
|
=/ cal=trial
|
||||||
:: XX parse token to verify url-safe base64?
|
:: XX parse token to verify url-safe base64?
|
||||||
::
|
::
|
||||||
@ -1147,7 +1147,7 @@
|
|||||||
:: XX get challenge, confirm urn:ietf:params:acme:error:connection
|
:: XX get challenge, confirm urn:ietf:params:acme:error:connection
|
||||||
::
|
::
|
||||||
:: =/ err=error:body
|
:: =/ err=error:body
|
||||||
:: (error:grab (need (de-json:html q:(need r.rep))))
|
:: (error:grab (need (de:json:html q:(need r.rep))))
|
||||||
:: ?: =('urn:ietf:params:acme:error:malformed' status.err)
|
:: ?: =('urn:ietf:params:acme:error:malformed' status.err)
|
||||||
::
|
::
|
||||||
=< cancel-order:effect
|
=< cancel-order:effect
|
||||||
@ -1155,7 +1155,7 @@
|
|||||||
'unable to finalize domain validation challenge'
|
'unable to finalize domain validation challenge'
|
||||||
(emil (notify msg [(sell !>(rep)) ~]))
|
(emil (notify msg [(sell !>(rep)) ~]))
|
||||||
=/ bod=challenge:body
|
=/ bod=challenge:body
|
||||||
(challenge:grab (need (de-json:html q:(need r.rep))))
|
(challenge:grab (need (de:json:html q:(need r.rep))))
|
||||||
:: XX check for other possible values in 200 response
|
:: XX check for other possible values in 200 response
|
||||||
:: note: may have already been validated
|
:: note: may have already been validated
|
||||||
::
|
::
|
||||||
|
@ -615,7 +615,7 @@
|
|||||||
::
|
::
|
||||||
?: fake.ae ~
|
?: fake.ae ~
|
||||||
=+ [%raw-poke %noun %refresh-rate ~s30]
|
=+ [%raw-poke %noun %refresh-rate ~s30]
|
||||||
[/g/aqua/reduce-refresh-rate %deal [. .]:who.ae %azimuth -]~
|
[/g/aqua/reduce-refresh-rate %deal [. . /]:who.ae %azimuth -]~
|
||||||
==
|
==
|
||||||
==
|
==
|
||||||
=. this
|
=. this
|
||||||
|
@ -45,7 +45,6 @@
|
|||||||
|= [=mark =vase]
|
|= [=mark =vase]
|
||||||
^- (quip card _this)
|
^- (quip card _this)
|
||||||
|^
|
|^
|
||||||
?> (team:title our.bowl src.bowl)
|
|
||||||
?+ mark (on-poke:def mark vase)
|
?+ mark (on-poke:def mark vase)
|
||||||
%handle-http-request
|
%handle-http-request
|
||||||
=+ !<([id=@ta req=inbound-request:eyre] vase)
|
=+ !<([id=@ta req=inbound-request:eyre] vase)
|
||||||
@ -53,6 +52,7 @@
|
|||||||
(handle-http-request id req)
|
(handle-http-request id req)
|
||||||
::
|
::
|
||||||
%azimuth-action
|
%azimuth-action
|
||||||
|
?> (team:title our.bowl src.bowl)
|
||||||
=+ !<([%disconnect bind=binding:eyre] vase)
|
=+ !<([%disconnect bind=binding:eyre] vase)
|
||||||
~& >>> "disconnecting at {<bind>}"
|
~& >>> "disconnecting at {<bind>}"
|
||||||
:_ this
|
:_ this
|
||||||
|
@ -269,7 +269,7 @@
|
|||||||
|= reg=cord
|
|= reg=cord
|
||||||
^- (list [=ship rights])
|
^- (list [=ship rights])
|
||||||
~| %registration-json-insane
|
~| %registration-json-insane
|
||||||
=+ jon=(need (de-json:html reg))
|
=+ jon=(need (de:json:html reg))
|
||||||
~| %registration-json-invalid
|
~| %registration-json-invalid
|
||||||
?> ?=(%o -.jon)
|
?> ?=(%o -.jon)
|
||||||
=. p.jon (~(del by p.jon) 'idCode')
|
=. p.jon (~(del by p.jon) 'idCode')
|
||||||
|
@ -361,16 +361,58 @@
|
|||||||
::
|
::
|
||||||
[%eyre %authentication ~]
|
[%eyre %authentication ~]
|
||||||
%- some
|
%- some
|
||||||
:- %a
|
=/ auth auth-state:v-eyre
|
||||||
%+ turn
|
|
||||||
%+ sort ~(tap by sessions:auth-state:v-eyre)
|
|
||||||
|= [[@uv a=session:eyre] [@uv b=session:eyre]]
|
|
||||||
(gth expiry-time.a expiry-time.b)
|
|
||||||
|= [cookie=@uv session:eyre]
|
|
||||||
%- pairs
|
%- pairs
|
||||||
:~ 'cookie'^s+(end [3 4] (rsh [3 2] (scot %x (shax cookie))))
|
:~ :- 'sessions'
|
||||||
'expiry'^(time expiry-time)
|
:- %a
|
||||||
'channels'^(numb ~(wyt in channels))
|
%+ turn
|
||||||
|
%+ sort ~(tap by sessions.auth)
|
||||||
|
|= [[@uv a=session:eyre] [@uv b=session:eyre]]
|
||||||
|
(gth expiry-time.a expiry-time.b)
|
||||||
|
|= [cookie=@uv session:eyre]
|
||||||
|
%- pairs
|
||||||
|
:~ 'cookie'^s+(scot %uv cookie)
|
||||||
|
'identity'^(render-identity:v-eyre identity)
|
||||||
|
'expiry'^(time expiry-time)
|
||||||
|
'channels'^(numb ~(wyt in channels))
|
||||||
|
==
|
||||||
|
::
|
||||||
|
:- 'visitors'
|
||||||
|
:- %a
|
||||||
|
%+ turn
|
||||||
|
%+ sort ~(tap by visitors.auth)
|
||||||
|
|= [[@uv a=visitor:eyre] [@uv b=visitor:eyre]]
|
||||||
|
?@ +.a &
|
||||||
|
?@ +.b |
|
||||||
|
(aor (scot %p ship.a) (scot %p ship.b))
|
||||||
|
|= [nonce=@uv v=visitor:eyre]
|
||||||
|
%- pairs
|
||||||
|
:+ 'nonce'^s+(scot %uv nonce)
|
||||||
|
'duct'^?~(duct.v ~ a+(turn u.duct.v path))
|
||||||
|
?@ +.v ['sesh' s+(scot %uv sesh.v)]~
|
||||||
|
:~ 'pend'^b+?=(^ pend.v)
|
||||||
|
'ship'^(ship ship.v)
|
||||||
|
'last'^s+last.v
|
||||||
|
'toke'^?~(toke.v ~ s+(scot %uv u.toke.v))
|
||||||
|
==
|
||||||
|
::
|
||||||
|
:- 'visiting'
|
||||||
|
:- %a
|
||||||
|
%- zing
|
||||||
|
%+ turn
|
||||||
|
%+ sort ~(tap by visiting.auth)
|
||||||
|
|= [[a=@p *] [b=@p *]]
|
||||||
|
(aor (scot %p a) (scot %p b))
|
||||||
|
|= [who=@p q=(qeu @uv) m=(map @uv portkey)]
|
||||||
|
%+ turn ~(tap by m)
|
||||||
|
|= [nonce=@uv p=portkey]
|
||||||
|
%- pairs
|
||||||
|
:+ 'who'^(ship who)
|
||||||
|
'nonce'^s+(scot %uv nonce)
|
||||||
|
?@ p ['made' (time made.p)]~
|
||||||
|
:~ ['pend' b+?=(^ pend.p)]
|
||||||
|
['toke' ?~(toke.p ~ s+(scot %uv u.toke.p))]
|
||||||
|
==
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
:: /eyre/channels.json
|
:: /eyre/channels.json
|
||||||
@ -383,6 +425,7 @@
|
|||||||
|= [key=@t channel:eyre]
|
|= [key=@t channel:eyre]
|
||||||
%- pairs
|
%- pairs
|
||||||
:~ 'session'^s+key
|
:~ 'session'^s+key
|
||||||
|
'identity'^(render-identity:v-eyre identity)
|
||||||
'connected'^b+!-.state
|
'connected'^b+!-.state
|
||||||
'expiry'^?-(-.state %& (time date.p.state), %| ~)
|
'expiry'^?-(-.state %& (time date.p.state), %| ~)
|
||||||
'next-id'^(numb next-id)
|
'next-id'^(numb next-id)
|
||||||
@ -992,6 +1035,16 @@
|
|||||||
++ channel-state
|
++ channel-state
|
||||||
(scry ^channel-state %e %channel-state ~)
|
(scry ^channel-state %e %channel-state ~)
|
||||||
::
|
::
|
||||||
|
++ render-identity
|
||||||
|
|= =identity
|
||||||
|
^- json
|
||||||
|
%- ship:enjs:format
|
||||||
|
?- -.identity
|
||||||
|
%ours our.bowl
|
||||||
|
%fake who.identity
|
||||||
|
%real who.identity
|
||||||
|
==
|
||||||
|
::
|
||||||
++ render-action
|
++ render-action
|
||||||
|= =action
|
|= =action
|
||||||
^- json
|
^- json
|
||||||
|
File diff suppressed because one or more lines are too long
@ -115,7 +115,7 @@
|
|||||||
:: |parser-at: parsers for dojo expressions using :dir as working directory
|
:: |parser-at: parsers for dojo expressions using :dir as working directory
|
||||||
::
|
::
|
||||||
++ parser-at
|
++ parser-at
|
||||||
|= [our=ship dir=beam]
|
|= [our=ship now=@da dir=beam]
|
||||||
|%
|
|%
|
||||||
++ default-app %hood
|
++ default-app %hood
|
||||||
++ hoon-parser (vang | (en-beam dir))
|
++ hoon-parser (vang | (en-beam dir))
|
||||||
@ -129,7 +129,7 @@
|
|||||||
=/ =desk
|
=/ =desk
|
||||||
::TODO maybe should recognize if the user specified a desk explicitly.
|
::TODO maybe should recognize if the user specified a desk explicitly.
|
||||||
:: currently eats the :app|desk#gen case.
|
:: currently eats the :app|desk#gen case.
|
||||||
=+ gop=(en-beam dir(q q.gol, s /$))
|
=+ gop=/(scot %p our)/[q.gol]/(scot %da now)/$
|
||||||
?. .^(? %gu gop)
|
?. .^(? %gu gop)
|
||||||
q.dir
|
q.dir
|
||||||
.^(desk %gd gop)
|
.^(desk %gd gop)
|
||||||
@ -365,7 +365,7 @@
|
|||||||
dir(r [%da now.hid])
|
dir(r [%da now.hid])
|
||||||
::
|
::
|
||||||
++ he-beak `beak`[p q r]:he-beam
|
++ he-beak `beak`[p q r]:he-beam
|
||||||
++ he-parser (parser-at our.hid he-beam)
|
++ he-parser (parser-at our.hid now.hid he-beam)
|
||||||
::
|
::
|
||||||
++ dy :: project work
|
++ dy :: project work
|
||||||
|_ dojo-project ::
|
|_ dojo-project ::
|
||||||
@ -846,7 +846,6 @@
|
|||||||
:: kev: key-value named arguments
|
:: kev: key-value named arguments
|
||||||
:: kuv: default keyword arguments
|
:: kuv: default keyword arguments
|
||||||
:: sam: fully populated sample
|
:: sam: fully populated sample
|
||||||
:: rog: default gat sample
|
|
||||||
::
|
::
|
||||||
|. ^- vase
|
|. ^- vase
|
||||||
=/ gat=vase (slot 3 q.cay)
|
=/ gat=vase (slot 3 q.cay)
|
||||||
@ -870,9 +869,11 @@
|
|||||||
!(~(has by q.cig) %drum-session)
|
!(~(has by q.cig) %drum-session)
|
||||||
==
|
==
|
||||||
[[%drum-session !>(ses.id)] soz] ::TODO does the who matter?
|
[[%drum-session !>(ses.id)] soz] ::TODO does the who matter?
|
||||||
?: =(~ soz)
|
?~ soz
|
||||||
(fall kuv !>(~))
|
(fall kuv !>(~))
|
||||||
~| keyword-arg-failure+~(key by q.cig)
|
~_ 'dojo: bad-keyword (supplied sample incorrect)'
|
||||||
|
~_ 'dojo: keywords allowed'
|
||||||
|
~_ (skol p:(fall kuv !>(~)))
|
||||||
%+ slap
|
%+ slap
|
||||||
(with-faces kuv+(need kuv) rep+(with-faces soz) ~)
|
(with-faces kuv+(need kuv) rep+(with-faces soz) ~)
|
||||||
:+ %cncb [%kuv]~
|
:+ %cncb [%kuv]~
|
||||||
@ -882,13 +883,57 @@
|
|||||||
[[var]~ [%wing var %rep ~]]
|
[[var]~ [%wing var %rep ~]]
|
||||||
::
|
::
|
||||||
=/ sam=vase :(slop ven poz kev)
|
=/ sam=vase :(slop ven poz kev)
|
||||||
?. (~(nest ut p.som) | p.sam)
|
?: (~(nest ut p.som) | p.sam)
|
||||||
~> %slog.1^leaf+"dojo: nest-need"
|
(slam gat sam)
|
||||||
~> %slog.0^(skol p.som)
|
:: something is wrong
|
||||||
~> %slog.1^leaf+"dojo: nest-have"
|
::
|
||||||
~> %slog.0^(skol p.sam)
|
%- mean
|
||||||
!!
|
^- (list tank)
|
||||||
(slam gat sam)
|
=/ cez=type [%cell %noun [%cell %noun %noun]]
|
||||||
|
?. (~(nest ut cez) | p.som)
|
||||||
|
:: [ven poz kev] can't nest in som
|
||||||
|
::
|
||||||
|
:~ 'dojo: nest-need'
|
||||||
|
(skol p.som)
|
||||||
|
'dojo: nest-have'
|
||||||
|
(skol p.sam)
|
||||||
|
'dojo: bad gate lost-argument (generator incorrect)'
|
||||||
|
==
|
||||||
|
::
|
||||||
|
=/ hed=vase (slot 2 som)
|
||||||
|
?. (~(nest ut p.hed) | p.ven)
|
||||||
|
:: ven can't nest in head
|
||||||
|
::
|
||||||
|
:~ 'dojo: nest-need'
|
||||||
|
(skol p.hed)
|
||||||
|
'dojo: nest-have'
|
||||||
|
(skol p.ven)
|
||||||
|
'dojo: bad gate event-sample (generator incorrect)'
|
||||||
|
==
|
||||||
|
::
|
||||||
|
=/ zop=vase (slot 6 som)
|
||||||
|
=/ lon=vase !>(*(lest))
|
||||||
|
?: ?& !(~(nest ut p.zop) | -:!>(~))
|
||||||
|
!(~(nest ut p.lon) | p.zop)
|
||||||
|
!(~(nest ut p.zop) | -:!>((slop zop !>(~))))
|
||||||
|
==
|
||||||
|
:: argument required, but nothing can nest
|
||||||
|
::
|
||||||
|
:~ 'dojo: nest-need'
|
||||||
|
(skol p.zop)
|
||||||
|
'dojo: nest-have'
|
||||||
|
(skol p.poz)
|
||||||
|
'dojo: bad gate impossible-nest (generator incorrect)'
|
||||||
|
==
|
||||||
|
:: poz doesn't nest in zop
|
||||||
|
::
|
||||||
|
?< (~(nest ut p.zop) | p.poz)
|
||||||
|
:~ 'dojo: nest-need'
|
||||||
|
(skol p.zop)
|
||||||
|
'dojo: nest-have'
|
||||||
|
(skol p.poz)
|
||||||
|
'dojo: bad-argument (supplied sample incorrect)'
|
||||||
|
==
|
||||||
::
|
::
|
||||||
++ dy-made-dial :: dialog product
|
++ dy-made-dial :: dialog product
|
||||||
|= cag=cage
|
|= cag=cage
|
||||||
@ -1172,6 +1217,16 @@
|
|||||||
::
|
::
|
||||||
%kick +>.$
|
%kick +>.$
|
||||||
==
|
==
|
||||||
|
::
|
||||||
|
++ he-self
|
||||||
|
|= [way=wire =sign:agent:gall]
|
||||||
|
^+ +>
|
||||||
|
?. ?=(%poke-ack -.sign)
|
||||||
|
~& [%strange-self sign]
|
||||||
|
+>
|
||||||
|
?~ p.sign
|
||||||
|
+>
|
||||||
|
(he-diff %tan leaf+"dojo: failed to process input" ~)
|
||||||
:: +he-http-response: result from http-client
|
:: +he-http-response: result from http-client
|
||||||
::
|
::
|
||||||
++ he-http-response
|
++ he-http-response
|
||||||
@ -1429,23 +1484,34 @@
|
|||||||
=/ naked-gen=(unit term)
|
=/ naked-gen=(unit term)
|
||||||
%+ rust txt
|
%+ rust txt
|
||||||
(full (ifix [lus (just `@`10)] ;~(pose sym (easy %$))))
|
(full (ifix [lus (just `@`10)] ;~(pose sym (easy %$))))
|
||||||
?~ naked-gen
|
?^ naked-gen
|
||||||
|
(complete-naked-gen u.naked-gen)
|
||||||
|
=/ naked-ted=(unit term)
|
||||||
|
%+ rust txt
|
||||||
|
(full (ifix [hep (just `@`10)] ;~(pose sym (easy %$))))
|
||||||
|
?~ naked-ted
|
||||||
res
|
res
|
||||||
(complete-naked-gen u.naked-gen)
|
(complete-naked-ted u.naked-ted)
|
||||||
::
|
::
|
||||||
++ complete-naked-poke
|
++ complete-naked-poke
|
||||||
|= app=term
|
|= app=term
|
||||||
=/ pax=path
|
=+ [our=(scot %p our.hid) now=(scot %da now.hid)]
|
||||||
/(scot %p our.hid)/[q:he-beam]/(scot %da now.hid)/app
|
=+ .^(desks=(set desk) %cd /[our]//[now])
|
||||||
|
=. desks (~(del in desks) %kids)
|
||||||
%+ complete (cat 3 ':' app)
|
%+ complete (cat 3 ':' app)
|
||||||
%+ murn ~(tap by dir:.^(arch %cy pax))
|
%- zing
|
||||||
|= [=term ~]
|
%+ turn ~(tap in desks)
|
||||||
^- (unit [^term tank])
|
|= =desk
|
||||||
?. =(app (end [3 (met 3 app)] term))
|
%+ murn
|
||||||
|
%~ tap in
|
||||||
|
.^((set [dude:gall ?]) %ge /[our]/[desk]/[now]/$)
|
||||||
|
|= [=dude:gall live=?]
|
||||||
|
^- (unit [term tank])
|
||||||
|
?. live
|
||||||
~
|
~
|
||||||
?~ =<(fil .^(arch %cy (weld pax ~[term %hoon])))
|
?. =(app (end [3 (met 3 app)] dude))
|
||||||
~
|
~
|
||||||
`[(cat 3 ':' term) *tank]
|
`[(cat 3 ':' dude) *tank]
|
||||||
::
|
::
|
||||||
++ complete-variable
|
++ complete-variable
|
||||||
|= variable=term
|
|= variable=term
|
||||||
@ -1459,14 +1525,17 @@
|
|||||||
::
|
::
|
||||||
++ complete-gen-poke-to-app
|
++ complete-gen-poke-to-app
|
||||||
|= [app=term gen=term]
|
|= [app=term gen=term]
|
||||||
=. app
|
=? app =(%$ app)
|
||||||
?:(?=(%$ app) %hood app)
|
%hood
|
||||||
%+ complete
|
%+ complete
|
||||||
?: =(%hood app)
|
?: =(%hood app)
|
||||||
(cat 3 '|' gen)
|
(cat 3 '|' gen)
|
||||||
:((cury cat 3) ':' app '|' gen)
|
:((cury cat 3) ':' app '|' gen)
|
||||||
=/ pfix=path
|
=+ [our=(scot %p our.hid) now=(scot %da now.hid)]
|
||||||
/(scot %p our.hid)/[q:he-beam]/(scot %da now.hid)/gen/[app]
|
?. .^(? %gu /[our]/[app]/[now]/$)
|
||||||
|
~
|
||||||
|
=+ .^(=desk %gd /[our]/[app]/[now]/$)
|
||||||
|
=/ pfix=path /[our]/[desk]/[now]/gen/[app]
|
||||||
::
|
::
|
||||||
%^ tab-generators:auto pfix `app
|
%^ tab-generators:auto pfix `app
|
||||||
%+ murn
|
%+ murn
|
||||||
@ -1493,6 +1562,27 @@
|
|||||||
~
|
~
|
||||||
(some term)
|
(some term)
|
||||||
::
|
::
|
||||||
|
++ complete-naked-ted
|
||||||
|
|= ted=term
|
||||||
|
=/ pfix=path
|
||||||
|
/(scot %p our.hid)/[q:he-beam]/(scot %da now.hid)/ted
|
||||||
|
=+ .^(paths=(list path) %ct pfix)
|
||||||
|
%+ complete (cat 3 '-' ted)
|
||||||
|
%+ murn paths
|
||||||
|
|= pax=path
|
||||||
|
^- (unit [term tank])
|
||||||
|
?~ pax
|
||||||
|
~
|
||||||
|
?~ t.pax
|
||||||
|
~
|
||||||
|
?. =(%hoon (rear t.pax))
|
||||||
|
~
|
||||||
|
=/ =cord
|
||||||
|
(reel (join '-' (snip `path`t.pax)) (cury cat 3))
|
||||||
|
?. =(ted (end [3 (met 3 ted)] cord))
|
||||||
|
~
|
||||||
|
`[(cat 3 '-' cord) *tank]
|
||||||
|
::
|
||||||
++ complete
|
++ complete
|
||||||
|= [completing=term options=(list [term tank])]
|
|= [completing=term options=(list [term tank])]
|
||||||
?~ options
|
?~ options
|
||||||
@ -1528,7 +1618,9 @@
|
|||||||
:: Else, print results
|
:: Else, print results
|
||||||
::
|
::
|
||||||
%+ he-diff %tab
|
%+ he-diff %tab
|
||||||
options
|
%+ sort options
|
||||||
|
|= [[a=term *] [b=term *]]
|
||||||
|
(aor a b)
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
++ he-type :: apply input
|
++ he-type :: apply input
|
||||||
@ -1538,7 +1630,7 @@
|
|||||||
he-pine:(~(dy-type dy u.poy) act)
|
he-pine:(~(dy-type dy u.poy) act)
|
||||||
?- -.dat.act
|
?- -.dat.act
|
||||||
%det (he-stir +.dat.act)
|
%det (he-stir +.dat.act)
|
||||||
%ret (he-done (tufa buf.say))
|
%ret (he-card %pass /self %agent [our.hid %dojo] %poke %done !>(id))
|
||||||
%clr he-pine(buf "")
|
%clr he-pine(buf "")
|
||||||
%tab (he-tab +.dat.act)
|
%tab (he-tab +.dat.act)
|
||||||
==
|
==
|
||||||
@ -1668,6 +1760,11 @@
|
|||||||
=+ !<([ses=@ta =command:lens] vase)
|
=+ !<([ses=@ta =command:lens] vase)
|
||||||
=/ =id [our.hid ses]
|
=/ =id [our.hid ses]
|
||||||
he-abet:(~(he-lens he hid id ~ (~(got by hoc) id)) command)
|
he-abet:(~(he-lens he hid id ~ (~(got by hoc) id)) command)
|
||||||
|
::
|
||||||
|
%done
|
||||||
|
=+ !<(=id vase)
|
||||||
|
=/ ses=session (~(got by hoc) id)
|
||||||
|
he-abet:(~(he-done he hid id ~ ses) (tufa buf.say.ses))
|
||||||
::
|
::
|
||||||
%allow-remote-login
|
%allow-remote-login
|
||||||
=/ who !<(@p vase)
|
=/ who !<(@p vase)
|
||||||
@ -1736,6 +1833,7 @@
|
|||||||
?+ i.t.t.wire ~|([%dojo-bad-on-agent wire -.sign] !!)
|
?+ i.t.t.wire ~|([%dojo-bad-on-agent wire -.sign] !!)
|
||||||
%poke (he-unto:he-full t.wire sign)
|
%poke (he-unto:he-full t.wire sign)
|
||||||
%wool (he-wool:he-full t.wire sign)
|
%wool (he-wool:he-full t.wire sign)
|
||||||
|
%self (he-self:he-full t.wire sign)
|
||||||
==
|
==
|
||||||
[moves ..on-init]
|
[moves ..on-init]
|
||||||
::
|
::
|
||||||
|
@ -1,618 +0,0 @@
|
|||||||
:: gaze: azimuth statistics
|
|
||||||
::
|
|
||||||
:: general flow:
|
|
||||||
:: - receive events
|
|
||||||
:: - process events whose timestamp is known
|
|
||||||
:: - request timestamps for unknown block numbers (if not already running)
|
|
||||||
:: - receive timestamps, process events
|
|
||||||
::
|
|
||||||
/- eth-watcher
|
|
||||||
/+ *ethereum, *azimuth, default-agent, verb
|
|
||||||
::
|
|
||||||
=> |%
|
|
||||||
+$ state-0
|
|
||||||
$: %0
|
|
||||||
:: qued: event logs waiting on block timestamp, oldest first
|
|
||||||
:: time: timstamps of block numbers
|
|
||||||
:: seen: events sorted by timestamp, newest first
|
|
||||||
:: days: stats by day, newest first
|
|
||||||
::
|
|
||||||
running=(unit @ta)
|
|
||||||
qued=loglist
|
|
||||||
time=(map @ud @da)
|
|
||||||
seen=(list [wen=@da wat=event])
|
|
||||||
days=(list [day=@da sat=stats])
|
|
||||||
==
|
|
||||||
::
|
|
||||||
+$ loglist loglist:eth-watcher
|
|
||||||
+$ event
|
|
||||||
$% [%azimuth who=ship dif=diff-point]
|
|
||||||
[%invite by=ship of=ship gift=ship to=address]
|
|
||||||
==
|
|
||||||
::
|
|
||||||
+$ stats
|
|
||||||
$: spawned=(list @p)
|
|
||||||
activated=(list @p)
|
|
||||||
transfer-p=(list @p)
|
|
||||||
transferred=(list @p)
|
|
||||||
configured=(list @p)
|
|
||||||
breached=(list @p)
|
|
||||||
request=(list @p)
|
|
||||||
sponsor=(list @p)
|
|
||||||
management-p=(list @p)
|
|
||||||
voting-p=(list @p)
|
|
||||||
spawn-p=(list @p)
|
|
||||||
invites-senders=(list @p)
|
|
||||||
==
|
|
||||||
::
|
|
||||||
+$ card card:agent:gall
|
|
||||||
::
|
|
||||||
++ node-url 'http://eth-mainnet.urbit.org:8545'
|
|
||||||
++ refresh-rate ~h1
|
|
||||||
++ timeout-time ~h2
|
|
||||||
--
|
|
||||||
::
|
|
||||||
=| state-0
|
|
||||||
=* state -
|
|
||||||
::
|
|
||||||
%+ verb |
|
|
||||||
^- agent:gall
|
|
||||||
=<
|
|
||||||
|_ =bowl:gall
|
|
||||||
+* this .
|
|
||||||
do ~(. +> bowl)
|
|
||||||
def ~(. (default-agent this %|) bowl)
|
|
||||||
bec byk.bowl(r da+now.bowl)
|
|
||||||
::
|
|
||||||
++ on-init
|
|
||||||
^- (quip card _this)
|
|
||||||
[setup-cards:do this]
|
|
||||||
::
|
|
||||||
++ on-save !>(state)
|
|
||||||
++ on-load
|
|
||||||
|= old=vase
|
|
||||||
^- (quip card _this)
|
|
||||||
[~ this(state !<(state-0 old))]
|
|
||||||
::
|
|
||||||
++ on-poke
|
|
||||||
|= [=mark =vase]
|
|
||||||
^- (quip card _this)
|
|
||||||
?> ?=(%noun mark)
|
|
||||||
=/ =noun !<(noun vase)
|
|
||||||
|- ^- [cards=(list card) =_this]
|
|
||||||
?+ noun ~|([dap.bowl %unknown-poke noun] !!)
|
|
||||||
%reconnect
|
|
||||||
:_ this
|
|
||||||
:~ leave-eth-watcher:do
|
|
||||||
watch-eth-watcher:do
|
|
||||||
==
|
|
||||||
::
|
|
||||||
%reload
|
|
||||||
:- cards:$(noun %reconnect)
|
|
||||||
this(qued ~, seen ~, days ~)
|
|
||||||
::
|
|
||||||
%rewatch
|
|
||||||
:_ this:$(noun %reset)
|
|
||||||
:~ leave-eth-watcher:do
|
|
||||||
clear-eth-watcher:do
|
|
||||||
setup-eth-watcher:do
|
|
||||||
await-eth-watcher:do
|
|
||||||
==
|
|
||||||
::
|
|
||||||
%export
|
|
||||||
[export:do this]
|
|
||||||
::
|
|
||||||
%debug
|
|
||||||
~& latest=(turn (scag 5 seen) head)
|
|
||||||
~& oldest=(turn (slag (sub (max 5 (lent seen)) 5) seen) head)
|
|
||||||
~& :- 'order is'
|
|
||||||
=- ?:(sane 'sane' 'insane')
|
|
||||||
%+ roll seen
|
|
||||||
|= [[this=@da *] last=@da sane=?]
|
|
||||||
:- this
|
|
||||||
?: =(*@da last) &
|
|
||||||
(lte this last)
|
|
||||||
~& time=~(wyt by time)
|
|
||||||
~& qued=(lent qued)
|
|
||||||
~& days=(lent days)
|
|
||||||
[~ this]
|
|
||||||
==
|
|
||||||
::
|
|
||||||
++ on-agent
|
|
||||||
|= [=wire =sign:agent:gall]
|
|
||||||
^- (quip card _this)
|
|
||||||
?+ -.sign (on-agent:def wire sign)
|
|
||||||
%kick
|
|
||||||
?. =(/watcher wire) [~ this]
|
|
||||||
[[watch-eth-watcher:do]~ this]
|
|
||||||
::
|
|
||||||
%fact
|
|
||||||
?+ wire (on-agent:def wire sign)
|
|
||||||
[%watcher ~]
|
|
||||||
?. ?=(%eth-watcher-diff p.cage.sign)
|
|
||||||
(on-agent:def wire sign)
|
|
||||||
=^ cards state
|
|
||||||
%- handle-eth-watcher-diff:do
|
|
||||||
!<(diff:eth-watcher q.cage.sign)
|
|
||||||
[cards this]
|
|
||||||
::
|
|
||||||
[%timestamps @ ~]
|
|
||||||
?+ p.cage.sign (on-agent:def wire sign)
|
|
||||||
%thread-fail
|
|
||||||
=+ !<([=term =tang] q.cage.sign)
|
|
||||||
=/ =tank leaf+"{(trip dap.bowl)} thread failed; will retry"
|
|
||||||
%- (slog tank leaf+<term> tang)
|
|
||||||
=^ cards state
|
|
||||||
request-timestamps:do
|
|
||||||
[cards this]
|
|
||||||
::
|
|
||||||
%thread-done
|
|
||||||
=^ cards state
|
|
||||||
%- save-timestamps:do
|
|
||||||
!<((list [@ud @da]) q.cage.sign)
|
|
||||||
[cards this]
|
|
||||||
==
|
|
||||||
==
|
|
||||||
==
|
|
||||||
::
|
|
||||||
++ on-arvo
|
|
||||||
|= [=wire =sign-arvo]
|
|
||||||
^- (quip card _this)
|
|
||||||
?+ +<.sign-arvo ~|([dap.bowl %strange-arvo-sign +<.sign-arvo] !!)
|
|
||||||
%wake
|
|
||||||
?: =(/export wire)
|
|
||||||
[[wait-export:do export:do] this]
|
|
||||||
?: =(/watch wire)
|
|
||||||
[[watch-eth-watcher:do]~ this]
|
|
||||||
~& [dap.bowl %strange-wake wire]
|
|
||||||
[~ this]
|
|
||||||
==
|
|
||||||
::
|
|
||||||
++ on-peek on-peek:def
|
|
||||||
++ on-watch on-watch:def
|
|
||||||
++ on-leave on-leave:def
|
|
||||||
++ on-fail on-fail:def
|
|
||||||
--
|
|
||||||
::
|
|
||||||
|_ =bowl:gall
|
|
||||||
++ bec byk.bowl(r da+now.bowl)
|
|
||||||
++ setup-cards
|
|
||||||
^- (list card)
|
|
||||||
:~ wait-export
|
|
||||||
setup-eth-watcher
|
|
||||||
:: we punt on subscribing to the eth-watcher for a little while.
|
|
||||||
:: this way we get a %history diff containing all past events,
|
|
||||||
:: instead of so many individual %log diffs that we bail meme.
|
|
||||||
:: (to repro, replace this with `watch-eth-watcher`)
|
|
||||||
::
|
|
||||||
await-eth-watcher
|
|
||||||
==
|
|
||||||
::
|
|
||||||
++ wait
|
|
||||||
|= [=wire =@dr]
|
|
||||||
^- card
|
|
||||||
[%pass wire %arvo %b %wait (add now.bowl dr)]
|
|
||||||
::
|
|
||||||
++ wait-export (wait /export refresh-rate)
|
|
||||||
::
|
|
||||||
++ to-eth-watcher
|
|
||||||
|= [=wire =task:agent:gall]
|
|
||||||
^- card
|
|
||||||
[%pass wire %agent [our.bowl %eth-watcher] task]
|
|
||||||
::
|
|
||||||
++ setup-eth-watcher
|
|
||||||
%+ to-eth-watcher /setup
|
|
||||||
:+ %poke %eth-watcher-poke
|
|
||||||
!> ^- poke:eth-watcher
|
|
||||||
:+ %watch /[dap.bowl]
|
|
||||||
:* node-url
|
|
||||||
|
|
|
||||||
refresh-rate
|
|
||||||
timeout-time
|
|
||||||
public:mainnet-contracts
|
|
||||||
~
|
|
||||||
~[azimuth delegated-sending]:mainnet-contracts
|
|
||||||
~
|
|
||||||
~
|
|
||||||
==
|
|
||||||
::
|
|
||||||
:: see also comment in +setup-cards
|
|
||||||
++ await-eth-watcher (wait /watch ~m30)
|
|
||||||
::
|
|
||||||
++ watch-eth-watcher
|
|
||||||
%+ to-eth-watcher /watcher
|
|
||||||
[%watch /logs/[dap.bowl]]
|
|
||||||
::
|
|
||||||
++ leave-eth-watcher
|
|
||||||
%+ to-eth-watcher /watcher
|
|
||||||
[%leave ~]
|
|
||||||
::
|
|
||||||
++ clear-eth-watcher
|
|
||||||
%+ to-eth-watcher /clear
|
|
||||||
:+ %poke %eth-watcher-poke
|
|
||||||
!> ^- poke:eth-watcher
|
|
||||||
[%clear /logs/[dap.bowl]]
|
|
||||||
::
|
|
||||||
++ poke-spider
|
|
||||||
|= [=wire =cage]
|
|
||||||
^- card
|
|
||||||
[%pass wire %agent [our.bowl %spider] %poke cage]
|
|
||||||
::
|
|
||||||
++ watch-spider
|
|
||||||
|= [=wire =sub=path]
|
|
||||||
^- card
|
|
||||||
[%pass wire %agent [our.bowl %spider] %watch sub-path]
|
|
||||||
::
|
|
||||||
:: +handle-eth-watcher-diff: process new logs, clear state on rollback
|
|
||||||
::
|
|
||||||
:: processes logs for which we know the timestamp
|
|
||||||
:: adds timestamp-less logs to queue
|
|
||||||
::
|
|
||||||
++ handle-eth-watcher-diff
|
|
||||||
|= =diff:eth-watcher
|
|
||||||
^- (quip card _state)
|
|
||||||
=^ logs state
|
|
||||||
^- [loglist _state]
|
|
||||||
?- -.diff
|
|
||||||
%history ~& [%got-history (lent loglist.diff)]
|
|
||||||
[loglist.diff state(qued ~, seen ~)]
|
|
||||||
%logs ~& %got-log
|
|
||||||
[loglist.diff state]
|
|
||||||
%disavow ~& %disavow-unimplemented
|
|
||||||
[~ state]
|
|
||||||
==
|
|
||||||
%- process-logs
|
|
||||||
%+ skip logs
|
|
||||||
|= =event-log:rpc
|
|
||||||
%- is-lockup-block
|
|
||||||
block-number:(need mined.event-log)
|
|
||||||
::
|
|
||||||
:: +is-lockup-block: whether the block contains lockup/ignorable transactions
|
|
||||||
::
|
|
||||||
:: this is the stupid dumb equivalent to actually identifying lockup
|
|
||||||
:: transactions procedurally, which is still in git history, but didn't
|
|
||||||
:: work quite right for unidentified reasons
|
|
||||||
::
|
|
||||||
++ is-lockup-block
|
|
||||||
|= num=@ud
|
|
||||||
^- ?
|
|
||||||
%+ roll
|
|
||||||
^- (list [@ud @ud])
|
|
||||||
:~ [7.050.978 7.051.038]
|
|
||||||
==
|
|
||||||
|= [[start=@ud end=@ud] in=_|]
|
|
||||||
?: in &
|
|
||||||
&((gte num start) (lte num end))
|
|
||||||
::
|
|
||||||
:: +request-timestamps: request block timestamps for the logs as necessary
|
|
||||||
::
|
|
||||||
:: will come back as a thread result
|
|
||||||
::
|
|
||||||
++ request-timestamps
|
|
||||||
^- (quip card _state)
|
|
||||||
?~ qued [~ state]
|
|
||||||
?^ running [~ state]
|
|
||||||
=/ tid=@ta
|
|
||||||
%+ scot %ta
|
|
||||||
:((cury cat 3) dap.bowl '_' (scot %uv eny.bowl))
|
|
||||||
:_ state(running `tid)
|
|
||||||
:~ (watch-spider /timestamps/[tid] /thread-result/[tid])
|
|
||||||
::
|
|
||||||
%+ poke-spider /timestamps/[tid]
|
|
||||||
:- %spider-start
|
|
||||||
=- !>([~ `tid bec %eth-get-timestamps -])
|
|
||||||
!> ^- [@t (list @ud)]
|
|
||||||
:- node-url
|
|
||||||
=- ~(tap in -)
|
|
||||||
%- ~(gas in *(set @ud))
|
|
||||||
^- (list @ud)
|
|
||||||
%+ turn qued
|
|
||||||
|= log=event-log:rpc
|
|
||||||
block-number:(need mined.log)
|
|
||||||
==
|
|
||||||
::
|
|
||||||
:: +save-timestamps: store timestamps into state
|
|
||||||
::
|
|
||||||
++ save-timestamps
|
|
||||||
|= timestamps=(list [@ud @da])
|
|
||||||
^- (quip card _state)
|
|
||||||
=. time (~(gas by time) timestamps)
|
|
||||||
=. running ~
|
|
||||||
(process-logs ~)
|
|
||||||
::
|
|
||||||
:: +process-logs: handle new incoming logs
|
|
||||||
::
|
|
||||||
++ process-logs
|
|
||||||
|= new=loglist :: oldest first
|
|
||||||
^- (quip card _state)
|
|
||||||
=. qued (weld qued new)
|
|
||||||
?~ qued [~ state]
|
|
||||||
=- %_ request-timestamps
|
|
||||||
qued (flop rest) :: oldest first
|
|
||||||
seen (weld logs seen) :: newest first
|
|
||||||
days (count-events (flop logs)) :: oldest first
|
|
||||||
==
|
|
||||||
%+ roll `loglist`qued
|
|
||||||
|= [log=event-log:rpc [rest=loglist logs=(list [wen=@da wat=event])]]
|
|
||||||
:: to ensure logs are processed in sane order,
|
|
||||||
:: stop processing as soon as we skipped one
|
|
||||||
::
|
|
||||||
?^ rest [[log rest] logs]
|
|
||||||
=/ tim=(unit @da)
|
|
||||||
%- ~(get by time)
|
|
||||||
block-number:(need mined.log)
|
|
||||||
?~ tim [[log rest] logs]
|
|
||||||
:- rest
|
|
||||||
=+ ven=(event-log-to-event log)
|
|
||||||
?~ ven logs
|
|
||||||
[[u.tim u.ven] logs]
|
|
||||||
::
|
|
||||||
:: +event-log-to-event: turn raw log into gaze noun
|
|
||||||
::
|
|
||||||
++ event-log-to-event
|
|
||||||
|= log=event-log:rpc
|
|
||||||
^- (unit event)
|
|
||||||
?: =(azimuth:mainnet-contracts address.log)
|
|
||||||
=+ (event-log-to-point-diff log)
|
|
||||||
?~ - ~
|
|
||||||
`azimuth+u
|
|
||||||
?: =(delegated-sending:mainnet-contracts address.log)
|
|
||||||
?. .= i.topics.log
|
|
||||||
0x4763.8e3c.ddee.2204.81e4.c3f9.183d.639c.
|
|
||||||
0efe.a7f0.5fcd.2df4.1888.5572.9f71.5419
|
|
||||||
~
|
|
||||||
=/ [of=@ pool=@]
|
|
||||||
~| t.topics.log
|
|
||||||
%+ decode-topics:abi:ethereum t.topics.log
|
|
||||||
~[%uint %uint]
|
|
||||||
=/ [by=@ gift=@ to=@]
|
|
||||||
~| data.log
|
|
||||||
%+ decode-topics:abi:ethereum
|
|
||||||
%+ rash data.log
|
|
||||||
=- ;~(pfix (jest '0x') -)
|
|
||||||
%+ stun [3 3]
|
|
||||||
(bass 16 (stun [64 64] hit))
|
|
||||||
~[%uint %uint %address]
|
|
||||||
`invite+[by of gift to]
|
|
||||||
~
|
|
||||||
::
|
|
||||||
:: +count-events: add events to the daily stats
|
|
||||||
::
|
|
||||||
++ count-events
|
|
||||||
|= logs=_seen :: oldest first
|
|
||||||
^+ days
|
|
||||||
=/ head=[day=@da sat=stats]
|
|
||||||
?^ days i.days
|
|
||||||
*[@da stats]
|
|
||||||
=+ tail=?~(days ~ t.days)
|
|
||||||
|-
|
|
||||||
:: when done, store updated head, but only if it's set
|
|
||||||
::
|
|
||||||
?~ logs
|
|
||||||
?: =(*[@da stats] head) tail
|
|
||||||
[head tail]
|
|
||||||
=* log i.logs
|
|
||||||
:: calculate day for current event, set head if unset
|
|
||||||
::
|
|
||||||
=/ day=@da
|
|
||||||
(sub wen.log (mod wen.log ~d1))
|
|
||||||
=? day.head =(*@da day.head) day
|
|
||||||
:: same day as head, so add to it
|
|
||||||
::
|
|
||||||
?: =(day day.head)
|
|
||||||
%_ $
|
|
||||||
sat.head (count-event wat.log sat.head)
|
|
||||||
logs t.logs
|
|
||||||
==
|
|
||||||
~| [%weird-new-day old=day.head new=day]
|
|
||||||
?> (gth day day.head)
|
|
||||||
:: newer day than head of days, so start new head
|
|
||||||
::
|
|
||||||
%_ $
|
|
||||||
tail [head tail]
|
|
||||||
head [day *stats]
|
|
||||||
==
|
|
||||||
::
|
|
||||||
:: +count-event: add event to the stats, if it's relevant
|
|
||||||
::
|
|
||||||
++ count-event
|
|
||||||
|= [eve=event sat=stats]
|
|
||||||
^- stats
|
|
||||||
?- -.eve
|
|
||||||
%invite sat(invites-senders [by.eve invites-senders.sat])
|
|
||||||
::
|
|
||||||
%azimuth
|
|
||||||
?+ -.dif.eve sat
|
|
||||||
%spawned sat(spawned [who.dif.eve spawned.sat])
|
|
||||||
%activated sat(activated [who.eve activated.sat])
|
|
||||||
%transfer-proxy ?: =(0x0 new.dif.eve) sat
|
|
||||||
sat(transfer-p [who.eve transfer-p.sat])
|
|
||||||
%owner sat(transferred [who.eve transferred.sat])
|
|
||||||
%keys sat(configured [who.eve configured.sat])
|
|
||||||
%continuity sat(breached [who.eve breached.sat])
|
|
||||||
%escape ?~ new.dif.eve sat
|
|
||||||
sat(request [who.eve request.sat])
|
|
||||||
%sponsor ?. has.new.dif.eve sat
|
|
||||||
sat(sponsor [who.eve sponsor.sat])
|
|
||||||
%management-proxy sat(management-p [who.eve management-p.sat])
|
|
||||||
%voting-proxy sat(voting-p [who.eve voting-p.sat])
|
|
||||||
%spawn-proxy sat(spawn-p [who.eve spawn-p.sat])
|
|
||||||
==
|
|
||||||
==
|
|
||||||
::
|
|
||||||
::
|
|
||||||
:: +export: periodically export data
|
|
||||||
::
|
|
||||||
++ export
|
|
||||||
^- (list card)
|
|
||||||
:~ (export-move %days (export-days days))
|
|
||||||
(export-move %months (export-months days))
|
|
||||||
(export-move %events export-raw)
|
|
||||||
==
|
|
||||||
::
|
|
||||||
:: +export-move: %info move to write exported .txt
|
|
||||||
::
|
|
||||||
++ export-move
|
|
||||||
|= [nom=@t dat=(list @t)]
|
|
||||||
^- card
|
|
||||||
=- [%pass /export/[nom] %arvo %c %info -]
|
|
||||||
%+ foal:space:userlib
|
|
||||||
/(scot %p our.bowl)/base/(scot %da now.bowl)/gaze-exports/[nom]/txt
|
|
||||||
[%txt !>(dat)]
|
|
||||||
::
|
|
||||||
:: +peek-x: accept gall scry
|
|
||||||
::
|
|
||||||
:: %/days/txt: per day, digest stats
|
|
||||||
:: %/months/txt: per month, digest stats
|
|
||||||
:: %/raw/txt: all observed events
|
|
||||||
::
|
|
||||||
++ peek-x ::TODO
|
|
||||||
|= pax=path
|
|
||||||
^- (unit (unit (pair mark *)))
|
|
||||||
?~ pax ~
|
|
||||||
?: =(%days i.pax)
|
|
||||||
:^ ~ ~ %txt
|
|
||||||
(export-days days)
|
|
||||||
?: =(%months i.pax)
|
|
||||||
:^ ~ ~ %txt
|
|
||||||
(export-months days)
|
|
||||||
?: =(%raw i.pax)
|
|
||||||
``txt+export-raw
|
|
||||||
~
|
|
||||||
::
|
|
||||||
:: +export-months: generate a csv of stats per month
|
|
||||||
::
|
|
||||||
++ export-months
|
|
||||||
|= =_days
|
|
||||||
%- export-days
|
|
||||||
^+ days
|
|
||||||
%+ roll (flop days)
|
|
||||||
|= [[day=@da sat=stats] mos=(list [mod=@da sat=stats])]
|
|
||||||
^+ mos
|
|
||||||
=/ mod=@da
|
|
||||||
%- year
|
|
||||||
=+ (yore day)
|
|
||||||
-(d.t 1)
|
|
||||||
?~ mos [mod sat]~
|
|
||||||
?: !=(mod mod.i.mos)
|
|
||||||
[[mod sat] mos]
|
|
||||||
:_ t.mos
|
|
||||||
:- mod
|
|
||||||
::TODO this is hideous. can we make a wet gate do this?
|
|
||||||
:* (weld spawned.sat spawned.sat.i.mos)
|
|
||||||
(weld activated.sat activated.sat.i.mos)
|
|
||||||
(weld transfer-p.sat transfer-p.sat.i.mos)
|
|
||||||
(weld transferred.sat transferred.sat.i.mos)
|
|
||||||
(weld configured.sat configured.sat.i.mos)
|
|
||||||
(weld breached.sat breached.sat.i.mos)
|
|
||||||
(weld request.sat request.sat.i.mos)
|
|
||||||
(weld sponsor.sat sponsor.sat.i.mos)
|
|
||||||
(weld management-p.sat management-p.sat.i.mos)
|
|
||||||
(weld voting-p.sat voting-p.sat.i.mos)
|
|
||||||
(weld spawn-p.sat spawn-p.sat.i.mos)
|
|
||||||
(weld invites-senders.sat invites-senders.sat.i.mos)
|
|
||||||
==
|
|
||||||
::
|
|
||||||
:: +export-days: generate a csv of stats per day
|
|
||||||
::
|
|
||||||
++ export-days
|
|
||||||
|= =_days
|
|
||||||
:- %- crip
|
|
||||||
;: weld
|
|
||||||
"date,"
|
|
||||||
"spawned,"
|
|
||||||
"activated,"
|
|
||||||
"transfer proxy,"
|
|
||||||
"transferred,"
|
|
||||||
"transferred (unique),"
|
|
||||||
"configured,"
|
|
||||||
"configured (unique),"
|
|
||||||
"escape request,"
|
|
||||||
"sponsor change,"
|
|
||||||
"invites,"
|
|
||||||
"invites (unique senders)"
|
|
||||||
==
|
|
||||||
|^ ^- (list @t)
|
|
||||||
%+ turn days
|
|
||||||
|= [day=@da stats]
|
|
||||||
%- crip
|
|
||||||
;: weld
|
|
||||||
(scow %da day) ","
|
|
||||||
(count spawned) ","
|
|
||||||
(count activated) ","
|
|
||||||
(count transfer-p) ","
|
|
||||||
(unique transferred) ","
|
|
||||||
(unique configured) ","
|
|
||||||
(count request) ","
|
|
||||||
(count sponsor) ","
|
|
||||||
(unique invites-senders)
|
|
||||||
==
|
|
||||||
::
|
|
||||||
++ count
|
|
||||||
|* l=(list)
|
|
||||||
(num (lent l))
|
|
||||||
::
|
|
||||||
++ unique
|
|
||||||
|* l=(list)
|
|
||||||
;: weld
|
|
||||||
(count l)
|
|
||||||
","
|
|
||||||
(num ~(wyt in (~(gas in *(set)) l)))
|
|
||||||
==
|
|
||||||
::
|
|
||||||
++ num (d-co:co 1)
|
|
||||||
--
|
|
||||||
::
|
|
||||||
:: +export-raw: generate a csv of individual transactions
|
|
||||||
::
|
|
||||||
++ export-raw
|
|
||||||
:- %- crip
|
|
||||||
;: weld
|
|
||||||
"date,"
|
|
||||||
"point,"
|
|
||||||
"event,"
|
|
||||||
"field 1,field2,field3"
|
|
||||||
==
|
|
||||||
|^ ^- (list @t)
|
|
||||||
%+ turn seen
|
|
||||||
:: (cork tail event-to-row crip)
|
|
||||||
|= [wen=@da =event]
|
|
||||||
(crip "{(scow %da wen)},{(event-to-row event)}")
|
|
||||||
::
|
|
||||||
++ event-to-row
|
|
||||||
|= =event
|
|
||||||
?- -.event
|
|
||||||
%azimuth (point-diff-to-row +.event)
|
|
||||||
%invite (invite-to-row +.event)
|
|
||||||
==
|
|
||||||
::
|
|
||||||
++ point-diff-to-row
|
|
||||||
|= [who=ship dif=diff-point]
|
|
||||||
^- tape
|
|
||||||
%+ weld "{(pon who)},"
|
|
||||||
?- -.dif
|
|
||||||
%full "full,"
|
|
||||||
%owner "owner,{(adr new.dif)}"
|
|
||||||
%activated "activated,"
|
|
||||||
%spawned "spawned,{(pon who.dif)}"
|
|
||||||
%keys "keys,{(num life.dif)}"
|
|
||||||
%continuity "breached,{(num new.dif)}"
|
|
||||||
%sponsor "sponsor,{(spo has.new.dif)},{(pon who.new.dif)}"
|
|
||||||
%escape "escape-req,{(req new.dif)}"
|
|
||||||
%management-proxy "management-p,{(adr new.dif)}"
|
|
||||||
%voting-proxy "voting-p,{(adr new.dif)}"
|
|
||||||
%spawn-proxy "spawn-p,{(adr new.dif)}"
|
|
||||||
%transfer-proxy "transfer-p,{(adr new.dif)}"
|
|
||||||
==
|
|
||||||
::
|
|
||||||
++ invite-to-row
|
|
||||||
|= [by=ship of=ship ship to=address]
|
|
||||||
"{(pon by)},invite,{(pon of)},{(adr to)}"
|
|
||||||
::
|
|
||||||
++ num (d-co:co 1)
|
|
||||||
++ pon (cury scow %p)
|
|
||||||
++ adr |=(a=@ ['0' 'x' ((x-co:co (mul 2 20)) a)])
|
|
||||||
++ spo |=(h=? ?:(h "escaped to" "detached from"))
|
|
||||||
++ req |=(r=(unit @p) ?~(r "canceled" (pon u.r)))
|
|
||||||
--
|
|
||||||
--
|
|
@ -2,8 +2,8 @@
|
|||||||
/+ drum=hood-drum, helm=hood-helm, kiln=hood-kiln
|
/+ drum=hood-drum, helm=hood-helm, kiln=hood-kiln
|
||||||
|%
|
|%
|
||||||
+$ state
|
+$ state
|
||||||
$~ [%26 *state:drum *state:helm *state:kiln]
|
$~ [%27 *state:drum *state:helm *state:kiln]
|
||||||
$>(%26 any-state)
|
$>(%27 any-state)
|
||||||
::
|
::
|
||||||
+$ any-state
|
+$ any-state
|
||||||
$% [ver=?(%1 %2 %3 %4 %5 %6) lac=(map @tas fin-any-state)]
|
$% [ver=?(%1 %2 %3 %4 %5 %6) lac=(map @tas fin-any-state)]
|
||||||
@ -27,6 +27,7 @@
|
|||||||
[%24 drum=state-4:drum helm=state-2:helm kiln=state-10:kiln]
|
[%24 drum=state-4:drum helm=state-2:helm kiln=state-10:kiln]
|
||||||
[%25 drum=state-5:drum helm=state-2:helm kiln=state-10:kiln]
|
[%25 drum=state-5:drum helm=state-2:helm kiln=state-10:kiln]
|
||||||
[%26 drum=state-6:drum helm=state-2:helm kiln=state-10:kiln]
|
[%26 drum=state-6:drum helm=state-2:helm kiln=state-10:kiln]
|
||||||
|
[%27 drum=state-6:drum helm=state-2:helm kiln=state-11:kiln]
|
||||||
==
|
==
|
||||||
+$ any-state-tuple
|
+$ any-state-tuple
|
||||||
$: drum=any-state:drum
|
$: drum=any-state:drum
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
^- card:agent:gall
|
^- card:agent:gall
|
||||||
[%pass /import-all %agent [our.bowl app] %poke %import !>(data)]
|
[%pass /import-all %agent [our.bowl app] %poke %import !>(data)]
|
||||||
=/ jon=json
|
=/ jon=json
|
||||||
(need (de-json:html body))
|
(need (de:json:html body))
|
||||||
=/ com=command:lens
|
=/ com=command:lens
|
||||||
(json:grab:lens-mark jon)
|
(json:grab:lens-mark jon)
|
||||||
::
|
::
|
||||||
|
@ -9,126 +9,50 @@
|
|||||||
:: Note this issue manifests itself even for bootstrapping a planet to
|
:: Note this issue manifests itself even for bootstrapping a planet to
|
||||||
:: talk to its own star.
|
:: talk to its own star.
|
||||||
::
|
::
|
||||||
/+ default-agent, verb
|
/+ default-agent, verb, dbug
|
||||||
=* point point:kale
|
=* point point:kale
|
||||||
::
|
::
|
||||||
|%
|
|%
|
||||||
|
:: How often to ping our sponsor when we might be behind a NAT.
|
||||||
|
::
|
||||||
|
:: NAT timeouts are often pretty short for UDP entries. 5 minutes is
|
||||||
|
:: a common value. We use 25 seconds, same as Wireguard.
|
||||||
|
::
|
||||||
|
++ nat-timeout ~s25
|
||||||
|
::
|
||||||
|
:: How often to check our IP when we know we're not behind a NAT.
|
||||||
|
::
|
||||||
|
++ ip-timeout ~m5
|
||||||
|
::
|
||||||
|
:: Chosen because it's run by Cloudflare, and others I tried were
|
||||||
|
:: inconsistently slow.
|
||||||
|
::
|
||||||
|
++ ip-reflector 'https://icanhazip.com'
|
||||||
|
::
|
||||||
+$ card card:agent:gall
|
+$ card card:agent:gall
|
||||||
+$ ship-state
|
+$ ship-state
|
||||||
$% [%idle ~]
|
$% [%idle ~]
|
||||||
[%poking ~]
|
[%poking ~]
|
||||||
|
[%http until=@da]
|
||||||
[%waiting until=@da]
|
[%waiting until=@da]
|
||||||
==
|
==
|
||||||
|
+$ state-1
|
||||||
|
$: %1
|
||||||
|
ships=(set ship)
|
||||||
|
nonce=@ud
|
||||||
|
$= plan
|
||||||
|
$~ [%nat ~]
|
||||||
|
$% [%nat ~]
|
||||||
|
[%pub ip=(unit @t)]
|
||||||
|
==
|
||||||
|
==
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
=| state=[%0 ships=(map ship [=rift =ship-state])]
|
%- agent:dbug
|
||||||
|
::
|
||||||
|
=| state=state-1
|
||||||
=> |%
|
=> |%
|
||||||
:: +print-error: maybe +slog
|
:: Bind for the the writer monad on (quip effect state)
|
||||||
::
|
|
||||||
++ print-error
|
|
||||||
|= [=tape error=(unit tang)]
|
|
||||||
^+ same
|
|
||||||
?~ error same
|
|
||||||
%- (slog leaf+tape u.error) same
|
|
||||||
:: +set-timer: send a card to behn to set a timer
|
|
||||||
::
|
|
||||||
++ set-timer
|
|
||||||
|= [now=@da =ship]
|
|
||||||
^- (quip card _state)
|
|
||||||
=/ s (~(get by ships.state) ship)
|
|
||||||
?~ s
|
|
||||||
`state
|
|
||||||
?. ?=(%poking -.ship-state.u.s)
|
|
||||||
%- (slog leaf+"ping: strange state {<ship s>}" ~)
|
|
||||||
`state
|
|
||||||
:: NAT timeouts are often pretty short for UDP entries. 5
|
|
||||||
:: minutes is a common value. We use 25 seconds, same as Wireguard.
|
|
||||||
::
|
|
||||||
=/ until (add ~s25 now)
|
|
||||||
=. ships.state
|
|
||||||
(~(put by ships.state) ship u.s(ship-state [%waiting until]))
|
|
||||||
:_ state
|
|
||||||
=/ =wire /ping-wait/(scot %p ship)/(scot %da until)
|
|
||||||
[%pass wire %arvo %b %wait `@da`until]~
|
|
||||||
:: +send-ping: poke their %ping app
|
|
||||||
::
|
|
||||||
++ send-ping
|
|
||||||
|= [our=@p now=@da =ship]
|
|
||||||
^- (quip card _state)
|
|
||||||
::
|
|
||||||
?: =(our ship)
|
|
||||||
`state
|
|
||||||
=/ s (~(get by ships.state) ship)
|
|
||||||
?~ s
|
|
||||||
`state
|
|
||||||
?. ?=(%idle -.ship-state.u.s)
|
|
||||||
`state
|
|
||||||
:_ state(ships (~(put by ships.state) ship u.s(ship-state [%poking ~])))
|
|
||||||
[%pass /ping-send/(scot %p ship) %agent [ship %ping] %poke %noun !>(~)]~
|
|
||||||
:: +stop-ping-ship: stop listening to jael if not sponsor or old rift
|
|
||||||
::
|
|
||||||
++ stop-ping-ship
|
|
||||||
|= [our=@p now=@da =ship =old=rift =ship-state]
|
|
||||||
^- (quip card _state)
|
|
||||||
=+ .^(=new=rift %j /(scot %p our)/rift/(scot %da now)/(scot %p ship))
|
|
||||||
:: if nothing's changed about us, don't cancel
|
|
||||||
::
|
|
||||||
?: ?& =(old-rift new-rift)
|
|
||||||
(~(has in (silt (saxo:title our now our))) ship)
|
|
||||||
==
|
|
||||||
`state
|
|
||||||
:: otherwise, kill jael subscription and timer
|
|
||||||
::
|
|
||||||
:_ state(ships (~(del by ships.state) ship))
|
|
||||||
[%pass /jael/(scot %p ship) %arvo %j %nuke (silt ship ~)]~
|
|
||||||
:: +start-ping-ship: start listening to jael updates if not already
|
|
||||||
::
|
|
||||||
:: While %public-keys is idempotent in most senses, it does
|
|
||||||
:: trigger a response, and this function is called on that
|
|
||||||
:: response, so we need a guard to avoid an infinite loop.
|
|
||||||
::
|
|
||||||
++ start-ping-ship
|
|
||||||
|= [our=@p now=@da =ship]
|
|
||||||
^- (quip card _state)
|
|
||||||
::
|
|
||||||
?: (~(has by ships.state) ship)
|
|
||||||
(send-ping our now ship)
|
|
||||||
::
|
|
||||||
;< new-state=_state (rind card state)
|
|
||||||
=+ .^(=rift %j /(scot %p our)/rift/(scot %da now)/(scot %p ship))
|
|
||||||
:_ state(ships (~(put by ships.state) ship rift %idle ~))
|
|
||||||
[%pass /jael/(scot %p ship) %arvo %j %public-keys (silt ship ~)]~
|
|
||||||
=. state new-state
|
|
||||||
::
|
|
||||||
(send-ping our now ship)
|
|
||||||
:: +kick: idempotent operation to make clean start for all pings
|
|
||||||
::
|
|
||||||
++ kick
|
|
||||||
|= [our=@p now=@da]
|
|
||||||
^- (quip card _state)
|
|
||||||
?: =(%czar (clan:title our))
|
|
||||||
`state
|
|
||||||
::
|
|
||||||
=/ old-ships=(list [=ship =rift =ship-state]) ~(tap by ships.state)
|
|
||||||
|- ^- (quip card _state)
|
|
||||||
=* loop $
|
|
||||||
?^ old-ships
|
|
||||||
;< new-state=_state (rind card state)
|
|
||||||
(stop-ping-ship our now i.old-ships)
|
|
||||||
=. state new-state
|
|
||||||
loop(old-ships t.old-ships)
|
|
||||||
::
|
|
||||||
=/ new-ships (saxo:title our now our)
|
|
||||||
|- ^- (quip card _state)
|
|
||||||
=* loop $
|
|
||||||
?^ new-ships
|
|
||||||
;< new-state=_state (rind card state)
|
|
||||||
(start-ping-ship our now i.new-ships)
|
|
||||||
=. state new-state
|
|
||||||
loop(new-ships t.new-ships)
|
|
||||||
::
|
|
||||||
`state
|
|
||||||
:: +rind: bind for the the writer monad on (quip effect state)
|
|
||||||
::
|
::
|
||||||
++ rind
|
++ rind
|
||||||
|* [effect=mold state=*]
|
|* [effect=mold state=*]
|
||||||
@ -141,6 +65,211 @@
|
|||||||
=^ effects-2=(list effect) state (fun state)
|
=^ effects-2=(list effect) state (fun state)
|
||||||
[(weld effects-1 effects-2) state]
|
[(weld effects-1 effects-2) state]
|
||||||
::
|
::
|
||||||
|
++ once
|
||||||
|
|= =cord
|
||||||
|
=(cord (scot %uw nonce.state))
|
||||||
|
::
|
||||||
|
:: Subsystem to keep track of which ships to ping across breaches
|
||||||
|
:: and sponsorship changes
|
||||||
|
::
|
||||||
|
++ ships
|
||||||
|
|%
|
||||||
|
++ rind (^rind card state)
|
||||||
|
++ kick
|
||||||
|
|= [our=@p now=@da]
|
||||||
|
^- (quip card _state)
|
||||||
|
:: ?: =(%czar (clan:title our))
|
||||||
|
:: `state
|
||||||
|
::
|
||||||
|
:: NB: !! This includes our own ship, and for moons, this is
|
||||||
|
:: what has caused Jael to fetch our own rift from our parent.
|
||||||
|
:: This role may be taken by Ames's subscription to
|
||||||
|
:: %public-keys, but this must be tested before changing the
|
||||||
|
:: behavior here.
|
||||||
|
::
|
||||||
|
=/ new-ships (~(gas in *(set ship)) (saxo:title our now our))
|
||||||
|
=/ removed (~(dif in ships.state) new-ships)
|
||||||
|
=/ added (~(dif in new-ships) ships.state)
|
||||||
|
;< new-state=_state rind
|
||||||
|
?~ removed `state
|
||||||
|
[[%pass /jael %arvo %j %nuke removed]~ state]
|
||||||
|
=. state new-state
|
||||||
|
::
|
||||||
|
;< new-state=_state rind
|
||||||
|
?~ added `state
|
||||||
|
[[%pass /jael %arvo %j %public-keys added]~ state]
|
||||||
|
=. state new-state
|
||||||
|
::
|
||||||
|
:: Kick even if ships weren't added or removed
|
||||||
|
::
|
||||||
|
(kick-pings our now new-ships)
|
||||||
|
::
|
||||||
|
:: Kick whenever we get a response. We really care about
|
||||||
|
:: breaches and sponsorship changes.
|
||||||
|
::
|
||||||
|
:: Delay until next event in case of breach, so that ames can
|
||||||
|
:: clear its state.
|
||||||
|
::
|
||||||
|
++ take-jael
|
||||||
|
|= now=@da
|
||||||
|
^- (quip card _state)
|
||||||
|
[[%pass /jael/delay %arvo %b %wait now]~ state]
|
||||||
|
::
|
||||||
|
++ take-delay kick
|
||||||
|
--
|
||||||
|
::
|
||||||
|
:: Starts pinging a new set of `ships`.
|
||||||
|
::
|
||||||
|
++ kick-pings
|
||||||
|
|= [our=@p now=@da ships=(set ship)]
|
||||||
|
^- (quip card _state)
|
||||||
|
=: nonce.state +(nonce.state)
|
||||||
|
ships.state ships
|
||||||
|
==
|
||||||
|
::
|
||||||
|
?: ?=(%nat -.plan.state)
|
||||||
|
(kick:nat our)
|
||||||
|
(kick:pub our now)
|
||||||
|
::
|
||||||
|
:: Subsystem for pinging our sponsors when we might be behind a NAT
|
||||||
|
::
|
||||||
|
:: Ping each ship every 25 seconds to keep the pinhole open.
|
||||||
|
:: This is expensive, but if you don't do it and you are behind a
|
||||||
|
:: NAT, you will stop receiving packets from other ships except
|
||||||
|
:: during the 30 seconds following each packet you send.
|
||||||
|
::
|
||||||
|
++ nat
|
||||||
|
?> ?=(%nat -.plan.state)
|
||||||
|
|%
|
||||||
|
++ rind (^rind card state)
|
||||||
|
++ kick
|
||||||
|
|= our=@p
|
||||||
|
^- (quip card _state)
|
||||||
|
=/ ships ~(tap in ships.state)
|
||||||
|
|- ^- (quip card _state)
|
||||||
|
?~ ships `state
|
||||||
|
?: =(our i.ships) $(ships t.ships)
|
||||||
|
;< new-state=_state rind (send-ping i.ships)
|
||||||
|
=. state new-state
|
||||||
|
$(ships t.ships)
|
||||||
|
::
|
||||||
|
++ send-ping
|
||||||
|
|= =ship
|
||||||
|
^- (quip card _state)
|
||||||
|
:_ state
|
||||||
|
=/ wire /nat/(scot %uw nonce.state)/ping/(scot %p ship)
|
||||||
|
[%pass wire %agent [ship %ping] %poke %noun !>(~)]~
|
||||||
|
::
|
||||||
|
++ take-ping
|
||||||
|
|= [now=@da =wire error=(unit tang)]
|
||||||
|
^- (quip card _state)
|
||||||
|
?. ?=([%nat @ %ping @ ~] wire) `state
|
||||||
|
?. (once i.t.wire) `state
|
||||||
|
=/ ship (slav %p i.t.t.t.wire)
|
||||||
|
%- (slog ?~(error ~ ['ping: got nack' >ship< u.error]))
|
||||||
|
:_ state
|
||||||
|
=/ wire /nat/(scot %uw nonce.state)/wait/(scot %p ship)
|
||||||
|
[%pass wire %arvo %b %wait (add nat-timeout now)]~
|
||||||
|
::
|
||||||
|
++ take-wait
|
||||||
|
|= =wire
|
||||||
|
^- (quip card _state)
|
||||||
|
?. ?=([%nat @ %wait @ ~] wire) `state
|
||||||
|
?. (once i.t.wire) `state
|
||||||
|
=/ ship (slav %p i.t.t.t.wire)
|
||||||
|
(send-ping ship)
|
||||||
|
--
|
||||||
|
::
|
||||||
|
:: Subsystem for pinging our sponsors when we know we're not behind a NAT
|
||||||
|
::
|
||||||
|
:: Check our IP address every minute, and only if it changes,
|
||||||
|
:: ping all our sponsors.
|
||||||
|
::
|
||||||
|
++ pub
|
||||||
|
?> ?=(%pub -.plan.state)
|
||||||
|
|%
|
||||||
|
++ rind (^rind card state)
|
||||||
|
++ kick
|
||||||
|
|= [our=@p now=@da]
|
||||||
|
^- (quip card _state)
|
||||||
|
;< new-state=_state rind (send-pings our)
|
||||||
|
=. state new-state
|
||||||
|
::
|
||||||
|
;< new-state=_state rind check-ip
|
||||||
|
=. state new-state
|
||||||
|
::
|
||||||
|
(set-timer now)
|
||||||
|
::
|
||||||
|
++ send-pings
|
||||||
|
|= our=@p
|
||||||
|
^- (quip card _state)
|
||||||
|
:_ state
|
||||||
|
%+ murn ~(tap in ships.state)
|
||||||
|
|= =ship
|
||||||
|
?: =(our ship)
|
||||||
|
~
|
||||||
|
=/ wire /pub/(scot %uw nonce.state)/ping/(scot %p ship)
|
||||||
|
`u=[%pass wire %agent [ship %ping] %poke %noun !>(~)]
|
||||||
|
::
|
||||||
|
++ take-pings
|
||||||
|
|= [=wire error=(unit tang)]
|
||||||
|
^- (quip card _state)
|
||||||
|
?. ?=([%pub @ %ping @ ~] wire) `state
|
||||||
|
?. (once i.t.wire) `state
|
||||||
|
=/ ship (slav %p i.t.t.t.wire)
|
||||||
|
%- (slog ?~(error ~ ['ping: got nack' >ship< u.error]))
|
||||||
|
`state
|
||||||
|
::
|
||||||
|
++ check-ip
|
||||||
|
^- (quip card _state)
|
||||||
|
:_ state
|
||||||
|
=/ wire /pub/(scot %uw nonce.state)/ip
|
||||||
|
=/ =request:http [%'GET' ip-reflector ~ ~]
|
||||||
|
[%pass wire %arvo %i %request request *outbound-config:iris]~
|
||||||
|
::
|
||||||
|
++ take-ip
|
||||||
|
|= [our=@p =wire resp=client-response:iris]
|
||||||
|
^- (quip card _state)
|
||||||
|
?. ?=([%pub @ %ip ~] wire) `state
|
||||||
|
?. (once i.t.wire) `state
|
||||||
|
::
|
||||||
|
?. ?=(%finished -.resp) `state :: will retry in a minute
|
||||||
|
?. ?=(%200 status-code.response-header.resp)
|
||||||
|
=* s status-code.response-header.resp
|
||||||
|
%- (slog leaf+"ping: ip check failed: {<s>}" ~)
|
||||||
|
`state
|
||||||
|
::
|
||||||
|
?~ full-file.resp
|
||||||
|
%- (slog 'ping: ip check body empty' ~)
|
||||||
|
`state
|
||||||
|
::
|
||||||
|
=* body q.data.u.full-file.resp
|
||||||
|
?~ body
|
||||||
|
%- (slog 'ping: ip check body empty' ~)
|
||||||
|
`state
|
||||||
|
::
|
||||||
|
=/ ip (end [3 (dec (met 3 body))] body)
|
||||||
|
?: =(ip.plan.state `ip) `state
|
||||||
|
::
|
||||||
|
=. ip.plan.state `ip
|
||||||
|
(send-pings our)
|
||||||
|
::
|
||||||
|
++ set-timer
|
||||||
|
|= now=@da
|
||||||
|
^- (quip card _state)
|
||||||
|
=/ =wire /pub/(scot %uw nonce.state)/wait
|
||||||
|
[[%pass wire %arvo %b %wait (add ip-timeout now)]~ state]
|
||||||
|
::
|
||||||
|
++ take-wait
|
||||||
|
|= [our=@p now=@da =wire]
|
||||||
|
^- (quip card _state)
|
||||||
|
?. ?=([%pub @ %wait ~] wire) `state
|
||||||
|
?. (once i.t.wire) `state
|
||||||
|
;< new-state=_state rind check-ip
|
||||||
|
=. state new-state
|
||||||
|
::
|
||||||
|
(set-timer now)
|
||||||
|
--
|
||||||
--
|
--
|
||||||
%+ verb |
|
%+ verb |
|
||||||
^- agent:gall
|
^- agent:gall
|
||||||
@ -152,25 +281,47 @@
|
|||||||
::
|
::
|
||||||
++ on-init
|
++ on-init
|
||||||
^- [(list card) _this]
|
^- [(list card) _this]
|
||||||
=^ cards state (kick our.bowl now.bowl)
|
=. plan.state [%nat ~]
|
||||||
|
=^ cards state (kick:ships our.bowl now.bowl)
|
||||||
[cards this]
|
[cards this]
|
||||||
::
|
::
|
||||||
++ on-save !>(state)
|
++ on-save !>(state)
|
||||||
++ on-load
|
++ on-load
|
||||||
|= old=vase
|
|= old-vase=vase
|
||||||
=. state !<(_state old)
|
|^
|
||||||
(on-poke %noun !>(%kick))
|
=/ old !<(state-any old-vase)
|
||||||
|
=? old ?=(%0 -.old) (state-0-to-1 old)
|
||||||
|
?> ?=(%1 -.old)
|
||||||
|
=. state old
|
||||||
|
=^ cards state (kick:ships our.bowl now.bowl)
|
||||||
|
[cards this]
|
||||||
|
::
|
||||||
|
+$ state-any $%(state-0 state-1)
|
||||||
|
+$ state-0 [%0 ships=(map ship [=rift =ship-state])]
|
||||||
|
::
|
||||||
|
++ state-0-to-1
|
||||||
|
|= old=state-0
|
||||||
|
^- state-1
|
||||||
|
[%1 ~ 0 %nat ~]
|
||||||
|
--
|
||||||
:: +on-poke: positively acknowledge pokes
|
:: +on-poke: positively acknowledge pokes
|
||||||
::
|
::
|
||||||
++ on-poke
|
++ on-poke
|
||||||
|= [=mark =vase]
|
|= [=mark =vase]
|
||||||
?: =(q.vase %kick)
|
?. =(our src):bowl :: don't crash, this is where pings are handled
|
||||||
=. ships.state
|
`this
|
||||||
%- ~(run by ships.state)
|
::
|
||||||
|= [=rift =ship-state]
|
=^ cards state
|
||||||
[999.999 ship-state]
|
?: =(q.vase %kick) :: NB: ames calls this on %born
|
||||||
on-init
|
(kick:ships our.bowl now.bowl)
|
||||||
`this
|
?: =(q.vase %nat)
|
||||||
|
=. plan.state [%nat ~]
|
||||||
|
(kick:ships our.bowl now.bowl)
|
||||||
|
?: =(q.vase %no-nat)
|
||||||
|
=. plan.state [%pub ~]
|
||||||
|
(kick:ships our.bowl now.bowl)
|
||||||
|
`state
|
||||||
|
[cards this]
|
||||||
::
|
::
|
||||||
++ on-watch on-watch:def
|
++ on-watch on-watch:def
|
||||||
++ on-leave on-leave:def
|
++ on-leave on-leave:def
|
||||||
@ -183,46 +334,56 @@
|
|||||||
++ on-agent
|
++ on-agent
|
||||||
|= [=wire =sign:agent:gall]
|
|= [=wire =sign:agent:gall]
|
||||||
^- [(list card) _this]
|
^- [(list card) _this]
|
||||||
?> ?=([%ping-send @ ~] wire)
|
|
||||||
?> ?=(%poke-ack -.sign)
|
|
||||||
::
|
|
||||||
%- (print-error "ping: ack" p.sign)
|
|
||||||
=^ cards state
|
=^ cards state
|
||||||
(set-timer now.bowl (slav %p i.t.wire))
|
?+ wire `state
|
||||||
|
[%nat *]
|
||||||
|
?. ?=(%nat -.plan.state) `state
|
||||||
|
?. ?=(%poke-ack -.sign) `state
|
||||||
|
(take-ping:nat now.bowl wire p.sign)
|
||||||
|
::
|
||||||
|
[%pub *]
|
||||||
|
?. ?=(%pub -.plan.state) `state
|
||||||
|
?. ?=(%poke-ack -.sign) `state
|
||||||
|
(take-pings:pub wire p.sign)
|
||||||
|
==
|
||||||
[cards this]
|
[cards this]
|
||||||
:: +on-arvo: handle timer firing
|
:: +on-arvo: handle timer firing
|
||||||
::
|
::
|
||||||
++ on-arvo
|
++ on-arvo
|
||||||
|= [=wire =sign-arvo]
|
|= [=wire =sign-arvo]
|
||||||
^- [(list card) _this]
|
^- [(list card) _this]
|
||||||
?+ wire !!
|
=^ cards state
|
||||||
[%ping-wait @ @ ~]
|
?+ wire `state
|
||||||
?> ?=(%wake +<.sign-arvo)
|
[%jael %delay ~]
|
||||||
=/ =ship (slav %p i.t.wire)
|
?> ?=(%wake +<.sign-arvo)
|
||||||
=/ until=@da (slav %da i.t.t.wire)
|
?^ error.sign-arvo
|
||||||
=/ s (~(get by ships.state) ship)
|
%- (slog 'ping: strange jael wake fail!' u.error.sign-arvo)
|
||||||
?~ s
|
`state
|
||||||
`this
|
(take-delay:ships our.bowl now.bowl)
|
||||||
?. =([%waiting until] ship-state.u.s)
|
|
||||||
`this
|
|
||||||
=. ships.state (~(put by ships.state) ship u.s(ship-state [%idle ~]))
|
|
||||||
%- (print-error "ping: wake" error.sign-arvo)
|
|
||||||
=^ cards state
|
|
||||||
(send-ping our.bowl now.bowl ship)
|
|
||||||
[cards this]
|
|
||||||
::
|
|
||||||
[%jael @ ~]
|
|
||||||
:: whenever we get an update from Jael, kick
|
|
||||||
::
|
::
|
||||||
?> ?=(%public-keys +<.sign-arvo)
|
[%jael ~]
|
||||||
:_ this
|
?> ?=(%public-keys +<.sign-arvo)
|
||||||
[%pass /delay %arvo %b %wait now.bowl]~
|
(take-jael:ships now.bowl)
|
||||||
:: Delayed until next event so that ames can clear its state
|
::
|
||||||
::
|
[%nat *]
|
||||||
[%delay ~]
|
?. ?=(%nat -.plan.state) `state
|
||||||
?> ?=(%wake +<.sign-arvo)
|
?> ?=(%wake +<.sign-arvo)
|
||||||
on-init
|
?^ error.sign-arvo
|
||||||
==
|
%- (slog 'ping: strange nat wake fail!' u.error.sign-arvo)
|
||||||
|
`state
|
||||||
|
(take-wait:nat wire)
|
||||||
|
::
|
||||||
|
[%pub @ %ip *]
|
||||||
|
?. ?=(%pub -.plan.state) `state
|
||||||
|
?> ?=(%http-response +<.sign-arvo)
|
||||||
|
(take-ip:pub our.bowl wire client-response.sign-arvo)
|
||||||
|
::
|
||||||
|
[%pub @ %wait *]
|
||||||
|
?. ?=(%pub -.plan.state) `state
|
||||||
|
?> ?=(%wake +<.sign-arvo)
|
||||||
|
(take-wait:pub our.bowl now.bowl wire)
|
||||||
|
==
|
||||||
|
[cards this]
|
||||||
::
|
::
|
||||||
++ on-fail on-fail:def
|
++ on-fail on-fail:def
|
||||||
--
|
--
|
||||||
|
@ -45,7 +45,6 @@
|
|||||||
|= [=mark =vase]
|
|= [=mark =vase]
|
||||||
^- (quip card _this)
|
^- (quip card _this)
|
||||||
|^
|
|^
|
||||||
?> (team:title our.bowl src.bowl)
|
|
||||||
?+ mark (on-poke:def mark vase)
|
?+ mark (on-poke:def mark vase)
|
||||||
%handle-http-request
|
%handle-http-request
|
||||||
=+ !<([id=@ta req=inbound-request:eyre] vase)
|
=+ !<([id=@ta req=inbound-request:eyre] vase)
|
||||||
@ -53,6 +52,7 @@
|
|||||||
(handle-http-request id req)
|
(handle-http-request id req)
|
||||||
::
|
::
|
||||||
%azimuth-action
|
%azimuth-action
|
||||||
|
?> (team:title our.bowl src.bowl)
|
||||||
=+ !<([%disconnect bind=binding:eyre] vase)
|
=+ !<([%disconnect bind=binding:eyre] vase)
|
||||||
~& >>> "disconnecting at {<bind>}"
|
~& >>> "disconnecting at {<bind>}"
|
||||||
:_ this
|
:_ this
|
||||||
@ -89,7 +89,6 @@
|
|||||||
++ on-watch
|
++ on-watch
|
||||||
|= =path
|
|= =path
|
||||||
^- (quip card _this)
|
^- (quip card _this)
|
||||||
?> (team:title our.bowl src.bowl)
|
|
||||||
?+ path (on-watch:def path)
|
?+ path (on-watch:def path)
|
||||||
[%http-response *] [~ this]
|
[%http-response *] [~ this]
|
||||||
==
|
==
|
||||||
|
@ -363,7 +363,7 @@
|
|||||||
++ state-0
|
++ state-0
|
||||||
$: %0
|
$: %0
|
||||||
pending=(list pend-tx)
|
pending=(list pend-tx)
|
||||||
sending=(tree [l1-tx-pointer send-tx])
|
sending=(tree [l1-tx-pointer old-send-tx-4])
|
||||||
finding=(map keccak ?(%confirmed %failed [=time l1-tx-pointer]))
|
finding=(map keccak ?(%confirmed %failed [=time l1-tx-pointer]))
|
||||||
history=(map address:ethereum (tree hist-tx))
|
history=(map address:ethereum (tree hist-tx))
|
||||||
next-nonce=(unit @ud)
|
next-nonce=(unit @ud)
|
||||||
|
@ -315,7 +315,7 @@
|
|||||||
::
|
::
|
||||||
=/ tube (convert-tube %json input-mark desk bowl)
|
=/ tube (convert-tube %json input-mark desk bowl)
|
||||||
?> ?=(^ body.request.inbound-request)
|
?> ?=(^ body.request.inbound-request)
|
||||||
=/ body=json (need (de-json:html q.u.body.request.inbound-request))
|
=/ body=json (need (de:json:html q.u.body.request.inbound-request))
|
||||||
=/ input=vase (slop !>(~) (tube !>(body)))
|
=/ input=vase (slop !>(~) (tube !>(body)))
|
||||||
=/ boc bec
|
=/ boc bec
|
||||||
=/ =start-args:spider [~ `tid boc(q desk, r da+now.bowl) thread input]
|
=/ =start-args:spider [~ `tid boc(q desk, r da+now.bowl) thread input]
|
||||||
@ -554,9 +554,13 @@
|
|||||||
~
|
~
|
||||||
%+ give-simple-payload:app:server u.eyre-id
|
%+ give-simple-payload:app:server u.eyre-id
|
||||||
^- simple-payload:http
|
^- simple-payload:http
|
||||||
:_ ~ :_ ~
|
|
||||||
?. ?=(http-error:spider term)
|
?. ?=(http-error:spider term)
|
||||||
((slog tang) 500)
|
%- (slog tang)
|
||||||
|
=/ tube (convert-tube %tang %json desk bowl)
|
||||||
|
:- [500 [['content-type' 'application/json'] ~]]
|
||||||
|
=- `(as-octs:mimes:html (en:json:html -))
|
||||||
|
o/(malt `(list [key=@t json])`[term+s/term tang+!<(json (tube !>(tang))) ~])
|
||||||
|
:_ ~ :_ ~
|
||||||
?- term
|
?- term
|
||||||
%bad-request 400
|
%bad-request 400
|
||||||
%forbidden 403
|
%forbidden 403
|
||||||
@ -570,9 +574,9 @@
|
|||||||
::%- (slog leaf+"strand {<yarn>} failed" leaf+<term> tang)
|
::%- (slog leaf+"strand {<yarn>} failed" leaf+<term> tang)
|
||||||
=/ =tid (yarn-to-tid yarn)
|
=/ =tid (yarn-to-tid yarn)
|
||||||
=/ fail-cards (thread-say-fail tid term tang)
|
=/ fail-cards (thread-say-fail tid term tang)
|
||||||
=^ cards state (thread-clean yarn)
|
|
||||||
=^ http-cards state (thread-http-fail tid term tang)
|
=^ http-cards state (thread-http-fail tid term tang)
|
||||||
=^ scry-card state (cancel-scry tid silent=%.n)
|
=^ scry-card state (cancel-scry tid silent=%.n)
|
||||||
|
=^ cards state (thread-clean yarn)
|
||||||
:_ state
|
:_ state
|
||||||
:(weld fail-cards cards http-cards scry-card)
|
:(weld fail-cards cards http-cards scry-card)
|
||||||
::
|
::
|
||||||
|
6
pkg/arvo/gen/hood/approve-merge.hoon
Normal file
6
pkg/arvo/gen/hood/approve-merge.hoon
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
:- %say
|
||||||
|
|= $: [now=@da eny=@uvJ bec=beak]
|
||||||
|
[syd=desk her=ship sud=desk approve=? ~]
|
||||||
|
~
|
||||||
|
==
|
||||||
|
kiln-approve-merge+[[syd her sud] approve]
|
@ -4,6 +4,88 @@
|
|||||||
:: To actually close the flows, run with |close-flows, =dry |
|
:: To actually close the flows, run with |close-flows, =dry |
|
||||||
::
|
::
|
||||||
:- %say
|
:- %say
|
||||||
|= [^ arg=~ dry=?]
|
|= [[now=@da eny=@uvJ bec=beak] arg=~ peer=(unit @p) dry=? veb=?]
|
||||||
::
|
::
|
||||||
[%helm-ames-kroc dry]
|
=/ peers-map
|
||||||
|
.^((map ship ?(%alien %known)) %ax /(scot %p p.bec)//(scot %da now)/peers)
|
||||||
|
::
|
||||||
|
=/ peers=(list ship)
|
||||||
|
%+ murn ~(tap by peers-map)
|
||||||
|
|= [=ship val=?(%alien %known)]
|
||||||
|
?: =(ship p.bec)
|
||||||
|
~ :: this is weird, but we saw it
|
||||||
|
?- val
|
||||||
|
%alien ~
|
||||||
|
%known (some ship)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
=; bones=(list [ship bone])
|
||||||
|
:- %helm-ames-kroc
|
||||||
|
~? dry "#{<(lent bones)>} flows can be closed"
|
||||||
|
dry^bones
|
||||||
|
::
|
||||||
|
%+ roll peers
|
||||||
|
|= [=ship bones=(list [ship bone])]
|
||||||
|
?: &(?=(^ peer) !=(u.peer ship))
|
||||||
|
bones
|
||||||
|
::
|
||||||
|
=+ .^ =ship-state:ames
|
||||||
|
%ax /(scot %p p.bec)//(scot %da now)/peers/(scot %p ship)
|
||||||
|
==
|
||||||
|
=/ =peer-state:ames ?>(?=(%known -.ship-state) +.ship-state)
|
||||||
|
|^
|
||||||
|
=/ subs=(jar path [bone sub-nonce=@]) resubscriptions
|
||||||
|
%+ roll ~(tap by subs)
|
||||||
|
|= [[=wire flows=(list [bone sub-nonce=@])] bones=_bones]
|
||||||
|
::
|
||||||
|
%- flop %- tail
|
||||||
|
%+ roll (sort flows |=([[@ n=@] [@ m=@]] (lte n m)))
|
||||||
|
|= [[=bone nonce=@] resubs=_(lent flows) bones=_bones]
|
||||||
|
=/ app=term ?>(?=([%gall %use sub=@ *] wire) i.t.t.wire)
|
||||||
|
=/ =path (slag 7 wire)
|
||||||
|
=/ log=tape "[bone={<bone>} agent={<app>} nonce={<nonce>}] {<path>}"
|
||||||
|
=; corkable=?
|
||||||
|
=? bones corkable [[ship bone] bones]
|
||||||
|
(dec resubs)^bones
|
||||||
|
:: checks if this is a stale re-subscription
|
||||||
|
::
|
||||||
|
?. =(resubs 1)
|
||||||
|
~? veb [ship (weld "stale %watch plea " log)]
|
||||||
|
&
|
||||||
|
:: the current subscription can be safely corked if there
|
||||||
|
:: is a flow with a naxplanation ack on a backward bone
|
||||||
|
::
|
||||||
|
=+ backward-bone=(mix 0b10 bone)
|
||||||
|
?. =(%2 (mod backward-bone 4))
|
||||||
|
|
|
||||||
|
?~ (~(get by rcv.peer-state) backward-bone)
|
||||||
|
|
|
||||||
|
~? veb [ship (weld "failed %watch plea " log)]
|
||||||
|
&
|
||||||
|
::
|
||||||
|
++ resubscriptions
|
||||||
|
%+ roll ~(tap by snd.peer-state)
|
||||||
|
|= $: [=forward=bone message-pump-state:ames]
|
||||||
|
subs=(jar path [bone sub-nonce=@])
|
||||||
|
==
|
||||||
|
?: (~(has in closing.peer-state) forward-bone)
|
||||||
|
~? veb
|
||||||
|
:- ship
|
||||||
|
%+ weld "stale flow bone={<forward-bone>} in closing, "
|
||||||
|
"#{<~(wyt in live:packet-pump-state)>} packets retrying"
|
||||||
|
subs
|
||||||
|
?~ duct=(~(get by by-bone.ossuary.peer-state) forward-bone)
|
||||||
|
subs
|
||||||
|
?. ?=([* [%gall %use sub=@ @ %out @ @ *] *] u.duct)
|
||||||
|
subs
|
||||||
|
=/ =wire i.t.u.duct
|
||||||
|
=/ nonce=(unit @) ?~((slag 7 wire) ~ (slaw %ud &8.wire))
|
||||||
|
%- ~(add ja subs)
|
||||||
|
:: 0 for old pre-nonce subscriptions
|
||||||
|
::
|
||||||
|
:_ [forward-bone ?~(nonce 0 u.nonce)]
|
||||||
|
?~ nonce wire
|
||||||
|
:: don't include the sub-nonce in the key
|
||||||
|
::
|
||||||
|
(weld (scag 7 wire) (slag 8 wire))
|
||||||
|
--
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
:- %say
|
|
||||||
|= [^ [dap=term wake=$@(~ [%wake ~])] ~]
|
|
||||||
=/ mode ?@(wake %idle %jolt)
|
|
||||||
[%helm-pass %g %fade dap mode]
|
|
@ -1,17 +0,0 @@
|
|||||||
:: Drum: destroy app
|
|
||||||
::
|
|
||||||
:::: /hoon/fade/hood/gen
|
|
||||||
::
|
|
||||||
/? 310
|
|
||||||
::
|
|
||||||
::::
|
|
||||||
::
|
|
||||||
:- %say
|
|
||||||
|= $: [now=@da eny=@uvJ bec=beak]
|
|
||||||
[arg=[@ $@(~ [@ ~])] ~]
|
|
||||||
==
|
|
||||||
:- %drum-fade
|
|
||||||
?> ((sane %tas) -.arg)
|
|
||||||
?@ +.arg [q.bec -.arg]
|
|
||||||
?> ((sane %tas) +<.arg)
|
|
||||||
[-.arg +<.arg]
|
|
6
pkg/arvo/gen/hood/global-automerge.hoon
Normal file
6
pkg/arvo/gen/hood/global-automerge.hoon
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
:- %say
|
||||||
|
|= $: [now=@da eny=@uvJ bec=beak]
|
||||||
|
[auto=? ~]
|
||||||
|
~
|
||||||
|
==
|
||||||
|
kiln-global-automerge+auto
|
6
pkg/arvo/gen/hood/jump/approve.hoon
Normal file
6
pkg/arvo/gen/hood/jump/approve.hoon
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
:- %say
|
||||||
|
|= $: [now=@da eny=@uvJ bec=beak]
|
||||||
|
[old=dock new=dock ~]
|
||||||
|
~
|
||||||
|
==
|
||||||
|
kiln-jump-opt+[old new &]
|
16
pkg/arvo/gen/hood/jump/propose.hoon
Normal file
16
pkg/arvo/gen/hood/jump/propose.hoon
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/+ *generators
|
||||||
|
:- %ask
|
||||||
|
|= $: [now=@da eny=@uvJ bec=beak]
|
||||||
|
[syd=desk her=ship sud=desk ~]
|
||||||
|
hard=_|
|
||||||
|
==
|
||||||
|
?: hard (produce %kiln-jump-propose syd her sud)
|
||||||
|
=/ msg
|
||||||
|
leaf+"Are you sure you want to tell subscribers to get ".
|
||||||
|
"updates for {<syd>} from {<her>}/{(trip sud)}?"
|
||||||
|
%+ print msg
|
||||||
|
%+ prompt [%& %prompt "(y/N) "]
|
||||||
|
|= in=tape
|
||||||
|
?. |(=("y" in) =("Y" in) =("yes" in))
|
||||||
|
no-product
|
||||||
|
(produce %kiln-jump-propose syd her sud)
|
6
pkg/arvo/gen/hood/jump/reject.hoon
Normal file
6
pkg/arvo/gen/hood/jump/reject.hoon
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
:- %say
|
||||||
|
|= $: [now=@da eny=@uvJ bec=beak]
|
||||||
|
[old=dock new=dock ~]
|
||||||
|
~
|
||||||
|
==
|
||||||
|
kiln-jump-opt+[old new |]
|
@ -1,13 +0,0 @@
|
|||||||
:: Helm: Reload %clay
|
|
||||||
::
|
|
||||||
:::: /hoon/rc/hood/gen
|
|
||||||
::
|
|
||||||
/? 310
|
|
||||||
::
|
|
||||||
::::
|
|
||||||
::
|
|
||||||
:- %say
|
|
||||||
|= $: [now=@da eny=@uvJ bec=beak]
|
|
||||||
[arg=~ ~]
|
|
||||||
==
|
|
||||||
[%helm-reload ~[%c]]
|
|
@ -1,5 +0,0 @@
|
|||||||
:- %say
|
|
||||||
|= $: [now=@da eny=@uvJ bec=beak]
|
|
||||||
[[=desk ~] ~]
|
|
||||||
==
|
|
||||||
[%kiln-resume desk]
|
|
6
pkg/arvo/gen/hood/sync-automerge.hoon
Normal file
6
pkg/arvo/gen/hood/sync-automerge.hoon
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
:- %say
|
||||||
|
|= $: [now=@da eny=@uvJ bec=beak]
|
||||||
|
[syd=desk her=ship sud=desk auto=(unit ?) ~]
|
||||||
|
~
|
||||||
|
==
|
||||||
|
kiln-sync-automerge+[[syd her sud] auto]
|
16
pkg/arvo/gen/jumps.hoon
Normal file
16
pkg/arvo/gen/jumps.hoon
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/- h=hood
|
||||||
|
:- %say
|
||||||
|
|= [[now=@da eny=@uvJ bec=beak] ~ ~]
|
||||||
|
:- %tang
|
||||||
|
^- tang
|
||||||
|
=+ .^ hop=jump:h
|
||||||
|
%gx
|
||||||
|
(scot %p p.bec)
|
||||||
|
%hood
|
||||||
|
(scot %da now)
|
||||||
|
/kiln/jumps/noun
|
||||||
|
==
|
||||||
|
?> ?=(%all -.hop)
|
||||||
|
%+ turn ~(tap by all.hop)
|
||||||
|
|= [old=dock new=dock]
|
||||||
|
leaf+"{<p.old>}/{(trip q.old)} -> {<p.new>}/{(trip q.new)}"
|
@ -4,24 +4,26 @@
|
|||||||
:: |stale-flows, =veb %2 :: stale flows that keep (re)trying to connect
|
:: |stale-flows, =veb %2 :: stale flows that keep (re)trying to connect
|
||||||
:: |stale-flows, =veb %21 :: ... per app (only forward)
|
:: |stale-flows, =veb %21 :: ... per app (only forward)
|
||||||
:: |stale-flows, =veb %3 :: stale resubscriptions
|
:: |stale-flows, =veb %3 :: stale resubscriptions
|
||||||
|
:: |stale-flows, =veb %4 :: print live naxplanation flows
|
||||||
::
|
::
|
||||||
=> |%
|
=> |%
|
||||||
+$ subs (jar path [ship bone @])
|
+$ subs (jar path [ship bone @ close=?])
|
||||||
+$ pags (jar app=term [dst=term =ship =path]) :: per-agent
|
+$ pags (jar app=term [dst=term =ship =path]) :: per-agent
|
||||||
+$ naks (set [ship bone])
|
+$ naks (set [ship bone])
|
||||||
:: verbosity
|
:: verbosity
|
||||||
::
|
::
|
||||||
+$ veb ?(%0 %1 %2 %21 %3 %31)
|
+$ veb ?(%0 %1 %2 %21 %3 %4 ~)
|
||||||
::
|
::
|
||||||
++ resubs
|
++ resubs
|
||||||
|= [=subs =veb]
|
|= [=subs =veb]
|
||||||
^- @
|
^- @
|
||||||
::=/ sorted
|
%+ roll ~(tap by subs)
|
||||||
:: %+ sort ~(tap by subs)
|
|= [[k=path v=(list [ship bone @ close=?])] num=@]
|
||||||
:: |=([a=(list *) b=(list *)] (lte (lent a) (lent b)))
|
=/ in-close=@
|
||||||
%+ roll ~(tap by subs)::sorted
|
(roll v |=([[@ @ @ c=?] n=@] ?:(c +(n) n)))
|
||||||
|= [[k=path v=(list [ship bone @])] num=@]
|
|
||||||
~? &(=(%3 veb) (gth (lent v) 1))
|
~? &(=(%3 veb) (gth (lent v) 1))
|
||||||
|
%+ weld ?: =(in-close 0) ""
|
||||||
|
"[#{<in-close>} %close] "
|
||||||
"#{<(dec (lent v))>} stale resubs on {<k>}"
|
"#{<(dec (lent v))>} stale resubs on {<k>}"
|
||||||
?. (gth (lent v) 1) num
|
?. (gth (lent v) 1) num
|
||||||
(add (dec (lent v)) num)
|
(add (dec (lent v)) num)
|
||||||
@ -29,7 +31,7 @@
|
|||||||
::
|
::
|
||||||
:- %say
|
:- %say
|
||||||
|= $: [now=@da eny=@uvJ bec=beak]
|
|= $: [now=@da eny=@uvJ bec=beak]
|
||||||
[arg=~ dry=? =veb]
|
[arg=~ peer=(unit @p) dry=? =veb]
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
=/ peers-map
|
=/ peers-map
|
||||||
@ -45,12 +47,14 @@
|
|||||||
%known (some ship)
|
%known (some ship)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
=; [[=subs =pags backward=@ forward=@] =naks]
|
=; [[=subs =pags close=@ incoming=@ outgoing=@ nax=@] =naks]
|
||||||
:- %tang %- flop
|
:- %tang %- flop
|
||||||
%+ weld
|
%+ weld
|
||||||
:~ leaf+"#{<~(wyt in naks)>} flows from %nacking %watches"
|
:~ leaf+"#{<~(wyt in naks)>} flows from %nacking %watches"
|
||||||
leaf+"#{<backward>} live backward flows with (keep retrying)"
|
leaf+"#{<incoming>} live backward flows"
|
||||||
leaf+"#{<forward>} live forward flows with (keep retrying)"
|
leaf+"#{<outgoing>} live forward flows"
|
||||||
|
leaf+"#{<nax>} live naxplanations"
|
||||||
|
leaf+"#{<close>} flows in closing"
|
||||||
leaf+"#{<(resubs subs veb)>} stale resubscriptions"
|
leaf+"#{<(resubs subs veb)>} stale resubscriptions"
|
||||||
==
|
==
|
||||||
?. =(%21 veb) ~
|
?. =(%21 veb) ~
|
||||||
@ -60,13 +64,17 @@
|
|||||||
(gth (lent v) (lent w))
|
(gth (lent v) (lent w))
|
||||||
|= [app=term v=(list [dst=term =ship =path])]
|
|= [app=term v=(list [dst=term =ship =path])]
|
||||||
:- %leaf
|
:- %leaf
|
||||||
%+ weld "#{<(lent v)>} flows for {<app>} with >10 retries"
|
%+ weld "#{<(lent v)>} flows for {<app>}"
|
||||||
?. =(1 (lent v)) ~
|
?. =(1 (lent v)) ~
|
||||||
?> ?=(^ v)
|
?> ?=(^ v)
|
||||||
" on {<ship.i.v>} to {<dst.i.v>} at {<path.i.v>}"
|
" on {<ship.i.v>} to {<dst.i.v>} at {<path.i.v>}"
|
||||||
::
|
::
|
||||||
%+ roll peers
|
%+ roll peers
|
||||||
|= [=ship [=subs p=pags b=@ f=@] n=naks]
|
|= [=ship [=subs p=pags cl=@ in=@ ou=@ na=@] =naks]
|
||||||
|
?: ?& ?=(^ peer)
|
||||||
|
!=(u.peer ship)
|
||||||
|
==
|
||||||
|
+<+
|
||||||
=+ .^ =ship-state:ames
|
=+ .^ =ship-state:ames
|
||||||
%ax /(scot %p p.bec)//(scot %da now)/peers/(scot %p ship)
|
%ax /(scot %p p.bec)//(scot %da now)/peers/(scot %p ship)
|
||||||
==
|
==
|
||||||
@ -78,55 +86,63 @@
|
|||||||
%+ roll ~(tap by snd.peer-state)
|
%+ roll ~(tap by snd.peer-state)
|
||||||
|= $: [=bone message-pump-state:ames]
|
|= $: [=bone message-pump-state:ames]
|
||||||
subs=_subs pags=_p
|
subs=_subs pags=_p
|
||||||
backward=_b forward=_f
|
close=_cl
|
||||||
|
incoming=_in outgoing=_ou nax=_na
|
||||||
==
|
==
|
||||||
=, packet-pump-state
|
=, packet-pump-state
|
||||||
|
=+ closing=(~(has ^in closing.peer-state) bone)
|
||||||
:- ?~ duct=(~(get by by-bone.ossuary.peer-state) bone) subs
|
:- ?~ duct=(~(get by by-bone.ossuary.peer-state) bone) subs
|
||||||
?. ?=([* [%gall %use sub=@ @ %out @ @ nonce=@ pub=@ *] *] u.duct)
|
?. ?=([* [%gall %use sub=@ @ %out @ @ *] *] u.duct)
|
||||||
subs
|
subs
|
||||||
=/ =wire i.t.u.duct
|
=/ =wire i.t.u.duct
|
||||||
=/ nonce=(unit @) (rush i.t.t.t.t.t.t.t.i.t.u.duct dem)
|
=/ nonce=(unit @ud)
|
||||||
|
?~ (slag 7 wire) ~
|
||||||
|
(slaw %ud &8.wire)
|
||||||
%- ~(add ja subs)
|
%- ~(add ja subs)
|
||||||
:_ [ship bone ?~(nonce 0 u.nonce)] :: 0, 1?
|
:_ [ship bone ?~(nonce 0 u.nonce) closing] :: 0 = pre-nonce subscriptions
|
||||||
?~ nonce wire
|
?~ nonce
|
||||||
|
wire
|
||||||
:: don't include the sub-nonce in the key
|
:: don't include the sub-nonce in the key
|
||||||
::
|
::
|
||||||
(weld (scag 7 wire) (slag 8 wire))
|
(weld (scag 7 wire) (slag 8 wire))
|
||||||
%+ roll ~(tap in live)
|
?~ live [pags close incoming outgoing nax]
|
||||||
|= $: [[msg=@ frag=@] [packet-state:ames *]]
|
|
||||||
pags=_pags
|
|
||||||
out=[b=_backward f=_forward]
|
|
||||||
==
|
|
||||||
::
|
|
||||||
:: only forward flows
|
:: only forward flows
|
||||||
::
|
::
|
||||||
=? pags &(=(0 (end 0 bone)) (gth tries 10))
|
=? pags =(%0 (mod bone 4))
|
||||||
?~ duct=(~(get by by-bone.ossuary.peer-state) bone)
|
?~ duct=(~(get by by-bone.ossuary.peer-state) bone)
|
||||||
pags
|
pags
|
||||||
?. ?=([* [%gall %use sub=@ @ %out @ @ nonce=@ pub=@ *] *] u.duct)
|
?. ?=([* [%gall %use sub=@ @ %out @ @ *] *] u.duct)
|
||||||
pags
|
pags
|
||||||
=/ =wire i.t.u.duct
|
=/ =wire i.t.u.duct
|
||||||
(~(add ja pags) (snag 2 wire) (snag 8 wire) ship (slag 9 wire))
|
(~(add ja pags) (snag 2 wire) (snag 6 wire) ship (slag 7 wire))
|
||||||
::
|
::
|
||||||
~? &(=(%2 veb) (gth tries 10))
|
=? close closing +(close)
|
||||||
=+ arrow=?:(=(0 (end 0 bone)) "<-" "->")
|
~? =(%2 veb)
|
||||||
=+ closing=(~(has in closing.peer-state) bone)
|
=/ arrow=tape
|
||||||
%+ weld "{arrow} ({(cite:title ship)}) bone=#{<bone>} "
|
?+ (mod bone 4) ~|([%odd-bone bone] !!)
|
||||||
"closing={<closing>} msg=#{<msg>} frag=#{<frag>} #{<tries>}"
|
%0 "<-"
|
||||||
:- pags
|
%1 "->"
|
||||||
=? out (gth tries 10)
|
%3 "<-"
|
||||||
?: =(0 (end 0 bone))
|
==
|
||||||
[b.out +(f.out)]
|
"{arrow} ({(cite:title ship)}) bone=#{<bone>} closing={<closing>}"
|
||||||
[+(b.out) f.out]
|
::
|
||||||
out
|
=/ is-nax=? =(%3 (mod bone 4))
|
||||||
|
~? &(=(%4 veb) is-nax)
|
||||||
|
"nax: ({(cite:title ship)}) bone=#{<bone>} closing={<closing>}"
|
||||||
|
:+ pags close
|
||||||
|
?+ (mod bone 4) ~|([%odd-bone bone] !!)
|
||||||
|
%0 [incoming +(outgoing) nax]
|
||||||
|
%1 [+(incoming) outgoing nax]
|
||||||
|
%3 [incoming outgoing +(nax)]
|
||||||
|
==
|
||||||
::
|
::
|
||||||
++ nacks
|
++ nacks
|
||||||
%+ roll ~(tap by rcv.peer-state)
|
%+ roll ~(tap by rcv.peer-state)
|
||||||
|= [[=bone *] nacks=_n]
|
|= [[=bone *] n=_naks]
|
||||||
?. &(=(0 (end 0 bone)) =(1 (end 0 (rsh 0 bone))))
|
?. &(=(0 (end 0 bone)) =(1 (end 0 (rsh 0 bone))))
|
||||||
:: not a naxplanation ack bone
|
:: not a naxplanation ack bone
|
||||||
::
|
::
|
||||||
nacks
|
n
|
||||||
:: by only corking forward flows that have received
|
:: by only corking forward flows that have received
|
||||||
:: a nack we avoid corking the current subscription
|
:: a nack we avoid corking the current subscription
|
||||||
::
|
::
|
||||||
@ -134,16 +150,18 @@
|
|||||||
:: make sure that the nack bone has a forward flow
|
:: make sure that the nack bone has a forward flow
|
||||||
::
|
::
|
||||||
?~ duct=(~(get by by-bone.ossuary.peer-state) target)
|
?~ duct=(~(get by by-bone.ossuary.peer-state) target)
|
||||||
nacks
|
n
|
||||||
?. ?=([* [%gall %use sub=@ @ %out @ @ nonce=@ pub=@ *] *] u.duct)
|
?. ?=([* [%gall %use sub=@ @ %out @ @ nonce=@ pub=@ *] *] u.duct)
|
||||||
nacks
|
n
|
||||||
=/ =wire i.t.u.duct
|
=/ =wire i.t.u.duct
|
||||||
|
=+ closing=(~(has ^in closing.peer-state) bone)
|
||||||
?> ?=([%gall %use sub=@ @ %out @ @ nonce=@ pub=@ *] wire)
|
?> ?=([%gall %use sub=@ @ %out @ @ nonce=@ pub=@ *] wire)
|
||||||
=/ app=term i.t.t.wire
|
=/ app=term i.t.t.wire
|
||||||
=/ nonce=@
|
=/ nonce=@
|
||||||
=- ?~(- 0 u.-)
|
=- ?~(- 0 u.-)
|
||||||
(rush i.t.t.t.t.t.t.t.wire dem)
|
(slaw %ud &8.wire)
|
||||||
=/ =path t.t.t.t.t.t.t.t.wire
|
=/ =path |8.wire
|
||||||
~? =(%1 veb) "[bone={<target>} nonce={<nonce>} agent={<app>}] {<path>}"
|
~? =(%1 veb)
|
||||||
(~(put in nacks) [ship target])
|
"[bone={<target>} nonce={<nonce>} agent={<app>} close={<closing>}] {<path>}"
|
||||||
|
(~(put ^in n) [ship target])
|
||||||
--
|
--
|
||||||
|
16
pkg/arvo/gen/updates.hoon
Normal file
16
pkg/arvo/gen/updates.hoon
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/- h=hood
|
||||||
|
:- %say
|
||||||
|
|= [[now=@da eny=@uvJ bec=beak] ~ ~]
|
||||||
|
:- %tang
|
||||||
|
^- tang
|
||||||
|
=+ .^ upd=sync-update:h
|
||||||
|
%gx
|
||||||
|
(scot %p p.bec)
|
||||||
|
%hood
|
||||||
|
(scot %da now)
|
||||||
|
/kiln/pending/noun
|
||||||
|
==
|
||||||
|
?> ?=(%pending -.upd)
|
||||||
|
%+ turn ~(tap in pending.upd)
|
||||||
|
|= [sync-record:h rev=@ud]
|
||||||
|
leaf+"{<syd>} <- {<her>}/{(trip sud)}/{<rev>}"
|
@ -22,7 +22,7 @@
|
|||||||
%- zing
|
%- zing
|
||||||
%+ turn
|
%+ turn
|
||||||
%+ sort
|
%+ sort
|
||||||
=/ sed .^((set desk) %cd /(scot %p p.bec)/base/(scot %da now))
|
=/ sed .^((set desk) %cd /(scot %p p.bec)//(scot %da now))
|
||||||
(sort ~(tap in sed) |=([a=@ b=@] !(aor a b)))
|
(sort ~(tap in sed) |=([a=@ b=@] !(aor a b)))
|
||||||
|=([a=desk b=desk] ?|(=(a %kids) =(b %base)))
|
|=([a=desk b=desk] ?|(=(a %kids) =(b %base)))
|
||||||
|=(syd=desk (report-vat (report-prep p.bec now) p.bec now syd verb))
|
|=(syd=desk (report-vat (report-prep p.bec now) p.bec now syd verb))
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
++ get-single-req
|
++ get-single-req
|
||||||
|= req=@t
|
|= req=@t
|
||||||
=/ batch
|
=/ batch
|
||||||
((ar:dejs:format same) (need (de-json:html req)))
|
((ar:dejs:format same) (need (de:json:html req)))
|
||||||
?> ?=([* ~] batch)
|
?> ?=([* ~] batch)
|
||||||
i.batch
|
i.batch
|
||||||
::
|
::
|
||||||
@ -110,8 +110,7 @@
|
|||||||
|= [req=@t result=json]
|
|= [req=@t result=json]
|
||||||
^- card:agent:gall
|
^- card:agent:gall
|
||||||
=/ resp
|
=/ resp
|
||||||
%- crip
|
%- en:json:html
|
||||||
%- en-json:html
|
|
||||||
:- %a :_ ~
|
:- %a :_ ~
|
||||||
%- pairs
|
%- pairs
|
||||||
:~ id+s+(get-id req)
|
:~ id+s+(get-id req)
|
||||||
|
@ -246,8 +246,9 @@
|
|||||||
(emit %pass /helm %arvo %a %stir '')
|
(emit %pass /helm %arvo %a %stir '')
|
||||||
::
|
::
|
||||||
++ poke-ames-kroc
|
++ poke-ames-kroc
|
||||||
|= dry=? =< abet
|
|= [dry=? bones=(list [ship bone])] =< abet
|
||||||
(emit %pass /helm %arvo %a %kroc dry)
|
?: dry this
|
||||||
|
(emit %pass /helm %arvo %a %kroc bones)
|
||||||
::
|
::
|
||||||
++ poke-ames-cong
|
++ poke-ames-cong
|
||||||
|= cong=[msg=@ud mem=@ud] =< abet
|
|= cong=[msg=@ud mem=@ud] =< abet
|
||||||
|
@ -5,7 +5,8 @@
|
|||||||
=, format
|
=, format
|
||||||
=* dude dude:gall
|
=* dude dude:gall
|
||||||
|%
|
|%
|
||||||
+$ state state-10
|
+$ state state-11
|
||||||
|
+$ state-11 [%11 pith-11]
|
||||||
+$ state-10 [%10 pith-10]
|
+$ state-10 [%10 pith-10]
|
||||||
+$ state-9 [%9 pith-9]
|
+$ state-9 [%9 pith-9]
|
||||||
+$ state-8 [%8 pith-9]
|
+$ state-8 [%8 pith-9]
|
||||||
@ -19,7 +20,8 @@
|
|||||||
+$ state-0 [%0 pith-0]
|
+$ state-0 [%0 pith-0]
|
||||||
+$ any-state
|
+$ any-state
|
||||||
$~ *state
|
$~ *state
|
||||||
$% state-10
|
$% state-11
|
||||||
|
state-10
|
||||||
state-9
|
state-9
|
||||||
state-8
|
state-8
|
||||||
state-7
|
state-7
|
||||||
@ -32,10 +34,32 @@
|
|||||||
state-0
|
state-0
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
|
+$ pith-11
|
||||||
|
$: rem=(map desk per-desk)
|
||||||
|
nyz=@ud
|
||||||
|
zyn=(map sync-record sync-state)
|
||||||
|
:: requests from publishers to switch sync source
|
||||||
|
hop=(map dock dock)
|
||||||
|
:: toggle global update auto-merge
|
||||||
|
mer=?
|
||||||
|
::
|
||||||
|
commit-timer=[way=wire nex=@da tim=@dr mon=term]
|
||||||
|
:: map desk to the currently ongoing fuse request
|
||||||
|
:: and the latest version numbers for beaks to
|
||||||
|
fus=(map desk per-fuse)
|
||||||
|
:: used for fuses - every time we get a fuse we
|
||||||
|
:: bump this. used when calculating hashes to
|
||||||
|
:: ensure they're unique even when the same
|
||||||
|
:: request is made multiple times.
|
||||||
|
hxs=(map desk @ud)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
+$ sync-state-10 [nun=@ta kid=(unit desk) let=@ud]
|
||||||
|
::
|
||||||
+$ pith-10
|
+$ pith-10
|
||||||
$: rem=(map desk per-desk)
|
$: rem=(map desk per-desk)
|
||||||
nyz=@ud
|
nyz=@ud
|
||||||
zyn=(map kiln-sync sync-state)
|
zyn=(map sync-record sync-state-10)
|
||||||
commit-timer=[way=wire nex=@da tim=@dr mon=term]
|
commit-timer=[way=wire nex=@da tim=@dr mon=term]
|
||||||
:: map desk to the currently ongoing fuse request
|
:: map desk to the currently ongoing fuse request
|
||||||
:: and the latest version numbers for beaks to
|
:: and the latest version numbers for beaks to
|
||||||
@ -50,7 +74,7 @@
|
|||||||
+$ pith-9
|
+$ pith-9
|
||||||
$: wef=(unit weft)
|
$: wef=(unit weft)
|
||||||
rem=(map desk per-desk)
|
rem=(map desk per-desk)
|
||||||
syn=(map kiln-sync let=@ud)
|
syn=(map sync-record let=@ud)
|
||||||
ark=(map desk arak-9)
|
ark=(map desk arak-9)
|
||||||
commit-timer=[way=wire nex=@da tim=@dr mon=term]
|
commit-timer=[way=wire nex=@da tim=@dr mon=term]
|
||||||
:: map desk to the currently ongoing fuse request
|
:: map desk to the currently ongoing fuse request
|
||||||
@ -78,7 +102,7 @@
|
|||||||
+$ pith-7
|
+$ pith-7
|
||||||
$: wef=(unit weft)
|
$: wef=(unit weft)
|
||||||
rem=(map desk per-desk)
|
rem=(map desk per-desk)
|
||||||
syn=(map kiln-sync let=@ud)
|
syn=(map sync-record let=@ud)
|
||||||
ark=(map desk arak-7)
|
ark=(map desk arak-7)
|
||||||
commit-timer=[way=wire nex=@da tim=@dr mon=term]
|
commit-timer=[way=wire nex=@da tim=@dr mon=term]
|
||||||
:: map desk to the currently ongoing fuse request
|
:: map desk to the currently ongoing fuse request
|
||||||
@ -121,7 +145,7 @@
|
|||||||
+$ pith-6
|
+$ pith-6
|
||||||
$: wef=(unit weft)
|
$: wef=(unit weft)
|
||||||
rem=(map desk per-desk) ::
|
rem=(map desk per-desk) ::
|
||||||
syn=(map kiln-sync let=@ud) ::
|
syn=(map sync-record let=@ud) ::
|
||||||
ark=(map desk arak-6) ::
|
ark=(map desk arak-6) ::
|
||||||
commit-timer=[way=wire nex=@da tim=@dr mon=term] ::
|
commit-timer=[way=wire nex=@da tim=@dr mon=term] ::
|
||||||
:: map desk to the currently ongoing fuse request
|
:: map desk to the currently ongoing fuse request
|
||||||
@ -139,7 +163,7 @@
|
|||||||
::
|
::
|
||||||
+$ pith-5
|
+$ pith-5
|
||||||
$: rem=(map desk per-desk) ::
|
$: rem=(map desk per-desk) ::
|
||||||
syn=(map kiln-sync let=@ud) ::
|
syn=(map sync-record let=@ud) ::
|
||||||
ark=(map desk arak-6) ::
|
ark=(map desk arak-6) ::
|
||||||
commit-timer=[way=wire nex=@da tim=@dr mon=term] ::
|
commit-timer=[way=wire nex=@da tim=@dr mon=term] ::
|
||||||
:: map desk to the currently ongoing fuse request
|
:: map desk to the currently ongoing fuse request
|
||||||
@ -154,7 +178,7 @@
|
|||||||
::
|
::
|
||||||
+$ pith-4 ::
|
+$ pith-4 ::
|
||||||
$: rem=(map desk per-desk) ::
|
$: rem=(map desk per-desk) ::
|
||||||
syn=(map kiln-sync let=@ud) ::
|
syn=(map sync-record let=@ud) ::
|
||||||
ark=(map desk arak-4) ::
|
ark=(map desk arak-4) ::
|
||||||
commit-timer=[way=wire nex=@da tim=@dr mon=term] ::
|
commit-timer=[way=wire nex=@da tim=@dr mon=term] ::
|
||||||
:: map desk to the currently ongoing fuse request
|
:: map desk to the currently ongoing fuse request
|
||||||
@ -175,7 +199,7 @@
|
|||||||
==
|
==
|
||||||
+$ pith-3 ::
|
+$ pith-3 ::
|
||||||
$: rem=(map desk per-desk) ::
|
$: rem=(map desk per-desk) ::
|
||||||
syn=(map kiln-sync let=@ud) ::
|
syn=(map sync-record let=@ud) ::
|
||||||
ark=(map desk arak-3) ::
|
ark=(map desk arak-3) ::
|
||||||
commit-timer=[way=wire nex=@da tim=@dr mon=term] ::
|
commit-timer=[way=wire nex=@da tim=@dr mon=term] ::
|
||||||
:: map desk to the currently ongoing fuse request
|
:: map desk to the currently ongoing fuse request
|
||||||
@ -201,7 +225,7 @@
|
|||||||
::
|
::
|
||||||
+$ pith-2 ::
|
+$ pith-2 ::
|
||||||
$: rem=(map desk per-desk) ::
|
$: rem=(map desk per-desk) ::
|
||||||
syn=(map kiln-sync let=@ud) ::
|
syn=(map sync-record let=@ud) ::
|
||||||
ota=(unit [=ship =desk =aeon]) ::
|
ota=(unit [=ship =desk =aeon]) ::
|
||||||
commit-timer=[way=wire nex=@da tim=@dr mon=term] ::
|
commit-timer=[way=wire nex=@da tim=@dr mon=term] ::
|
||||||
fus=(map desk per-fuse)
|
fus=(map desk per-fuse)
|
||||||
@ -209,13 +233,13 @@
|
|||||||
== ::
|
== ::
|
||||||
+$ pith-1 ::
|
+$ pith-1 ::
|
||||||
$: rem=(map desk per-desk) ::
|
$: rem=(map desk per-desk) ::
|
||||||
syn=(map kiln-sync let=@ud) ::
|
syn=(map sync-record let=@ud) ::
|
||||||
ota=(unit [=ship =desk =aeon]) ::
|
ota=(unit [=ship =desk =aeon]) ::
|
||||||
commit-timer=[way=wire nex=@da tim=@dr mon=term] ::
|
commit-timer=[way=wire nex=@da tim=@dr mon=term] ::
|
||||||
== ::
|
== ::
|
||||||
+$ pith-0 ::
|
+$ pith-0 ::
|
||||||
$: rem=(map desk per-desk) ::
|
$: rem=(map desk per-desk) ::
|
||||||
syn=(map kiln-sync let=@ud) ::
|
syn=(map sync-record let=@ud) ::
|
||||||
autoload-on=? ::
|
autoload-on=? ::
|
||||||
cur-hoon=@uvI ::
|
cur-hoon=@uvI ::
|
||||||
cur-arvo=@uvI ::
|
cur-arvo=@uvI ::
|
||||||
@ -245,16 +269,6 @@
|
|||||||
pot=term ::
|
pot=term ::
|
||||||
==
|
==
|
||||||
+$ kiln-unmount $@(term [knot path]) ::
|
+$ kiln-unmount $@(term [knot path]) ::
|
||||||
+$ kiln-sync ::
|
|
||||||
$: syd=desk :: local desk
|
|
||||||
her=ship :: foreign ship
|
|
||||||
sud=desk :: foreign desk
|
|
||||||
==
|
|
||||||
+$ kiln-unsync ::
|
|
||||||
$: syd=desk :: local desk
|
|
||||||
her=ship :: foreign ship
|
|
||||||
sud=desk :: foreign desk
|
|
||||||
==
|
|
||||||
+$ kiln-merge ::
|
+$ kiln-merge ::
|
||||||
$@ ~
|
$@ ~
|
||||||
$: syd=desk ::
|
$: syd=desk ::
|
||||||
@ -285,7 +299,6 @@
|
|||||||
+$ kiln-fuse-list (unit desk)
|
+$ kiln-fuse-list (unit desk)
|
||||||
--
|
--
|
||||||
|= [bowl:gall state]
|
|= [bowl:gall state]
|
||||||
?> =(src our)
|
|
||||||
=| moz=(list card:agent:gall)
|
=| moz=(list card:agent:gall)
|
||||||
|%
|
|%
|
||||||
++ kiln .
|
++ kiln .
|
||||||
@ -440,7 +453,7 @@
|
|||||||
=^ cards-9=(list card:agent:gall) old
|
=^ cards-9=(list card:agent:gall) old
|
||||||
?. ?=(%9 -.old)
|
?. ?=(%9 -.old)
|
||||||
`old
|
`old
|
||||||
=/ syn=(set kiln-sync)
|
=/ syn=(set sync-record)
|
||||||
%- ~(gas in ~(key by syn.old))
|
%- ~(gas in ~(key by syn.old))
|
||||||
%+ murn ~(tap by ark.old)
|
%+ murn ~(tap by ark.old)
|
||||||
|= [=desk =arak-9]
|
|= [=desk =arak-9]
|
||||||
@ -468,8 +481,8 @@
|
|||||||
[%pass /kiln/load-zest %arvo %c %zest desk zest]
|
[%pass /kiln/load-zest %arvo %c %zest desk zest]
|
||||||
::
|
::
|
||||||
%+ turn ~(tap in syn)
|
%+ turn ~(tap in syn)
|
||||||
|= k=kiln-sync
|
|= r=sync-record
|
||||||
[%pass /kiln/load-sync %agent [our %hood] %poke %kiln-sync !>(k)]
|
[%pass /kiln/load-sync %agent [our %hood] %poke %kiln-sync !>(r)]
|
||||||
::
|
::
|
||||||
=/ ks ~(tap in syn)
|
=/ ks ~(tap in syn)
|
||||||
|- ^- (list card:agent:gall)
|
|- ^- (list card:agent:gall)
|
||||||
@ -483,7 +496,17 @@
|
|||||||
$(ks t.ks)
|
$(ks t.ks)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
?> ?=(%10 -.old)
|
=? old ?=(%10 -.old)
|
||||||
|
%= old
|
||||||
|
- %11
|
||||||
|
|4 [hop=~ mer=& |4.old]
|
||||||
|
zyn %- ~(run by zyn.old)
|
||||||
|
|= sync-state-10
|
||||||
|
^- sync-state
|
||||||
|
[nun kid let ~ ~ |]
|
||||||
|
==
|
||||||
|
::
|
||||||
|
?> ?=(%11 -.old)
|
||||||
=. state old
|
=. state old
|
||||||
abet:(emil cards-9)
|
abet:(emil cards-9)
|
||||||
::
|
::
|
||||||
@ -499,8 +522,10 @@
|
|||||||
=/ ver (mergebase-hashes our %base now (~(got by sources) %base))
|
=/ ver (mergebase-hashes our %base now (~(got by sources) %base))
|
||||||
``noun+!>(?~(ver 0v0 i.ver))
|
``noun+!>(?~(ver 0v0 i.ver))
|
||||||
::
|
::
|
||||||
[%x %kiln %syncs ~] ``noun+!>(zyn)
|
[%x %kiln %jumps ~] ``kiln-jump+!>([%all hop])
|
||||||
[%x %kiln %sources ~] ``noun+!>(sources)
|
[%x %kiln %syncs ~] ``noun+!>(zyn)
|
||||||
|
[%x %kiln %sources ~] ``noun+!>(sources)
|
||||||
|
[%x %kiln %automerge ~] ``loob+!>(mer)
|
||||||
[%x %kiln %pikes ~]
|
[%x %kiln %pikes ~]
|
||||||
=+ .^(=rock:tire %cx /(scot %p our)//(scot %da now)/tire)
|
=+ .^(=rock:tire %cx /(scot %p our)//(scot %da now)/tire)
|
||||||
:^ ~ ~ %kiln-pikes
|
:^ ~ ~ %kiln-pikes
|
||||||
@ -511,6 +536,17 @@
|
|||||||
=+ .^(hash=@uv %cz /(scot %p our)/[desk]/(scot %da now))
|
=+ .^(hash=@uv %cz /(scot %p our)/[desk]/(scot %da now))
|
||||||
=/ sync (~(get by sources) desk)
|
=/ sync (~(get by sources) desk)
|
||||||
[sync hash zest wic]
|
[sync hash zest wic]
|
||||||
|
::
|
||||||
|
[%x %kiln %pending ~]
|
||||||
|
:^ ~ ~ %kiln-sync-update
|
||||||
|
!> ^- sync-update
|
||||||
|
:- %pending
|
||||||
|
%- ~(gas by *(set [sync-record @ud]))
|
||||||
|
^- (list [sync-record @ud])
|
||||||
|
%+ murn ~(tap by zyn)
|
||||||
|
|= [sync-record sync-state]
|
||||||
|
?~ hav ~
|
||||||
|
(some [syd her sud] u.hav)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
:: +get-germ: select merge strategy into local desk
|
:: +get-germ: select merge strategy into local desk
|
||||||
@ -528,12 +564,15 @@
|
|||||||
::
|
::
|
||||||
++ poke
|
++ poke
|
||||||
|= [=mark =vase]
|
|= [=mark =vase]
|
||||||
|
?> |(=(src our) =(%kiln-jump-ask mark))
|
||||||
?+ mark ~|([%poke-kiln-bad-mark mark] !!)
|
?+ mark ~|([%poke-kiln-bad-mark mark] !!)
|
||||||
|
%kiln-approve-merge =;(f (f !<(_+<.f vase)) poke-approve-merge)
|
||||||
%kiln-autocommit =;(f (f !<(_+<.f vase)) poke-autocommit)
|
%kiln-autocommit =;(f (f !<(_+<.f vase)) poke-autocommit)
|
||||||
%kiln-bump =;(f (f !<(_+<.f vase)) poke-bump)
|
%kiln-bump =;(f (f !<(_+<.f vase)) poke-bump)
|
||||||
%kiln-cancel =;(f (f !<(_+<.f vase)) poke-cancel)
|
%kiln-cancel =;(f (f !<(_+<.f vase)) poke-cancel)
|
||||||
%kiln-cancel-autocommit =;(f (f !<(_+<.f vase)) poke-cancel-autocommit)
|
%kiln-cancel-autocommit =;(f (f !<(_+<.f vase)) poke-cancel-autocommit)
|
||||||
%kiln-commit =;(f (f !<(_+<.f vase)) poke-commit)
|
%kiln-commit =;(f (f !<(_+<.f vase)) poke-commit)
|
||||||
|
%kiln-sync-automerge =;(f (f !<(_+<.f vase)) poke-sync-automerge)
|
||||||
%kiln-fuse =;(f (f !<(_+<.f vase)) poke-fuse)
|
%kiln-fuse =;(f (f !<(_+<.f vase)) poke-fuse)
|
||||||
%kiln-fuse-list =;(f (f !<(_+<.f vase)) poke-fuse-list)
|
%kiln-fuse-list =;(f (f !<(_+<.f vase)) poke-fuse-list)
|
||||||
%kiln-gall-sear =;(f (f !<(_+<.f vase)) poke-gall-sear)
|
%kiln-gall-sear =;(f (f !<(_+<.f vase)) poke-gall-sear)
|
||||||
@ -543,12 +582,16 @@
|
|||||||
%kiln-label =;(f (f !<(_+<.f vase)) poke-label)
|
%kiln-label =;(f (f !<(_+<.f vase)) poke-label)
|
||||||
%kiln-merge =;(f (f !<(_+<.f vase)) poke-merge)
|
%kiln-merge =;(f (f !<(_+<.f vase)) poke-merge)
|
||||||
%kiln-mount =;(f (f !<(_+<.f vase)) poke-mount)
|
%kiln-mount =;(f (f !<(_+<.f vase)) poke-mount)
|
||||||
|
%kiln-jump-ask =;(f (f !<(_+<.f vase)) poke-jump-ask)
|
||||||
|
%kiln-jump-opt =;(f (f !<(_+<.f vase)) poke-jump-opt)
|
||||||
|
%kiln-jump-propose =;(f (f !<(_+<.f vase)) poke-jump-propose)
|
||||||
%kiln-nuke =;(f (f !<(_+<.f vase)) poke-nuke)
|
%kiln-nuke =;(f (f !<(_+<.f vase)) poke-nuke)
|
||||||
%kiln-pause =;(f (f !<(_+<.f vase)) poke-pause)
|
%kiln-pause =;(f (f !<(_+<.f vase)) poke-pause)
|
||||||
%kiln-permission =;(f (f !<(_+<.f vase)) poke-permission)
|
%kiln-permission =;(f (f !<(_+<.f vase)) poke-permission)
|
||||||
%kiln-revive =;(f (f !<(_+<.f vase)) poke-revive)
|
%kiln-revive =;(f (f !<(_+<.f vase)) poke-revive)
|
||||||
%kiln-rein =;(f (f !<(_+<.f vase)) poke-rein)
|
%kiln-rein =;(f (f !<(_+<.f vase)) poke-rein)
|
||||||
%kiln-rm =;(f (f !<(_+<.f vase)) poke-rm)
|
%kiln-rm =;(f (f !<(_+<.f vase)) poke-rm)
|
||||||
|
%kiln-global-automerge =;(f (f !<(_+<.f vase)) poke-global-automerge)
|
||||||
%kiln-schedule =;(f (f !<(_+<.f vase)) poke-schedule)
|
%kiln-schedule =;(f (f !<(_+<.f vase)) poke-schedule)
|
||||||
%kiln-suspend =;(f (f !<(_+<.f vase)) poke-suspend)
|
%kiln-suspend =;(f (f !<(_+<.f vase)) poke-suspend)
|
||||||
%kiln-suspend-many =;(f (f !<(_+<.f vase)) poke-suspend-many)
|
%kiln-suspend-many =;(f (f !<(_+<.f vase)) poke-suspend-many)
|
||||||
@ -559,6 +602,19 @@
|
|||||||
%kiln-unsync =;(f (f !<(_+<.f vase)) poke-unsync)
|
%kiln-unsync =;(f (f !<(_+<.f vase)) poke-unsync)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
|
++ poke-approve-merge
|
||||||
|
|= [sync-record approve=?]
|
||||||
|
?~ got=(~(get by zyn) syd her sud)
|
||||||
|
=+ msg="kiln: no syncs from {(scow %p her)}/{(trip sud)} to {<syd>}"
|
||||||
|
((slog leaf+msg ~) abet)
|
||||||
|
?~ hav.u.got
|
||||||
|
=+ msg="kiln: no updates from {(scow %p her)}/{(trip sud)} for {<syd>}"
|
||||||
|
((slog leaf+msg ~) abet)
|
||||||
|
=< abet
|
||||||
|
?. approve
|
||||||
|
abet:drop:(sync syd her sud)
|
||||||
|
abet:(merg /main syd):(sync syd her sud)
|
||||||
|
::
|
||||||
++ poke-autocommit
|
++ poke-autocommit
|
||||||
|= [mon=kiln-commit auto=?]
|
|= [mon=kiln-commit auto=?]
|
||||||
=< abet
|
=< abet
|
||||||
@ -679,6 +735,23 @@
|
|||||||
|= =ship
|
|= =ship
|
||||||
abet:(emit %pass /kiln %arvo %g %sear ship)
|
abet:(emit %pass /kiln %arvo %g %sear ship)
|
||||||
::
|
::
|
||||||
|
++ poke-global-automerge
|
||||||
|
|= auto=?
|
||||||
|
=. mer auto
|
||||||
|
?. mer abet
|
||||||
|
=/ zyns=(list [sync-record sync-state]) ~(tap by zyn)
|
||||||
|
=< abet
|
||||||
|
|-
|
||||||
|
?~ zyns ..abet
|
||||||
|
?. ?& ?=(^ hav.i.zyns)
|
||||||
|
!?=([~ %.n] nit.i.zyns)
|
||||||
|
==
|
||||||
|
$(zyns t.zyns)
|
||||||
|
%= $
|
||||||
|
zyns t.zyns
|
||||||
|
..abet abet:(merg /main syd):(sync -.i.zyns)
|
||||||
|
==
|
||||||
|
::
|
||||||
++ poke-info
|
++ poke-info
|
||||||
|= [mez=tape tor=(unit toro)]
|
|= [mez=tape tor=(unit toro)]
|
||||||
?~ tor
|
?~ tor
|
||||||
@ -692,17 +765,20 @@
|
|||||||
?~ got=(~(get by rock) loc)
|
?~ got=(~(get by rock) loc)
|
||||||
%dead
|
%dead
|
||||||
zest.u.got
|
zest.u.got
|
||||||
=. zyn
|
=. ..abet
|
||||||
?~ got=(~(get by sources) loc)
|
?~ got=(~(get by sources) loc)
|
||||||
zyn
|
..abet
|
||||||
(~(del by zyn) loc u.got)
|
?: =([her rem] u.got)
|
||||||
|
..abet
|
||||||
|
=. ..abet abet:drop:(sync loc u.got)
|
||||||
|
..abet(zyn (~(del by zyn) loc u.got))
|
||||||
=? ..abet ?=(%dead zest)
|
=? ..abet ?=(%dead zest)
|
||||||
(emit %pass /kiln/install %arvo %c %zest loc ?:(=(our her) %live %held))
|
(emit %pass /kiln/install %arvo %c %zest loc ?:(=(our her) %live %held))
|
||||||
?: (~(has by zyn) loc her rem)
|
?: (~(has by zyn) loc her rem)
|
||||||
abet:(spam (render "already syncing" loc her rem ~) ~)
|
abet:(spam (render "already syncing" loc her rem ~) ~)
|
||||||
?: =([our loc] [her rem])
|
?: =([our loc] [her rem])
|
||||||
abet
|
abet
|
||||||
=/ sun (sync loc her rem)
|
=/ sun okay:(sync loc her rem)
|
||||||
~> %slog.(fmt "beginning install into {here:sun}")
|
~> %slog.(fmt "beginning install into {here:sun}")
|
||||||
=< abet:abet:init
|
=< abet:abet:init
|
||||||
?: =(%base loc)
|
?: =(%base loc)
|
||||||
@ -710,7 +786,7 @@
|
|||||||
sun
|
sun
|
||||||
::
|
::
|
||||||
++ poke-kids
|
++ poke-kids
|
||||||
|= [hos=kiln-sync nex=(unit desk)]
|
|= [hos=sync-record nex=(unit desk)]
|
||||||
abet:abet:(apex:(sync hos) nex)
|
abet:abet:(apex:(sync hos) nex)
|
||||||
::
|
::
|
||||||
++ poke-label
|
++ poke-label
|
||||||
@ -731,6 +807,84 @@
|
|||||||
abet:(spam leaf+- ~)
|
abet:(spam leaf+- ~)
|
||||||
abet:(emit %pass /mount %arvo %c [%mont pot u.bem])
|
abet:(emit %pass /mount %arvo %c [%mont pot u.bem])
|
||||||
::
|
::
|
||||||
|
++ poke-jump-propose
|
||||||
|
|= [syd=desk her=ship sud=desk]
|
||||||
|
?: =([our syd] [her sud])
|
||||||
|
abet
|
||||||
|
=/ let=@ud ud:.^(cass:clay %cw /(scot %p our)/[syd]/(scot %da now))
|
||||||
|
=/ subs=(set [@p rave:clay])
|
||||||
|
.^((set [@p rave:clay]) %cx /(scot %p our)//(scot %da now)/cult/[syd])
|
||||||
|
=/ ships=(set @p)
|
||||||
|
%+ roll ~(tap in subs)
|
||||||
|
|= [[=ship =rave:clay] ships=(set @p)]
|
||||||
|
?: =(our ship) ships
|
||||||
|
?. ?=([%sing %w [%ud @] ~] rave) ships
|
||||||
|
?. =(+(let) p.case.mood.rave) ships
|
||||||
|
(~(put in ships) ship)
|
||||||
|
=< abet
|
||||||
|
%- emil
|
||||||
|
%+ turn ~(tap in ships)
|
||||||
|
|= =ship
|
||||||
|
:* %pass /kiln/jump-propose %agent [ship %hood]
|
||||||
|
%poke %kiln-jump-ask !>([[our syd] [her sud]])
|
||||||
|
==
|
||||||
|
::
|
||||||
|
++ poke-jump-ask
|
||||||
|
|= [old=dock new=dock]
|
||||||
|
?> |(=(src p.old) =(src our))
|
||||||
|
?: =(old new)
|
||||||
|
?~ had=(~(get by hop) old)
|
||||||
|
abet
|
||||||
|
=. hop (~(del by hop) old)
|
||||||
|
abet:(emit %give %fact ~[/jumps] %kiln-jump !>([%nay old u.had]))
|
||||||
|
?~ (skim ~(tap by sources) |=(sync-record =(old [her sud])))
|
||||||
|
~> %slog.(fmt "no syncs from {<p.old>}/{(trip q.old)}")
|
||||||
|
abet
|
||||||
|
=. hop (~(put by hop) old new)
|
||||||
|
abet:(emit %give %fact ~[/jumps] %kiln-jump !>([%add old new]))
|
||||||
|
::
|
||||||
|
++ poke-jump-opt
|
||||||
|
|= [old=dock new=dock yea=?]
|
||||||
|
?~ got=(~(get by hop) old)
|
||||||
|
~> %slog.(fmt "no jump request for {<p.old>}/{(trip q.old)}")
|
||||||
|
abet
|
||||||
|
?. =(new u.got)
|
||||||
|
=/ txt-old "{<p.old>}/{(trip q.old)}"
|
||||||
|
=/ txt-new "{<p.new>}/{(trip q.new)}"
|
||||||
|
~> %slog.(fmt "no jump request from {txt-old} to {txt-new}")
|
||||||
|
abet
|
||||||
|
?. yea
|
||||||
|
=/ txt-old "{<p.old>}/{(trip q.old)}"
|
||||||
|
=/ txt-new "{<p.new>}/{(trip q.new)}"
|
||||||
|
~> %slog.(fmt "denied jump from {txt-old} to {txt-new}")
|
||||||
|
=. hop (~(del by hop) old)
|
||||||
|
abet:(emit %give %fact ~[/jumps] %kiln-jump !>([%nay old new]))
|
||||||
|
=/ old-sources=(list sync-record)
|
||||||
|
(skim ~(tap by sources) |=(sync-record =(old [her sud])))
|
||||||
|
=/ new-sources=(list sync-record)
|
||||||
|
(turn old-sources |=(sync-record [syd new]))
|
||||||
|
=. ..abet
|
||||||
|
(emit %give %fact ~[/jumps] %kiln-jump !>([%yea old new]))
|
||||||
|
=. ..abet
|
||||||
|
|-
|
||||||
|
?~ old-sources
|
||||||
|
..abet
|
||||||
|
=. ..abet abet:drop:(sync i.old-sources)
|
||||||
|
=. zyn (~(del by zyn) i.old-sources)
|
||||||
|
$(old-sources t.old-sources, ..abet ..abet)
|
||||||
|
=. hop (~(del by hop) old)
|
||||||
|
=< abet
|
||||||
|
|- ^+ ..abet
|
||||||
|
?~ new-sources ..abet
|
||||||
|
%= $
|
||||||
|
new-sources t.new-sources
|
||||||
|
..abet =/ sun (sync i.new-sources)
|
||||||
|
=< abet:init
|
||||||
|
?: =(%base syd.i.new-sources)
|
||||||
|
(apex:sun `%kids)
|
||||||
|
sun
|
||||||
|
==
|
||||||
|
::
|
||||||
++ poke-nuke
|
++ poke-nuke
|
||||||
|= [=term desk=?]
|
|= [=term desk=?]
|
||||||
=< abet
|
=< abet
|
||||||
@ -795,17 +949,34 @@
|
|||||||
%+ turn
|
%+ turn
|
||||||
%+ skim desks
|
%+ skim desks
|
||||||
|= dek=desk
|
|= dek=desk
|
||||||
?: (~(has in .^((set desk) %cd /(scot %p our)/base/(scot %da now))) dek)
|
?: (~(has in .^((set desk) %cd /(scot %p our)//(scot %da now))) dek)
|
||||||
&
|
&
|
||||||
~> %slog.(fmt "desk does not yet exist: {<dek>}") |
|
~> %slog.(fmt "desk does not yet exist: {<dek>}") |
|
||||||
|=(=desk [%pass /kiln/suspend %arvo %c %zest desk %dead])
|
|=(=desk [%pass /kiln/suspend %arvo %c %zest desk %dead])
|
||||||
::
|
::
|
||||||
++ poke-sync
|
++ poke-sync
|
||||||
|= hos=kiln-sync
|
|= sync-record
|
||||||
?: (~(has by zyn) hos)
|
?: (~(has by zyn) sud her syd)
|
||||||
abet:(spam (render "already syncing" [sud her syd ~]:hos) ~)
|
abet:(spam (render "already syncing" [sud her syd ~]) ~)
|
||||||
~> %slog.(fmt "beginning sync into {<syd.hos>} from {<her.hos>}/{<sud.hos>}")
|
=. ..abet
|
||||||
abet:abet:init:(sync hos)
|
?~ got=(~(get by sources) syd)
|
||||||
|
..abet
|
||||||
|
=. ..abet abet:drop:(sync syd u.got)
|
||||||
|
..abet(zyn (~(del by zyn) syd u.got))
|
||||||
|
~> %slog.(fmt "beginning sync into {<syd>} from {<her>}/{<sud>}")
|
||||||
|
abet:abet:init:(sync syd her sud)
|
||||||
|
::
|
||||||
|
++ poke-sync-automerge
|
||||||
|
|= [sync-record auto=(unit ?)]
|
||||||
|
?~ got=(~(get by zyn) syd her sud)
|
||||||
|
=+ msg="kiln: no syncs from {(scow %p her)}/{(trip sud)} to {<syd>}"
|
||||||
|
((slog leaf+msg ~) abet)
|
||||||
|
=. zyn (~(put by zyn) [syd her sud] u.got(nit auto))
|
||||||
|
?~ hav.u.got
|
||||||
|
abet
|
||||||
|
?. |(?=([~ %.y] auto) &(mer ?=(~ auto)))
|
||||||
|
abet
|
||||||
|
abet:abet:(merg /main syd):(sync [syd her sud])
|
||||||
::
|
::
|
||||||
++ poke-syncs :: print sync config
|
++ poke-syncs :: print sync config
|
||||||
|= ~
|
|= ~
|
||||||
@ -813,7 +984,7 @@
|
|||||||
?: =(0 ~(wyt by zyn))
|
?: =(0 ~(wyt by zyn))
|
||||||
[%leaf "no syncs configured"]~
|
[%leaf "no syncs configured"]~
|
||||||
%+ turn ~(tap by zyn)
|
%+ turn ~(tap by zyn)
|
||||||
|= [kiln-sync sync-state]
|
|= [sync-record sync-state]
|
||||||
(render "sync configured" sud her syd kid)
|
(render "sync configured" sud her syd kid)
|
||||||
::
|
::
|
||||||
++ poke-uninstall
|
++ poke-uninstall
|
||||||
@ -821,10 +992,9 @@
|
|||||||
=+ .^(=rock:tire %cx /(scot %p our)//(scot %da now)/tire)
|
=+ .^(=rock:tire %cx /(scot %p our)//(scot %da now)/tire)
|
||||||
?~ got=(~(get by rock) loc)
|
?~ got=(~(get by rock) loc)
|
||||||
abet:(spam leaf+"desk does not exist: {<loc>}" ~)
|
abet:(spam leaf+"desk does not exist: {<loc>}" ~)
|
||||||
?: =(+<:got %dead)
|
|
||||||
abet:(spam leaf+"desk not installed: {<loc>}" ~)
|
|
||||||
~> %slog.(fmt "uninstalling {<loc>}")
|
~> %slog.(fmt "uninstalling {<loc>}")
|
||||||
=. ..on-init (emit %pass /kiln/uninstall %arvo %c %zest loc %dead)
|
=? ..on-init !=(+<:got %dead)
|
||||||
|
(emit %pass /kiln/uninstall %arvo %c %zest loc %dead)
|
||||||
?~ sync=(~(get by sources) loc)
|
?~ sync=(~(get by sources) loc)
|
||||||
abet
|
abet
|
||||||
(poke-unsync loc u.sync)
|
(poke-unsync loc u.sync)
|
||||||
@ -842,9 +1012,10 @@
|
|||||||
:: Don't need to cancel anything because new syncs will get a new nonce
|
:: Don't need to cancel anything because new syncs will get a new nonce
|
||||||
::
|
::
|
||||||
++ poke-unsync
|
++ poke-unsync
|
||||||
|= hus=kiln-unsync
|
|= hus=sync-record
|
||||||
?~ got=(~(get by zyn) hus)
|
?~ got=(~(get by zyn) hus)
|
||||||
abet:(spam (render "not syncing" [sud her syd ~]:hus) ~)
|
abet:(spam (render "not syncing" [sud her syd ~]:hus) ~)
|
||||||
|
=. ..abet abet:drop:(sync hus)
|
||||||
=. zyn (~(del by zyn) hus)
|
=. zyn (~(del by zyn) hus)
|
||||||
abet:(spam (render "cancelling sync" sud.hus her.hus syd.hus kid.u.got) ~)
|
abet:(spam (render "cancelling sync" sud.hus her.hus syd.hus kid.u.got) ~)
|
||||||
:: +peer: handle %watch
|
:: +peer: handle %watch
|
||||||
@ -852,10 +1023,26 @@
|
|||||||
++ peer
|
++ peer
|
||||||
|= =path
|
|= =path
|
||||||
?> (team:title our src)
|
?> (team:title our src)
|
||||||
?: =(0 1) abet :: avoid mint-vain
|
|
||||||
?+ path ~|(kiln-path/path !!)
|
?+ path ~|(kiln-path/path !!)
|
||||||
[%vats ~]
|
[%vats ~]
|
||||||
(mean leaf+"kiln: old subscription to /kiln/vats failed" ~)
|
(mean leaf+"kiln: old subscription to /kiln/vats failed" ~)
|
||||||
|
::
|
||||||
|
[%jumps ~]
|
||||||
|
abet:(emit %give %fact ~ %kiln-jump !>([%all hop]))
|
||||||
|
::
|
||||||
|
[%updates ~]
|
||||||
|
=< abet
|
||||||
|
%- emit
|
||||||
|
:^ %give %fact ~
|
||||||
|
:- %kiln-sync-update
|
||||||
|
!> ^- sync-update
|
||||||
|
:- %pending
|
||||||
|
%- ~(gas by *(set [sync-record @ud]))
|
||||||
|
^- (list [sync-record @ud])
|
||||||
|
%+ murn ~(tap by zyn)
|
||||||
|
|= [sync-record sync-state]
|
||||||
|
?~ hav ~
|
||||||
|
(some [syd her sud] u.hav)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ take-agent
|
++ take-agent
|
||||||
@ -865,6 +1052,8 @@
|
|||||||
~? ?=(^ p.sign) [%kiln-poke-nack u.p.sign]
|
~? ?=(^ p.sign) [%kiln-poke-nack u.p.sign]
|
||||||
abet
|
abet
|
||||||
~|([%kiln-bad-take-agent wire -.sign] !!)
|
~|([%kiln-bad-take-agent wire -.sign] !!)
|
||||||
|
::
|
||||||
|
[%change-publisher ~] abet
|
||||||
::
|
::
|
||||||
[%fancy *]
|
[%fancy *]
|
||||||
?> ?=(%poke-ack -.sign)
|
?> ?=(%poke-ack -.sign)
|
||||||
@ -1079,15 +1268,30 @@
|
|||||||
abet:abet:(take:(sync syd her sud) t.t.t.wire sign-arvo)
|
abet:abet:(take:(sync syd her sud) t.t.t.wire sign-arvo)
|
||||||
::
|
::
|
||||||
++ sync
|
++ sync
|
||||||
|= kiln-sync
|
|= sync-record
|
||||||
=/ got (~(get by zyn) syd her sud)
|
=/ got (~(get by zyn) syd her sud)
|
||||||
=+ `sync-state`(fall got [(scot %uv nyz) ~ *@ud])
|
=+ `sync-state`(fall got [(scot %uv nyz) ~ *@ud ~ ~ |])
|
||||||
=? nyz ?=(~ got) +(nyz)
|
=? nyz ?=(~ got) +(nyz)
|
||||||
|%
|
|%
|
||||||
++ abet ..sync(zyn (~(put by zyn) [syd her sud] nun kid let))
|
++ abet ..sync(zyn (~(put by zyn) [syd her sud] nun kid let nit hav yea))
|
||||||
++ apex |=(nex=(unit desk) ..abet(kid nex))
|
++ apex |=(nex=(unit desk) ..abet(kid nex))
|
||||||
++ emit |=(card:agent:gall ..abet(kiln (^emit +<)))
|
++ emit |=(card:agent:gall ..abet(kiln (^emit +<)))
|
||||||
++ emil |=((list card:agent:gall) ..abet(kiln (^emil +<)))
|
++ emil |=((list card:agent:gall) ..abet(kiln (^emil +<)))
|
||||||
|
++ okay ..abet(yea &)
|
||||||
|
++ gain
|
||||||
|
=. hav `(dec let)
|
||||||
|
=/ upd=sync-update [%new [syd her sud] (dec let)]
|
||||||
|
(emit %give %fact ~[/update] %kiln-sync-update !>(upd))
|
||||||
|
++ drop
|
||||||
|
=? ..abet ?=(^ hav)
|
||||||
|
=/ upd=sync-update [%drop [syd her sud] u.hav]
|
||||||
|
(emit %give %fact ~[/updates] %kiln-sync-update !>(upd))
|
||||||
|
..abet(hav ~, yea |)
|
||||||
|
++ tada
|
||||||
|
=? ..abet ?=(^ hav)
|
||||||
|
=/ upd=sync-update [%done [syd her sud] u.hav]
|
||||||
|
(emit %give %fact ~[/updates] %kiln-sync-update !>(upd))
|
||||||
|
..abet(hav ~, yea |)
|
||||||
++ here "{<syd>} from {<her>}/{<sud>}"
|
++ here "{<syd>} from {<her>}/{<sud>}"
|
||||||
++ ware
|
++ ware
|
||||||
|= =wire
|
|= =wire
|
||||||
@ -1102,7 +1306,6 @@
|
|||||||
%merg desk her sud
|
%merg desk her sud
|
||||||
ud+(dec let) (get-germ desk)
|
ud+(dec let) (get-germ desk)
|
||||||
==
|
==
|
||||||
::
|
|
||||||
:: (re)Start a sync from scratch by finding what version the source
|
:: (re)Start a sync from scratch by finding what version the source
|
||||||
:: desk is at
|
:: desk is at
|
||||||
::
|
::
|
||||||
@ -1128,6 +1331,12 @@
|
|||||||
=/ m (strand:rand ,vase)
|
=/ m (strand:rand ,vase)
|
||||||
;< =riot:clay bind:m (warp:strandio her sud ~ %sing %w ud+let /)
|
;< =riot:clay bind:m (warp:strandio her sud ~ %sing %w ud+let /)
|
||||||
?> ?=(^ riot)
|
?> ?=(^ riot)
|
||||||
|
:: The syncs may have changed, so get the latest
|
||||||
|
::
|
||||||
|
;< zyx=(map sync-record sync-state) bind:m
|
||||||
|
(scry:strandio (map sync-record sync-state) /gx/hood/kiln/syncs/noun)
|
||||||
|
?. (~(has by zyx) syd her sud)
|
||||||
|
(pure:m !>(%done))
|
||||||
~> %slog.(fmt "downloading update for {here}")
|
~> %slog.(fmt "downloading update for {here}")
|
||||||
;< =riot:clay bind:m (warp:strandio her sud ~ %sing %v ud+let /)
|
;< =riot:clay bind:m (warp:strandio her sud ~ %sing %v ud+let /)
|
||||||
?> ?=(^ riot)
|
?> ?=(^ riot)
|
||||||
@ -1170,6 +1379,7 @@
|
|||||||
?: ?=(%| -.p.sign-arvo)
|
?: ?=(%| -.p.sign-arvo)
|
||||||
:: ~> %slog.(fmt "download failed into {here}; retrying sync")
|
:: ~> %slog.(fmt "download failed into {here}; retrying sync")
|
||||||
:: %- (slog p.p.sign-arvo)
|
:: %- (slog p.p.sign-arvo)
|
||||||
|
=. ..abet drop
|
||||||
init
|
init
|
||||||
::
|
::
|
||||||
~> %slog.(fmt "finished downloading update for {here}")
|
~> %slog.(fmt "finished downloading update for {here}")
|
||||||
@ -1177,7 +1387,7 @@
|
|||||||
:: If nothing changed, just ensure %kids is up-to-date and advance
|
:: If nothing changed, just ensure %kids is up-to-date and advance
|
||||||
::
|
::
|
||||||
?. (get-remote-diff our syd now [her sud (dec let)])
|
?. (get-remote-diff our syd now [her sud (dec let)])
|
||||||
=< next
|
=< next:drop
|
||||||
?~ kid
|
?~ kid
|
||||||
~> %slog.(fmt "remote is identical to {here}, skipping")
|
~> %slog.(fmt "remote is identical to {here}, skipping")
|
||||||
..abet
|
..abet
|
||||||
@ -1186,15 +1396,22 @@
|
|||||||
..abet
|
..abet
|
||||||
~> %slog.(fmt "remote is identical to {here}, merging into {<u.kid>}")
|
~> %slog.(fmt "remote is identical to {here}, merging into {<u.kid>}")
|
||||||
(merg /kids u.kid)
|
(merg /kids u.kid)
|
||||||
|
:: wait for approval if can't automerge & signal available update
|
||||||
|
::
|
||||||
|
?. |(=(our her) yea =([~ &] nit) &(=(~ nit) mer))
|
||||||
|
=. ..abet gain
|
||||||
|
next
|
||||||
:: Else start merging, but also immediately start listening to
|
:: Else start merging, but also immediately start listening to
|
||||||
:: the next revision. Now, all errors should no-op -- we're
|
:: the next revision. Now, all errors should no-op -- we're
|
||||||
:: already waiting for the next revision.
|
:: already waiting for the next revision.
|
||||||
::
|
::
|
||||||
|
=. yea |
|
||||||
=. ..abet (merg /main syd)
|
=. ..abet (merg /main syd)
|
||||||
next
|
next
|
||||||
::
|
::
|
||||||
%main
|
%main
|
||||||
?> ?=(%mere +<.sign-arvo)
|
?> ?=(%mere +<.sign-arvo)
|
||||||
|
=< tada
|
||||||
?: ?=(%| -.p.sign-arvo)
|
?: ?=(%| -.p.sign-arvo)
|
||||||
=+ "kiln: merge into {here} failed, waiting for next revision"
|
=+ "kiln: merge into {here} failed, waiting for next revision"
|
||||||
%- (slog leaf/- p.p.sign-arvo)
|
%- (slog leaf/- p.p.sign-arvo)
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
%- ~(gas in *math:eyre)
|
%- ~(gas in *math:eyre)
|
||||||
~['Content-Type'^['application/json']~]
|
~['Content-Type'^['application/json']~]
|
||||||
%- some
|
%- some
|
||||||
%- as-octt:mimes:html
|
%- as-octs:mimes:html
|
||||||
(en-json:html (request-to-json req))
|
(en:json:html (request-to-json req))
|
||||||
::
|
::
|
||||||
++ request-to-json
|
++ request-to-json
|
||||||
|= request
|
|= request
|
||||||
@ -65,7 +65,7 @@
|
|||||||
|= body=(unit octs)
|
|= body=(unit octs)
|
||||||
^- (unit batch-request)
|
^- (unit batch-request)
|
||||||
?~ body ~
|
?~ body ~
|
||||||
?~ jon=(de-json:html q.u.body) ~
|
?~ jon=(de:json:html q.u.body) ~
|
||||||
=, dejs-soft:format
|
=, dejs-soft:format
|
||||||
=; reparser
|
=; reparser
|
||||||
?: ?=([%a *] u.jon)
|
?: ?=([%a *] u.jon)
|
||||||
|
@ -186,9 +186,9 @@
|
|||||||
!< (list @ux)
|
!< (list @ux)
|
||||||
=< q
|
=< q
|
||||||
%- need %- need
|
%- need %- need
|
||||||
(scry:(ames-gate now eny roof) ~ %x beam)
|
(scry:(ames-gate now eny roof) ~ / %x beam)
|
||||||
::
|
::
|
||||||
=/ paz=(list have:ames)
|
=/ paz=(list have:ames)
|
||||||
%+ spun meows
|
%+ spun meows
|
||||||
|= [blob=@ux num=_1]
|
|= [blob=@ux num=_1]
|
||||||
^- [have:ames _num]
|
^- [have:ames _num]
|
||||||
@ -196,9 +196,10 @@
|
|||||||
[num (sift-meow:ames blob)]
|
[num (sift-meow:ames blob)]
|
||||||
::
|
::
|
||||||
:- sig:(sift-roar:ames-raw (lent paz) (flop paz))
|
:- sig:(sift-roar:ames-raw (lent paz) (flop paz))
|
||||||
%+ turn meows
|
%+ spun meows
|
||||||
|= meow=@ux
|
|= [meow=@ux num=_1]
|
||||||
(can 3 4^lop 2^wid wid^`@`pat (met 3 meow)^meow ~)
|
:_ +(num)
|
||||||
|
(can 3 4^num 2^wid wid^`@`pat (met 3 meow)^meow ~)
|
||||||
:: ::
|
:: ::
|
||||||
++ ames-scry-peer
|
++ ames-scry-peer
|
||||||
|= $: =ames-gate
|
|= $: =ames-gate
|
||||||
@ -212,7 +213,7 @@
|
|||||||
=< q
|
=< q
|
||||||
%- need %- need
|
%- need %- need
|
||||||
%- scry:(ames-gate now eny roof)
|
%- scry:(ames-gate now eny roof)
|
||||||
[~ %x [[our %$ da+now] /peers/(scot %p her)]]
|
[~ / %x [[our %$ da+now] /peers/(scot %p her)]]
|
||||||
::
|
::
|
||||||
++ gall-scry-nonce
|
++ gall-scry-nonce
|
||||||
|= $: =gall-gate
|
|= $: =gall-gate
|
||||||
@ -226,7 +227,7 @@
|
|||||||
=< q
|
=< q
|
||||||
%- need %- need
|
%- need %- need
|
||||||
%- scry:(gall-gate now eny roof)
|
%- scry:(gall-gate now eny roof)
|
||||||
[~ %n [[our dude da+now] [%$ (scot %p ship.sub) [term wire]:sub]]]
|
[~ / %n [[our dude da+now] [%$ (scot %p ship.sub) [term wire]:sub]]]
|
||||||
::
|
::
|
||||||
++ load-agent
|
++ load-agent
|
||||||
|= [=ship =gall-gate =dude:gall =agent:gall]
|
|= [=ship =gall-gate =dude:gall =agent:gall]
|
||||||
|
@ -49,8 +49,8 @@
|
|||||||
::
|
::
|
||||||
++ czar
|
++ czar
|
||||||
^- octs
|
^- octs
|
||||||
%- as-octt:mimes:html
|
%- as-octs:mimes:html
|
||||||
%- en-json:html
|
%- en:json:html
|
||||||
:- %a
|
:- %a
|
||||||
%+ turn (gulf 0 255)
|
%+ turn (gulf 0 255)
|
||||||
|= gal=@
|
|= gal=@
|
||||||
@ -63,8 +63,8 @@
|
|||||||
++ point
|
++ point
|
||||||
|= who=ship
|
|= who=ship
|
||||||
^- octs
|
^- octs
|
||||||
%- as-octt:mimes:html
|
%- as-octs:mimes:html
|
||||||
%- en-json:html
|
%- en:json:html
|
||||||
%+ request-to-json
|
%+ request-to-json
|
||||||
~.
|
~.
|
||||||
:- 'getPoint'
|
:- 'getPoint'
|
||||||
@ -73,8 +73,8 @@
|
|||||||
::
|
::
|
||||||
++ turf
|
++ turf
|
||||||
^- octs
|
^- octs
|
||||||
%- as-octt:mimes:html
|
%- as-octs:mimes:html
|
||||||
%- en-json:html
|
%- en:json:html
|
||||||
%+ request-to-json
|
%+ request-to-json
|
||||||
'turf'
|
'turf'
|
||||||
['getDns' ~]
|
['getDns' ~]
|
||||||
@ -106,7 +106,7 @@
|
|||||||
++ czar
|
++ czar
|
||||||
|= rep=octs
|
|= rep=octs
|
||||||
^- (unit (map ship [=rift =life =pass]))
|
^- (unit (map ship [=rift =life =pass]))
|
||||||
=/ jon=(unit json) (de-json:html q.rep)
|
=/ jon=(unit json) (de:json:html q.rep)
|
||||||
?~ jon
|
?~ jon
|
||||||
~&([%czar-take-dawn %invalid-json] ~)
|
~&([%czar-take-dawn %invalid-json] ~)
|
||||||
=/ res=(unit (list [@t @ud @ud @]))
|
=/ res=(unit (list [@t @ud @ud @]))
|
||||||
@ -142,7 +142,7 @@
|
|||||||
|= [who=ship rep=octs]
|
|= [who=ship rep=octs]
|
||||||
^- (unit point:azimuth)
|
^- (unit point:azimuth)
|
||||||
~! *point:azimuth
|
~! *point:azimuth
|
||||||
=/ jon=(unit json) (de-json:html q.rep)
|
=/ jon=(unit json) (de:json:html q.rep)
|
||||||
?~ jon
|
?~ jon
|
||||||
~&([%point-take-dawn %invalid-json] ~)
|
~&([%point-take-dawn %invalid-json] ~)
|
||||||
=- ?~ res
|
=- ?~ res
|
||||||
@ -202,7 +202,7 @@
|
|||||||
++ turf
|
++ turf
|
||||||
|= rep=octs
|
|= rep=octs
|
||||||
^- (unit (list ^turf))
|
^- (unit (list ^turf))
|
||||||
=/ jon=(unit json) (de-json:html q.rep)
|
=/ jon=(unit json) (de:json:html q.rep)
|
||||||
?~ jon
|
?~ jon
|
||||||
~&([%turf-take-dawn %invalid-json] ~)
|
~&([%turf-take-dawn %invalid-json] ~)
|
||||||
=/ res=(unit (list @t))
|
=/ res=(unit (list @t))
|
||||||
|
1
pkg/arvo/mar/kiln/approve-merge.hoon
Symbolic link
1
pkg/arvo/mar/kiln/approve-merge.hoon
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../base-dev/mar/kiln/approve-merge.hoon
|
1
pkg/arvo/mar/kiln/jump-ask.hoon
Symbolic link
1
pkg/arvo/mar/kiln/jump-ask.hoon
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../base-dev/mar/kiln/jump-ask.hoon
|
1
pkg/arvo/mar/kiln/jump-opt.hoon
Symbolic link
1
pkg/arvo/mar/kiln/jump-opt.hoon
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../base-dev/mar/kiln/jump-opt.hoon
|
1
pkg/arvo/mar/kiln/jump.hoon
Symbolic link
1
pkg/arvo/mar/kiln/jump.hoon
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../base-dev/mar/kiln/jump.hoon
|
1
pkg/arvo/mar/kiln/sync-update.hoon
Symbolic link
1
pkg/arvo/mar/kiln/sync-update.hoon
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../base-dev/mar/kiln/sync-update.hoon
|
@ -13,7 +13,6 @@
|
|||||||
=> v=.
|
=> v=.
|
||||||
|%
|
|%
|
||||||
++ mime => v [/text/plain (as-octs (of-wain pem))]
|
++ mime => v [/text/plain (as-octs (of-wain pem))]
|
||||||
++ elem => v ;pre: {(trip (of-wain pem))}
|
|
||||||
--
|
--
|
||||||
++ grad %mime
|
++ grad %mime
|
||||||
--
|
--
|
||||||
|
@ -3,42 +3,6 @@
|
|||||||
::
|
::
|
||||||
/? 310
|
/? 310
|
||||||
=, html
|
=, html
|
||||||
|%
|
|
||||||
++ words 1
|
|
||||||
++ hedtal
|
|
||||||
=| met=marl
|
|
||||||
|= a=marl ^- [hed=marl tal=marl]
|
|
||||||
?~ a [~ ~]
|
|
||||||
?. ?=(%h1 n.g.i.a)
|
|
||||||
?: ?=(%meta n.g.i.a)
|
|
||||||
$(a t.a, met [i.a met])
|
|
||||||
=+ had=$(a c.i.a)
|
|
||||||
?^ -.had had
|
|
||||||
$(a t.a)
|
|
||||||
[c.i.a (weld (flop met) (limit words t.a))]
|
|
||||||
::
|
|
||||||
++ limit
|
|
||||||
|= [lim=@u mal=marl]
|
|
||||||
=< res
|
|
||||||
|- ^- [rem=@u res=marl]
|
|
||||||
?~ mal [lim ~]
|
|
||||||
?~ lim [0 ~]
|
|
||||||
=/ [lam=@u hed=manx]
|
|
||||||
?: ?=(_;/(**) i.mal)
|
|
||||||
[lim ;/(tay)]:(deword lim v.i.a.g.i.mal)
|
|
||||||
[rem ele(c res)]:[ele=i.mal $(mal c.i.mal)]
|
|
||||||
[rem - res]:[hed $(lim lam, mal t.mal)]
|
|
||||||
::
|
|
||||||
++ deword
|
|
||||||
|= [lim=@u tay=tape] ^- [lim=@u tay=tape]
|
|
||||||
?~ tay [lim tay]
|
|
||||||
?~ lim [0 ~]
|
|
||||||
=+ wer=(dot 1^1 tay)
|
|
||||||
?~ q.wer
|
|
||||||
[lim - tay]:[i.tay $(tay t.tay)]
|
|
||||||
=+ nex=$(lim (dec lim), tay q.q.u.q.wer)
|
|
||||||
[-.nex [(wonk wer) +.nex]]
|
|
||||||
--
|
|
||||||
::
|
::
|
||||||
::
|
::
|
||||||
=, mimes:html
|
=, mimes:html
|
||||||
@ -50,14 +14,18 @@
|
|||||||
++ mime
|
++ mime
|
||||||
=< mime
|
=< mime
|
||||||
|%
|
|%
|
||||||
++ elem ;div:(h1:"*{hed}" div:"*{tal}") :: convert to %elem
|
++ hymn :: convert to %hymn
|
||||||
++ hymn ;html:(head:title:"snip" body:"+{elem}") :: convert to %hymn
|
|^ html
|
||||||
|
++ div ;div:(h1:"*{hed}" div:"*{tal}")
|
||||||
|
++ html ;html:(head:title:"snip" body:"+{div}")
|
||||||
|
--
|
||||||
++ html (crip (en-xml hymn)) :: convert to %html
|
++ html (crip (en-xml hymn)) :: convert to %html
|
||||||
++ mime [/text/html (as-octs html)] :: convert to %mime
|
++ mime [/text/html (as-octs html)] :: convert to %mime
|
||||||
--
|
--
|
||||||
++ noun [hed tal]
|
++ noun [hed tal]
|
||||||
--
|
--
|
||||||
++ grab |% :: convert from
|
++ grab :: convert from
|
||||||
++ noun ,[marl marl] :: clam from %noun
|
|%
|
||||||
++ elem |=(a=manx (hedtal +.a))
|
++ noun ,[marl marl] :: clam from %noun
|
||||||
-- --
|
--
|
||||||
|
--
|
||||||
|
24
pkg/arvo/mar/vere-update.hoon
Normal file
24
pkg/arvo/mar/vere-update.hoon
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
|_ [cur=vere next=(unit vere)]
|
||||||
|
++ en-vere
|
||||||
|
|= v=vere
|
||||||
|
%- pairs:enjs:format
|
||||||
|
:- [%non s+non.v]
|
||||||
|
:- [%rev (path:enjs:format rev.v)]
|
||||||
|
%+ turn kel.v
|
||||||
|
|= w=weft
|
||||||
|
[lal.w (numb:enjs:format num.w)]
|
||||||
|
::
|
||||||
|
++ grab
|
||||||
|
|%
|
||||||
|
++ noun ,[cur=vere next=(unit vere)]
|
||||||
|
--
|
||||||
|
++ grow
|
||||||
|
|%
|
||||||
|
++ json
|
||||||
|
%- pairs:enjs:format
|
||||||
|
:- [%cur (en-vere cur)]
|
||||||
|
?~ next ~
|
||||||
|
:- [%next (en-vere u.next)] ~
|
||||||
|
--
|
||||||
|
++ grad %noun
|
||||||
|
--
|
1
pkg/arvo/mar/vere.hoon
Symbolic link
1
pkg/arvo/mar/vere.hoon
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../base-dev/mar/vere.hoon
|
@ -1,12 +0,0 @@
|
|||||||
|_ a=manx
|
|
||||||
++ grad %noun
|
|
||||||
++ grab
|
|
||||||
|%
|
|
||||||
++ noun manx
|
|
||||||
--
|
|
||||||
++ grow
|
|
||||||
|%
|
|
||||||
++ htm a
|
|
||||||
++ noun a
|
|
||||||
--
|
|
||||||
--
|
|
@ -1,11 +0,0 @@
|
|||||||
|_ a=manx
|
|
||||||
++ grad %noun
|
|
||||||
++ grab
|
|
||||||
|%
|
|
||||||
++ noun manx
|
|
||||||
--
|
|
||||||
++ grow
|
|
||||||
|%
|
|
||||||
++ noun a
|
|
||||||
--
|
|
||||||
--
|
|
1
pkg/arvo/mar/xhtml.hoon
Symbolic link
1
pkg/arvo/mar/xhtml.hoon
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../base-dev/mar/xhtml.hoon
|
@ -1 +1 @@
|
|||||||
[%zuse 413]
|
[%zuse 411]
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|%
|
|%
|
||||||
+| %global
|
+| %global
|
||||||
::
|
::
|
||||||
++ arvo %238
|
++ arvo %237
|
||||||
::
|
::
|
||||||
:: $arch: node identity
|
:: $arch: node identity
|
||||||
:: $axal: fundamental node, recursive (trie)
|
:: $axal: fundamental node, recursive (trie)
|
||||||
@ -111,6 +111,7 @@
|
|||||||
|$ [a]
|
|$ [a]
|
||||||
$~ =>(~ |~(* ~))
|
$~ =>(~ |~(* ~))
|
||||||
$- $: lyc=gang :: leakset
|
$- $: lyc=gang :: leakset
|
||||||
|
pov=path :: provenance
|
||||||
omen :: perspective, path
|
omen :: perspective, path
|
||||||
== ::
|
== ::
|
||||||
%- unit :: ~: unknown
|
%- unit :: ~: unknown
|
||||||
@ -118,7 +119,7 @@
|
|||||||
(cask a) ::
|
(cask a) ::
|
||||||
+$ roon :: partial namespace
|
+$ roon :: partial namespace
|
||||||
$~ =>(~ |~(* ~))
|
$~ =>(~ |~(* ~))
|
||||||
$- [lyc=gang car=term bem=beam]
|
$- [lyc=gang pov=path car=term bem=beam]
|
||||||
(unit (unit cage))
|
(unit (unit cage))
|
||||||
+$ root $-(^ (unit (unit)))
|
+$ root $-(^ (unit (unit)))
|
||||||
+$ view $@(term [way=term car=term]) :: perspective
|
+$ view $@(term [way=term car=term]) :: perspective
|
||||||
@ -207,9 +208,9 @@
|
|||||||
==
|
==
|
||||||
+$ heir
|
+$ heir
|
||||||
$% $: %grub
|
$% $: %grub
|
||||||
$% [?(%240 %239 %238) =grub]
|
$% [?(%240 %239 %238 %237) =grub]
|
||||||
== ==
|
== ==
|
||||||
[?(%240 %239 %238) =debt =soul]
|
[?(%240 %239 %238 %237) =debt =soul]
|
||||||
==
|
==
|
||||||
+$ plan (pair germ (list move))
|
+$ plan (pair germ (list move))
|
||||||
+$ soul
|
+$ soul
|
||||||
@ -342,13 +343,13 @@
|
|||||||
::
|
::
|
||||||
++ look
|
++ look
|
||||||
~/ %look
|
~/ %look
|
||||||
|= [rof=roof lyc=gang]
|
|= [rof=roof lyc=gang pov=path]
|
||||||
^- root
|
^- root
|
||||||
~/ %in
|
~/ %in
|
||||||
|= [ref=* raw=*]
|
|= [ref=* raw=*]
|
||||||
?~ pax=((soft path) raw) ~
|
?~ pax=((soft path) raw) ~
|
||||||
?~ mon=(de-omen u.pax) ~
|
?~ mon=(de-omen u.pax) ~
|
||||||
?~ dat=(rof lyc u.mon) ~
|
?~ dat=(rof lyc pov u.mon) ~
|
||||||
?~ u.dat [~ ~]
|
?~ u.dat [~ ~]
|
||||||
=* vax q.u.u.dat
|
=* vax q.u.u.dat
|
||||||
?. ?& ?=(^ ref)
|
?. ?& ?=(^ ref)
|
||||||
@ -1052,7 +1053,7 @@
|
|||||||
++ smit
|
++ smit
|
||||||
|= [cap=tape sub=vase pax=path txt=@t]
|
|= [cap=tape sub=vase pax=path txt=@t]
|
||||||
^- vase
|
^- vase
|
||||||
~> %slog.[0 leaf/"{cap}: {(scow p+(mug txt))}"]
|
~> %slog.[0 leaf/"{cap}: {(scow uv+(mug txt))}"]
|
||||||
~> %bout
|
~> %bout
|
||||||
%- road |.
|
%- road |.
|
||||||
~_ leaf/"{cap}: build failed"
|
~_ leaf/"{cap}: build failed"
|
||||||
@ -1101,7 +1102,7 @@
|
|||||||
++ peek
|
++ peek
|
||||||
~/ %peek
|
~/ %peek
|
||||||
^- rook
|
^- rook
|
||||||
|= [lyc=gang omen]
|
|= [lyc=gang pov=path omen]
|
||||||
^- (unit (unit (cask meta)))
|
^- (unit (unit (cask meta)))
|
||||||
:: namespace reads receive no entropy
|
:: namespace reads receive no entropy
|
||||||
::
|
::
|
||||||
@ -1113,7 +1114,7 @@
|
|||||||
~> %mean.'peek: pull failed'
|
~> %mean.'peek: pull failed'
|
||||||
(~(slap wa sac) rig [%limb %scry])
|
(~(slap wa sac) rig [%limb %scry])
|
||||||
::
|
::
|
||||||
=/ mas=[gang view beam] [lyc vis bem]
|
=/ mas=[gang path view beam] [lyc pov vis bem]
|
||||||
::
|
::
|
||||||
=^ pro sac
|
=^ pro sac
|
||||||
~> %mean.'peek: call failed'
|
~> %mean.'peek: call failed'
|
||||||
@ -1293,7 +1294,7 @@
|
|||||||
:^ %pass [vane.gem vane]
|
:^ %pass [vane.gem vane]
|
||||||
?: ?=(?(%deal %deal-gall) +>-.task)
|
?: ?=(?(%deal %deal-gall) +>-.task)
|
||||||
:- :- +>-.task
|
:- :- +>-.task
|
||||||
;;([[ship ship] term term] [+>+< +>+>- +>+>+<]:task)
|
;;([[ship ship path] term term] [+>+< +>+>- +>+>+<]:task)
|
||||||
wire
|
wire
|
||||||
[(symp +>-.task) wire]
|
[(symp +>-.task) wire]
|
||||||
duct
|
duct
|
||||||
@ -1373,7 +1374,7 @@
|
|||||||
|= [nam=term =vane]
|
|= [nam=term =vane]
|
||||||
=; mas=(list mass)
|
=; mas=(list mass)
|
||||||
nam^|+(welp mas [dot+&+q.vase typ+&+p.vase sac+&+worm ~]:vane)
|
nam^|+(welp mas [dot+&+q.vase typ+&+p.vase sac+&+worm ~]:vane)
|
||||||
?~ met=(peek [~ ~] [nam %x] bem) ~
|
?~ met=(peek [~ ~] / [nam %x] bem) ~
|
||||||
?~ u.met ~
|
?~ u.met ~
|
||||||
~| mass+nam
|
~| mass+nam
|
||||||
;;((list mass) q.q.u.u.met)
|
;;((list mass) q.q.u.u.met)
|
||||||
@ -1381,7 +1382,7 @@
|
|||||||
::
|
::
|
||||||
++ peek
|
++ peek
|
||||||
^- rook
|
^- rook
|
||||||
|= [lyc=gang omen]
|
|= [lyc=gang pov=path omen]
|
||||||
^- (unit (unit (cask meta)))
|
^- (unit (unit (cask meta)))
|
||||||
:: vane and care may be concatenated
|
:: vane and care may be concatenated
|
||||||
::
|
::
|
||||||
@ -1392,12 +1393,12 @@
|
|||||||
[(end 3 vis) (rsh 3 vis)]
|
[(end 3 vis) (rsh 3 vis)]
|
||||||
::
|
::
|
||||||
?: ?=(%$ way)
|
?: ?=(%$ way)
|
||||||
(peek:pith lyc car bem)
|
(peek:pith lyc pov car bem)
|
||||||
::
|
::
|
||||||
=. way (grow way)
|
=. way (grow way)
|
||||||
?~ van=(~(get by van.mod) way)
|
?~ van=(~(get by van.mod) way)
|
||||||
~
|
~
|
||||||
%. [lyc car bem]
|
%. [lyc pov car bem]
|
||||||
peek:spin:(~(plow va [vil u.van]) now peek)
|
peek:spin:(~(plow va [vil u.van]) now peek)
|
||||||
:: +call: advance to target
|
:: +call: advance to target
|
||||||
::
|
::
|
||||||
@ -1552,11 +1553,11 @@
|
|||||||
::
|
::
|
||||||
++ peek
|
++ peek
|
||||||
^- roon
|
^- roon
|
||||||
|= [lyc=gang car=term bem=beam]
|
|= [lyc=gang pov=path car=term bem=beam]
|
||||||
^- (unit (unit cage))
|
^- (unit (unit cage))
|
||||||
?. ?| =(our p.bem)
|
?. ?& =(our p.bem)
|
||||||
?=(%$ q.bem)
|
?=(%$ q.bem)
|
||||||
=([%da now] p.r.bem)
|
=([%da now] r.bem)
|
||||||
==
|
==
|
||||||
~
|
~
|
||||||
?+ s.bem ~
|
?+ s.bem ~
|
||||||
@ -1741,6 +1742,7 @@
|
|||||||
%i %iris
|
%i %iris
|
||||||
%j %jael
|
%j %jael
|
||||||
%k %khan
|
%k %khan
|
||||||
|
%l %lick
|
||||||
==
|
==
|
||||||
-- =>
|
-- =>
|
||||||
::
|
::
|
||||||
@ -1764,7 +1766,7 @@
|
|||||||
::
|
::
|
||||||
=. sol
|
=. sol
|
||||||
?- -.hir
|
?- -.hir
|
||||||
?(%240 %239 %238) soul.hir
|
?(%240 %239 %238 %237) soul.hir
|
||||||
==
|
==
|
||||||
:: clear compiler caches
|
:: clear compiler caches
|
||||||
::
|
::
|
||||||
@ -1805,7 +1807,7 @@
|
|||||||
==
|
==
|
||||||
::
|
::
|
||||||
?~ hap ~
|
?~ hap ~
|
||||||
=/ pro (~(peek le:part [pit vil] sol) lyc [vis bem]:u.hap)
|
=/ pro (~(peek le:part [pit vil] sol) lyc / [vis bem]:u.hap)
|
||||||
?: |(?=(~ pro) ?=(~ u.pro)) ~
|
?: |(?=(~ pro) ?=(~ u.pro)) ~
|
||||||
=/ dat=(cask) [p q.q]:u.u.pro
|
=/ dat=(cask) [p q.q]:u.u.pro
|
||||||
?. pat.u.hap `dat
|
?. pat.u.hap `dat
|
||||||
@ -1879,7 +1881,7 @@
|
|||||||
++ smit
|
++ smit
|
||||||
|= [cap=tape sub=(trap vase) pax=path txt=@t]
|
|= [cap=tape sub=(trap vase) pax=path txt=@t]
|
||||||
^- (trap vase)
|
^- (trap vase)
|
||||||
~> %slog.[0 leaf/"{cap}: {(scow p+(mug txt))}"]
|
~> %slog.[0 leaf/"{cap}: {(scow uv+(mug txt))}"]
|
||||||
%- road |.
|
%- road |.
|
||||||
~_ leaf/"{cap}: build failed"
|
~_ leaf/"{cap}: build failed"
|
||||||
(swat sub (rain pax txt))
|
(swat sub (rain pax txt))
|
||||||
|
@ -4270,12 +4270,11 @@
|
|||||||
?& ?| =(1 tef)
|
?& ?| =(1 tef)
|
||||||
=+ i=1
|
=+ i=1
|
||||||
|- ^- ?
|
|- ^- ?
|
||||||
?|
|
?| =(i tef)
|
||||||
=(i tef)
|
|
||||||
?& (gte (cut 3 [(add i inx) 1] b) 128)
|
?& (gte (cut 3 [(add i inx) 1] b) 128)
|
||||||
$(i +(i))
|
$(i +(i))
|
||||||
== == ==
|
== == ==
|
||||||
$(inx +(inx))
|
$(inx (add inx tef))
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ ruth :: biblical sanity
|
++ ruth :: biblical sanity
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
=> ..part
|
=> ..part
|
||||||
~% %lull ..part ~
|
~% %lull ..part ~
|
||||||
|%
|
|%
|
||||||
++ lull %324
|
++ lull %323
|
||||||
:: :: ::
|
:: :: ::
|
||||||
:::: :: :: (1) models
|
:::: :: :: (1) models
|
||||||
:: :: ::
|
:: :: ::
|
||||||
@ -462,7 +462,8 @@
|
|||||||
+$ rift @ud :: ship continuity
|
+$ rift @ud :: ship continuity
|
||||||
+$ mime (pair mite octs) :: mimetyped data
|
+$ mime (pair mite octs) :: mimetyped data
|
||||||
+$ octs (pair @ud @) :: octet-stream
|
+$ octs (pair @ud @) :: octet-stream
|
||||||
+$ sock (pair ship ship) :: outgoing [our his]
|
+$ sock (pair ship ship) :: outgoing [src dest]
|
||||||
|
+$ sack (trel ship ship path) :: $sock /w provenance
|
||||||
+$ stub (list (pair stye (list @c))) :: styled unicode
|
+$ stub (list (pair stye (list @c))) :: styled unicode
|
||||||
+$ stye (pair (set deco) (pair tint tint)) :: decos/bg/fg
|
+$ stye (pair (set deco) (pair tint tint)) :: decos/bg/fg
|
||||||
+$ styl %+ pair (unit deco) :: cascading style
|
+$ styl %+ pair (unit deco) :: cascading style
|
||||||
@ -584,6 +585,7 @@
|
|||||||
%'GET'
|
%'GET'
|
||||||
%'HEAD'
|
%'HEAD'
|
||||||
%'OPTIONS'
|
%'OPTIONS'
|
||||||
|
%'PATCH'
|
||||||
%'POST'
|
%'POST'
|
||||||
%'PUT'
|
%'PUT'
|
||||||
%'TRACE'
|
%'TRACE'
|
||||||
@ -762,11 +764,14 @@
|
|||||||
:: Messaging Tasks
|
:: Messaging Tasks
|
||||||
::
|
::
|
||||||
:: %hear: packet from unix
|
:: %hear: packet from unix
|
||||||
|
:: %dear: lane from unix
|
||||||
:: %heed: track peer's responsiveness; gives %clog if slow
|
:: %heed: track peer's responsiveness; gives %clog if slow
|
||||||
:: %jilt: stop tracking peer's responsiveness
|
:: %jilt: stop tracking peer's responsiveness
|
||||||
:: %cork: request to delete message flow
|
:: %cork: request to delete message flow
|
||||||
:: %kroc: request to delete stale message flows
|
:: %tame: request to delete route for ship
|
||||||
|
:: %kroc: request to delete specific message flows, from their bones
|
||||||
:: %plea: request to send message
|
:: %plea: request to send message
|
||||||
|
:: %deep: deferred calls to %ames, from itself
|
||||||
::
|
::
|
||||||
:: Remote Scry Tasks
|
:: Remote Scry Tasks
|
||||||
::
|
::
|
||||||
@ -783,17 +788,21 @@
|
|||||||
:: %snub: set packet blocklist to .ships
|
:: %snub: set packet blocklist to .ships
|
||||||
:: %spew: set verbosity toggles
|
:: %spew: set verbosity toggles
|
||||||
:: %cong: adjust congestion control parameters
|
:: %cong: adjust congestion control parameters
|
||||||
:: %stir: recover from timer desync
|
:: %stir: recover from timer desync and assorted debug commands
|
||||||
:: %trim: release memory
|
:: %trim: release memory
|
||||||
:: %vega: kernel reload notification
|
:: %vega: kernel reload notification
|
||||||
::
|
::
|
||||||
+$ task
|
+$ task
|
||||||
|
$+ ames-task
|
||||||
$% [%hear =lane =blob]
|
$% [%hear =lane =blob]
|
||||||
|
[%dear =ship =lane]
|
||||||
[%heed =ship]
|
[%heed =ship]
|
||||||
[%jilt =ship]
|
[%jilt =ship]
|
||||||
[%cork =ship]
|
[%cork =ship]
|
||||||
[%kroc dry=?]
|
[%tame =ship]
|
||||||
|
[%kroc bones=(list [ship bone])]
|
||||||
$>(%plea vane-task)
|
$>(%plea vane-task)
|
||||||
|
[%deep =deep]
|
||||||
::
|
::
|
||||||
[%keen spar]
|
[%keen spar]
|
||||||
[%yawn spar]
|
[%yawn spar]
|
||||||
@ -901,7 +910,15 @@
|
|||||||
:: life based on the ship.
|
:: life based on the ship.
|
||||||
::
|
::
|
||||||
+$ spar [=ship =path]
|
+$ spar [=ship =path]
|
||||||
|
:: $deep: deferred %ames call, from self, to keep +abet cores pure
|
||||||
::
|
::
|
||||||
|
+$ deep
|
||||||
|
$% [%nack =ship =nack=bone =message-blob]
|
||||||
|
[%sink =ship =target=bone naxplanation=[=message-num =error]]
|
||||||
|
[%drop =ship =nack=bone =message-num]
|
||||||
|
[%cork =ship =bone]
|
||||||
|
[%kill =ship =bone]
|
||||||
|
==
|
||||||
:: +| %atomics
|
:: +| %atomics
|
||||||
::
|
::
|
||||||
+$ bone @udbone
|
+$ bone @udbone
|
||||||
@ -960,6 +977,7 @@
|
|||||||
:: %known: we know their life and public keys, so we have a channel
|
:: %known: we know their life and public keys, so we have a channel
|
||||||
::
|
::
|
||||||
+$ ship-state
|
+$ ship-state
|
||||||
|
$+ ship-state
|
||||||
$% [%alien alien-agenda]
|
$% [%alien alien-agenda]
|
||||||
[%known peer-state]
|
[%known peer-state]
|
||||||
==
|
==
|
||||||
@ -970,6 +988,7 @@
|
|||||||
:: heeds: local tracking requests; passed through into $peer-state
|
:: heeds: local tracking requests; passed through into $peer-state
|
||||||
::
|
::
|
||||||
+$ alien-agenda
|
+$ alien-agenda
|
||||||
|
$+ alien-agenda
|
||||||
$: messages=(list [=duct =plea])
|
$: messages=(list [=duct =plea])
|
||||||
packets=(set =blob)
|
packets=(set =blob)
|
||||||
heeds=(set duct)
|
heeds=(set duct)
|
||||||
@ -997,6 +1016,7 @@
|
|||||||
:: corked: bones closed on both sender and receiver
|
:: corked: bones closed on both sender and receiver
|
||||||
::
|
::
|
||||||
+$ peer-state
|
+$ peer-state
|
||||||
|
$+ peer-state
|
||||||
$: $: =symmetric-key
|
$: $: =symmetric-key
|
||||||
=life
|
=life
|
||||||
=rift
|
=rift
|
||||||
@ -1015,6 +1035,7 @@
|
|||||||
keens=(map path keen-state)
|
keens=(map path keen-state)
|
||||||
==
|
==
|
||||||
+$ keen-state
|
+$ keen-state
|
||||||
|
$+ keen-state
|
||||||
$: wan=((mop @ud want) lte) :: request packets, sent
|
$: wan=((mop @ud want) lte) :: request packets, sent
|
||||||
nex=(list want) :: request packets, unsent
|
nex=(list want) :: request packets, unsent
|
||||||
hav=(list have) :: response packets, backward
|
hav=(list have) :: response packets, backward
|
||||||
@ -1133,6 +1154,7 @@
|
|||||||
:: packet-pump-state: state of corresponding |packet-pump
|
:: packet-pump-state: state of corresponding |packet-pump
|
||||||
::
|
::
|
||||||
+$ message-pump-state
|
+$ message-pump-state
|
||||||
|
$+ message-pump-state
|
||||||
$: current=_`message-num`1
|
$: current=_`message-num`1
|
||||||
next=_`message-num`1
|
next=_`message-num`1
|
||||||
unsent-messages=(qeu message-blob)
|
unsent-messages=(qeu message-blob)
|
||||||
@ -1153,6 +1175,7 @@
|
|||||||
:: metrics: congestion control information
|
:: metrics: congestion control information
|
||||||
::
|
::
|
||||||
+$ packet-pump-state
|
+$ packet-pump-state
|
||||||
|
$+ packet-pump-state
|
||||||
$: next-wake=(unit @da)
|
$: next-wake=(unit @da)
|
||||||
live=((mop live-packet-key live-packet-val) lte-packets)
|
live=((mop live-packet-key live-packet-val) lte-packets)
|
||||||
metrics=pump-metrics
|
metrics=pump-metrics
|
||||||
@ -1190,7 +1213,6 @@
|
|||||||
:: rto: retransmission timeout
|
:: rto: retransmission timeout
|
||||||
:: rtt: roundtrip time estimate, low-passed using EWMA
|
:: rtt: roundtrip time estimate, low-passed using EWMA
|
||||||
:: rttvar: mean deviation of .rtt, also low-passed with EWMA
|
:: rttvar: mean deviation of .rtt, also low-passed with EWMA
|
||||||
:: num-live: how many packets sent, awaiting ack
|
|
||||||
:: ssthresh: slow-start threshold
|
:: ssthresh: slow-start threshold
|
||||||
:: cwnd: congestion window; max unacked packets
|
:: cwnd: congestion window; max unacked packets
|
||||||
::
|
::
|
||||||
@ -1200,7 +1222,6 @@
|
|||||||
rttvar=_~s1
|
rttvar=_~s1
|
||||||
ssthresh=_10.000
|
ssthresh=_10.000
|
||||||
cwnd=_1
|
cwnd=_1
|
||||||
num-live=@ud
|
|
||||||
counter=@ud
|
counter=@ud
|
||||||
==
|
==
|
||||||
+$ live-packet
|
+$ live-packet
|
||||||
@ -1229,6 +1250,7 @@
|
|||||||
:: live-messages: partially received messages
|
:: live-messages: partially received messages
|
||||||
::
|
::
|
||||||
+$ message-sink-state
|
+$ message-sink-state
|
||||||
|
$+ message-sink-state
|
||||||
$: last-acked=message-num
|
$: last-acked=message-num
|
||||||
last-heard=message-num
|
last-heard=message-num
|
||||||
pending-vane-ack=(qeu [=message-num message=*])
|
pending-vane-ack=(qeu [=message-num message=*])
|
||||||
@ -1365,7 +1387,9 @@
|
|||||||
=+ len=(cut 3 [4 2] hoot)
|
=+ len=(cut 3 [4 2] hoot)
|
||||||
=+ pat=(cut 3 [6 len] hoot)
|
=+ pat=(cut 3 [6 len] hoot)
|
||||||
~| pat=pat
|
~| pat=pat
|
||||||
[(add 6 len) [(stab pat) num]]
|
:- (add 6 len)
|
||||||
|
:_ num
|
||||||
|
(rash pat ;~(pfix fas (most fas (cook crip (star ;~(less fas prn))))))
|
||||||
::
|
::
|
||||||
++ sift-meow
|
++ sift-meow
|
||||||
|= =yowl
|
|= =yowl
|
||||||
@ -1518,7 +1542,10 @@
|
|||||||
file-path=term ::
|
file-path=term ::
|
||||||
== ::
|
== ::
|
||||||
+$ care :: clay submode
|
+$ care :: clay submode
|
||||||
?(%a %b %c %d %e %f %p %r %s %t %u %v %w %x %y %z) ::
|
$? %a %b %c %d %e %f ::
|
||||||
|
%p %q %r %s %t %u ::
|
||||||
|
%v %w %x %y %z ::
|
||||||
|
== ::
|
||||||
+$ cash :: case or tako
|
+$ cash :: case or tako
|
||||||
$% [%tako p=tako] ::
|
$% [%tako p=tako] ::
|
||||||
case ::
|
case ::
|
||||||
@ -2060,7 +2087,10 @@
|
|||||||
$% [%payload =simple-payload:http]
|
$% [%payload =simple-payload:http]
|
||||||
== ==
|
== ==
|
||||||
+$ gift
|
+$ gift
|
||||||
$% :: set-config: configures the external http server
|
$% :: ames responses
|
||||||
|
::
|
||||||
|
$>(?(%boon %done) gift:ames)
|
||||||
|
:: set-config: configures the external http server
|
||||||
::
|
::
|
||||||
:: TODO: We need to actually return a (map (unit @t) http-config)
|
:: TODO: We need to actually return a (map (unit @t) http-config)
|
||||||
:: so we can apply configurations on a per-site basis
|
:: so we can apply configurations on a per-site basis
|
||||||
@ -2091,6 +2121,9 @@
|
|||||||
:: new unix process
|
:: new unix process
|
||||||
::
|
::
|
||||||
$>(%born vane-task)
|
$>(%born vane-task)
|
||||||
|
:: network request
|
||||||
|
::
|
||||||
|
$>(%plea vane-task)
|
||||||
:: trim state (in response to memory pressure)
|
:: trim state (in response to memory pressure)
|
||||||
::
|
::
|
||||||
$>(%trim vane-task)
|
$>(%trim vane-task)
|
||||||
@ -2103,6 +2136,11 @@
|
|||||||
:: update http configuration
|
:: update http configuration
|
||||||
::
|
::
|
||||||
[%rule =http-rule]
|
[%rule =http-rule]
|
||||||
|
:: set a base url for eauth, like `'https://sampel.com'
|
||||||
|
::
|
||||||
|
:: eyre will append /~/eauth to it internally to redirect into eauth
|
||||||
|
::
|
||||||
|
[%eauth-host host=(unit @t)]
|
||||||
:: starts handling an inbound http request
|
:: starts handling an inbound http request
|
||||||
::
|
::
|
||||||
[%request secure=? =address =request:http]
|
[%request secure=? =address =request:http]
|
||||||
@ -2163,6 +2201,14 @@
|
|||||||
:: inbound-request: the original request which caused this connection
|
:: inbound-request: the original request which caused this connection
|
||||||
::
|
::
|
||||||
=inbound-request
|
=inbound-request
|
||||||
|
:: session-id: the session associated with this connection
|
||||||
|
:: identity: the identity associated with this connection
|
||||||
|
::
|
||||||
|
::NOTE technically the identity is associated with the session (id),
|
||||||
|
:: but we may still need to know the identity that was used
|
||||||
|
:: after the session proper expires.
|
||||||
|
::
|
||||||
|
[session-id=@uv =identity]
|
||||||
:: response-header: set when we get our first %start
|
:: response-header: set when we get our first %start
|
||||||
::
|
::
|
||||||
response-header=(unit response-header:http)
|
response-header=(unit response-header:http)
|
||||||
@ -2176,11 +2222,26 @@
|
|||||||
$: :: sessions: a mapping of session cookies to session information
|
$: :: sessions: a mapping of session cookies to session information
|
||||||
::
|
::
|
||||||
sessions=(map @uv session)
|
sessions=(map @uv session)
|
||||||
|
:: visitors: in-progress incoming eauth flows
|
||||||
|
::
|
||||||
|
visitors=(map @uv visitor)
|
||||||
|
:: visiting: outgoing eauth state per ship
|
||||||
|
::
|
||||||
|
visiting=(map ship logbook)
|
||||||
|
:: endpoint: hardcoded local eauth endpoint for %syn and %ack
|
||||||
|
::
|
||||||
|
:: user-configured or auth-o-detected, with last-updated timestamp.
|
||||||
|
:: both shaped like 'prot://host'
|
||||||
|
::
|
||||||
|
endpoint=[user=(unit @t) auth=(unit @t) =time]
|
||||||
==
|
==
|
||||||
:: +session: server side data about a session
|
:: +session: server side data about a session
|
||||||
::
|
::
|
||||||
+$ session
|
+$ session
|
||||||
$: :: expiry-time: when this session expires
|
$: :: identity: authentication level & id of this session
|
||||||
|
::
|
||||||
|
=identity
|
||||||
|
:: expiry-time: when this session expires
|
||||||
::
|
::
|
||||||
:: We check this server side, too, so we aren't relying on the browser
|
:: We check this server side, too, so we aren't relying on the browser
|
||||||
:: to properly handle cookie expiration as a security mechanism.
|
:: to properly handle cookie expiration as a security mechanism.
|
||||||
@ -2194,6 +2255,73 @@
|
|||||||
:: mint some sort of long lived cookie for mobile apps which only has
|
:: mint some sort of long lived cookie for mobile apps which only has
|
||||||
:: access to a single application path.
|
:: access to a single application path.
|
||||||
==
|
==
|
||||||
|
:: +visitor: completed or in-progress incoming eauth flow
|
||||||
|
::
|
||||||
|
:: duct: boon duct
|
||||||
|
:: and
|
||||||
|
:: sesh: login completed, session exists
|
||||||
|
:: or
|
||||||
|
:: pend: awaiting %tune for %keen sent at time, for initial eauth http req
|
||||||
|
:: ship: the @p attempting to log in
|
||||||
|
:: base: local protocol+hostname the attempt started on, if any
|
||||||
|
:: last: the url to redirect to after log-in
|
||||||
|
:: toke: authentication secret received over ames or offered by visitor
|
||||||
|
::
|
||||||
|
+$ visitor
|
||||||
|
$: duct=(unit duct)
|
||||||
|
$@ sesh=@uv
|
||||||
|
$: pend=(unit [http=duct keen=time])
|
||||||
|
ship=ship
|
||||||
|
base=(unit @t)
|
||||||
|
last=@t
|
||||||
|
toke=(unit @uv)
|
||||||
|
== ==
|
||||||
|
:: +logbook: record of outgoing eauth comms & state
|
||||||
|
::
|
||||||
|
:: qeu: a queue of nonces for to-be-n/acked pleas
|
||||||
|
:: map: per nonce, completed or pending eauth session
|
||||||
|
::
|
||||||
|
+$ logbook [=(qeu @uv) =(map @uv portkey)]
|
||||||
|
:: +portkey: completed or in-progress outgoing eauth flow
|
||||||
|
::
|
||||||
|
:: made: live since
|
||||||
|
:: or
|
||||||
|
:: duct: confirm request awaiting redirect
|
||||||
|
:: toke: secret to include in redirect, unless aborting
|
||||||
|
::
|
||||||
|
+$ portkey
|
||||||
|
$@ made=@da :: live since
|
||||||
|
$: pend=(unit duct) :: or await redir
|
||||||
|
toke=(unit @uv) :: with secret
|
||||||
|
==
|
||||||
|
:: +eauth-plea: client talking to host
|
||||||
|
::
|
||||||
|
+$ eauth-plea
|
||||||
|
$: %0
|
||||||
|
$% :: %open: client decided on an attempt, wants to return to url
|
||||||
|
:: %shut: client wants the attempt or session closed
|
||||||
|
::
|
||||||
|
[%open nonce=@uv token=(unit @uv)]
|
||||||
|
[%shut nonce=@uv]
|
||||||
|
== ==
|
||||||
|
:: +eauth-boon: host responding to client
|
||||||
|
::
|
||||||
|
+$ eauth-boon
|
||||||
|
$: %0
|
||||||
|
$% :: %okay: attempt heard, client to finish auth through url
|
||||||
|
:: %shut: host has expired the session
|
||||||
|
::
|
||||||
|
[%okay nonce=@uv url=@t]
|
||||||
|
[%shut nonce=@uv]
|
||||||
|
== ==
|
||||||
|
:: $identity: authentication method & @p
|
||||||
|
::
|
||||||
|
+$ identity
|
||||||
|
$~ [%ours ~]
|
||||||
|
$% [%ours ~] :: local, root
|
||||||
|
[%fake who=@p] :: guest id
|
||||||
|
[%real who=@p] :: authed cross-ship
|
||||||
|
==
|
||||||
:: channel-state: state used in the channel system
|
:: channel-state: state used in the channel system
|
||||||
::
|
::
|
||||||
+$ channel-state
|
+$ channel-state
|
||||||
@ -2237,6 +2365,7 @@
|
|||||||
::
|
::
|
||||||
+$ channel
|
+$ channel
|
||||||
$: mode=?(%json %jam)
|
$: mode=?(%json %jam)
|
||||||
|
=identity
|
||||||
:: channel-state: expiration time or the duct currently listening
|
:: channel-state: expiration time or the duct currently listening
|
||||||
::
|
::
|
||||||
:: For each channel, there is at most one open EventSource
|
:: For each channel, there is at most one open EventSource
|
||||||
@ -2309,6 +2438,9 @@
|
|||||||
:: internal authentication page
|
:: internal authentication page
|
||||||
::
|
::
|
||||||
[%authentication ~]
|
[%authentication ~]
|
||||||
|
:: cross-ship authentication handling
|
||||||
|
::
|
||||||
|
[%eauth ~]
|
||||||
:: internal logout page
|
:: internal logout page
|
||||||
::
|
::
|
||||||
[%logout ~]
|
[%logout ~]
|
||||||
@ -2321,6 +2453,9 @@
|
|||||||
:: respond with the @p the requester is authenticated as
|
:: respond with the @p the requester is authenticated as
|
||||||
::
|
::
|
||||||
[%name ~]
|
[%name ~]
|
||||||
|
:: respond with the @p of the ship serving the response
|
||||||
|
::
|
||||||
|
[%host ~]
|
||||||
:: respond with the default file not found page
|
:: respond with the default file not found page
|
||||||
::
|
::
|
||||||
[%four-oh-four ~]
|
[%four-oh-four ~]
|
||||||
@ -2569,11 +2704,12 @@
|
|||||||
+$ gift :: outgoing result
|
+$ gift :: outgoing result
|
||||||
$% [%boon payload=*] :: ames response
|
$% [%boon payload=*] :: ames response
|
||||||
[%done error=(unit error:ames)] :: ames message (n)ack
|
[%done error=(unit error:ames)] :: ames message (n)ack
|
||||||
|
[%flub ~] :: not ready to handle plea
|
||||||
[%unto p=unto] ::
|
[%unto p=unto] ::
|
||||||
== ::
|
== ::
|
||||||
+$ task :: incoming request
|
+$ task :: incoming request
|
||||||
$~ [%vega ~] ::
|
$~ [%vega ~] ::
|
||||||
$% [%deal p=sock q=term r=deal] :: full transmission
|
$% [%deal p=sack q=term r=deal] :: full transmission
|
||||||
[%sear =ship] :: clear pending queues
|
[%sear =ship] :: clear pending queues
|
||||||
[%jolt =desk =dude] :: (re)start agent
|
[%jolt =desk =dude] :: (re)start agent
|
||||||
[%idle =dude] :: suspend agent
|
[%idle =dude] :: suspend agent
|
||||||
@ -2595,6 +2731,7 @@
|
|||||||
$: $: our=ship :: host
|
$: $: our=ship :: host
|
||||||
src=ship :: guest
|
src=ship :: guest
|
||||||
dap=term :: agent
|
dap=term :: agent
|
||||||
|
sap=path :: provenance
|
||||||
== ::
|
== ::
|
||||||
$: wex=boat :: outgoing subs
|
$: wex=boat :: outgoing subs
|
||||||
sup=bitt :: incoming subs
|
sup=bitt :: incoming subs
|
||||||
@ -3070,6 +3207,30 @@
|
|||||||
:: ::
|
:: ::
|
||||||
+$ shed _*form:(strand:rand ,vase) :: compute vase
|
+$ shed _*form:(strand:rand ,vase) :: compute vase
|
||||||
-- ::khan
|
-- ::khan
|
||||||
|
:: ::::
|
||||||
|
:::: ++lick :: (1j) IPC
|
||||||
|
:: ::::
|
||||||
|
++ lick ^?
|
||||||
|
|%
|
||||||
|
+$ gift :: out result <-$
|
||||||
|
$% [%spin =name] :: open an IPC port
|
||||||
|
[%shut =name] :: close an IPC port
|
||||||
|
[%spit =name =mark =noun] :: spit a noun to the IPC port
|
||||||
|
[%soak =name =mark =noun] :: soak a noun from the IPC port
|
||||||
|
==
|
||||||
|
+$ task :: in request ->$
|
||||||
|
$~ [%vega ~] ::
|
||||||
|
$% $>(%born vane-task) :: new unix process
|
||||||
|
$>(%trim vane-task) :: trim state
|
||||||
|
$>(%vega vane-task) :: report upgrade
|
||||||
|
[%spin =name] :: open an IPC port
|
||||||
|
[%shut =name] :: close an IPC port
|
||||||
|
[%spit =name =mark =noun] :: spit a noun to the IPC port
|
||||||
|
[%soak =name =mark =noun] :: soak a noun from the IPC port
|
||||||
|
==
|
||||||
|
::
|
||||||
|
+$ name path
|
||||||
|
-- ::lick
|
||||||
::
|
::
|
||||||
++ rand :: computation
|
++ rand :: computation
|
||||||
|%
|
|%
|
||||||
@ -3272,6 +3433,7 @@
|
|||||||
gift:iris
|
gift:iris
|
||||||
gift:jael
|
gift:jael
|
||||||
gift:khan
|
gift:khan
|
||||||
|
gift:lick
|
||||||
==
|
==
|
||||||
+$ task-arvo :: in request ->$
|
+$ task-arvo :: in request ->$
|
||||||
$% task:ames
|
$% task:ames
|
||||||
@ -3283,6 +3445,7 @@
|
|||||||
task:iris
|
task:iris
|
||||||
task:jael
|
task:jael
|
||||||
task:khan
|
task:khan
|
||||||
|
task:lick
|
||||||
==
|
==
|
||||||
+$ note-arvo :: out request $->
|
+$ note-arvo :: out request $->
|
||||||
$~ [%b %wake ~]
|
$~ [%b %wake ~]
|
||||||
@ -3295,6 +3458,7 @@
|
|||||||
[%i task:iris]
|
[%i task:iris]
|
||||||
[%j task:jael]
|
[%j task:jael]
|
||||||
[%k task:khan]
|
[%k task:khan]
|
||||||
|
[%l task:lick]
|
||||||
[%$ %whiz ~]
|
[%$ %whiz ~]
|
||||||
[@tas %meta vase]
|
[@tas %meta vase]
|
||||||
==
|
==
|
||||||
@ -3317,6 +3481,7 @@
|
|||||||
[%iris gift:iris]
|
[%iris gift:iris]
|
||||||
[%jael gift:jael]
|
[%jael gift:jael]
|
||||||
[%khan gift:khan]
|
[%khan gift:khan]
|
||||||
|
[%lick gift:lick]
|
||||||
==
|
==
|
||||||
:: $unix-task: input from unix
|
:: $unix-task: input from unix
|
||||||
::
|
::
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -235,7 +235,7 @@
|
|||||||
::
|
::
|
||||||
++ scry
|
++ scry
|
||||||
^- roon
|
^- roon
|
||||||
|= [lyc=gang car=term bem=beam]
|
|= [lyc=gang pov=path car=term bem=beam]
|
||||||
^- (unit (unit cage))
|
^- (unit (unit cage))
|
||||||
=* ren car
|
=* ren car
|
||||||
=* why=shop &/p.bem
|
=* why=shop &/p.bem
|
||||||
|
@ -160,6 +160,8 @@
|
|||||||
[%1 =desk =lobe]
|
[%1 =desk =lobe]
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
|
:: All except %1 are deprecated
|
||||||
|
::
|
||||||
+$ fell
|
+$ fell
|
||||||
$% [%direct p=lobe q=page]
|
$% [%direct p=lobe q=page]
|
||||||
[%delta p=lobe q=[p=mark q=lobe] r=page]
|
[%delta p=lobe q=[p=mark q=lobe] r=page]
|
||||||
@ -943,7 +945,7 @@
|
|||||||
%- road |.
|
%- road |.
|
||||||
((pile-rule pax) [1 1] tex)
|
((pile-rule pax) [1 1] tex)
|
||||||
?^ res pile.u.res
|
?^ res pile.u.res
|
||||||
%- mean %- flop
|
%- mean
|
||||||
=/ lyn p.hair
|
=/ lyn p.hair
|
||||||
=/ col q.hair
|
=/ col q.hair
|
||||||
^- (list tank)
|
^- (list tank)
|
||||||
@ -1544,7 +1546,7 @@
|
|||||||
::
|
::
|
||||||
++ good-care
|
++ good-care
|
||||||
|= =care
|
|= =care
|
||||||
(~(has in ^~((silt `(list ^care)`~[%u %w %x %y %z]))) care)
|
(~(has in ^~((silt `(list ^care)`~[%q %u %w %x %y %z]))) care)
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
:: Build and send agents to gall
|
:: Build and send agents to gall
|
||||||
@ -3362,6 +3364,7 @@
|
|||||||
%s ~| %please-dont-get-your-takos-over-a-network !!
|
%s ~| %please-dont-get-your-takos-over-a-network !!
|
||||||
%t ~| %requesting-foreign-directory-is-vaporware !!
|
%t ~| %requesting-foreign-directory-is-vaporware !!
|
||||||
%v ~| %weird-shouldnt-get-v-request-from-network !!
|
%v ~| %weird-shouldnt-get-v-request-from-network !!
|
||||||
|
%q `[p %noun q]:r.rand
|
||||||
%u `(validate-u r.rand)
|
%u `(validate-u r.rand)
|
||||||
%w `(validate-w r.rand)
|
%w `(validate-w r.rand)
|
||||||
%x (validate-x [p.p q.p q r]:rand)
|
%x (validate-x [p.p q.p q r]:rand)
|
||||||
@ -3566,7 +3569,7 @@
|
|||||||
== ==
|
== ==
|
||||||
:: make the request over remote scry
|
:: make the request over remote scry
|
||||||
::
|
::
|
||||||
=/ =mood [%x uv+tako path]:i.need.sat
|
=/ =mood [%q uv+tako path]:i.need.sat
|
||||||
=< [`[%back-index -] +]
|
=< [`[%back-index -] +]
|
||||||
(send-over-scry %back-index hen her inx syd mood)
|
(send-over-scry %back-index hen her inx syd mood)
|
||||||
:: otherwise, request over ames
|
:: otherwise, request over ames
|
||||||
@ -3784,6 +3787,10 @@
|
|||||||
:: %next is just %mult with one path, so we pretend %next = %mult here.
|
:: %next is just %mult with one path, so we pretend %next = %mult here.
|
||||||
::
|
::
|
||||||
?(%next %mult)
|
?(%next %mult)
|
||||||
|
?. ?=(~ for)
|
||||||
|
:: reject if foreign (doesn't work over the network)
|
||||||
|
::
|
||||||
|
[[~ ~] ..park]
|
||||||
:: because %mult requests need to wait on multiple files for each
|
:: because %mult requests need to wait on multiple files for each
|
||||||
:: revision that needs to be checked for changes, we keep two
|
:: revision that needs to be checked for changes, we keep two
|
||||||
:: cache maps. {old} is the revision at {(dec aeon)}, {new} is
|
:: cache maps. {old} is the revision at {(dec aeon)}, {new} is
|
||||||
@ -3965,6 +3972,8 @@
|
|||||||
::
|
::
|
||||||
%many
|
%many
|
||||||
:_ ..park
|
:_ ..park
|
||||||
|
?. |(?=(~ for) (allowed-by:ze u.for path.moat.rov per.red))
|
||||||
|
[~ ~]
|
||||||
=/ from-aeon (case-to-aeon from.moat.rov)
|
=/ from-aeon (case-to-aeon from.moat.rov)
|
||||||
?~ from-aeon
|
?~ from-aeon
|
||||||
:: haven't entered the relevant range, so do nothing
|
:: haven't entered the relevant range, so do nothing
|
||||||
@ -4249,6 +4258,27 @@
|
|||||||
^- (list (pair path lobe))
|
^- (list (pair path lobe))
|
||||||
[[~ ?~(us *lobe u.us)] descendants]
|
[[~ ?~(us *lobe u.us)] descendants]
|
||||||
|=([[path lobe] @uvI] (shax (jam +<)))
|
|=([[path lobe] @uvI] (shax (jam +<)))
|
||||||
|
:: +read-q: typeless %x
|
||||||
|
::
|
||||||
|
:: useful if the marks can't be built (eg for old marks built
|
||||||
|
:: against an incompatible standard library). also useful if you
|
||||||
|
:: don't need the type (eg for remote scry) because it's faster.
|
||||||
|
::
|
||||||
|
++ read-q
|
||||||
|
|= [tak=tako pax=path]
|
||||||
|
^- (unit (unit cage))
|
||||||
|
?: =(0v0 tak)
|
||||||
|
[~ ~]
|
||||||
|
=+ yak=(tako-to-yaki tak)
|
||||||
|
=+ lob=(~(get by q.yak) pax)
|
||||||
|
?~ lob
|
||||||
|
[~ ~]
|
||||||
|
=/ peg=(unit page) (~(get by lat.ran) u.lob)
|
||||||
|
:: if tombstoned, nothing to return
|
||||||
|
::
|
||||||
|
?~ peg
|
||||||
|
~
|
||||||
|
``[p.u.peg %noun q.u.peg]
|
||||||
:: +read-r: %x wrapped in a vase
|
:: +read-r: %x wrapped in a vase
|
||||||
::
|
::
|
||||||
++ read-r
|
++ read-r
|
||||||
@ -4285,8 +4315,12 @@
|
|||||||
:- -:!>(*(map lobe page))
|
:- -:!>(*(map lobe page))
|
||||||
^- (map lobe page)
|
^- (map lobe page)
|
||||||
%- %~ rep in
|
%- %~ rep in
|
||||||
%- reachable-takos
|
|- ^- (set tako)
|
||||||
(~(got by hit.dom) let.dom)
|
=/ ts=(set tako)
|
||||||
|
%- reachable-takos
|
||||||
|
(~(got by hit.dom) let.dom)
|
||||||
|
?: (lte let.dom 1) ts
|
||||||
|
(~(uni in ts) $(let.dom (dec let.dom)))
|
||||||
|= [t=tako o=(map lobe page)]
|
|= [t=tako o=(map lobe page)]
|
||||||
%- ~(gas by o)
|
%- ~(gas by o)
|
||||||
%+ turn
|
%+ turn
|
||||||
@ -4443,23 +4477,15 @@
|
|||||||
++ read-x
|
++ read-x
|
||||||
|= [tak=tako pax=path]
|
|= [tak=tako pax=path]
|
||||||
^- [(unit (unit cage)) _..park]
|
^- [(unit (unit cage)) _..park]
|
||||||
?: =(0v0 tak)
|
=/ q (read-q tak pax)
|
||||||
[[~ ~] ..park]
|
?~ q `..park
|
||||||
=+ yak=(tako-to-yaki tak)
|
?~ u.q [[~ ~] ..park]
|
||||||
=+ lob=(~(get by q.yak) pax)
|
|
||||||
?~ lob
|
|
||||||
[[~ ~] ..park]
|
|
||||||
=/ peg=(unit page) (~(get by lat.ran) u.lob)
|
|
||||||
:: if tombstoned, nothing to return
|
|
||||||
::
|
|
||||||
?~ peg
|
|
||||||
[~ ..park]
|
|
||||||
:: should convert any lobe to cage
|
:: should convert any lobe to cage
|
||||||
::
|
::
|
||||||
=^ =cage ..park
|
=^ =cage ..park
|
||||||
%+ tako-flow tak
|
%+ tako-flow tak
|
||||||
%- wrap:fusion
|
%- wrap:fusion
|
||||||
(page-to-cage:(tako-ford tak) u.peg)
|
(page-to-cage:(tako-ford tak) p.u.u.q q.q.u.u.q)
|
||||||
[``cage ..park]
|
[``cage ..park]
|
||||||
::
|
::
|
||||||
:: Gets an arch (directory listing) at a node.
|
:: Gets an arch (directory listing) at a node.
|
||||||
@ -4511,7 +4537,12 @@
|
|||||||
?. ?| =(0v0 tak)
|
?. ?| =(0v0 tak)
|
||||||
?& (~(has by hut.ran) tak)
|
?& (~(has by hut.ran) tak)
|
||||||
?| (~(any by hit.dom) |=(=tako =(tak tako))) :: fast-path
|
?| (~(any by hit.dom) |=(=tako =(tak tako))) :: fast-path
|
||||||
(~(has in (reachable-takos (aeon-to-tako:ze let.dom))) tak)
|
|- ^- ?
|
||||||
|
?: (lte let.dom 1)
|
||||||
|
%.n
|
||||||
|
?| (~(has in (reachable-takos (aeon-to-tako:ze let.dom))) tak)
|
||||||
|
$(let.dom (dec let.dom))
|
||||||
|
==
|
||||||
==
|
==
|
||||||
|(?=(~ for) (may-read u.for care.mun tak path.mun))
|
|(?=(~ for) (may-read u.for care.mun tak path.mun))
|
||||||
== ==
|
== ==
|
||||||
@ -4533,6 +4564,7 @@
|
|||||||
%e (read-e tak path.mun)
|
%e (read-e tak path.mun)
|
||||||
%f (read-f tak path.mun)
|
%f (read-f tak path.mun)
|
||||||
%p [(read-p path.mun) ..park]
|
%p [(read-p path.mun) ..park]
|
||||||
|
%q [(read-q tak path.mun) ..park]
|
||||||
%r (read-r tak path.mun)
|
%r (read-r tak path.mun)
|
||||||
%s [(read-s tak path.mun case.mun) ..park]
|
%s [(read-s tak path.mun case.mun) ..park]
|
||||||
%t [(read-t tak path.mun) ..park]
|
%t [(read-t tak path.mun) ..park]
|
||||||
@ -5049,6 +5081,11 @@
|
|||||||
==
|
==
|
||||||
==
|
==
|
||||||
[~ ..^$]
|
[~ ..^$]
|
||||||
|
::
|
||||||
|
[%fine ~]
|
||||||
|
~& "clay: resetting fine state. old:"
|
||||||
|
~& sad.ruf
|
||||||
|
`..^$(sad.ruf ~)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
%tire
|
%tire
|
||||||
@ -5869,7 +5906,7 @@
|
|||||||
++ scry :: inspect
|
++ scry :: inspect
|
||||||
~/ %clay-scry
|
~/ %clay-scry
|
||||||
^- roon
|
^- roon
|
||||||
|= [lyc=gang car=term bem=beam]
|
|= [lyc=gang pov=path car=term bem=beam]
|
||||||
^- (unit (unit cage))
|
^- (unit (unit cage))
|
||||||
=* scry-loop $
|
=* scry-loop $
|
||||||
|^
|
|^
|
||||||
@ -6193,12 +6230,15 @@
|
|||||||
?: ?=(%boon +<.hin) `;;(fell payload.hin)
|
?: ?=(%boon +<.hin) `;;(fell payload.hin)
|
||||||
?~ roar.hin ~
|
?~ roar.hin ~
|
||||||
?~ q.dat.u.roar.hin ~
|
?~ q.dat.u.roar.hin ~
|
||||||
=* pag u.q.dat.u.roar.hin
|
`[%1 `u.q.dat.u.roar.hin]
|
||||||
`[%direct (page-to-lobe pag) pag]
|
|
||||||
::
|
::
|
||||||
=^ mos ruf
|
=^ mos ruf
|
||||||
=/ den ((de now rof hen ruf) her desk)
|
=/ den ((de now rof hen ruf) her desk)
|
||||||
?~ fell
|
?~ fell
|
||||||
|
:: We shouldn't get back null on any of the fine requests we
|
||||||
|
:: make unless they're out of date
|
||||||
|
::
|
||||||
|
%- (slog leaf+"clay: got null from {<her>}, falling back to ames" ~)
|
||||||
abet:(retry-with-ames:den %back-index index)
|
abet:(retry-with-ames:den %back-index index)
|
||||||
=? den ?=(%tune +<.hin)
|
=? den ?=(%tune +<.hin)
|
||||||
(cancel-scry-timeout:den index)
|
(cancel-scry-timeout:den index)
|
||||||
|
@ -104,7 +104,7 @@
|
|||||||
::
|
::
|
||||||
%seat
|
%seat
|
||||||
%^ pass /seat %g
|
%^ pass /seat %g
|
||||||
:+ %deal [our our]
|
:+ %deal [our our /dill]
|
||||||
[%hood %poke %kiln-install !>([desk.kyz our desk.kyz])]
|
[%hood %poke %kiln-install !>([desk.kyz our desk.kyz])]
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
@ -129,7 +129,7 @@
|
|||||||
::
|
::
|
||||||
++ deal :: pass to %gall
|
++ deal :: pass to %gall
|
||||||
|= [=wire =deal:gall]
|
|= [=wire =deal:gall]
|
||||||
(pass wire [%g %deal [our our] ram deal])
|
(pass wire [%g %deal [our our /dill] ram deal])
|
||||||
::
|
::
|
||||||
++ pass :: pass note
|
++ pass :: pass note
|
||||||
|= [=wire =note]
|
|= [=wire =note]
|
||||||
@ -146,7 +146,7 @@
|
|||||||
++ sponsor
|
++ sponsor
|
||||||
^- ship
|
^- ship
|
||||||
=/ dat=(unit (unit cage))
|
=/ dat=(unit (unit cage))
|
||||||
(rof `[our ~ ~] j/[[our sein/da/now] /(scot %p our)])
|
(rof `[our ~ ~] /dill j/[[our sein/da/now] /(scot %p our)])
|
||||||
;;(ship q.q:(need (need dat)))
|
;;(ship q.q:(need (need dat)))
|
||||||
::
|
::
|
||||||
++ init :: initialize
|
++ init :: initialize
|
||||||
@ -479,7 +479,7 @@
|
|||||||
::
|
::
|
||||||
++ scry
|
++ scry
|
||||||
^- roon
|
^- roon
|
||||||
|= [lyc=gang car=term bem=beam]
|
|= [lyc=gang pov=path car=term bem=beam]
|
||||||
^- (unit (unit cage))
|
^- (unit (unit cage))
|
||||||
=* ren car
|
=* ren car
|
||||||
=* why=shop &/p.bem
|
=* why=shop &/p.bem
|
||||||
@ -525,9 +525,10 @@
|
|||||||
:: only the new-style subscription.
|
:: only the new-style subscription.
|
||||||
::
|
::
|
||||||
=/ hey (need hey.all.lax)
|
=/ hey (need hey.all.lax)
|
||||||
:* [hey %pass / %g %deal [our our] %hood %leave ~]
|
=/ =sack [our our /dill]
|
||||||
[hey %pass [%peer %$ ~] %g %deal [our our] %hood %leave ~]
|
:* [hey %pass / %g %deal sack %hood %leave ~]
|
||||||
[hey %pass [%peer %$ ~] %g %deal [our our] %hood %watch [%dill %$ ~]]
|
[hey %pass [%peer %$ ~] %g %deal sack %hood %leave ~]
|
||||||
|
[hey %pass [%peer %$ ~] %g %deal sack %hood %watch [%dill %$ ~]]
|
||||||
moz
|
moz
|
||||||
==
|
==
|
||||||
=. egg.all.lax |
|
=. egg.all.lax |
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -44,7 +44,7 @@
|
|||||||
+$ move [=duct move=(wind note-arvo gift-arvo)]
|
+$ move [=duct move=(wind note-arvo gift-arvo)]
|
||||||
:: $state-13: overall gall state, versioned
|
:: $state-13: overall gall state, versioned
|
||||||
::
|
::
|
||||||
+$ state-13 [%13 state]
|
+$ state-14 [%14 state]
|
||||||
:: $state: overall gall state
|
:: $state: overall gall state
|
||||||
::
|
::
|
||||||
:: system-duct: TODO document
|
:: system-duct: TODO document
|
||||||
@ -66,7 +66,7 @@
|
|||||||
::
|
::
|
||||||
+$ routes
|
+$ routes
|
||||||
$: disclosing=(unit (set ship))
|
$: disclosing=(unit (set ship))
|
||||||
attributing=ship
|
attributing=[=ship =path]
|
||||||
==
|
==
|
||||||
:: $yoke: agent runner state
|
:: $yoke: agent runner state
|
||||||
::
|
::
|
||||||
@ -162,7 +162,7 @@
|
|||||||
:: $spore: structures for update, produced by +stay
|
:: $spore: structures for update, produced by +stay
|
||||||
::
|
::
|
||||||
+$ spore
|
+$ spore
|
||||||
$: %13
|
$: %14
|
||||||
system-duct=duct
|
system-duct=duct
|
||||||
outstanding=(map [wire duct] (qeu remote-request))
|
outstanding=(map [wire duct] (qeu remote-request))
|
||||||
contacts=(set ship)
|
contacts=(set ship)
|
||||||
@ -192,7 +192,7 @@
|
|||||||
--
|
--
|
||||||
:: adult gall vane interface, for type compatibility with pupa
|
:: adult gall vane interface, for type compatibility with pupa
|
||||||
::
|
::
|
||||||
=| state=state-13
|
=| state=state-14
|
||||||
|= [now=@da eny=@uvJ rof=roof]
|
|= [now=@da eny=@uvJ rof=roof]
|
||||||
=* gall-payload .
|
=* gall-payload .
|
||||||
~% %gall-top ..part ~
|
~% %gall-top ..part ~
|
||||||
@ -249,7 +249,7 @@
|
|||||||
:: +mo-doff: kill all outgoing subscriptions
|
:: +mo-doff: kill all outgoing subscriptions
|
||||||
::
|
::
|
||||||
++ mo-doff
|
++ mo-doff
|
||||||
|= [dude=(unit dude) ship=(unit ship)]
|
|= [prov=path dude=(unit dude) ship=(unit ship)]
|
||||||
^+ mo-core
|
^+ mo-core
|
||||||
=/ apps=(list (pair term yoke))
|
=/ apps=(list (pair term yoke))
|
||||||
?~ dude ~(tap by yokes.state)
|
?~ dude ~(tap by yokes.state)
|
||||||
@ -257,12 +257,12 @@
|
|||||||
|- ^+ mo-core
|
|- ^+ mo-core
|
||||||
?~ apps mo-core
|
?~ apps mo-core
|
||||||
?: ?=(%nuke -.q.i.apps) $(apps t.apps)
|
?: ?=(%nuke -.q.i.apps) $(apps t.apps)
|
||||||
=/ ap-core (ap-yoke:ap p.i.apps [~ our] q.i.apps)
|
=/ ap-core (ap-yoke:ap p.i.apps [~ our prov] q.i.apps)
|
||||||
$(apps t.apps, mo-core ap-abet:(ap-doff:ap-core ship))
|
$(apps t.apps, mo-core ap-abet:(ap-doff:ap-core ship))
|
||||||
:: +mo-rake: send %cork's for old subscriptions if needed
|
:: +mo-rake: send %cork's for old subscriptions if needed
|
||||||
::
|
::
|
||||||
++ mo-rake
|
++ mo-rake
|
||||||
|= [dude=(unit dude) all=?]
|
|= [prov=path dude=(unit dude) all=?]
|
||||||
^+ mo-core
|
^+ mo-core
|
||||||
=/ apps=(list (pair term yoke))
|
=/ apps=(list (pair term yoke))
|
||||||
?~ dude ~(tap by yokes.state)
|
?~ dude ~(tap by yokes.state)
|
||||||
@ -270,7 +270,7 @@
|
|||||||
|- ^+ mo-core
|
|- ^+ mo-core
|
||||||
?~ apps mo-core
|
?~ apps mo-core
|
||||||
?: ?=(%nuke -.q.i.apps) $(apps t.apps)
|
?: ?=(%nuke -.q.i.apps) $(apps t.apps)
|
||||||
=/ ap-core (ap-yoke:ap p.i.apps [~ our] q.i.apps)
|
=/ ap-core (ap-yoke:ap p.i.apps [~ our prov] q.i.apps)
|
||||||
$(apps t.apps, mo-core ap-abet:(ap-rake:ap-core all))
|
$(apps t.apps, mo-core ap-abet:(ap-rake:ap-core all))
|
||||||
:: +mo-receive-core: receives an app core built by %ford.
|
:: +mo-receive-core: receives an app core built by %ford.
|
||||||
::
|
::
|
||||||
@ -286,7 +286,7 @@
|
|||||||
::
|
::
|
||||||
++ mo-receive-core
|
++ mo-receive-core
|
||||||
~/ %mo-receive-core
|
~/ %mo-receive-core
|
||||||
|= [dap=term bek=beak =agent]
|
|= [prov=path dap=term bek=beak =agent]
|
||||||
^+ mo-core
|
^+ mo-core
|
||||||
::
|
::
|
||||||
=/ yak (~(get by yokes.state) dap)
|
=/ yak (~(get by yokes.state) dap)
|
||||||
@ -309,7 +309,7 @@
|
|||||||
::
|
::
|
||||||
=. yokes.state
|
=. yokes.state
|
||||||
(~(put by yokes.state) dap u.yak(beak bek, code agent))
|
(~(put by yokes.state) dap u.yak(beak bek, code agent))
|
||||||
=/ ap-core (ap-abed:ap dap `our)
|
=/ ap-core (ap-abed:ap dap [~ our prov])
|
||||||
=. ap-core (ap-reinstall:ap-core agent)
|
=. ap-core (ap-reinstall:ap-core agent)
|
||||||
=. mo-core ap-abet:ap-core
|
=. mo-core ap-abet:ap-core
|
||||||
(mo-clear-queue dap)
|
(mo-clear-queue dap)
|
||||||
@ -329,7 +329,7 @@
|
|||||||
::
|
::
|
||||||
=/ old mo-core
|
=/ old mo-core
|
||||||
=/ wag
|
=/ wag
|
||||||
=/ ap-core (ap-abed:ap dap `our)
|
=/ ap-core (ap-abed:ap dap [~ our prov])
|
||||||
(ap-upgrade-state:ap-core ~)
|
(ap-upgrade-state:ap-core ~)
|
||||||
::
|
::
|
||||||
=/ maybe-tang -.wag
|
=/ maybe-tang -.wag
|
||||||
@ -419,7 +419,7 @@
|
|||||||
:: +mo-breach: ship breached, so forget about them
|
:: +mo-breach: ship breached, so forget about them
|
||||||
::
|
::
|
||||||
++ mo-breach
|
++ mo-breach
|
||||||
|= =ship
|
|= [prov=path =ship]
|
||||||
^+ mo-core
|
^+ mo-core
|
||||||
=. mo-core (mo-untrack-ship ship)
|
=. mo-core (mo-untrack-ship ship)
|
||||||
=. mo-core (mo-filter-queue ship)
|
=. mo-core (mo-filter-queue ship)
|
||||||
@ -434,7 +434,7 @@
|
|||||||
?~ agents
|
?~ agents
|
||||||
mo-core
|
mo-core
|
||||||
=? mo-core ?=(%live -.yoke.i.agents)
|
=? mo-core ?=(%live -.yoke.i.agents)
|
||||||
=/ =routes [disclosing=~ attributing=ship]
|
=/ =routes [disclosing=~ attributing=[ship prov]]
|
||||||
=/ app (ap-abed:ap name.i.agents routes)
|
=/ app (ap-abed:ap name.i.agents routes)
|
||||||
ap-abet:(ap-breach:app ship)
|
ap-abet:(ap-breach:app ship)
|
||||||
$(agents t.agents)
|
$(agents t.agents)
|
||||||
@ -464,7 +464,7 @@
|
|||||||
?> ?=([%era ~] wire)
|
?> ?=([%era ~] wire)
|
||||||
?. ?=(%breach -.public-keys-result.sign-arvo)
|
?. ?=(%breach -.public-keys-result.sign-arvo)
|
||||||
mo-core
|
mo-core
|
||||||
(mo-breach who.public-keys-result.sign-arvo)
|
(mo-breach /jael who.public-keys-result.sign-arvo)
|
||||||
:: +mo-handle-sys-lag: handle an ames %clog notification
|
:: +mo-handle-sys-lag: handle an ames %clog notification
|
||||||
::
|
::
|
||||||
++ mo-handle-sys-lag
|
++ mo-handle-sys-lag
|
||||||
@ -479,7 +479,7 @@
|
|||||||
?~ agents mo-core
|
?~ agents mo-core
|
||||||
::
|
::
|
||||||
=? mo-core ?=(%live -.yoke.i.agents)
|
=? mo-core ?=(%live -.yoke.i.agents)
|
||||||
=/ app (ap-abed:ap dude.i.agents `our)
|
=/ app (ap-abed:ap dude.i.agents [~ our /ames])
|
||||||
ap-abet:(ap-clog:app ship.sign-arvo)
|
ap-abet:(ap-clog:app ship.sign-arvo)
|
||||||
::
|
::
|
||||||
$(agents t.agents)
|
$(agents t.agents)
|
||||||
@ -630,14 +630,16 @@
|
|||||||
mo-core
|
mo-core
|
||||||
=/ app
|
=/ app
|
||||||
=/ =ship (slav %p i.t.t.wire)
|
=/ =ship (slav %p i.t.t.wire)
|
||||||
=/ =routes [disclosing=~ attributing=ship]
|
=/ =routes [disclosing=~ attributing=[ship /[-.sign-arvo]]]
|
||||||
(ap-abed:ap dap routes)
|
(ap-abed:ap dap routes)
|
||||||
::
|
::
|
||||||
=. app (ap-generic-take:app t.t.t.wire sign-arvo)
|
=. app (ap-generic-take:app t.t.t.wire sign-arvo)
|
||||||
ap-abet:app
|
ap-abet:app
|
||||||
?> ?=([%out @ @ *] t.t.wire)
|
?> ?=([%out @ @ *] t.t.wire)
|
||||||
=/ =ship (slav %p i.t.t.t.wire)
|
=/ =ship (slav %p i.t.t.t.wire)
|
||||||
=/ =routes [disclosing=~ attributing=ship]
|
=/ other-agent i.t.t.t.t.wire
|
||||||
|
=/ prov=path ?.(=(ship our) *path /gall/[other-agent])
|
||||||
|
=/ =routes [disclosing=~ attributing=[ship prov]]
|
||||||
=/ =unto +>.sign-arvo
|
=/ =unto +>.sign-arvo
|
||||||
?: ?=(%| -.agent.u.yoke)
|
?: ?=(%| -.agent.u.yoke)
|
||||||
=/ blocked=(qeu blocked-move)
|
=/ blocked=(qeu blocked-move)
|
||||||
@ -672,8 +674,8 @@
|
|||||||
~(get to blocked)
|
~(get to blocked)
|
||||||
?: ?=(%| -.blocker) $
|
?: ?=(%| -.blocker) $
|
||||||
=/ =move
|
=/ =move
|
||||||
=/ =sock [attributing.routes our]
|
=/ =sack [ship.attributing.routes our path.attributing.routes]
|
||||||
=/ card [%slip %g %deal sock dap p.blocker]
|
=/ card [%slip %g %deal sack dap p.blocker]
|
||||||
[duct card]
|
[duct card]
|
||||||
$(moves [move moves])
|
$(moves [move moves])
|
||||||
:: +mo-filter-queue: remove all blocked tasks from ship.
|
:: +mo-filter-queue: remove all blocked tasks from ship.
|
||||||
@ -696,30 +698,30 @@
|
|||||||
new-agents (~(put by new-agents) name.i.agents new-blocked)
|
new-agents (~(put by new-agents) name.i.agents new-blocked)
|
||||||
==
|
==
|
||||||
=^ mov=blocked-move blocked.i.agents ~(get to blocked.i.agents)
|
=^ mov=blocked-move blocked.i.agents ~(get to blocked.i.agents)
|
||||||
=? new-blocked !=(ship attributing.routes.mov)
|
=? new-blocked !=(ship ship.attributing.routes.mov)
|
||||||
(~(put to new-blocked) mov)
|
(~(put to new-blocked) mov)
|
||||||
$
|
$
|
||||||
:: +mo-idle: put agent to sleep
|
:: +mo-idle: put agent to sleep
|
||||||
::
|
::
|
||||||
++ mo-idle
|
++ mo-idle
|
||||||
|= dap=dude
|
|= [prov=path dap=dude]
|
||||||
^+ mo-core
|
^+ mo-core
|
||||||
=/ yoke=(unit yoke) (~(get by yokes.state) dap)
|
=/ yoke=(unit yoke) (~(get by yokes.state) dap)
|
||||||
?: |(?=(~ yoke) ?=(%nuke -.u.yoke))
|
?: |(?=(~ yoke) ?=(%nuke -.u.yoke))
|
||||||
~> %slog.0^leaf/"gall: ignoring %idle for {<dap>}, not running"
|
~> %slog.0^leaf/"gall: ignoring %idle for {<dap>}, not running"
|
||||||
mo-core
|
mo-core
|
||||||
ap-abet:ap-idle:(ap-abed:ap dap `our)
|
ap-abet:ap-idle:(ap-abed:ap dap [~ our prov])
|
||||||
:: +mo-nuke: delete agent completely
|
:: +mo-nuke: delete agent completely
|
||||||
::
|
::
|
||||||
++ mo-nuke
|
++ mo-nuke
|
||||||
|= dap=dude
|
|= [prov=path dap=dude]
|
||||||
^+ mo-core
|
^+ mo-core
|
||||||
=/ yoke=(unit yoke) (~(get by yokes.state) dap)
|
=/ yoke=(unit yoke) (~(get by yokes.state) dap)
|
||||||
?: |(?=(~ yoke) ?=(%nuke -.u.yoke))
|
?: |(?=(~ yoke) ?=(%nuke -.u.yoke))
|
||||||
~> %slog.0^leaf/"gall: ignoring %nuke for {<dap>}, not running"
|
~> %slog.0^leaf/"gall: ignoring %nuke for {<dap>}, not running"
|
||||||
mo-core
|
mo-core
|
||||||
~> %slog.0^leaf/"gall: nuking {<dap>}"
|
~> %slog.0^leaf/"gall: nuking {<dap>}"
|
||||||
=. mo-core ap-abet:ap-nuke:(ap-abed:ap dap `our)
|
=. mo-core ap-abet:ap-nuke:(ap-abed:ap dap [~ our prov])
|
||||||
=- mo-core(yokes.state -)
|
=- mo-core(yokes.state -)
|
||||||
%+ ~(jab by yokes.state) dap
|
%+ ~(jab by yokes.state) dap
|
||||||
|= =^yoke
|
|= =^yoke
|
||||||
@ -731,13 +733,13 @@
|
|||||||
:: +mo-load: install agents
|
:: +mo-load: install agents
|
||||||
::
|
::
|
||||||
++ mo-load
|
++ mo-load
|
||||||
|= agents=(list [=dude =beak =agent])
|
|= [prov=path agents=(list [=dude =beak =agent])]
|
||||||
=. mo-core
|
=. mo-core
|
||||||
|- ^+ mo-core
|
|- ^+ mo-core
|
||||||
?~ agents mo-core
|
?~ agents mo-core
|
||||||
=/ [=dude =desk] [dude q.beak]:i.agents
|
=/ [=dude =desk] [dude q.beak]:i.agents
|
||||||
:: ~> %slog.0^leaf/"gall: starting {<dude>} on {<desk>}"
|
:: ~> %slog.0^leaf/"gall: starting {<dude>} on {<desk>}"
|
||||||
$(agents t.agents, mo-core (mo-receive-core i.agents))
|
$(agents t.agents, mo-core (mo-receive-core prov i.agents))
|
||||||
::
|
::
|
||||||
=/ kil
|
=/ kil
|
||||||
=/ lol
|
=/ lol
|
||||||
@ -749,7 +751,7 @@
|
|||||||
|- ^+ mo-core
|
|- ^+ mo-core
|
||||||
?~ kil mo-core
|
?~ kil mo-core
|
||||||
~> %slog.0^leaf/"gall: stopping {<i.kil>}"
|
~> %slog.0^leaf/"gall: stopping {<i.kil>}"
|
||||||
$(kil t.kil, mo-core (mo-idle i.kil))
|
$(kil t.kil, mo-core (mo-idle prov i.kil))
|
||||||
:: +mo-peek: call to +ap-peek (which is not accessible outside of +mo).
|
:: +mo-peek: call to +ap-peek (which is not accessible outside of +mo).
|
||||||
::
|
::
|
||||||
++ mo-peek
|
++ mo-peek
|
||||||
@ -776,7 +778,7 @@
|
|||||||
=/ =case da+now
|
=/ =case da+now
|
||||||
=/ yok (~(got by yokes.state) dap)
|
=/ yok (~(got by yokes.state) dap)
|
||||||
=/ =desk q.beak:?>(?=(%live -.yok) yok) ::TODO acceptable assertion?
|
=/ =desk q.beak:?>(?=(%live -.yok) yok) ::TODO acceptable assertion?
|
||||||
=/ sky (rof ~ %cb [our desk case] /[mark.deal])
|
=/ sky (rof ~ /gall %cb [our desk case] /[mark.deal])
|
||||||
?- sky
|
?- sky
|
||||||
?(~ [~ ~])
|
?(~ [~ ~])
|
||||||
=/ ror "gall: raw-poke fail :{(trip dap)} {<mark.deal>}"
|
=/ ror "gall: raw-poke fail :{(trip dap)} {<mark.deal>}"
|
||||||
@ -800,7 +802,7 @@
|
|||||||
=/ mars-path /[a.mars]/[b.mars]
|
=/ mars-path /[a.mars]/[b.mars]
|
||||||
=/ yok (~(got by yokes.state) dap)
|
=/ yok (~(got by yokes.state) dap)
|
||||||
=/ =desk q.beak:?>(?=(%live -.yok) yok) ::TODO acceptable assertion?
|
=/ =desk q.beak:?>(?=(%live -.yok) yok) ::TODO acceptable assertion?
|
||||||
=/ sky (rof ~ %cc [our desk case] mars-path)
|
=/ sky (rof ~ /gall %cc [our desk case] mars-path)
|
||||||
?- sky
|
?- sky
|
||||||
?(~ [~ ~])
|
?(~ [~ ~])
|
||||||
=/ ror "gall: poke cast fail :{(trip dap)} {<mars>}"
|
=/ ror "gall: poke cast fail :{(trip dap)} {<mars>}"
|
||||||
@ -831,10 +833,10 @@
|
|||||||
:: +deal. Otherwise simply apply the action to the agent.
|
:: +deal. Otherwise simply apply the action to the agent.
|
||||||
::
|
::
|
||||||
++ mo-handle-local
|
++ mo-handle-local
|
||||||
|= [=ship agent=term =deal]
|
|= [prov=path =ship agent=term =deal]
|
||||||
^+ mo-core
|
^+ mo-core
|
||||||
::
|
::
|
||||||
=/ =routes [disclosing=~ attributing=ship]
|
=/ =routes [disclosing=~ attributing=[ship prov]]
|
||||||
=/ running (~(get by yokes.state) agent)
|
=/ running (~(get by yokes.state) agent)
|
||||||
=/ is-running &(?=([~ %live *] running) ?=(%& -.agent.u.running))
|
=/ is-running &(?=([~ %live *] running) ?=(%& -.agent.u.running))
|
||||||
=/ is-blocked (~(has by blocked.state) agent)
|
=/ is-blocked (~(has by blocked.state) agent)
|
||||||
@ -863,6 +865,14 @@
|
|||||||
=. mo-core (mo-track-ship ship)
|
=. mo-core (mo-track-ship ship)
|
||||||
=? mo-core ?=(%u -.ames-request) (mo-give %done ~)
|
=? mo-core ?=(%u -.ames-request) (mo-give %done ~)
|
||||||
::
|
::
|
||||||
|
=/ yok=(unit yoke) (~(get by yokes.state) agent-name)
|
||||||
|
?~ yok
|
||||||
|
(mo-give %flub ~)
|
||||||
|
?: ?=(%nuke -.u.yok)
|
||||||
|
(mo-give %flub ~)
|
||||||
|
?: ?=(%.n -.agent.u.yok)
|
||||||
|
(mo-give %flub ~)
|
||||||
|
::
|
||||||
=/ =wire /sys/req/(scot %p ship)/[agent-name]
|
=/ =wire /sys/req/(scot %p ship)/[agent-name]
|
||||||
::
|
::
|
||||||
=/ =deal
|
=/ =deal
|
||||||
@ -872,7 +882,7 @@
|
|||||||
%s [%watch path.ames-request]
|
%s [%watch path.ames-request]
|
||||||
%u [%leave ~]
|
%u [%leave ~]
|
||||||
==
|
==
|
||||||
(mo-pass wire %g %deal [ship our] agent-name deal)
|
(mo-pass wire %g %deal [ship our /] agent-name deal)
|
||||||
:: +mo-spew: handle request to set verbosity toggles on debug output
|
:: +mo-spew: handle request to set verbosity toggles on debug output
|
||||||
::
|
::
|
||||||
++ mo-spew
|
++ mo-spew
|
||||||
@ -1111,7 +1121,7 @@
|
|||||||
=/ =case da+now
|
=/ =case da+now
|
||||||
=/ bek=beak [our q.beak.yoke case]
|
=/ bek=beak [our q.beak.yoke case]
|
||||||
=/ mars-path /[a.mars]/[b.mars]
|
=/ mars-path /[a.mars]/[b.mars]
|
||||||
=/ sky (rof ~ %cc bek mars-path)
|
=/ sky (rof ~ /gall %cc bek mars-path)
|
||||||
?- sky
|
?- sky
|
||||||
?(~ [~ ~])
|
?(~ [~ ~])
|
||||||
%- (slog leaf+"watch-as fact conversion find-fail" >sky< ~)
|
%- (slog leaf+"watch-as fact conversion find-fail" >sky< ~)
|
||||||
@ -1145,14 +1155,21 @@
|
|||||||
?- -.neet
|
?- -.neet
|
||||||
%agent [%out (scot %p ship.neet) name.neet wire]
|
%agent [%out (scot %p ship.neet) name.neet wire]
|
||||||
%huck [%out (scot %p ship.neet) name.neet wire]
|
%huck [%out (scot %p ship.neet) name.neet wire]
|
||||||
%arvo [(scot %p attributing.agent-routes) wire]
|
%arvo [(scot %p ship.attributing.agent-routes) wire]
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
=/ =note-arvo
|
=/ =note-arvo
|
||||||
|
=/ prov=path /gall/[agent-name]
|
||||||
?- -.neet
|
?- -.neet
|
||||||
%arvo +.neet
|
%arvo ?. ?=([%l *] +.neet)
|
||||||
|
+.neet
|
||||||
|
?+ +.neet
|
||||||
|
~|(%nope !!)
|
||||||
|
[%l ?(%spin %shut) *] +.neet(name [agent-name name.+.neet])
|
||||||
|
[%l %spit *] +.neet(name [agent-name name.+.neet])
|
||||||
|
==
|
||||||
%huck note-arvo.neet
|
%huck note-arvo.neet
|
||||||
%agent [%g %deal [our ship.neet] [name task]:neet]
|
%agent [%g %deal [our ship.neet prov] [name task]:neet]
|
||||||
==
|
==
|
||||||
[duct %pass wire note-arvo]~
|
[duct %pass wire note-arvo]~
|
||||||
==
|
==
|
||||||
@ -1274,7 +1291,7 @@
|
|||||||
::
|
::
|
||||||
?. ?& ?=(%x care)
|
?. ?& ?=(%x care)
|
||||||
?=([~ ~ *] p.peek-result)
|
?=([~ ~ *] p.peek-result)
|
||||||
!=(mark p.u.u.p.peek-result)
|
!=(want p.u.u.p.peek-result)
|
||||||
==
|
==
|
||||||
p.peek-result
|
p.peek-result
|
||||||
:: for %x scries, attempt to convert to the requested mark if needed
|
:: for %x scries, attempt to convert to the requested mark if needed
|
||||||
@ -1284,7 +1301,7 @@
|
|||||||
=/ tub=(unit tube:clay)
|
=/ tub=(unit tube:clay)
|
||||||
?: =(have want) `(bake same ^vase)
|
?: =(have want) `(bake same ^vase)
|
||||||
=/ tuc=(unit (unit cage))
|
=/ tuc=(unit (unit cage))
|
||||||
(rof ~ %cc [our q.beak.yoke da+now] /[have]/[want])
|
(rof ~ /gall %cc [our q.beak.yoke da+now] /[have]/[want])
|
||||||
?. ?=([~ ~ *] tuc) ~
|
?. ?=([~ ~ *] tuc) ~
|
||||||
`!<(tube:clay q.u.u.tuc)
|
`!<(tube:clay q.u.u.tuc)
|
||||||
?~ tub
|
?~ tub
|
||||||
@ -1313,8 +1330,9 @@
|
|||||||
++ ap-construct-bowl
|
++ ap-construct-bowl
|
||||||
^- bowl
|
^- bowl
|
||||||
:* :* our :: host
|
:* :* our :: host
|
||||||
attributing.agent-routes :: guest
|
ship.attributing.agent-routes :: guest
|
||||||
agent-name :: agent
|
agent-name :: agent
|
||||||
|
path.attributing.agent-routes :: provenance
|
||||||
== ::
|
== ::
|
||||||
:* wex=boat.yoke :: outgoing
|
:* wex=boat.yoke :: outgoing
|
||||||
sup=bitt.yoke :: incoming
|
sup=bitt.yoke :: incoming
|
||||||
@ -1359,7 +1377,7 @@
|
|||||||
~/ %ap-subscribe
|
~/ %ap-subscribe
|
||||||
|= pax=path
|
|= pax=path
|
||||||
^+ ap-core
|
^+ ap-core
|
||||||
=/ incoming [attributing.agent-routes pax]
|
=/ incoming [ship.attributing.agent-routes pax]
|
||||||
=. bitt.yoke (~(put by bitt.yoke) agent-duct incoming)
|
=. bitt.yoke (~(put by bitt.yoke) agent-duct incoming)
|
||||||
=^ maybe-tang ap-core
|
=^ maybe-tang ap-core
|
||||||
%+ ap-ingest %watch-ack |.
|
%+ ap-ingest %watch-ack |.
|
||||||
@ -1393,6 +1411,15 @@
|
|||||||
~/ %ap-generic-take
|
~/ %ap-generic-take
|
||||||
|= [=wire =sign-arvo]
|
|= [=wire =sign-arvo]
|
||||||
^+ ap-core
|
^+ ap-core
|
||||||
|
=? sign-arvo ?=([%lick *] sign-arvo)
|
||||||
|
?+ sign-arvo
|
||||||
|
~|(%nope !!)
|
||||||
|
::
|
||||||
|
[%lick %soak *]
|
||||||
|
=- sign-arvo(name -)
|
||||||
|
?> &(?=(^ name.sign-arvo) =(agent-name i.name.sign-arvo))
|
||||||
|
t.name.sign-arvo
|
||||||
|
==
|
||||||
=^ maybe-tang ap-core
|
=^ maybe-tang ap-core
|
||||||
%+ ap-ingest ~ |.
|
%+ ap-ingest ~ |.
|
||||||
(on-arvo:ap-agent-core wire sign-arvo)
|
(on-arvo:ap-agent-core wire sign-arvo)
|
||||||
@ -1421,7 +1448,7 @@
|
|||||||
?: ?=(%spider agent-name)
|
?: ?=(%spider agent-name)
|
||||||
:- [%fact mark.unto !>(noun.unto)]
|
:- [%fact mark.unto !>(noun.unto)]
|
||||||
ap-core
|
ap-core
|
||||||
=/ sky (rof ~ %cb [our q.beak.yoke case] /[mark.unto])
|
=/ sky (rof ~ /gall %cb [our q.beak.yoke case] /[mark.unto])
|
||||||
?. ?=([~ ~ *] sky)
|
?. ?=([~ ~ *] sky)
|
||||||
(mean leaf+"gall: ames mark fail {<mark.unto>}" ~)
|
(mean leaf+"gall: ames mark fail {<mark.unto>}" ~)
|
||||||
::
|
::
|
||||||
@ -1603,7 +1630,8 @@
|
|||||||
|= =duct
|
|= =duct
|
||||||
^- (list move)
|
^- (list move)
|
||||||
::
|
::
|
||||||
:~ [duct %slip %g %deal [our our] agent-name %leave ~]
|
=/ =sack [our our /gall/[agent-name]]
|
||||||
|
:~ [duct %slip %g %deal sack agent-name %leave ~]
|
||||||
[duct %give %unto %kick ~]
|
[duct %give %unto %kick ~]
|
||||||
==
|
==
|
||||||
:: +ap-kill-down: 2-sided kill from subscriber side
|
:: +ap-kill-down: 2-sided kill from subscriber side
|
||||||
@ -1675,7 +1703,7 @@
|
|||||||
++ scry-peer-state
|
++ scry-peer-state
|
||||||
|= her=ship
|
|= her=ship
|
||||||
~+ ^- (unit peer-state:ames)
|
~+ ^- (unit peer-state:ames)
|
||||||
=/ sky (rof [~ ~] %ax [our %$ da+now] /peers/(scot %p her))
|
=/ sky (rof [~ ~] /gall %ax [our %$ da+now] /peers/(scot %p her))
|
||||||
?: |(?=(~ sky) ?=(~ u.sky))
|
?: |(?=(~ sky) ?=(~ u.sky))
|
||||||
~
|
~
|
||||||
=/ sat !<(ship-state:ames q.u.u.sky)
|
=/ sat !<(ship-state:ames q.u.u.sky)
|
||||||
@ -1692,7 +1720,7 @@
|
|||||||
++ ap-mule
|
++ ap-mule
|
||||||
|= run=_^?(|.(*step:agent))
|
|= run=_^?(|.(*step:agent))
|
||||||
^- (each step:agent tang)
|
^- (each step:agent tang)
|
||||||
=/ res (mock [run %9 2 %0 1] (look rof ~))
|
=/ res (mock [run %9 2 %0 1] (look rof ~ /gall/[agent-name]))
|
||||||
?- -.res
|
?- -.res
|
||||||
%0 [%& !<(step:agent [-:!>(*step:agent) p.res])]
|
%0 [%& !<(step:agent [-:!>(*step:agent) p.res])]
|
||||||
%1 [%| (smyt ;;(path p.res)) ~]
|
%1 [%| (smyt ;;(path p.res)) ~]
|
||||||
@ -1703,7 +1731,7 @@
|
|||||||
++ ap-mule-peek
|
++ ap-mule-peek
|
||||||
|= run=_^?(|.(*(unit (unit cage))))
|
|= run=_^?(|.(*(unit (unit cage))))
|
||||||
^- (each (unit (unit cage)) tang)
|
^- (each (unit (unit cage)) tang)
|
||||||
=/ res (mock [run %9 2 %0 1] (look rof ~))
|
=/ res (mock [run %9 2 %0 1] (look rof ~ /gall/[agent-name]))
|
||||||
?- -.res
|
?- -.res
|
||||||
%0 [%& !<((unit (unit cage)) [-:!>(*(unit (unit cage))) p.res])]
|
%0 [%& !<((unit (unit cage)) [-:!>(*(unit (unit cage))) p.res])]
|
||||||
%1 [%| (smyt ;;(path p.res)) ~]
|
%1 [%| (smyt ;;(path p.res)) ~]
|
||||||
@ -1874,15 +1902,27 @@
|
|||||||
::
|
::
|
||||||
~| [%gall-call-failed duct hic]
|
~| [%gall-call-failed duct hic]
|
||||||
=/ =task ((harden task) hic)
|
=/ =task ((harden task) hic)
|
||||||
|
=/ prov=path
|
||||||
|
?: ?=(%deal -.task)
|
||||||
|
?.(=(p.p.task our) *path r.p.task)
|
||||||
|
?. ?& ?=([^ *] duct)
|
||||||
|
?= $? %ames %behn %clay
|
||||||
|
%dill %eyre %gall
|
||||||
|
%iris %jael %khan
|
||||||
|
==
|
||||||
|
i.i.duct
|
||||||
|
==
|
||||||
|
*path
|
||||||
|
/[i.i.duct]
|
||||||
::
|
::
|
||||||
=/ mo-core (mo-abed:mo duct)
|
=/ mo-core (mo-abed:mo duct)
|
||||||
?- -.task
|
?- -.task
|
||||||
%deal
|
%deal
|
||||||
=/ [=sock =term =deal] [p q r]:task
|
=/ [=sack =term =deal] [p q r]:task
|
||||||
?. =(q.sock our)
|
?. =(q.sack our)
|
||||||
?> =(p.sock our)
|
?> =(p.sack our)
|
||||||
mo-abet:(mo-send-foreign-request:mo-core q.sock term deal)
|
mo-abet:(mo-send-foreign-request:mo-core q.sack term deal)
|
||||||
mo-abet:(mo-handle-local:mo-core p.sock term deal)
|
mo-abet:(mo-handle-local:mo-core prov p.sack term deal)
|
||||||
::
|
::
|
||||||
%init [~ gall-payload(system-duct.state duct)]
|
%init [~ gall-payload(system-duct.state duct)]
|
||||||
%plea
|
%plea
|
||||||
@ -1901,11 +1941,11 @@
|
|||||||
::
|
::
|
||||||
%sear mo-abet:(mo-filter-queue:mo-core ship.task)
|
%sear mo-abet:(mo-filter-queue:mo-core ship.task)
|
||||||
%jolt mo-abet:(mo-jolt:mo-core dude.task our desk.task)
|
%jolt mo-abet:(mo-jolt:mo-core dude.task our desk.task)
|
||||||
%idle mo-abet:(mo-idle:mo-core dude.task)
|
%idle mo-abet:(mo-idle:mo-core prov dude.task)
|
||||||
%load mo-abet:(mo-load:mo-core +.task)
|
%load mo-abet:(mo-load:mo-core prov +.task)
|
||||||
%nuke mo-abet:(mo-nuke:mo-core dude.task)
|
%nuke mo-abet:(mo-nuke:mo-core prov dude.task)
|
||||||
%doff mo-abet:(mo-doff:mo-core +.task)
|
%doff mo-abet:(mo-doff:mo-core prov +.task)
|
||||||
%rake mo-abet:(mo-rake:mo-core +.task)
|
%rake mo-abet:(mo-rake:mo-core prov +.task)
|
||||||
%spew mo-abet:(mo-spew:mo-core veb.task)
|
%spew mo-abet:(mo-spew:mo-core veb.task)
|
||||||
%sift mo-abet:(mo-sift:mo-core dudes.task)
|
%sift mo-abet:(mo-sift:mo-core dudes.task)
|
||||||
%trim [~ gall-payload]
|
%trim [~ gall-payload]
|
||||||
@ -1921,17 +1961,33 @@
|
|||||||
=? old ?=(%10 -.old) (spore-10-to-11 old)
|
=? old ?=(%10 -.old) (spore-10-to-11 old)
|
||||||
=? old ?=(%11 -.old) (spore-11-to-12 old)
|
=? old ?=(%11 -.old) (spore-11-to-12 old)
|
||||||
=? old ?=(%12 -.old) (spore-12-to-13 old)
|
=? old ?=(%12 -.old) (spore-12-to-13 old)
|
||||||
?> ?=(%13 -.old)
|
=? old ?=(%13 -.old) (spore-13-to-14 old)
|
||||||
|
?> ?=(%14 -.old)
|
||||||
gall-payload(state old)
|
gall-payload(state old)
|
||||||
::
|
::
|
||||||
+$ spore-any $%(spore spore-7 spore-8 spore-9 spore-10 spore-11 spore-12)
|
+$ spore-any
|
||||||
|
$%(spore spore-7 spore-8 spore-9 spore-10 spore-11 spore-12 spore-13)
|
||||||
|
+$ spore-13
|
||||||
|
$: %13
|
||||||
|
system-duct=duct
|
||||||
|
outstanding=(map [wire duct] (qeu remote-request))
|
||||||
|
contacts=(set ship)
|
||||||
|
eggs=(map term egg)
|
||||||
|
blocked=(map term (qeu blocked-move-13))
|
||||||
|
=bug
|
||||||
|
==
|
||||||
|
+$ blocked-move-13 [=duct routes=routes-13 move=(each deal unto)]
|
||||||
|
+$ routes-13
|
||||||
|
$: disclosing=(unit (set ship))
|
||||||
|
attributing=ship
|
||||||
|
==
|
||||||
+$ spore-12
|
+$ spore-12
|
||||||
$: %12
|
$: %12
|
||||||
system-duct=duct
|
system-duct=duct
|
||||||
outstanding=(map [wire duct] (qeu remote-request))
|
outstanding=(map [wire duct] (qeu remote-request))
|
||||||
contacts=(set ship)
|
contacts=(set ship)
|
||||||
eggs=(map term egg-12)
|
eggs=(map term egg-12)
|
||||||
blocked=(map term (qeu blocked-move))
|
blocked=(map term (qeu blocked-move-13))
|
||||||
=bug
|
=bug
|
||||||
==
|
==
|
||||||
+$ egg-12
|
+$ egg-12
|
||||||
@ -1956,7 +2012,7 @@
|
|||||||
outstanding=(map [wire duct] (qeu remote-request))
|
outstanding=(map [wire duct] (qeu remote-request))
|
||||||
contacts=(set ship)
|
contacts=(set ship)
|
||||||
eggs=(map term egg-11)
|
eggs=(map term egg-11)
|
||||||
blocked=(map term (qeu blocked-move))
|
blocked=(map term (qeu blocked-move-13))
|
||||||
=bug
|
=bug
|
||||||
==
|
==
|
||||||
+$ egg-11
|
+$ egg-11
|
||||||
@ -1978,7 +2034,7 @@
|
|||||||
outstanding=(map [wire duct] (qeu remote-request))
|
outstanding=(map [wire duct] (qeu remote-request))
|
||||||
contacts=(set ship)
|
contacts=(set ship)
|
||||||
eggs=(map term egg-10)
|
eggs=(map term egg-10)
|
||||||
blocked=(map term (qeu blocked-move))
|
blocked=(map term (qeu blocked-move-13))
|
||||||
=bug
|
=bug
|
||||||
==
|
==
|
||||||
+$ egg-10
|
+$ egg-10
|
||||||
@ -2000,7 +2056,7 @@
|
|||||||
outstanding=(map [wire duct] (qeu remote-request-9))
|
outstanding=(map [wire duct] (qeu remote-request-9))
|
||||||
contacts=(set ship)
|
contacts=(set ship)
|
||||||
eggs=(map term egg-10)
|
eggs=(map term egg-10)
|
||||||
blocked=(map term (qeu blocked-move))
|
blocked=(map term (qeu blocked-move-13))
|
||||||
=bug
|
=bug
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
@ -2012,7 +2068,7 @@
|
|||||||
outstanding=(map [wire duct] (qeu remote-request-9))
|
outstanding=(map [wire duct] (qeu remote-request-9))
|
||||||
contacts=(set ship)
|
contacts=(set ship)
|
||||||
eggs=(map term egg-8)
|
eggs=(map term egg-8)
|
||||||
blocked=(map term (qeu blocked-move))
|
blocked=(map term (qeu blocked-move-13))
|
||||||
==
|
==
|
||||||
+$ egg-8
|
+$ egg-8
|
||||||
$: control-duct=duct
|
$: control-duct=duct
|
||||||
@ -2033,7 +2089,7 @@
|
|||||||
outstanding=(map [wire duct] (qeu remote-request-9))
|
outstanding=(map [wire duct] (qeu remote-request-9))
|
||||||
contacts=(set ship)
|
contacts=(set ship)
|
||||||
eggs=(map term egg-8)
|
eggs=(map term egg-8)
|
||||||
blocked=(map term (qeu blocked-move))
|
blocked=(map term (qeu blocked-move-13))
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ spore-7-to-8
|
++ spore-7-to-8
|
||||||
@ -2115,7 +2171,7 @@
|
|||||||
::
|
::
|
||||||
++ spore-12-to-13
|
++ spore-12-to-13
|
||||||
|= old=spore-12
|
|= old=spore-12
|
||||||
^- spore
|
^- spore-13
|
||||||
%= old
|
%= old
|
||||||
- %13
|
- %13
|
||||||
eggs
|
eggs
|
||||||
@ -2125,13 +2181,32 @@
|
|||||||
?: ?=(%nuke -.e) e
|
?: ?=(%nuke -.e) e
|
||||||
e(sky [sky.e ken:*$>(%live egg)])
|
e(sky [sky.e ken:*$>(%live egg)])
|
||||||
==
|
==
|
||||||
|
:: added provenance path to routes
|
||||||
|
::
|
||||||
|
++ spore-13-to-14
|
||||||
|
|= old=spore-13
|
||||||
|
^- spore
|
||||||
|
%= old
|
||||||
|
- %14
|
||||||
|
blocked
|
||||||
|
^- (map term (qeu blocked-move))
|
||||||
|
%- ~(run by blocked.old)
|
||||||
|
|= q=(qeu blocked-move-13)
|
||||||
|
%- ~(gas to *(qeu blocked-move))
|
||||||
|
%+ turn ~(tap to q)
|
||||||
|
|= blocked=blocked-move-13
|
||||||
|
^- blocked-move
|
||||||
|
%= blocked
|
||||||
|
attributing.routes [ship=attributing.routes.blocked path=/]
|
||||||
|
==
|
||||||
|
==
|
||||||
--
|
--
|
||||||
:: +scry: standard scry
|
:: +scry: standard scry
|
||||||
::
|
::
|
||||||
++ scry
|
++ scry
|
||||||
~/ %gall-scry
|
~/ %gall-scry
|
||||||
^- roon
|
^- roon
|
||||||
|= [lyc=gang care=term bem=beam]
|
|= [lyc=gang pov=path care=term bem=beam]
|
||||||
^- (unit (unit cage))
|
^- (unit (unit cage))
|
||||||
=* ship p.bem
|
=* ship p.bem
|
||||||
=* dap q.bem
|
=* dap q.bem
|
||||||
@ -2149,7 +2224,7 @@
|
|||||||
== ~
|
== ~
|
||||||
?. (~(has by yokes.state) dap) [~ ~]
|
?. (~(has by yokes.state) dap) [~ ~]
|
||||||
?. ?=(^ path) ~
|
?. ?=(^ path) ~
|
||||||
=/ =routes [~ ship]
|
=/ =routes [~ ship pov]
|
||||||
(mo-peek:mo & dap routes care path)
|
(mo-peek:mo & dap routes care path)
|
||||||
::
|
::
|
||||||
=> .(path t.path)
|
=> .(path t.path)
|
||||||
@ -2240,7 +2315,7 @@
|
|||||||
|= [dap=term =yoke]
|
|= [dap=term =yoke]
|
||||||
^- mass
|
^- mass
|
||||||
=/ met=(list mass)
|
=/ met=(list mass)
|
||||||
=/ dat (mo-peek:mo | dap [~ ship] %x /whey/mass)
|
=/ dat (mo-peek:mo | dap [~ ship pov] %x /whey/mass)
|
||||||
?: ?=(?(~ [~ ~]) dat) ~
|
?: ?=(?(~ [~ ~]) dat) ~
|
||||||
(fall ((soft (list mass)) q.q.u.u.dat) ~)
|
(fall ((soft (list mass)) q.q.u.u.dat) ~)
|
||||||
?~ met
|
?~ met
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user