Add option for set up validator and discovery node.
Pre-releaseImportant Changes
Please see #705.
Originally this feature was brought at v0.1.3, but we think it is important change so we introduce once again. Previous release v0.1.2 , node must know these things about its validators,
- all public addresses of nodes.
- all endpoints of nodes.
When one of the endpoints is updated, all the nodes in the network must be restarted with the updated endpoints. This will be a painful job for maintenance.
This change will solve this problem and new endpoint of validators will be updated without downtime.
--validators only with public address.
The current way to set --validators is,
--validators "self https://127.0.0.1:2822?address=G..W&alias=node2 https://127.0.0.1:2823/?address=G..4&alias=node3 https://127.0.0.1:2824/?address=G..O&alias=node4"New way to set up validators only with public address like below;
--validators "self G..W G..4 G..O"
Caution : Node just knows only the public address, the variable information like endpoint and alias are removed.
The environment variable also can be set like below;
SEBAK_VALIDATORS="self G..W G..4 G..O"Note : New option, --discovery
--discovery https://1.2.3.4:5678 --discovery https://8.7.6.5:4321Instead of setting endpoint in --validators option, using --discovery node will try to discover the validators. When a node starts, the node will send network.DiscoveryMessage to --discovery values. Each node sends and receives network.DiscoveryMessages, the node can be started until the number of discovered validators is over consensus threshold.
--discovery also can be set by an environment variable, SEBAK_DISCOVERY, multiple values can be separated by empty space.
Omitting -discovery option also be possible. Without --discovery node will just wait network.DiscoveryMessage from other nodes.
WatcherMode
Watcher does not care about the validator, it just needs the target node to watch. Watcher will use --discovery instead of --validators, the node address will be fetched from the node info of --discovery node. At this process, the remote node info is compared with watcher; the network id and initial balance are matched.
For more about this changes, please see #705, Adaptable Discovering Nodes.
Changes
You can see other changes in #883 ,#893.
Detailed changes you can see through here -