Skip to content

Commit

Permalink
rm wait for usr input on reset/rollback
Browse files Browse the repository at this point in the history
FAB-15944 #done

Change-Id: If814bd46a6723a2eb76c8f67f7152373377b467b
Signed-off-by: senthil <cendhu@gmail.com>
  • Loading branch information
cendhu authored and manish-sethi committed Jul 15, 2019
1 parent b137f5b commit 964200d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
7 changes: 0 additions & 7 deletions peer/node/reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ SPDX-License-Identifier: Apache-2.0
package node

import (
"bufio"
"fmt"
"os"

"github.com/hyperledger/fabric/core/ledger/kvledger"
"github.com/spf13/cobra"
)
Expand All @@ -23,9 +19,6 @@ var nodeResetCmd = &cobra.Command{
Short: "Resets the node.",
Long: `Resets all channels to the genesis block. When the command is executed, the peer must be offline. When the peer starts after the reset, it will receive blocks starting with block number one from an orderer or another peer to rebuild the block store and state database.`,
RunE: func(cmd *cobra.Command, args []string) error {
fmt.Println("This will reset all channels to genesis blocks. Press enter to continue...")
reader := bufio.NewReader(os.Stdin)
reader.ReadBytes('\n')
return kvledger.ResetAllKVLedgers()
},
}
9 changes: 0 additions & 9 deletions peer/node/rollback.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ SPDX-License-Identifier: Apache-2.0
package node

import (
"bufio"
"fmt"
"os"

"github.com/hyperledger/fabric/core/ledger/kvledger"
"github.com/hyperledger/fabric/peer/common"
"github.com/pkg/errors"
Expand Down Expand Up @@ -39,11 +35,6 @@ var nodeRollbackCmd = &cobra.Command{
if channelID == common.UndefinedParamValue {
return errors.New("Must supply channel ID")
}

fmt.Printf("This will rollback channel [%s] to the block number [%d]. Press enter to continue...",
channelID, blockNumber)
reader := bufio.NewReader(os.Stdin)
reader.ReadBytes('\n')
return kvledger.RollbackKVLedger(channelID, blockNumber)
},
}

0 comments on commit 964200d

Please sign in to comment.