This offers different ways to load configuration and information about the other nodes.
It will try to load the information in the following order:
The detection is made in class DockerusAuto
.
If this is launched via docker-compose, and is multiplied using scale
,
it will already grab all needed info from docker, and the following Environment variables
HOSTNAME
own host name (should be given from the system)API_HOST
where the api node is. Example:http://localhost:8080/api
SENSOR_SIMULATE
set to1
to enable reading from theDS1820
sensor (tested on Raspberry Pi)
This happens in the class Dockerus
.
If you specify a config.json
file however, that one will be used:
{
"node_hosts": ["192.168.2.8", "192.168.2.9", "192.168.2.10", "192.168.2.11"],
"own_host": "192.168.2.8", # If not given: Falls back to the local socket ip address, which might be wrong!
"api_host": "http://example.com/" # If you have this entry, it overwrites $API_HOST env variable. Or set to null, to disable.
"sensor_simulate": false # If you have this entry, it overwrites $SENSOR_SIMULATE env variable.
}
This is handled in the class DockerusFile
.
It is not possible to use the PBFT algorithm with this.
This is the fallback so unit tests can still be executed.
See the class DockerusDummy
.