No description
Find a file
2024-11-07 22:35:33 +01:00
src Adjust edge calculation 2024-11-07 22:35:33 +01:00
.envrc Pass arguments over stdio 2023-11-17 09:49:05 +02:00
.gitignore Pass arguments over stdio 2023-11-17 09:49:05 +02:00
README.md Rename mask to bits 2024-11-07 14:43:16 +01:00
sbom.json Add standalone mode 2024-11-07 10:59:22 +01:00
schema.prs Rename mask to bits 2024-11-07 14:43:16 +01:00
shell.nix Pass arguments over stdio 2023-11-17 09:49:05 +02:00
tonaltime.nimble *.nimble: swap nim:bin key and value 2024-09-30 16:41:04 +01:00
Tupfile Replace Nimble with CycloneDX 2024-06-01 13:00:33 +03:00
Tuprules.tup Syndicate API update 2024-04-08 12:25:14 +01:00

Tonaltime

A Syndicated clock actor.

Publishes the current Tonal time with 8_00_0 aligned to solar noon local to the given coordinates.

  • <tonaltime @raw int @hex string>

Four solar assertions are published in traditational local time.

  • <midnight <rfc3339 @hh:mm:ss string>>
  • <sunrise <rfc3339 @hh:mm:ss string>>
  • <noon <rfc3339 @hh:mm:ss string>>
  • <sunset <rfc3339 @hh:mm:ss string>>

The actor implements the gatekeeper protocol. Use a step in the form <tonaltime { lat: 00.000 lon: 00.000 }> to resove to a dataspace where the clock and solar assertions are made.

To run in standalone mode pass a Preserves dictionary with lat and lon values specifying coordinates to align with.

$ tonaltime '{ lon:-3.571702 lat:36.998503}'

The optional { bits: } argument sets the number of bits used by the clock and affects how often clock ticks are issued. This number is currently clamped to a value between 1 and 16.

Example

Configuration

# syndicate-server configuration

# Listen on a Unix socket.
<require-service <relay-listener <unix "/run/user/1000/syndicate"> $gatekeeper>>

# Create a dataspace for resolving services.
let ?servicespace = dataspace

# Bind that dataspace with a sturdyref.
<bind <ref { oid: services key: #x"" }> $servicespace #f>

# Observe resolve requests.
$servicespace ? <resolve <tonaltime ?detail> ?obs> [
  # Start the daemon.
  $config <require-service <daemon tonaltime>>

  # Forward the request onto the daemon.
  $config ? <service-object <daemon tonaltime> ?cap> [
    $cap <resolve <tonaltime $detail> $obs>
  ]
]

# Specify how the daemon is started.
<daemon tonaltime {
  argv: "tonaltime"
  protocol: application/syndicate
  clearEnv: #t
}>

Access

To access the service configured above use the route <route [<unix "/run/user/1000/syndicate">] <ref {oid: services sig: #x"279857dc7ab625a174a797934cea4f2d"}> <tonaltime { lon: 15.0 lat: 55.1 }>>