Skip to main content

Start options

node.start(fastify, options) accepts StellariumNodeOptions. Options that have an environment variable fall back to it when you leave them out, so you can configure a node either way. Because a node reads the environment only for options you don’t pass, several nodes can run in one process with different options. start throws if a required value is missing from both the options and the environment.

Environment variables

Importing StellariumNode loads dotenv, so a .env file in the working directory is applied automatically.
BASE_URL excludes /v1, but OPERATOR_URL includes it, because the node appends the operator’s routes (such as /payments/authorize) directly.

Generating signing keys

Keep signing identities stable. A new key gives the node a new identity on the network: it has to be enrolled in its organization again, and grants issued to the old key no longer work.

Local state

The node stores the peers, resources and grants it learns, and the contracts deployed to it, in requestscript.db in the current working directory, or in the file named by databasePath (or DATABASE_PATH). If you run more than one node on a machine, give each its own database file. For more throughput, or to keep several nodes in one database, use Postgres instead. Set DATABASE_URL, and give each node its own schema with DATABASE_SCHEMA:
.env
The node creates its schema and tables when it starts. Setting both DATABASE_URL and DATABASE_PATH is an error, and so is a DATABASE_SCHEMA that isn’t lowercase letters, digits and underscores. In a container, the working directory is usually rebuilt on every deploy, which wipes what the node has learned. Mount a persistent volume (for example at /data) and set DATABASE_PATH=/data/requestscript.db to keep it.