Docs Layers

Functions

Live on testnetRuns on OutLayer

A function is Rust compiled to WASI. OutLayer runs it in a TEE worker, and the contract keeps a registry of your functions and a record of every result. A function can hold a secret and make outbound HTTPS calls. There is no JavaScript runtime.

Commands

Terminal
quay functions deploy moderate
quay secrets set MOD_API_KEY --fn moderate
quay functions invoke digest '{}'
quay functions logs moderate

How Harbour Board uses it

  1. A member adds a post. The posts collection has on_add: moderate, so the contract asks OutLayer to run it.
  2. moderate gets the post and the MOD_API_KEY secret. It checks blocked words and fetches a preview for any link.
  3. The result lands in the _fn collection. A post marked hide: true leaves / and /api/posts.

The result moderate wrote for run 24, read from the _fn collection:

{
  "name": "moderate",
  "caller": "e2e-4eb351a1.harbour-board.testnet",
  "ok": true,
  "output": {
    "auth": "ok",
    "hide": false,
    "key_sha256_prefix": "f48adad6c4c4",
    "preview": { "title": "Example Domain", "url": "https://example.com/" },
    "reason": "ok"
  }
}

Proof on testnet

The function deployedAyEpD8Lf…
The secret stored3cZfXHtL…; the value was never printed, and only a sha256 prefix is kept
digest run by hand9vX1o2oD… and its attestation
A post hiddenRun 17, from promo-bot: hide: true, blocked words. /posts/9 answers 404.

Check it without a key: view fn_list '{}' and view db_list '{"collection":"_fn","query":{"limit":3,"order":"desc"}}'. The view helper is in the repository README, and scripts/judge.sh runs these checks.

What you trust

OutLayer is one operator's TEE network. Secrets are decrypted inside its enclave, so you trust that enclave and that operator. There is no drop-in replacement. Run the same logic on your own server, or leave functions out. Without them, posts still land, previews stay empty and scheduled results stop.

Limits

LanguageRust compiled to WASI. No JavaScript runtime.
Time30 seconds per call on the Board. Runs took 5 to 17 seconds.
Cost0.005 NEAR attached per call, paid by the site

Every flag is in the command reference, generated from quay functions --help, quay secrets --help.