Official Go implementation of the Ethereum protocol
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-ethereum/ethereum.go

46 lines
738 B

11 years ago
package main
import (
"fmt"
11 years ago
"os"
"os/signal"
"flag"
11 years ago
)
const Debug = true
11 years ago
var StartDBQueryInterface bool
func Init() {
flag.BoolVar(&StartDBQueryInterface, "db", false, "start db query interface")
flag.Parse()
}
11 years ago
// Register interrupt handlers so we can stop the server
func RegisterInterupts(s *Server) {
// Buffered chan of one is enough
c := make(chan os.Signal, 1)
// Notify about interrupts for now
signal.Notify(c, os.Interrupt)
go func() {
for sig := range c {
fmt.Println("Shutting down (%v) ... \n", sig)
s.Stop()
}
}()
}
11 years ago
func main() {
InitFees()
Init()
11 years ago
if StartDBQueryInterface {
dbInterface := NewDBInterface()
dbInterface.Start()
} else {
Testing()
}
11 years ago
}