fix: (issues/9) Worker does not support port assignment for routers (#11)

Quite a refactor and some code cleanup.

Co-authored-by: James Wells <jwells@dragonheim.net>
Reviewed-on: #11
Co-authored-by: James Wells <jwells@noreply.localhost>
Co-committed-by: James Wells <jwells@noreply.localhost>
This commit is contained in:
James Wells 2021-05-21 23:03:50 +00:00
parent 881a11316d
commit 7d6fbfef24
21 changed files with 451 additions and 271 deletions

View file

@ -4,7 +4,7 @@
*
* Optional.
*/
name = "gagent-zulu.example.org"
// name = "gagent-zulu.example.org"
/*
* This is the mode that this node operates in. There
@ -20,47 +20,59 @@ name = "gagent-zulu.example.org"
* send responses to routers for return
* the requesting client.
*
* If it is not defined, G'Agent will start in setup
* mode and attempt to write a new configuration file
* to the local directory. The file will be called
* gagent.hcl
*
* Required.
*/
mode = "router"
/*
* @TODO: Add authentication based on UUID
* This is the UUID used throughout the G'Agent system
* to uniquely identify this node. It is generated
* during setup.
* during setup if it doesn't exist.
*
* Required.
*/
uuid = "7e9d13fe-5151-5876-66c0-20ca03e8fca4"
// uuid = "7e9d13fe-5151-5876-66c0-20ca03e8fca4"
/*
* This is the IP Address to bind to, it defaults to
* 0.0.0.0
*
* Optional.
*
* listenaddr = 0.0.0.0
*/
// listenaddr = 0.0.0.0
/.
* This is the port to listen on, it defaults to
* 35570. It is strongly recommended that you not
* use ports 0 - 1024
/*
* This is the port to the router will listen for on
* for clients. It defaults to 35570.
*
* Optional.
*
* listenport = 35570
*/
// clientport = 35571
/*
* This is the UUID used throughout the G'Agent system
* to uniquely identify this node.
* This is the port to the router will listen for on
* for other routers. It defaults to 35570.
*
* Required.
* Optional.
*/
// uuid = "04f97538-270d-4ca3-b782-e09ef35830e9"
// routerport = 35570
/*
* This is the port to the router will listen for on
* for workers. It defaults to 35571.
*
* Optional.
*/
// workerport = 35572
/*
* @TODO
* This is the list of known G'Agent clients. Clients
* are not registered dynamically, instead the only
* clients that may connect are those listed here,
@ -70,11 +82,11 @@ uuid = "7e9d13fe-5151-5876-66c0-20ca03e8fca4"
* Optional.
*/
// client "alpha" {
// uuid = "04f97538-270d-4ce3-b782-e09ef35830e9"
// clientid = "04f97538-270d-4ce3-b782-e09ef35830e9"
// }
//
// client "beta" {
// uuid = "04f97538-270d-4cf3-b782-e09ef35830e9"
// clientid = "04f97538-270d-4cf3-b782-e09ef35830e9"
// }
/*
@ -83,23 +95,15 @@ uuid = "7e9d13fe-5151-5876-66c0-20ca03e8fca4"
* there is more than one router, clients and workers
* will connect to them in sequential order.
*/
// router "alpha" {
// uuid = "04f97538-270d-4cb3-b782-e09ef35830e9"
// address = "gagent-alpha.example.org"
// tags = [ "a", "b", "c", "d" ]
// }
//
// router "beta" {
// uuid = "04f97538-270d-4cc3-b782-e09ef35830e9"
// address = "gagent-beta.example.org"
// tags = [ "a", "c", "e", "g" ]
// }
//
// router "charlie" {
// uuid = "04f97538-270d-4cd3-b782-e09ef35830e9"
// address = "gagent-charlie.example.org"
// tags = [ "b", "d", "f", "h" ]
// }
// router "alpha" {
// routerid = "04f97538-270d-4cb3-b782-e09ef35830e9"
// address = "gagent-alpha.example.org"
// }
// router "beta" {
// routerid = "04f97538-270d-4cc3-b782-e09ef35830e9"
// address = "gagent-beta.example.org"
// }
/*
* This is a list of known G'Agent workers. This is only
@ -109,18 +113,9 @@ uuid = "7e9d13fe-5151-5876-66c0-20ca03e8fca4"
* At least one worker is reuqired for routers.
*/
// worker "alpha" {
// uuid = "04f97538-270d-4ce3-b782-e09ef35830e9"
// address = "gagent-alpha.example.org"
// tags = [ "a", "b", "c", "d" ]
// }
//
// worker "beta" {
// uuid = "04f97538-270d-4cf3-b782-e09ef35830e9"
// tags = [ "a", "c", "e", "g" ]
// }
//
// worker "charlie" {
// uuid = "04f97538-270d-4c04-b782-e09ef35830e9"
// tags = [ "b", "d", "f", "h" ]
// workerid = "04f97538-270d-4ce3-b782-e09ef35830e9"
// }
// worker "beta" {
// workerid = "04f97538-270d-4cf3-b782-e09ef35830e9"
// }

View file

@ -2,12 +2,12 @@
### Hello Earth ###
###################
# HINT START
# - console
# - thermal measurements
# - gravity measurements
# - gravity fluctuations
# HINT END
proc hello_earth {} {
puts "Hello Earth, does tempurature variations alter specific gravity?"
puts "Hello Earth, does localized tempurature variations alter specific gravity?"
}
hello_earth