Compare commits

..

8 Commits

4 changed files with 39 additions and 19 deletions

View File

@ -28,7 +28,6 @@ Example configuration:
$cap <cache { dataspace: $nixspace lifetime: 3600.0 }> ]
]
```
### File System Usage
Summarize the size of file-system directory. Equivalent to `du -s -b`.
@ -245,8 +244,32 @@ Sample Syndicate server script:
## msg
A utility that parses its command-line arguments as Preserves and send them as messages to `$SYNDICATE_ROUTE`.
When called as `assert` (by a symlink or a rename) it will make assertions instead.
A utility that sends messages to `$SYNDICATE_ROUTE`.
## net_mapper
Publishes ICMP packet round-trip-times. See [net_mapper.prs](./net_mapper.prs) for a protocol description. [Source](./src/net_mapper.nim).
Example script:
```
? <machine-dataspace ?machine> [
$machine ? <rtt "10.0.33.136" ?min ?avg ?max> [
$log ! <log "-" { ping: { min: $min avg: $avg max: $max } }>
]
$config [
<require-service <daemon net_mapper>>
<daemon net_mapper {
argv: ["/bin/net_mapper"]
protocol: application/syndicate
}>
? <service-object <daemon net_mapper> ?cap> [
$cap { dataspace: $machine }
]
]
]
```
## PostgreSQL

View File

@ -1,5 +1,4 @@
include_rules
: foreach *.nim | $(SYNDICATE_PROTOCOL) ./<schema> |> !nim_bin |> {bin}
: foreach {bin} |> !assert_built |>
: $(BIN_DIR)/msg |> !symlink |> $(BIN_DIR)/beep
: $(BIN_DIR)/msg |> !symlink |> $(BIN_DIR)/assert
: $(BIN_DIR)/msg |> cp %f %o |> $(BIN_DIR)/beep

View File

@ -1,22 +1,20 @@
# SPDX-FileCopyrightText: ☭ Emery Hemingway
# SPDX-License-Identifier: Unlicense
import std/[sequtils, os, strutils]
import std/[asyncdispatch, sequtils, os]
import preserves, syndicate, syndicate/relays
setControlCHook(proc () {.noconv.} = quit())
runActor("msg") do (turn: var Turn):
proc main =
let
route = envRoute()
data = map(commandLineParams(), parsePreserves)
cmd = paramStr(0).extractFilename.normalize
resolveEnvironment(turn) do (turn: var Turn; ds: Cap):
case cmd
of "assert":
for e in data:
publish(turn, ds, e)
else: # "msg"
discard bootDataspace("msg") do (turn: var Turn; root: Cap):
spawnRelays(turn, root)
resolve(turn, root, route) do (turn: var Turn; ds: Cap):
for e in data:
message(turn, ds, e)
sync(turn, ds) do (turn: var Turn):
stopActor(turn)
for _ in 1..2: poll()
main()

View File

@ -1,6 +1,6 @@
# Package
version = "20240407"
version = "20240405"
author = "Emery Hemingway"
description = "Utilites for Syndicated Actors and Synit"
license = "unlicense"