-
Kostas Christidis authored
https://jira.hyperledger.org/browse/FAB-1364 All consenters read several of their config settings (think sharedconfig) from the genesis block that is generated by a bootstrapper. The only bootstrapper available so far is the static one. However, when testing we need to be able to modify several of these config values on the fly. Therefore the bootstrapper should be able to read a config object (which is itself created by reading the orderer.yaml file and -if set- its associated ENV vars). An example of that would be the KafkaBrokers value. For unit tests the "right" value is "127.0.0.1:9092", whereas for the current Docker Compose-based BDD tests the right value is "kafka0:9092". Since this bootstrapper is no longer static, renaming the package seemed appropriate. For production we will need to introduce file-based bootstrapper that reads the genesis block created by the genesis block tool. This changeset allows the bootstrapper to generate the appropriate genesis blocks (with their own custom keys) for all know consenters types: solo, kafka, sbft (though sbft for now just short-circuits to the solo case). The new bootstrapper is built in a way that makes further extensions easier, and minimizes code duplication by creating the appropriate structs and doing the necessary embeddings. The test that inspected the block's Data field was removed. It was a tautological test, serving no good purpose, and was also hard to maintain. Finally, this changeset updates the bootstrap helper signature by removing the error return; while the error return can be useful if the expectation is that the caller will be able to resort to a different bootstrapper if the first one fails, etc. one could that this amount of flexibility is unnecessary, and complicates the code needlessly. The bootstrapper should simply panic if the wrong settings have been passed to it, and the user should read the fine manual. Change-Id: I6aef9b19dbf9a39652d2d6b3ccbefc794e3001df Signed-off-by: Kostas Christidis <kostas@christidis.io>
71a3389f