mirror of
https://github.com/fluencelabs/tendermint
synced 2025-05-03 10:32:17 +00:00
Spell out the package explicitly. This commit is totally textual, and does not change any logic. The swiss-army knife package may serve a kick-start in early stage development. But as the codebase growing, we might want to retire it gradually: For simple wrapping functions, just inline it on the call site. For larger pice of code, make it an independent package.
40 lines
867 B
Go
40 lines
867 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
|
|
"github.com/tendermint/abci/example/dummy"
|
|
"github.com/tendermint/abci/server"
|
|
"github.com/tendermint/abci/types"
|
|
common "github.com/tendermint/go-common"
|
|
)
|
|
|
|
func main() {
|
|
|
|
addrPtr := flag.String("addr", "tcp://0.0.0.0:46658", "Listen address")
|
|
abciPtr := flag.String("abci", "socket", "socket | grpc")
|
|
persistencePtr := flag.String("persist", "", "directory to use for a database")
|
|
flag.Parse()
|
|
|
|
// Create the application - in memory or persisted to disk
|
|
var app types.Application
|
|
if *persistencePtr == "" {
|
|
app = dummy.NewDummyApplication()
|
|
} else {
|
|
app = dummy.NewPersistentDummyApplication(*persistencePtr)
|
|
}
|
|
|
|
// Start the listener
|
|
srv, err := server.NewServer(*addrPtr, *abciPtr, app)
|
|
if err != nil {
|
|
common.Exit(err.Error())
|
|
}
|
|
|
|
// Wait forever
|
|
common.TrapSignal(func() {
|
|
// Cleanup
|
|
srv.Stop()
|
|
})
|
|
|
|
}
|