Mojo UpDocs
Nodes

Run a node as a service

Start a node with the machine, keep it running after a crash, and control it with start, stop and status.

A node you keep in a terminal stops when the terminal closes. Install it as a service and the operating system starts it at logon or at boot, and starts it again if it stops unexpectedly. The setup wizard offers this as Start this node when the machine starts?; you can also do it at any time from the command line.

Install the service

Terminal
mojoup-node service install

This registers the node with the operating system's service manager and starts it. Running it again rewrites the same definition, so it is safe to repeat.

OptionWhat it does
(none)Start the node when you log on, as you. No administrator rights needed.
--systemStart the node at boot, before anyone logs on. Needs an administrator (Windows) or root (Linux, macOS).
--trayAlso start the tray icon at logon (Windows only).

The node is installed as a Scheduled Task: at logon for your user, or with --system at boot as SYSTEM (run it from an elevated terminal). The task runs hidden with no time limit. A small supervisor restarts the node if it crashes, starting at two seconds and backing off to a minute.

Ending the task in Task Scheduler stops the node too.

Control it

CommandWhat it does
mojoup-node startStart the node. With no service installed, it runs the node in the background.
mojoup-node stopStop it cleanly.
mojoup-node restartStop it and start it again.
mojoup-node service statusWhether the service is installed and running.
mojoup-node statusWhat the node last reported, including a one-line service summary.
mojoup-node service uninstallStop the node and remove what install wrote. The node's state is kept.

start, stop and restart are the same as service start, service stop and service restart.

A clean stop lets each repository's host shut down before the node exits. If the node has not stopped after 20 seconds, it is ended.

Run in the background without a service

Terminal
mojoup-node run --daemon

This starts the node detached from your terminal, with a supervisor that restarts it if it crashes. Its output goes to logs/service.log in the state directory. Stop it with mojoup-node stop.

Leave a foreground node running

When you run mojoup-node run in a terminal, the node's console opens. Leaving it asks Stop the node, or leave it running and detach?: press s to stop it, or d to stop it here and start it again in the background (as the service if one is installed, otherwise as a daemon).

The tray icon (Windows)

PowerShell
mojoup-node tray start

The tray icon shows whether the node is running, starting or stopped, with Start, Stop, Restart, Open dashboard, Open logs and Quit tray. The node never needs it. mojoup-node service install --tray starts it at every logon. On macOS and Linux the node has no tray icon yet.

Logs

Terminal
mojoup-node logs -f

The node's log is logs/node.log in the state directory; when it runs as a service or daemon, the service manager's output is in logs/service.log.

On this page