diff options
-rw-r--r-- | Dockerfile | 7 | ||||
-rw-r--r-- | cmd/ethereum/main.go | 21 |
2 files changed, 24 insertions, 4 deletions
diff --git a/Dockerfile b/Dockerfile index b7e23aaab..966614e71 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,12 +26,11 @@ RUN tar -C /usr/local -xzf go*.tar.gz && go version ADD https://api.github.com/repos/ethereum/go-ethereum/git/refs/heads/develop file_does_not_exist ## Fetch and install go-ethereum -RUN go get github.com/tools/godep -RUN go get -d github.com/ethereum/go-ethereum/... +RUN mkdir -p $GOPATH/src/github.com/ethereum/ +RUN git clone https://github.com/ethereum/go-ethereum $GOPATH/src/github.com/ethereum/go-ethereum WORKDIR $GOPATH/src/github.com/ethereum/go-ethereum RUN git checkout develop -RUN godep restore -RUN go install -v ./cmd/ethereum +RUN GOPATH=$GOPATH:$GOPATH/src/github.com/ethereum/go-ethereum/Godeps/_workspace go install -v ./cmd/ethereum ## Run & expose JSON RPC ENTRYPOINT ["ethereum", "-rpc=true", "-rpcport=8545"] diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 94c62b97a..38c04ec9d 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 |