erigon-pulse/cmd/rpcdaemon/main.go
ledgerwatch 8cb96471a3
Skeleton of RPC daemon, for 1 operation eth_blockNumber (#209)
* Finish CmdSeek and add CmdNext

* Add remoteDb listener and RPC daemon CLI

* Fix test

* Fix CLI

* Fix lint

* Fix unreachable code

* Fix lint

* First working RPC command eth_blockNumber

* Fix lint

* Fix lint

* Fix memprofile/cpuprofile confusion

* Add comment
2019-12-02 13:47:00 +00:00

31 lines
706 B
Go

package main
import (
"io"
"os"
"github.com/ledgerwatch/turbo-geth/cmd/rpcdaemon/commands"
"github.com/ledgerwatch/turbo-geth/log"
"github.com/mattn/go-colorable"
"github.com/mattn/go-isatty"
)
func main() {
var (
ostream log.Handler
glogger *log.GlogHandler
)
usecolor := (isatty.IsTerminal(os.Stderr.Fd()) || isatty.IsCygwinTerminal(os.Stderr.Fd())) && os.Getenv("TERM") != "dumb"
output := io.Writer(os.Stderr)
if usecolor {
output = colorable.NewColorableStderr()
}
ostream = log.StreamHandler(output, log.TerminalFormat(usecolor))
glogger = log.NewGlogHandler(ostream)
log.Root().SetHandler(glogger)
glogger.Verbosity(log.Lvl(3)) // 3 == verbosity INF
commands.Execute()
}