aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/ethereum/main.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-03-17 21:12:34 +0800
committerFelix Lange <fjl@twurst.com>2015-03-17 21:12:34 +0800
commitb422835a59ddcba02f8fee3c0933c7bf09d9663e (patch)
tree0e5d4b552bbb1bca14065bad49c84cc43b3383c5 /cmd/ethereum/main.go
parent3ea99f989ff98432cbfa864d2e7e26628e16cc6f (diff)
downloaddexon-b422835a59ddcba02f8fee3c0933c7bf09d9663e.tar
dexon-b422835a59ddcba02f8fee3c0933c7bf09d9663e.tar.gz
dexon-b422835a59ddcba02f8fee3c0933c7bf09d9663e.tar.bz2
dexon-b422835a59ddcba02f8fee3c0933c7bf09d9663e.tar.lz
dexon-b422835a59ddcba02f8fee3c0933c7bf09d9663e.tar.xz
dexon-b422835a59ddcba02f8fee3c0933c7bf09d9663e.tar.zst
dexon-b422835a59ddcba02f8fee3c0933c7bf09d9663e.zip
cmd/ethereum: add makedag command for testing
Diffstat (limited to 'cmd/ethereum/main.go')
-rw-r--r--cmd/ethereum/main.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go
index 3b952dd79..35b636c6e 100644
--- a/cmd/ethereum/main.go
+++ b/cmd/ethereum/main.go
@@ -30,6 +30,7 @@ import (
"time"
"github.com/codegangsta/cli"
+ "github.com/ethereum/ethash"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
@@ -55,6 +56,17 @@ func init() {
app.Commands = []cli.Command{
blocktestCmd,
{
+ Action: makedag,
+ Name: "makedag",
+ Usage: "generate ethash dag (for testing)",
+ Description: `
+The makedag command generates an ethash DAG in /tmp/dag.
+
+This command exists to support the system testing project.
+Regular users do not need to execute it.
+`,
+ },
+ {
Action: version,
Name: "version",
Usage: "print ethereum version numbers",
@@ -318,6 +330,15 @@ func dump(ctx *cli.Context) {
}
}
+func makedag(ctx *cli.Context) {
+ chain, _, _ := utils.GetChain(ctx)
+ pow := ethash.New(chain)
+ fmt.Println("making cache")
+ pow.UpdateCache(true)
+ fmt.Println("making DAG")
+ pow.UpdateDAG()
+}
+
func version(c *cli.Context) {
fmt.Printf(`%v
Version: %v