Datumesh

Publish

Anyone can publish under their own domain: your domain signs its functions, your own mesh serves them, and each step below is a command that runs, as shown, on a private copy of the mesh every night.

Make a key

Your mesh makes the key. Postgres holds the mesh's store, so migrate prepares it first; then keygen with --publish writes the key file, mesh.key, in the directory you run from, and puts the public key into the key document of your domain.

datumesh-mesh migrate
datumesh-mesh keygen --out mesh.key --publish
key id 3e95e01822376cbe; published in the key document of your-domain.example

Serve the key document on your domain

serve starts the mesh, which serves the key document at its own address on your domain, over https. The curl below fetches it and prints it:

datumesh-mesh serve
curl -s https://your-domain.example/.well-known/datumesh.json
{"host":"your-domain.example","keys":[{"alg":"ed25519","id":"3e95e01822376cbe","public":"f9fe3ec21182083be3eaa9bad69e7861ebe44520d4ddfbfdd8a5497d222a09b9"}],"proto":"datumesh/1"}

Define and test your functions

datumesh define makes a function on this machine. --stored names a function whose values your mesh holds; a formula with --formula reads other functions, and its --tests are checked when it is rooted and published.

datumesh define local/price --stored --signature '{"args": {"sku": {"type": "string", "valid": false}, "date": {"type": "date", "valid": true}}, "order": ["sku", "date"], "returns": {"type": "number", "unit": "EUR"}}'
datumesh define local/vat_price --formula '@local/price(sku: sku, date: date) * 1.2' --signature '{"args": {"sku": {"type": "string", "valid": false}, "date": {"type": "date", "valid": true}}, "order": ["sku", "date"], "returns": {"type": "number", "unit": "EUR"}}' --tests '[{"call": "local/vat_price(W2, 2026-11-20)", "expect": {"fault": "E_FORMULA_ABSENT"}}]'

Root them under your domain

Rooting names the functions under your domain, here your-domain.example/shop. The key file is mesh.key, and root reads your key document from your domain, so your mesh must be serving (step 2).

datumesh allow add your-domain.example
datumesh root --namespace your-domain.example/shop --key mesh.key local/price local/vat_price

Sign a bundle

With --export, root writes a signed bundle of the functions and their tests. Your mesh imports it (below).

datumesh root --namespace your-domain.example/shop --key mesh.key --export bundle.json local/price local/vat_price

Serving your own mesh

The steps above need a mesh of your own on your domain. The complete route, from the parts of the mesh to the reader's side:

What the publisher needs

A domain with https, in front of the mesh, with a certificate that browsers trust. Postgres for the mesh's store, the datumesh-mesh image (datumesh-http 0.5.4), your key file and your bundle. The mesh of the steps above is already running; then the bundle is imported with import-signed, and the cells, the signed values your mesh serves, are published with publish-stored.

datumesh-mesh import-signed bundle.json
datumesh-mesh publish-stored cells.jsonl
# cells.jsonl: one line per cell the mesh serves, signed by its key
{"cell": {"fn": "your-domain.example/shop/price", "args": {"sku": {"type": "string", "value": "W1"}, "date": {"type": "date", "value": "2026-11-20"}}}, "value": {"type": "number", "value": "12.5"}, "licence": "CC-BY-4.0", "summary": "Widget W1 list price on 2026-11-20: 12.5 EUR."}

What the reader does

The reader runs datumesh allow add with your domain, which lets this machine fetch from it, then datumesh get of a cell. The answer comes back signed by the publisher, and it is verified against the publisher's own key document. No config file is edited.

datumesh allow add your-domain.example
datumesh get 'your-domain.example/shop/price(W1, 2026-11-20)'

12.5

ok (fetched); signer your-domain.example#3e95e01822376cbe

datumesh.com does not yet accept bundles from other domains.

Once listing is live, datumesh.com will list a mesh's functions in its catalogue and in find when the mesh publishes its own catalogue with subject keys and Datumesh adds its host to the list.