Documentation
¶
Overview ¶
Package update implements the `fxadmin compute-update` command, which computes the ConfigUpdate delta between the original and modified configuration JSON. It reproduces the logic of `configtxlator proto_encode --type common.Config` on each input followed by `configtxlator compute_update`: each JSON config is encoded to a common.Config, and the delta between the two is written as a marshaled common.ConfigUpdate. The channel ID is not part of common.Config, so it is read from the current config block supplied to Run.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct{}
Handler executes the compute-update command.
func (*Handler) Run ¶
Run implements `fxadmin compute-update`. It encodes the current and modified configuration JSON at currentPath and modifiedPath to common.Config messages, computes the ConfigUpdate delta between them, stamps it with the channel ID read from the config block at currentBlockPath, and writes the marshaled ConfigUpdate to outputPath.
The three inputs must all belong to the same channel: currentPath is expected to be the JSON decoded from currentBlockPath, and modifiedPath its edited copy. The delta is computed only from the two JSON configs, while the channel ID is taken only from the block. common.Config carries no channel ID, so a mismatch cannot be detected here: pass a block from a different channel and the resulting ConfigUpdate carries one channel's changes stamped with another channel's ID, which the orderer will reject on submission.
func (*Handler) RunFromBlocks ¶ added in v0.2.10
RunFromBlocks implements the block mode of `fxadmin compute-update` (--pb): it computes the ConfigUpdate delta between two config block files — the original block and the "next" block edited by the modify commands. Not implemented yet.