aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-03-19 19:17:43 +0800
committerFelix Lange <fjl@twurst.com>2015-03-19 19:17:43 +0800
commite13c6739804604849c7e43d27b073e68fba58191 (patch)
treeb3471931b63210a4d107875dffd6572bcd96239e /cmd
parent965c9babe336cfa8d5c740d5356acbc5f9ba4a72 (diff)
parent5f35e6778f10d9e2c6418beff7ed201be80448c4 (diff)
downloadgo-tangerine-e13c6739804604849c7e43d27b073e68fba58191.tar.gz
go-tangerine-e13c6739804604849c7e43d27b073e68fba58191.tar.zst
go-tangerine-e13c6739804604849c7e43d27b073e68fba58191.zip
Merge remote-tracking branch 'ethereum/conversion' into conversion
Diffstat (limited to 'cmd')
-rw-r--r--cmd/ethereum/main.go29
-rw-r--r--cmd/mist/main.go4
-rw-r--r--cmd/utils/flags.go71
3 files changed, 69 insertions, 35 deletions
diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go
index 459059e6c..181d6d60d 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"
@@ -41,7 +42,7 @@ import (
const (
ClientIdentifier = "Ethereum(G)"
- Version = "0.9.1"
+ Version = "Frontier - 0.9.1"
)
var (
@@ -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",
@@ -136,8 +148,8 @@ The Ethereum JavaScript VM exposes a node admin interface as well as the DAPP Ja
utils.RPCPortFlag,
utils.UnencryptedKeysFlag,
utils.VMDebugFlag,
-
- //utils.VMTypeFlag,
+ utils.ProtocolVersionFlag,
+ utils.NetworkIdFlag,
}
// missing:
@@ -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
@@ -327,7 +348,7 @@ GO: %s
OS: %s
GOPATH=%s
GOROOT=%s
-`, ClientIdentifier, Version, eth.ProtocolVersion, eth.NetworkId, runtime.Version(), runtime.GOOS, os.Getenv("GOPATH"), runtime.GOROOT())
+`, ClientIdentifier, Version, c.GlobalInt(utils.ProtocolVersionFlag.Name), c.GlobalInt(utils.NetworkIdFlag.Name), runtime.Version(), runtime.GOOS, os.Getenv("GOPATH"), runtime.GOROOT())
}
// hashish returns true for strings that look like hashes.
diff --git a/cmd/mist/main.go b/cmd/mist/main.go
index 1c51233e3..fab651b22 100644
--- a/cmd/mist/main.go
+++ b/cmd/mist/main.go
@@ -28,8 +28,8 @@ import (
"github.com/codegangsta/cli"
"github.com/ethereum/go-ethereum/cmd/utils"
- "github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/ui/qt/webengine"
"github.com/obscuren/qml"
@@ -66,6 +66,8 @@ func init() {
utils.RPCListenAddrFlag,
utils.RPCPortFlag,
utils.JSpathFlag,
+ utils.ProtocolVersionFlag,
+ utils.NetworkIdFlag,
}
}
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 42256903e..1d8f6382b 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -11,11 +11,11 @@ import (
"github.com/codegangsta/cli"
"github.com/ethereum/go-ethereum/accounts"
+ "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethdb"
- "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/p2p/nat"
@@ -70,25 +70,23 @@ func NewApp(version, usage string) *cli.App {
var (
// General settings
- /*
- VMTypeFlag = cli.IntFlag{
- Name: "vm",
- Usage: "Virtual Machine type: 0 is standard VM, 1 is debug VM",
- }
- */
- UnlockedAccountFlag = cli.StringFlag{
- Name: "unlock",
- Usage: "Unlock a given account untill this programs exits (address:password)",
- }
- VMDebugFlag = cli.BoolFlag{
- Name: "vmdebug",
- Usage: "Virtual Machine debug output",
- }
DataDirFlag = cli.StringFlag{
Name: "datadir",
Usage: "Data directory to be used",
Value: common.DefaultDataDir(),
}
+ ProtocolVersionFlag = cli.IntFlag{
+ Name: "protocolversion",
+ Usage: "ETH protocol version",
+ Value: eth.ProtocolVersion,
+ }
+ NetworkIdFlag = cli.IntFlag{
+ Name: "networkid",
+ Usage: "Network Id",
+ Value: eth.NetworkId,
+ }
+
+ // miner settings
MinerThreadsFlag = cli.IntFlag{
Name: "minerthreads",
Usage: "Number of miner threads",
@@ -98,11 +96,18 @@ var (
Name: "mine",
Usage: "Enable mining",
}
+
+ // key settings
UnencryptedKeysFlag = cli.BoolFlag{
Name: "unencrypted-keys",
Usage: "disable private key disk encryption (for testing)",
}
+ UnlockedAccountFlag = cli.StringFlag{
+ Name: "unlock",
+ Usage: "Unlock a given account untill this programs exits (address:password)",
+ }
+ // logging and debug settings
LogFileFlag = cli.StringFlag{
Name: "logfile",
Usage: "Send log output to a file",
@@ -117,6 +122,10 @@ var (
Usage: `"std" or "raw"`,
Value: "std",
}
+ VMDebugFlag = cli.BoolFlag{
+ Name: "vmdebug",
+ Usage: "Virtual Machine debug output",
+ }
// RPC settings
RPCEnabledFlag = cli.BoolFlag{
@@ -198,21 +207,23 @@ func GetNodeKey(ctx *cli.Context) (key *ecdsa.PrivateKey) {
func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
return &eth.Config{
- Name: common.MakeName(clientID, version),
- DataDir: ctx.GlobalString(DataDirFlag.Name),
- LogFile: ctx.GlobalString(LogFileFlag.Name),
- LogLevel: ctx.GlobalInt(LogLevelFlag.Name),
- LogFormat: ctx.GlobalString(LogFormatFlag.Name),
- MinerThreads: ctx.GlobalInt(MinerThreadsFlag.Name),
- AccountManager: GetAccountManager(ctx),
- VmDebug: ctx.GlobalBool(VMDebugFlag.Name),
- MaxPeers: ctx.GlobalInt(MaxPeersFlag.Name),
- Port: ctx.GlobalString(ListenPortFlag.Name),
- NAT: GetNAT(ctx),
- NodeKey: GetNodeKey(ctx),
- Shh: true,
- Dial: true,
- BootNodes: ctx.GlobalString(BootnodesFlag.Name),
+ Name: common.MakeName(clientID, version),
+ DataDir: ctx.GlobalString(DataDirFlag.Name),
+ ProtocolVersion: ctx.GlobalInt(ProtocolVersionFlag.Name),
+ NetworkId: ctx.GlobalInt(NetworkIdFlag.Name),
+ LogFile: ctx.GlobalString(LogFileFlag.Name),
+ LogLevel: ctx.GlobalInt(LogLevelFlag.Name),
+ LogFormat: ctx.GlobalString(LogFormatFlag.Name),
+ MinerThreads: ctx.GlobalInt(MinerThreadsFlag.Name),
+ AccountManager: GetAccountManager(ctx),
+ VmDebug: ctx.GlobalBool(VMDebugFlag.Name),
+ MaxPeers: ctx.GlobalInt(MaxPeersFlag.Name),
+ Port: ctx.GlobalString(ListenPortFlag.Name),
+ NAT: GetNAT(ctx),
+ NodeKey: GetNodeKey(ctx),
+ Shh: true,
+ Dial: true,
+ BootNodes: ctx.GlobalString(BootnodesFlag.Name),
}
}