Genesis logging

This commit is contained in:
obscuren 2014-02-07 22:25:59 +01:00
parent 9f4a81a02e
commit 827f341c97
1 changed files with 9 additions and 2 deletions

View File

@ -20,10 +20,12 @@ var StartConsole bool
var StartMining bool var StartMining bool
var UseUPnP bool var UseUPnP bool
var OutboundPort string var OutboundPort string
var ShowGenesis bool
func Init() { func Init() {
flag.BoolVar(&StartConsole, "c", false, "debug and testing console") flag.BoolVar(&StartConsole, "c", false, "debug and testing console")
flag.BoolVar(&StartMining, "m", false, "start dagger mining") flag.BoolVar(&StartMining, "m", false, "start dagger mining")
flag.BoolVar(&ShowGenesis, "g", false, "prints genesis header and exits")
flag.BoolVar(&UseUPnP, "upnp", false, "enable UPnP support") flag.BoolVar(&UseUPnP, "upnp", false, "enable UPnP support")
flag.StringVar(&OutboundPort, "port", "30303", "listening port") flag.StringVar(&OutboundPort, "port", "30303", "listening port")
@ -52,8 +54,6 @@ func main() {
ethchain.InitFees() ethchain.InitFees()
ethutil.ReadConfig() ethutil.ReadConfig()
log.Printf("Starting Ethereum v%s\n", ethutil.Config.Ver)
// Instantiated a eth stack // Instantiated a eth stack
ethereum, err := eth.New(eth.CapDefault, UseUPnP) ethereum, err := eth.New(eth.CapDefault, UseUPnP)
if err != nil { if err != nil {
@ -61,6 +61,13 @@ func main() {
return return
} }
if ShowGenesis {
fmt.Println(ethereum.BlockManager.BlockChain().Genesis())
os.Exit(0)
}
log.Printf("Starting Ethereum v%s\n", ethutil.Config.Ver)
if StartConsole { if StartConsole {
err := os.Mkdir(ethutil.Config.ExecPath, os.ModePerm) err := os.Mkdir(ethutil.Config.ExecPath, os.ModePerm)
// Error is OK if the error is ErrExist // Error is OK if the error is ErrExist