A base orchestrator service extending from tether-wrk-base that orchestrates rack management.
It serves as a central coordinator between app-node and workers to:
- Manage rack registrations and their lifecycle
- Aggregate and process data
The orchestrator handles the following RPC requests:
registerRack: Registers a new rack with the provided details.forgetRacks: Removes or forgets specified racks.listRacks: Retrieves a list of racks based on optional filtering criteria.tailLog: Tail a set of logged data from the racks.
To set up the configuration, run:
./setup-config.shTo install dependencies, run:
npm install-
Register Rack:
npx hp-rpc-cli -s <RPC_KEY> -m registerRack -d '{ "id": "<ID>", "type": "<TYPE>", "info": { "rpcPublicKey": <RPC_PUBLIC_KEY> } }' -t 1000000
-
List Racks:
npx hp-rpc-cli -s <RPC_KEY> -m listRacks -d '{ "type": "<TYPE>", "keys": ["<KEY>"] }' -t 1000000
-
Forget Racks:
npx hp-rpc-cli -s <RPC_KEY> -m forgetRacks -d '{ "ids": [ "<ID>" ], "all": <BOOLEAN> }' -t 1000000
-
Tail Log:
npx hp-rpc-cli -s <RPC_KEY> -m tailLog -d '{ "type": "<TYPE>", "key": "<KEY>", "tag": "<TAG>" }' -t 1000000
Since this class extends tether-wrk-base, it inherits all configurations from the parent class. If any new functions or features require configuration, updates should be made to config/common.json if the settings are shared across all child classes.
In the future, if you need to add a facility, include the facility code in the base class and add the corresponding configuration file in config/facs/xxx.config.json.example.
Current Configuration Details:
-
Common Configuration: Configuration is loaded from the
config/common.jsonfile. Example:{ "debug": 0, }debug: Controls the logging level for the worker.
-
Facilities Provided by the Base Class: The following facilities are inherited from the parent class:
hp-svc-facs-store: Exposes persistent Holepunch datastores. This facility does not require additional configuration files.hp-svc-facs-net: Provides access to the Holepunch networking stack (Hyperswarm). Configuration is loaded fromconfig/facs/net.config.json. Example:{ "r0": { "allow": [], "allowLocal": true } }allow: An array used as an allowlist to validate incoming connections based on theirremotePublicKey.allowLocal: If set totrue, it allows connections originating from the local IP address.