Operator mode
Running in production12.5.11+

Operator mode

Run the operator commands from the node's own web UI: who gets it, signing in, the lockout, reverse proxies, and what it never runs.

The node's own web UI can run a fixed list of operator commands and read the operator routes, for the operator only. Public visitors keep the read-only pages. It is at Developers, Operator (/dashboard/operator).

Who gets it #

A request is served only when all of this holds. Otherwise the page says that the mode is not available, and why.

  • operatorui is on (the default; operatorui=0 removes it).
  • The browser runs on the node's machine, or reaches it through an SSH tunnel.
  • The address in the browser is localhost, 127.0.0.1 or [::1].
  • The request carries no reverse-proxy header and no sign of a reverse proxy on this machine.

From another machine, open a tunnel, then http://localhost:10604/dashboard/operator:

Shell
ssh -L 10604:127.0.0.1:10604 user@node

Sign in #

Sign in with the node's JSON-RPC credentials, or with the line of the .cookie file as the password and an empty user. A user restricted by rpcwhitelist is refused. A session ends after 15 minutes without use and after 8 hours at most; a restart signs everyone out.

12.5.13+

After 5 wrong passwords in a row, each further one closes the sign-in for 30 seconds, doubled each time, at most 15 minutes. While it is closed, every sign-in answers 429 operator_locked with Retry-After, the right password included. The right password resets the count, and so does a restart; it is also forgotten after an hour without a failure.

A reverse proxy on the node's machine #

A proxy on the same machine forwards public requests from a loopback address, like a local browser. Tell the node which requests come through it, in one of two ways:

  • Bind the proxy to its own loopback address and declare it. Its requests are then never served the operator mode.
  • Make it set X-Forwarded-For (nginx: proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;).

With nginx and proxy_bind 127.0.0.2;:

Config
operatorproxy=127.0.0.2

Also deny /api/v1/operator in the proxy. operatortrustlocalproxy=1 serves the requests of a local proxy that sets no forwarding header: set it only when every client of that proxy may use the operator mode. operatorproxy is new in 12.5.13.

What it runs #

The page has a control for each command of its list: this node, peers, hole punching and block relay, the certificate, indexes, UTXO snapshots, live parameters and logging, mining and pool, child and parent chains, the node's messages, receipts and notary. Each answer shows the equivalent lotus-cli line. It also reads the operator routes: the node log, the Stratum server, the share chains and the operator side of the pool (12.5.13).

It never runs stop, a command that can move funds, a key export, a block invalidation, or a command that is not on the list. The wallet commands are refused as a category. Use lotus-cli on the node for those.

Routes #

Route under /api/v1/operator
GET sessionWhether the mode is available and signed in, the reason when not, the commands and routes, login_locked_for
POST login, POST logoutSign in and out
POST rpc/<method>One command of the list
GET route/<route> (12.5.13)One operator route, with the session
GET node-config (12.5.13)The settings of This node, as the operator sees them
Source share/www/docs/operator-mode.md in the lotusd repository
Checked against doc/webui-operator.md src/api/operator_handler.cpp src/httprpc.cpp share/www/dashboard/js/operator-page.js