Skip to content

Commit

Permalink
[FAB-1410] Remove node's call to bootstrapper
Browse files Browse the repository at this point in the history
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 <kostas@christidis.io>
  • Loading branch information
kchristidis committed Dec 15, 2016
1 parent 0eadb03 commit b504af9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions peer/node/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ import (
"github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/events/producer"
"github.com/hyperledger/fabric/gossip/service"
"github.com/hyperledger/fabric/orderer/common/bootstrap/static"
"github.com/hyperledger/fabric/peer/common"
pb "github.com/hyperledger/fabric/protos/peer"
"github.com/hyperledger/fabric/protos/utils"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"google.golang.org/grpc"
Expand Down Expand Up @@ -177,7 +177,7 @@ func serve(args []string) error {
commit := committer.NewLedgerCommitter(kvledger.GetLedger(chainID))

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

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

0 comments on commit b504af9

Please sign in to comment.