Skip to content

Commit b504af9

Browse files
committed
[FAB-1410] Remove node's call to bootstrapper
https://jira.hyperledger.org/browse/FAB-1410 The node package gets the genesis block by invoking the static bootstrapper, then uses that block for this call: `deliverService.JoinChannel(commit, block)` It should be noted that this is a temporary solution by the node package authors to test out the end-to-end integration. However, this layering violation (which could be ignored temporarily due to the reason cited above) manifests itself in a very practical and real way: 1. The static bootstrapper is being replaced by the provisional bootstrapper, for the reasons documented here: https://jira.hyperledger.org/browse/FAB-1364. 2. The provisional bootstrapper loads the `orderer.yaml` file (in the `orderer` package) to determine its output. 3. The fabric-peer Docker image however does not have access to this file. 4. Thus, if we call the provisional bootstrapper from the node, the `fabric-peer` container will crash. Upon further inspection, it seems that what the node really needs now is a configuration block with just the right chain ID, on the payload header of its first enclosed envelope. The simplest, least invasive way to offer this is by creating a sample block via the following call: `utils.MakeConfigurationBlock(util.GetTestChainID())` Change-Id: Ifb7e5b1617c0b0d49eff2598dfdb1bfd0628bf1f Signed-off-by: Kostas Christidis <[email protected]>
1 parent 0eadb03 commit b504af9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

peer/node/start.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ import (
3939
"github.com/hyperledger/fabric/core/util"
4040
"github.com/hyperledger/fabric/events/producer"
4141
"github.com/hyperledger/fabric/gossip/service"
42-
"github.com/hyperledger/fabric/orderer/common/bootstrap/static"
4342
"github.com/hyperledger/fabric/peer/common"
4443
pb "github.com/hyperledger/fabric/protos/peer"
44+
"github.com/hyperledger/fabric/protos/utils"
4545
"github.com/spf13/cobra"
4646
"github.com/spf13/viper"
4747
"google.golang.org/grpc"
@@ -177,7 +177,7 @@ func serve(args []string) error {
177177
commit := committer.NewLedgerCommitter(kvledger.GetLedger(chainID))
178178

179179
// TODO: Should real configuration block
180-
block, err := static.New().GenesisBlock()
180+
block, err := utils.MakeConfigurationBlock(util.GetTestChainID())
181181

182182
if nil != err {
183183
panic(fmt.Sprintf("Unable to create genesis block for [%s] due to [%s]", chainID, err))

0 commit comments

Comments
 (0)