PBFT-JAVA
PBFT-JAVA copied to clipboard
PBFT
Node configuration
This offers different ways to load configuration and information about the other nodes.
It will try to load the information in the following order:
- Configuration file
- Docker & Environment variables
- Dummy Configuration
The detection is made in class DockerusAuto.
Docker & Environment variables
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
HOSTNAMEown host name (should be given from the system)API_HOSTwhere the api node is. Example:http://localhost:8080/apiSENSOR_SIMULATEset to1to enable reading from theDS1820sensor (tested on Raspberry Pi)
This happens in the class Dockerus.
Configuration file
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.
Dummy Configuration
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.