Skip to main content
The Stellarium standard library is a set of general-purpose resources published under the sh.stellarium.stdlib path. They cover small tasks that RequestScript doesn’t do on its own, such as measuring a string, generating a UUID, or reading the current time. The resources are hosted by a node running stellarium-stdlib. Its functions have no payment manifest and aren’t restricted, so any request can call them for free.

Resources

Strings

sh.stellarium.stdlib.Strings

Uuid

sh.stellarium.stdlib.Uuid

Datetime

sh.stellarium.stdlib.Datetime

Calling the standard library

Bind a resource with its fully qualified name, then call its functions with named arguments. You can bind several standard library resources in one request:
Like every resource call, each call evaluates to a result object with either value or error set. Check error before you use value. See Requests.
Your node can only call the standard library if it knows about the node that hosts it. If your node joined through a starting peer that already knows the sh.stellarium.stdlib resources, it copies them on startup. Run GET /v1/resources on your node to check.

Running a stdlib node

You can host the standard library yourself, for example on a local network.
1

Clone and install

2

Create a .env file

The stdlib server reads three variables of its own. The node also needs the standard stellarium-ts variables, such as its signing keys. See Configuration.
.env
The STARTING_PEER default points at the stdlib node’s own default address. Set it to another node so the stdlib node joins a network.
3

Build and start

On startup the node registers Strings, Uuid and Datetime, then announces itself and broadcasts the resources to every known peer.