A tutorial application for teaching core Swim concepts. See a hosted version of this app running at https://cellular.swim.inc.
- Ensure that your
JAVA_HOMEenvironment variable points to the Java installation. - Ensure that your
PATHincludes$JAVA_HOME.
$ gradlew.bat run$ ./gradlew runOpen a web browser to http://localhost:9001.
Run two Swim instances on your local machine to distribute the application's Web Agents between two processes.
# Start the first fabric node in one terminal window
$ ./gradlew run -Dswim.config.resource=server-a.recon
# Start the second fabric node in another terminal window
$ ./gradlew run -Dswim.config.resource=server-b.reconWhen both processes are up and running, you can point your browser at either http://localhost:9008 (Server A) or http://localhost:9009 (Server B). You will see a live view of all Web Agents, regardless of which server you point your browser at. Swim transparently demultiplexes links opened by external clients, and routes them to the appropriate server in the fabric.
The Swim runtime exposes its internal subsystems as a set of meta web agents.
Use the swim:meta:host agent to introspect a running host. Use the pulse
lane to stream high level stats:
swim-cl i sync -h warps://cellular.swim.services -n swim:meta:host -l pulseThe nodes lane enumerates all agents running on a host:
swim-cli sync -h warps://cellular.swim.services -n swim:meta:host -l nodesThe fragment part of the nodes lane URI can contain a URI subpath filter:
swim-cli sync -h warps://cellular.swim.services -n swim:meta:host -l nodes#/You can stream the utilization of an individual web agent:
swim-cli sync -h warps://cellular.swim.services -n swim:meta:node/%2fcountry%2fUS -l pulseAnd discover its lanes:
swim-cli sync -h warps://cellular.swim.services -n swim:meta:node/%2fcountry%2fUS -l lanesSome additional examples:
swim-cli sync -h warps://cellular.swim.services -n swim:meta:node/%2fcountry%2fUS%2fstate%2fCA -l pulse
swim-cli sync -h warps://cellular.swim.services -n swim:meta:node/%2fcountry%2fUS%2fstate%2fCA -l lanes
swim-cli sync -h warps://cellular.swim.services -n swim:meta:node/%2fsite%2f1440 -l pulse
swim-cli sync -h warps://cellular.swim.services -n swim:meta:node/%2fsite%2f1440 -l lanesswim-cli sync -h warps://cellular.swim.services -n swim:meta:edge -l meshesYou can stream log message for a particular web agent:
swim-cli sync -h warps://cellular.swim.services -n swim:meta:node/%2fsite%2f1440 -l debugLogOr stream all log messages for a host:
swim-cli sync -h warps://cellular.swim.services -n swim:meta:host -l debugLog- gradlew/gradlew.bat — backend build script
- build.gradle — backend project configuration script
- gradle.properties — backend project configuration variables
- package.json — frontend project configuration
- rollup.config.js — frontend bundle configuration script
- src — backend and frontend source code, and configuration resources
- main/java — backend source code
- main/resources — backend configuration resources
- main/typescript — frontend source code
- pkg — support files for generated OS packages
- docker — support files for generating Docker images
- gradle — support files for the
gradlewbuild script