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.StringsUuid
sh.stellarium.stdlib.UuidDatetime
sh.stellarium.stdlib.DatetimeCalling 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: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
3
Build and start
Strings, Uuid and Datetime, then announces itself and broadcasts the resources to every known peer.