Skip to content

Commit

Permalink
Issue #1 : Change a syntax to initialize ledgermgmt
Browse files Browse the repository at this point in the history
  • Loading branch information
nekia committed Jan 15, 2019
1 parent 3f9b8a2 commit a400261
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Binary file modified ledgerfsck
Binary file not shown.
23 changes: 22 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ import (
"github.com/hyperledger/fabric/common/flogging"
"github.com/hyperledger/fabric/common/localmsp"
"github.com/hyperledger/fabric/common/policies"
"github.com/hyperledger/fabric/core/chaincode/platforms"
"github.com/hyperledger/fabric/core/chaincode/platforms/car"
"github.com/hyperledger/fabric/core/chaincode/platforms/golang"
"github.com/hyperledger/fabric/core/chaincode/platforms/java"
"github.com/hyperledger/fabric/core/chaincode/platforms/node"
"github.com/hyperledger/fabric/core/ledger"
"github.com/hyperledger/fabric/core/ledger/ledgermgmt"
"github.com/hyperledger/fabric/core/peer"
"github.com/hyperledger/fabric/core/scc/lscc"
gossipCommon "github.com/hyperledger/fabric/gossip/common"
"github.com/hyperledger/fabric/msp/mgmt"
"github.com/hyperledger/fabric/peer/common"
Expand Down Expand Up @@ -98,7 +104,22 @@ func (fsck *ledgerFsck) InitCrypto() error {
// OpenLedger
func (fsck *ledgerFsck) OpenLedger() error {
// Initialize ledger management
ledgermgmt.Initialize(peer.ConfigTxProcessors)
pr := platforms.NewRegistry(
&golang.Platform{},
&node.Platform{},
&java.Platform{},
&car.Platform{},
)

deployedCCInfoProvider := &lscc.DeployedCCInfoProvider{}

ledgermgmt.Initialize(
&ledgermgmt.Initializer{
CustomTxProcessors: peer.ConfigTxProcessors,
PlatformRegistry: pr,
DeployedChaincodeInfoProvider: deployedCCInfoProvider,
})

ledgerIds, err := ledgermgmt.GetLedgerIDs()
if err != nil {
errMsg := fmt.Sprintf("failed to read ledger, because of %s", err)
Expand Down

0 comments on commit a400261

Please sign in to comment.