Skip to content

Commit

Permalink
abci: remove counter app (port tendermint#6684) (tendermint#9143)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmwaters committed Aug 3, 2022
1 parent 4206a0e commit ea271c5
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 677 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermi

- Apps

- [abci/counter] \#6684 Delete counter example app

- P2P Protocol

- Go API
Expand All @@ -23,9 +25,6 @@ Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermi

### FEATURES

- [#9083] backport cli command to reindex missed events (@cmwaters)
- [cli] \#9107 Add the `p2p.external-address` argument to set the node P2P external address (@amimart)

### IMPROVEMENTS

### BUG FIXES
48 changes: 1 addition & 47 deletions abci/cmd/abci-cli/abci-cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (

abcicli "github.com/tendermint/tendermint/abci/client"
"github.com/tendermint/tendermint/abci/example/code"
"github.com/tendermint/tendermint/abci/example/counter"
"github.com/tendermint/tendermint/abci/example/kvstore"
"github.com/tendermint/tendermint/abci/server"
servertest "github.com/tendermint/tendermint/abci/tests/server"
Expand Down Expand Up @@ -44,9 +43,6 @@ var (
flagHeight int
flagProve bool

// counter
flagSerial bool

// kvstore
flagPersist string
)
Expand All @@ -58,9 +54,7 @@ var RootCmd = &cobra.Command{
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {

switch cmd.Use {
case "counter", "kvstore": // for the examples apps, don't pre-run
return nil
case "version": // skip running for version command
case "kvstore", "version":
return nil
}

Expand Down Expand Up @@ -135,10 +129,6 @@ func addQueryFlags() {
"whether or not to return a merkle proof of the query result")
}

func addCounterFlags() {
counterCmd.PersistentFlags().BoolVarP(&flagSerial, "serial", "", false, "enforce incrementing (serial) transactions")
}

func addKVStoreFlags() {
kvstoreCmd.PersistentFlags().StringVarP(&flagPersist, "persist", "", "", "directory to use for a database")
}
Expand All @@ -158,8 +148,6 @@ func addCommands() {
RootCmd.AddCommand(queryCmd)

// examples
addCounterFlags()
RootCmd.AddCommand(counterCmd)
addKVStoreFlags()
RootCmd.AddCommand(kvstoreCmd)
}
Expand Down Expand Up @@ -267,14 +255,6 @@ var queryCmd = &cobra.Command{
RunE: cmdQuery,
}

var counterCmd = &cobra.Command{
Use: "counter",
Short: "ABCI demo example",
Long: "ABCI demo example",
Args: cobra.ExactArgs(0),
RunE: cmdCounter,
}

var kvstoreCmd = &cobra.Command{
Use: "kvstore",
Short: "ABCI demo example",
Expand Down Expand Up @@ -625,32 +605,6 @@ func cmdQuery(cmd *cobra.Command, args []string) error {
return nil
}

func cmdCounter(cmd *cobra.Command, args []string) error {
app := counter.NewApplication(flagSerial)
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))

// Start the listener
srv, err := server.NewServer(flagAddress, flagAbci, app)
if err != nil {
return err
}
srv.SetLogger(logger.With("module", "abci-server"))
if err := srv.Start(); err != nil {
return err
}

// Stop upon receiving SIGTERM or CTRL-C.
tmos.TrapSignal(logger, func() {
// Cleanup
if err := srv.Stop(); err != nil {
logger.Error("Error while stopping server", "err", err)
}
})

// Run forever.
select {}
}

func cmdKVStore(cmd *cobra.Command, args []string) error {
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))

Expand Down
103 changes: 0 additions & 103 deletions abci/example/counter/counter.go

This file was deleted.

78 changes: 0 additions & 78 deletions abci/tests/test_app/app.go

This file was deleted.

95 changes: 0 additions & 95 deletions abci/tests/test_app/main.go

This file was deleted.

Loading

0 comments on commit ea271c5

Please sign in to comment.