Anatomy of a Node
The peers of OctoMY™
Topics
- components
- architecture
While agents, remotes and hubs serve widely different purposes, there is still a large overlap in features under the hood. They all share the following:
- Application launcher - The application launcher that launches the node instance
- Configuration helper - Helper to keep track of appConfigure() and appActivate() state
- Key store - Storage for security keys
- Local ID - The identify of the node
- Local network addresses - The addresses the node can be reachd by over the local network
- Address Book - Clients address book (clients are nodes we communicate with)
- Client instancess - Each client instance is an on-going communication state with another node
- Node Identity - The full identity of the node
- Discovery Client - A service to automatically discover other nodes
- Comms carrier - Comms channel carrier the underlying carrier such as udb/bluetooth/eth for comms
- Comms channel - Comms channel used to communicate with other nodes
- Zoo client - The zoo client is used to exchange data via the central repository server (zoo)
- Sensors - Helper to access all sensors available to the node
- Sensor comms courier - Comms Courier to manage transmission of changes in sensor data to friendly nodes
- Blob comms courier - Comms Courier to manage transmission of blobs such as images, files and video streams (they are treated as blobs)
- Cameras list - Helper to manage attached cameras adapting to dis- and re- connections
- Server URL - The URL of the zoo server
- Node activation state - The current state during activation
Service wrappers
- Key store service - Service wrapper for KeyStore
- Local ID service - Service wrapper for Local ID
- Local Address List service - Service wrapper for Local address list
- Address Book service - Service wrapper for Address Book
- Discovery service - Service wrapper for discovery
- Comms Carrier service - Service wrapper for comms carrier
- Comms service - Service wrapper for comms
Service levels
- Service level manager - Manager for maintaining the lifecycle and interdependencies of services
- Always service level - Service Level that will always be active as long as node is running
- Discovery service level - Service Level that will be active as long as node is in discovery mode
In this page we will go through how every Node is structured.
Launch sequence
Launcher
Launcher is instantiated
auto agentMain = QSharedPointer
Launcher is configured
agentMain->configure("agent", argc, argv);
This will create a new instance of AppContext that contains the following;
- AppCommandLineParser
- QProcessEnvironment (system environment from OS)
- Command line arguments from
Launcher is run
auto ret = agentMain->run(); exit(ret);
This will:
- Instantiate the QCoreApplication for headless and QApplication for headful node (or detect and defer to existing eventloop).
- Activate app
- Instantiate node
- appConfigure node with launcher "shared this" (see node below)
- appActivate node (see node below)
- Hook signals for nodeActivateChanged and nodeRequestExit
- put node->appActivate(true) call on eventloop
- Initialized executable resources such as icons/images/fonts etc.
- exec the eventloop in app if not already started.
Node
appConfigure()
-
Apply UI style
-
configure keystore in base folder from context "keystore.json"
-
configure keystore service
-
configure local identity in base folder from context "/local_identity.json"
-
configure local identity service
-
configure local address list using default port for node type
-
configure local address list service
-
configure address book in base folder from context "/addressbook.json"
-
configure address book service
-
configure discovery client using node type and hardcoded timing
-
configure discovery client service
-
configure comms carrier
-
configure comms carrier service
-
configure comms channel
-
configure comms channel service
-
configure service level manager
-
register all services into service levels "always" and "discovery"
-
call nodeConfigure() (spesific to node type)
nodeConfigure()
(called from laucnher appConfigure() ) NOTE: Spesific to node type. In this example we talk about Agent
- configure agent config store in base folder from context "agent_config.json"
appActivate()
(called from launcher)
- serviceActivation will enable service level "always"
- hook signals for comms(???)
- nodeActivation()
nodeActivation()
called by appActivate() NOTE: Spesific to node type. In this example we talk about Agent
- activate agent config store
- synchronize agent config store