sudo npm install -g valma @valos/kernel
We will use this tool to create a worker workspace without a domain and with @valos/web-spindle and @valos/authority-spindle toolsets.
vlm init
After answering, vlm will echo the internal commands it performs like so:
? Set 'vault' as the valos.type (workspace is outside a vault)? (y/N)
No
The echos are omitted for the rest of this guide. Now let's choose no domain and type to be worker.
[1] >> [2] vlm .configure/.valos-stanza
[2] >> [3] vlm '.select/.domain/**/*' --show-name --show-description
[2] << [3] vlm '.select/.domain/**/*': [{"...":{"columns":[["name",{"text...
? Choose a package.json:valos.domain for the new workspace
❯ <no domain> - <this workspace is not part of a domain>
? Choose a package.json:valos.type for the new workspace
❯ worker - Execute perspire gateway as a Node.js process in this workspace
At this point vlm init asks to delegate package.json initialization to yarn init . We accept defaults if available and give sane values otherwise.
? Confirm package.json:valos.type choice: 'worker'? (Y/n)
Yes
? Initialize package.json with 'yarn init'?
❯ Initialize
Verify that the domain @valos/kernel is visible as it is the origin of @valos/web-spindle and @valos/authority-spindle toolsets (among other things). We don't need to add other domains, so we bypass adding them.yarn init v1.21.1
question name (taur-worker):
question version (0.1.0): 0.1.0
question description: Test authority
question entry point (index.js):
question repository url:
question author: Iridian
question license (MIT):
question private (true):
[1] init informs: Visible domains:
package |version |pool
-------------|-------------------|------
@valos/kernel|0.37.0-prerelease.0|global
? yarn add more domains as devDependencies directly to this workspace?
❯ Bypass
At this point vlm init makes the first of several calls to yarn init . These separate calls are necessary as they bring in initialization and configuration code for subsequent stages.
? Commit package.json valos stanza: {"type":"worker","domain":""}?
❯ Commit
At this point the init is complete and we proceed to configuring the workspace. The command vlm configure --reconfigure can always be manually re-executed from the CLI if something goes wrong after this point.
[1] >> [4] vlm @ yarn add --dev @valos/type-worker@>=0.37.0-prerelease.0
yarn add v1.21.1
success Saved lockfile.
success Saved 224 new dependencies.
info Direct dependencies
└─ @valos/type-worker@0.37.0-prerelease.0
info All dependencies
└─ ...
Done in 38.60s.
Leave service chronicle URI empty. The basic authority setup does not involve any custom service logic.
? Configure workspace with 'vlm configure --reconfigure'?
❯ Configure
Always select copy-templates-files when given the option
? The service chronicle URI
Now we get to select the toolsets we want. We need to manually install web-spindle only first as authority-spindle depends on it (and unfortunately automated dependency ordering is not implemented yet)
? Pick tools selection choices for the toolset '@valos/type-worker'
◉ copy-template-files - Copy toolset template files to the workspace
? Pick toolsets selection choices for the workspace
◯ @valos/authority-spindle - Host a standalone authority using web-spindle route projectors
◉ @valos/web-spindle - Project http/s requests to valospace-fabric via a gateway plugin
◯ @valos/toolset-revealer - Run 'vlm rouse-revealer' to serve local inspire sites with webpack-dev-server
◯ @valos/type-toolset - Make current workspace selectable as a toolset for other workspaces
We configure the web-spindle to have SSL enabled at localhost port 5443 and choose to have openssl to create insecure self-signed certificates for testing our authority.
[13] >> [18] vlm @ yarn add --dev @valos/web-spindle@>=0.37.0-prerelease.0
yarn add v1.21.1
Done in 12.25s.
? Enable SSL
True
? The port the Web API listens.
5443
? The local address the Web API is bound to.
localhost
? Pick tools selection choices for the toolset '@valos/web-spindle'
◉ copy-template-files - Copy toolset template files to the workspace
? Use 'openssl' to create insecure self-signed placeholder certificates?
Yes
[14] >> [19] vlm @ openssl req -x509 -newkey=rsa:4096 -keyout=env/local-authority.key.pem -out=env/local-authority.crt -days=7300 -nodes -subj=/CN=localhost
At this point the init completes for the first time. We still need to select the authority-spindle, so we re-execute configure:
key |value
-------|-----
success|true
These two copy-template-files are redundantvlm configure
? Pick tools selection choices for the toolset '@valos/type-worker'
◉ copy-template-files
Finally we get to select the authority-spindle toolset also.
? Pick tools selection choices for the toolset '@valos/web-spindle'
◉ copy-template-files
Let's use the default URI for the actual authority URI. While the port and host should match the ones used by web-spindle, the hierarchy part can be anything. taur is only inferred from the package name.
? Pick toolsets selection choices for the workspace
◉ @valos/authority-spindle - Host a standalone authority using web-spindle route projectors
◉ @valos/web-spindle - Project http/s requests to valospace-fabric via a gateway plugin
◯ @valos/toolset-revealer - Run 'vlm rouse-revealer' to serve local inspire sites with webpack-dev-server
◯ @valos/type-toolset - Make current workspace selectable as a toolset for other workspaces
? The authority valosp URI.
valosp://localhost:5443/taur/
? Short description for the public authority config
Test authority
? Pick tools selection choices for the toolset '@valos/authority-spindle'
◉ copy-template-files
The setup of the authority is now complete. Let's start the perspire worker.
key |value
-------|-----
success|true
If everything runs smoothly, we should have 15 routes on two prefixes:
vlm perspire
[1] perspire informs: MapperService(MapperService$.1): listening @ { address: '127.0.0.1', family: 'IPv4', port: 5443 } prepared prefixes:
/: taur-worker@0.1.0 - openapi Example Title
valosp://localhost:5443/taur/: taur-worker@0.1.0 - Test authority