on main help sign in

A leaderboard for local app discovery

git clone ssh://git.iko.soy/hits

Hits

Hits

A leaderboard for app installs on Urbit.


Hits is an Urbit app that ranks other apps by how many installs they have among the ships around you. Each ship gossips a small message — a hit — whenever it installs or uninstalls an app, and counts the hits it hears so it can show a live leaderboard. There is no central server: the ranking is assembled on your own ship from the ships you already talk to.

How it works

How this fork differs from upstream

This is a fork of urbit/hits, reworked to run on the current kernel, serve everything from the ship, and hold up against bad input. The main differences:

Repository layout

PathWhat it is
desk/The %hits Gall agent, marks, and structures (Hoon)
desk/app/hits.hoonThe agent: scanning, counting, gossip, docket reads
desk/lib/hits.hoonShared helpers: install-time stamping and bounds
desk/lib/gossip.hoonRumor relay layer over Pals
ui/The React frontend, built into the app's glob
flake.nixBuilds the %hits desk reproducibly

Building with Nix

The desk is built reproducibly with a flake. No global tools are needed beyond Nix with flakes enabled (--extra-experimental-features 'nix-command flakes' if they aren't on by default).

nix build

./result is then a symlink to the finished desk. The build:

That urbit input (github:urbit/urbit/408k-2) must stay in step with desk/sys.kelvin (%zuse 408). To move to a different kernel, change both together and run nix flake update urbit.

Build for a specific platform with nix build '.#packages.<system>.desk' (for example aarch64-darwin, x86_64-linux, or aarch64-linux).

The frontend glob

The UI is built separately and uploaded as the app's glob:

cd ui
npm ci
npm run build

npm run dev runs the UI against a running ship for local development.

Installing on a ship

  1. Build the desk and the glob as above.
  2. Mount and replace %hits with the built desk. Vere cannot delete files in a mount, so swap in a writable copy, then commit:
    find <pier>/hits -mindepth 1 -delete
    cp -R result/. <pier>/hits/ && chmod -R u+w <pier>/hits
    In the ship's dojo: |commit %hits (For a pier on another machine, see the rsync note in flake.nix — macOS rsync ignores --chmod.)
  3. Upload the built UI glob through the docket, then publish:
    |public %hits

On a ship other than ~donmec-sallud, installing Hits from a file (for example with deskjam) leaves it without a frontend: the docket's glob-ames+[~donmec-sallud 0v0] is a placeholder. That ship can serve its own copy by clicking set in deskjam's glob box, then uploading the built ui/dist at /docket/upload.

License

MIT. See desk/LICENSE.

Forked from urbit/hits.