Skip to content

The rn Client

rn publishes, queries and fetches. In the Compose stack, run it with deploy/scripts/rn.sh, which mounts the current directory at /work. The key is created at /data/author.key on first use.

Command Purpose
rn whoami Public key and DID
rn publish -file F -name N [-title T] [-summary S] [-tag t=label] -relay U Upload a file and publish its asset event
rn event -kind K -content C [-tag name=value] -relay U Publish any event
rn delete [-name N] [-id ID] -relay U Delete an asset by name, or events by id
rn query -relay U [-kind K] [-author A] [-id ID] [-tag n=v] [-match TEXT] [-exec PROGRAM] Read relays directly, filter locally and optionally pipe the events through your own program
rn search -q TEXT [-sha256 H] [-author A] [-kind K] Federated search
rn fetch [-q TEXT] [-sha256 H] -out F Find an asset, download it and verify its hash

-relay, -tag, -author, -id, -kind and -match can be repeated. -store (ASSETS_URL), -api (SEARCH_URL), -key (KEY_FILE), -limit and -at change defaults. publish, event and delete exit with an error if any relay refuses.

Example

deploy/scripts/rn.sh publish -file model.bin -name my-model -title "My model" -tag t=ml -relay ws://personal:8080
deploy/scripts/rn.sh search -q "my model"
deploy/scripts/rn.sh fetch -q "my model" -out copy.bin

Computing over raw events

-exec runs a program with the matching events as JSON lines on standard input. This allows custom ranking or analysis without depending on any registry:

deploy/scripts/rn.sh query -relay ws://relay-0:8080 -kind 30500 -exec /work/rank.sh