Skip to content

Commit

Permalink
[FAB-2432] Encode anchor peers from configtx.yaml
Browse files Browse the repository at this point in the history
https://jira.hyperledger.org/browse/FAB-2432

This CR takes the already specified anchor peers from the configtx.yaml
and causes configtxgen to actually encode them into the genesis block /
configtx it generates.

Change-Id: Ia2144ae6a245b274810ebedeb772a3d44a062cca
Signed-off-by: Jason Yellick <[email protected]>
  • Loading branch information
Jason Yellick committed Feb 22, 2017
1 parent 2fc6bc6 commit 4013cb6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion common/configtx/tool/provisional/provisional.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/hyperledger/fabric/orderer/common/bootstrap"
cb "github.com/hyperledger/fabric/protos/common"
ab "github.com/hyperledger/fabric/protos/orderer"
pb "github.com/hyperledger/fabric/protos/peer"

logging "github.com/op/go-logging"
)
Expand Down Expand Up @@ -147,7 +148,17 @@ func New(conf *genesisconfig.Profile) Generator {
if err != nil {
logger.Panicf("Error loading MSP configuration for org %s: %s", org.Name, err)
}
bs.ordererGroups = append(bs.ordererGroups, configvaluesmsp.TemplateGroupMSP([]string{configtxapplication.GroupKey, org.Name}, mspConfig))
bs.applicationGroups = append(bs.applicationGroups, configvaluesmsp.TemplateGroupMSP([]string{configtxapplication.GroupKey, org.Name}, mspConfig))

var anchorProtos []*pb.AnchorPeer
for _, anchorPeer := range org.AnchorPeers {
anchorProtos = append(anchorProtos, &pb.AnchorPeer{
Host: anchorPeer.Host,
Port: int32(anchorPeer.Port),
})
}

bs.applicationGroups = append(bs.applicationGroups, configtxapplication.TemplateAnchorPeers(org.Name, anchorProtos))
}

}
Expand Down

0 comments on commit 4013cb6

Please sign in to comment.