From 60cdb1148c404218846fd39331690658168f4e04 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 12 Nov 2014 01:36:36 +0100 Subject: Transaction execution fixes --- cmd/ethereum/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index f8ef3855e..eb7be1ea7 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -30,7 +30,7 @@ import ( const ( ClientIdentifier = "Ethereum(G)" - Version = "0.7.3" + Version = "0.7.4" ) var clilogger = logger.NewLogger("CLI") -- cgit v1.2.3 From 711be7009ef5b9ad77f37a4ccd0dffcc9286e1f8 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 14 Nov 2014 13:51:41 +0100 Subject: Version bump --- cmd/ethereum/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index eb7be1ea7..ed42dfafb 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -30,7 +30,7 @@ import ( const ( ClientIdentifier = "Ethereum(G)" - Version = "0.7.4" + Version = "0.7.5" ) var clilogger = logger.NewLogger("CLI") -- cgit v1.2.3 From 1ecb3b4cf358a9c8fb0152b54bde70c925eaa5c9 Mon Sep 17 00:00:00 2001 From: Taylor Gerring Date: Fri, 14 Nov 2014 15:53:45 -0600 Subject: Remove failing Printf --- cmd/ethereum/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index ed42dfafb..c894a8f85 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -93,7 +93,8 @@ func main() { os.Exit(1) } - fmt.Printf("RLP: %x\nstate: %x\nhash: %x\n", ethutil.Rlp(block), block.GetRoot(), block.Hash()) + // block.GetRoot() does not exist + //fmt.Printf("RLP: %x\nstate: %x\nhash: %x\n", ethutil.Rlp(block), block.GetRoot(), block.Hash()) // Leave the Println. This needs clean output for piping fmt.Printf("%s\n", block.State().Dump()) -- cgit v1.2.3 From 3588c4a9feb4204419d9c0fa2a4c9089120221b7 Mon Sep 17 00:00:00 2001 From: Taylor Gerring Date: Sat, 15 Nov 2014 20:21:03 -0600 Subject: formatting update per gofmt --- cmd/ethereum/repl/repl_windows.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/repl/repl_windows.go b/cmd/ethereum/repl/repl_windows.go index 9b1eb3b7d..d2c405ee9 100644 --- a/cmd/ethereum/repl/repl_windows.go +++ b/cmd/ethereum/repl/repl_windows.go @@ -32,7 +32,7 @@ func (self *JSRepl) read() { if err != nil { fmt.Println("Error reading input", err) } else { - if (string(str) == "exit") { + if string(str) == "exit" { self.Stop() break } else { @@ -46,25 +46,25 @@ func addHistory(s string) { } func printColored(outputVal string) { - for ; outputVal != "" ; { + for outputVal != "" { codePart := "" - if (strings.HasPrefix(outputVal, "\033[32m")) { + if strings.HasPrefix(outputVal, "\033[32m") { codePart = "\033[32m" changeColor(2) } - if (strings.HasPrefix(outputVal, "\033[1m\033[30m")) { + if strings.HasPrefix(outputVal, "\033[1m\033[30m") { codePart = "\033[1m\033[30m" changeColor(8) } - if (strings.HasPrefix(outputVal, "\033[31m")) { + if strings.HasPrefix(outputVal, "\033[31m") { codePart = "\033[31m" changeColor(red) } - if (strings.HasPrefix(outputVal, "\033[35m")) { + if strings.HasPrefix(outputVal, "\033[35m") { codePart = "\033[35m" changeColor(5) } - if (strings.HasPrefix(outputVal, "\033[0m")) { + if strings.HasPrefix(outputVal, "\033[0m") { codePart = "\033[0m" resetColorful() } -- cgit v1.2.3 From 93e693be72e1a7734e826016316434c1e2320de9 Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 18 Nov 2014 19:52:45 +0100 Subject: Fixed tests for 'types' --- cmd/ethereum/main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index c894a8f85..aa933c4e7 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -21,8 +21,7 @@ import ( "fmt" "os" "runtime" - - "github.com/ethereum/go-ethereum/chain" + "github.com/ethereum/go-ethereum/chain/types" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/logger" @@ -74,7 +73,7 @@ func main() { ethereum := utils.NewEthereum(db, clientIdentity, keyManager, UseUPnP, OutboundPort, MaxPeer) if Dump { - var block *chain.Block + var block *types.Block if len(DumpHash) == 0 && DumpNumber == -1 { block = ethereum.ChainManager().CurrentBlock -- cgit v1.2.3 From 0f471291134c0b38df07b9a9cffda5c9807435ae Mon Sep 17 00:00:00 2001 From: Eric Robitaille Date: Thu, 20 Nov 2014 14:16:22 -0500 Subject: Updated main.go - fix for broken develop build Transaction execution fixes - 60cdb1148c404218846fd39331690658168f4e04 --- cmd/ethereum/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index ed42dfafb..88549b30a 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -93,7 +93,7 @@ func main() { os.Exit(1) } - fmt.Printf("RLP: %x\nstate: %x\nhash: %x\n", ethutil.Rlp(block), block.GetRoot(), block.Hash()) + fmt.Printf("RLP: %x\nstate: %x\nhash: %x\n", ethutil.Rlp(block), block.Root(), block.Hash()) // Leave the Println. This needs clean output for piping fmt.Printf("%s\n", block.State().Dump()) -- cgit v1.2.3 From a3559c5e1b469890bb8d71e9992175febaae31c7 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 28 Nov 2014 21:38:10 +0100 Subject: updated PV --- cmd/ethereum/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 88549b30a..1493de384 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -30,7 +30,7 @@ import ( const ( ClientIdentifier = "Ethereum(G)" - Version = "0.7.5" + Version = "0.7.6" ) var clilogger = logger.NewLogger("CLI") -- cgit v1.2.3 From 3d9a4e7084c33cb28a2265c0dd232a0ea3871c92 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 3 Dec 2014 12:21:12 +0100 Subject: Fixed mem error in vm. Fixed logs tests --- cmd/ethereum/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 1493de384..60052314c 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -30,7 +30,7 @@ import ( const ( ClientIdentifier = "Ethereum(G)" - Version = "0.7.6" + Version = "0.7.7" ) var clilogger = logger.NewLogger("CLI") -- cgit v1.2.3 From 83663ed4b01480c628ce2c849e4e881ac04b5120 Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 4 Dec 2014 10:53:49 +0100 Subject: Renames for chain, updated VM, moved methods * Renamed a couple more chain => core * Updated VM `pc` to be uint64 rather than big int * XEth interface cleanup --- cmd/ethereum/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 7e67a6dcc..c39f904fb 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -22,8 +22,8 @@ import ( "os" "runtime" - "github.com/ethereum/go-ethereum/chain/types" "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/logger" ) -- cgit v1.2.3 From 73c4ca3a6fcf948f4bc637f5c1b55277cf64c06f Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 4 Dec 2014 15:31:48 +0100 Subject: Upped protocol version --- cmd/ethereum/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index c39f904fb..14921bf10 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -30,7 +30,7 @@ import ( const ( ClientIdentifier = "Ethereum(G)" - Version = "0.7.7" + Version = "0.7.8" ) var clilogger = logger.NewLogger("CLI") -- cgit v1.2.3 From 9925916851c00323336e213fc18c83da5fceee94 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 5 Dec 2014 16:26:39 +0100 Subject: upped proto version and modified block pool --- cmd/ethereum/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 14921bf10..43551fb3a 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -30,7 +30,7 @@ import ( const ( ClientIdentifier = "Ethereum(G)" - Version = "0.7.8" + Version = "0.7.9" ) var clilogger = logger.NewLogger("CLI") -- cgit v1.2.3 From 50e1dcc43a3eb4d32147d10c29c0edeadeca6f78 Mon Sep 17 00:00:00 2001 From: zelig Date: Sun, 14 Dec 2014 18:23:48 +0000 Subject: import eth pkg --- cmd/ethereum/cmd.go | 2 +- cmd/ethereum/repl/repl.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/cmd.go b/cmd/ethereum/cmd.go index 8710d6136..d8b9ea487 100644 --- a/cmd/ethereum/cmd.go +++ b/cmd/ethereum/cmd.go @@ -21,9 +21,9 @@ import ( "io/ioutil" "os" - "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/cmd/ethereum/repl" "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/javascript" ) diff --git a/cmd/ethereum/repl/repl.go b/cmd/ethereum/repl/repl.go index a5146fecd..4a7880ff4 100644 --- a/cmd/ethereum/repl/repl.go +++ b/cmd/ethereum/repl/repl.go @@ -24,7 +24,7 @@ import ( "os" "path" - "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/javascript" "github.com/ethereum/go-ethereum/logger" -- cgit v1.2.3 From d9b16c1197f607a52ad62c71425b690bee973c3f Mon Sep 17 00:00:00 2001 From: zelig Date: Sun, 14 Dec 2014 18:29:05 +0000 Subject: new cli options - nat UPNP|PMP - gateway for PMP NAT - obsolete usepnp - add pubkey to client identity --- cmd/ethereum/flags.go | 6 ++++-- cmd/ethereum/main.go | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/flags.go b/cmd/ethereum/flags.go index 783944cf2..0bea73794 100644 --- a/cmd/ethereum/flags.go +++ b/cmd/ethereum/flags.go @@ -38,7 +38,8 @@ var ( StartRpc bool StartWebSockets bool RpcPort int - UseUPnP bool + NatType string + PMPGateway string OutboundPort string ShowGenesis bool AddPeer string @@ -84,7 +85,8 @@ func Init() { flag.StringVar(&KeyRing, "keyring", "", "identifier for keyring to use") flag.StringVar(&KeyStore, "keystore", "db", "system to store keyrings: db|file (db)") flag.StringVar(&OutboundPort, "port", "30303", "listening port") - flag.BoolVar(&UseUPnP, "upnp", false, "enable UPnP support") + flag.StringVar(&NatType, "nat", "", "nat support (UPNP|PMP)") + flag.StringVar(&PMPGateway, "gateway", "", "PMP gateway IP") flag.IntVar(&MaxPeer, "maxpeer", 10, "maximum desired peers") flag.IntVar(&RpcPort, "rpcport", 8080, "port to start json-rpc server on") flag.BoolVar(&StartRpc, "rpc", false, "start rpc server") diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 43551fb3a..4f87ef17b 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -69,9 +69,9 @@ func main() { // create, import, export keys utils.KeyTasks(keyManager, KeyRing, GenAddr, SecretFile, ExportDir, NonInteractive) - clientIdentity := utils.NewClientIdentity(ClientIdentifier, Version, Identifier) + clientIdentity := utils.NewClientIdentity(ClientIdentifier, Version, Identifier, string(keyManager.PublicKey())) - ethereum := utils.NewEthereum(db, clientIdentity, keyManager, UseUPnP, OutboundPort, MaxPeer) + ethereum := utils.NewEthereum(db, clientIdentity, keyManager, utils.NatType(NatType, PMPGateway), OutboundPort, MaxPeer) if Dump { var block *types.Block -- cgit v1.2.3 From 61940b2275a8f3c77d906947b2d1126bb6c3b21d Mon Sep 17 00:00:00 2001 From: zelig Date: Sun, 14 Dec 2014 19:55:52 +0000 Subject: adapt cmd/cli to new backend - new flag nat for nat support UPNP|PMP - new flag pmp for PMP gateway IP - add NatType to utils/cmd to get p2p.NAT from nat type string - obsolete usepnp flag - get rid of IsUpToDate and sleep in miner start - ethereum constructor takes nat type, port, maxpeer - add pubkey arg to client identity --- cmd/ethereum/flags.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/flags.go b/cmd/ethereum/flags.go index 0bea73794..e709ecf50 100644 --- a/cmd/ethereum/flags.go +++ b/cmd/ethereum/flags.go @@ -85,8 +85,13 @@ func Init() { flag.StringVar(&KeyRing, "keyring", "", "identifier for keyring to use") flag.StringVar(&KeyStore, "keystore", "db", "system to store keyrings: db|file (db)") flag.StringVar(&OutboundPort, "port", "30303", "listening port") +<<<<<<< HEAD flag.StringVar(&NatType, "nat", "", "nat support (UPNP|PMP)") flag.StringVar(&PMPGateway, "gateway", "", "PMP gateway IP") +======= + flag.StringVar(&NatType, "nat", "", "NAT support (UPNP|PMP) (none)") + flag.StringVar(&PMPGateway, "pmp", "", "Gateway IP for PMP") +>>>>>>> adapt cmd/cli to new backend flag.IntVar(&MaxPeer, "maxpeer", 10, "maximum desired peers") flag.IntVar(&RpcPort, "rpcport", 8080, "port to start json-rpc server on") flag.BoolVar(&StartRpc, "rpc", false, "start rpc server") -- cgit v1.2.3 From 72290f67fee2be183981c9672d830040466187bd Mon Sep 17 00:00:00 2001 From: zelig Date: Sun, 14 Dec 2014 20:57:29 +0000 Subject: resolve merge conflict hell --- cmd/ethereum/flags.go | 5 ----- 1 file changed, 5 deletions(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/flags.go b/cmd/ethereum/flags.go index e709ecf50..556735491 100644 --- a/cmd/ethereum/flags.go +++ b/cmd/ethereum/flags.go @@ -85,13 +85,8 @@ func Init() { flag.StringVar(&KeyRing, "keyring", "", "identifier for keyring to use") flag.StringVar(&KeyStore, "keystore", "db", "system to store keyrings: db|file (db)") flag.StringVar(&OutboundPort, "port", "30303", "listening port") -<<<<<<< HEAD - flag.StringVar(&NatType, "nat", "", "nat support (UPNP|PMP)") - flag.StringVar(&PMPGateway, "gateway", "", "PMP gateway IP") -======= flag.StringVar(&NatType, "nat", "", "NAT support (UPNP|PMP) (none)") flag.StringVar(&PMPGateway, "pmp", "", "Gateway IP for PMP") ->>>>>>> adapt cmd/cli to new backend flag.IntVar(&MaxPeer, "maxpeer", 10, "maximum desired peers") flag.IntVar(&RpcPort, "rpcport", 8080, "port to start json-rpc server on") flag.BoolVar(&StartRpc, "rpc", false, "start rpc server") -- cgit v1.2.3 From 2d09e67713757e2a80eb614562c97f962af36cf7 Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 18 Dec 2014 13:17:24 +0100 Subject: Updated to new methods --- cmd/ethereum/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 43551fb3a..9efc8e9dc 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -77,7 +77,7 @@ func main() { var block *types.Block if len(DumpHash) == 0 && DumpNumber == -1 { - block = ethereum.ChainManager().CurrentBlock + block = ethereum.ChainManager().CurrentBlock() } else if len(DumpHash) > 0 { block = ethereum.ChainManager().GetBlock(ethutil.Hex2Bytes(DumpHash)) } else { -- cgit v1.2.3 From 88af879f7ae55249ff7a9669184b52a611e4fb20 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 19 Dec 2014 01:18:22 +0100 Subject: version bump --- cmd/ethereum/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 9efc8e9dc..2a3c46054 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -30,7 +30,7 @@ import ( const ( ClientIdentifier = "Ethereum(G)" - Version = "0.7.9" + Version = "0.7.10" ) var clilogger = logger.NewLogger("CLI") -- cgit v1.2.3 From 0a9dc1536c5d776844d6947a0090ff7e1a7c6ab4 Mon Sep 17 00:00:00 2001 From: obscuren Date: Sat, 20 Dec 2014 02:33:45 +0100 Subject: Increased peer from 10 to 30 --- cmd/ethereum/flags.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/flags.go b/cmd/ethereum/flags.go index 783944cf2..85aca47c3 100644 --- a/cmd/ethereum/flags.go +++ b/cmd/ethereum/flags.go @@ -85,7 +85,7 @@ func Init() { flag.StringVar(&KeyStore, "keystore", "db", "system to store keyrings: db|file (db)") flag.StringVar(&OutboundPort, "port", "30303", "listening port") flag.BoolVar(&UseUPnP, "upnp", false, "enable UPnP support") - flag.IntVar(&MaxPeer, "maxpeer", 10, "maximum desired peers") + flag.IntVar(&MaxPeer, "maxpeer", 30, "maximum desired peers") flag.IntVar(&RpcPort, "rpcport", 8080, "port to start json-rpc server on") flag.BoolVar(&StartRpc, "rpc", false, "start rpc server") flag.BoolVar(&StartWebSockets, "ws", false, "start websocket server") -- cgit v1.2.3 From 4cd79d8ddd7608d60344b13fe4bda7315429d1d9 Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 23 Dec 2014 13:48:44 +0100 Subject: Refactored block & Transaction * Includes new rlp decoder --- cmd/ethereum/repl/repl.go | 6 ------ 1 file changed, 6 deletions(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/repl/repl.go b/cmd/ethereum/repl/repl.go index 4a7880ff4..822aaa19d 100644 --- a/cmd/ethereum/repl/repl.go +++ b/cmd/ethereum/repl/repl.go @@ -86,12 +86,6 @@ func (self *JSRepl) Stop() { } func (self *JSRepl) parseInput(code string) { - defer func() { - if r := recover(); r != nil { - fmt.Println("[native] error", r) - } - }() - value, err := self.re.Run(code) if err != nil { fmt.Println(err) -- cgit v1.2.3 From 9e5257b83b8572077b9c26e4ae9a9443f765bf6e Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 23 Dec 2014 14:33:15 +0100 Subject: Chain importer --- cmd/ethereum/flags.go | 2 ++ cmd/ethereum/main.go | 28 +++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/flags.go b/cmd/ethereum/flags.go index 72f1db458..d27b739c3 100644 --- a/cmd/ethereum/flags.go +++ b/cmd/ethereum/flags.go @@ -58,6 +58,7 @@ var ( DumpHash string DumpNumber int VmType int + ImportChain string ) // flags specific to cli client @@ -104,6 +105,7 @@ func Init() { flag.BoolVar(&DiffTool, "difftool", false, "creates output for diff'ing. Sets LogLevel=0") flag.StringVar(&DiffType, "diff", "all", "sets the level of diff output [vm, all]. Has no effect if difftool=false") flag.BoolVar(&ShowGenesis, "genesis", false, "Dump the genesis block") + flag.StringVar(&ImportChain, "chain", "", "Imports fiven chain") flag.BoolVar(&Dump, "dump", false, "output the ethereum state in JSON format. Sub args [number, hash]") flag.StringVar(&DumpHash, "hash", "", "specify arg in hex") diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index fff9aedf8..f16244a2d 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -18,6 +18,7 @@ package main import ( + "bytes" "fmt" "os" "runtime" @@ -26,6 +27,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/logger" + "github.com/ethereum/go-ethereum/rlp" ) const ( @@ -38,6 +40,10 @@ var clilogger = logger.NewLogger("CLI") func main() { runtime.GOMAXPROCS(runtime.NumCPU()) + defer func() { + logger.Flush() + }() + utils.HandleInterrupt() // precedence: code-internal flag default < config file < environment variables < command line @@ -112,6 +118,27 @@ func main() { utils.StartMining(ethereum) } + if len(ImportChain) > 0 { + clilogger.Infof("importing chain '%s'\n", ImportChain) + c, err := ethutil.ReadAllFile(ImportChain) + if err != nil { + clilogger.Infoln(err) + return + } + var chain types.Blocks + if err := rlp.Decode(bytes.NewReader([]byte(c)), &chain); err != nil { + clilogger.Infoln(err) + return + } + + ethereum.ChainManager().Reset() + if err := ethereum.ChainManager().InsertChain(chain); err != nil { + clilogger.Infoln(err) + return + } + clilogger.Infof("imported %d blocks\n", len(chain)) + } + // better reworked as cases if StartJsConsole { InitJsConsole(ethereum) @@ -131,5 +158,4 @@ func main() { // this blocks the thread ethereum.WaitForShutdown() - logger.Flush() } -- cgit v1.2.3 From 34f72ddb3d5a01d6c45c75604bc030c287d51fb2 Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 23 Dec 2014 15:18:48 +0100 Subject: Decode from stream directly --- cmd/ethereum/main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index f16244a2d..12e22a438 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -18,7 +18,6 @@ package main import ( - "bytes" "fmt" "os" "runtime" @@ -120,13 +119,13 @@ func main() { if len(ImportChain) > 0 { clilogger.Infof("importing chain '%s'\n", ImportChain) - c, err := ethutil.ReadAllFile(ImportChain) + fh, err := os.OpenFile(ImportChain, os.O_RDONLY, os.ModePerm) if err != nil { clilogger.Infoln(err) return } var chain types.Blocks - if err := rlp.Decode(bytes.NewReader([]byte(c)), &chain); err != nil { + if err := rlp.Decode(fh, &chain); err != nil { clilogger.Infoln(err) return } -- cgit v1.2.3 From 7d2353f24dad8bba8914b4014117fe73248c211c Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 23 Dec 2014 15:31:03 +0100 Subject: Close the file --- cmd/ethereum/main.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 12e22a438..d704140d4 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -124,6 +124,8 @@ func main() { clilogger.Infoln(err) return } + defer fh.Close() + var chain types.Blocks if err := rlp.Decode(fh, &chain); err != nil { clilogger.Infoln(err) -- cgit v1.2.3 From 1054c155db8ac59b97b81fa7a7a20f2239eb1e82 Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 23 Dec 2014 15:37:03 +0100 Subject: Moved import to utils --- cmd/ethereum/main.go | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index d704140d4..2e0a5663a 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -26,7 +26,6 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/logger" - "github.com/ethereum/go-ethereum/rlp" ) const ( @@ -118,26 +117,11 @@ func main() { } if len(ImportChain) > 0 { - clilogger.Infof("importing chain '%s'\n", ImportChain) - fh, err := os.OpenFile(ImportChain, os.O_RDONLY, os.ModePerm) + err := utils.ImportChain(ethereum, ImportChain) if err != nil { clilogger.Infoln(err) - return } - defer fh.Close() - - var chain types.Blocks - if err := rlp.Decode(fh, &chain); err != nil { - clilogger.Infoln(err) - return - } - - ethereum.ChainManager().Reset() - if err := ethereum.ChainManager().InsertChain(chain); err != nil { - clilogger.Infoln(err) - return - } - clilogger.Infof("imported %d blocks\n", len(chain)) + return } // better reworked as cases -- cgit v1.2.3 From 780abaec988df302e0c98f1a35e9af35b5623746 Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 23 Dec 2014 18:35:36 +0100 Subject: Switched to new trie --- cmd/ethereum/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 2e0a5663a..e4070aa47 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -21,6 +21,7 @@ import ( "fmt" "os" "runtime" + "time" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/core/types" @@ -97,9 +98,6 @@ func main() { os.Exit(1) } - // block.GetRoot() does not exist - //fmt.Printf("RLP: %x\nstate: %x\nhash: %x\n", ethutil.Rlp(block), block.GetRoot(), block.Hash()) - // Leave the Println. This needs clean output for piping fmt.Printf("%s\n", block.State().Dump()) @@ -117,10 +115,12 @@ func main() { } if len(ImportChain) > 0 { + start := time.Now() err := utils.ImportChain(ethereum, ImportChain) if err != nil { clilogger.Infoln(err) } + clilogger.Infoln("export done in", time.Since(start)) return } -- cgit v1.2.3 From c9f963a77e6e728c90e08c0e0008f1dc40df1fe0 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 24 Dec 2014 11:30:04 +0100 Subject: Bump --- cmd/ethereum/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 2a3c46054..30107c145 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -30,7 +30,7 @@ import ( const ( ClientIdentifier = "Ethereum(G)" - Version = "0.7.10" + Version = "0.7.11" ) var clilogger = logger.NewLogger("CLI") -- cgit v1.2.3 From dc7c584a4de371e449752dce5b5e90b26c83d0bb Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 24 Dec 2014 14:54:06 +0100 Subject: export => import --- cmd/ethereum/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 3f9a2a838..7efee31e7 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -120,7 +120,7 @@ func main() { if err != nil { clilogger.Infoln(err) } - clilogger.Infoln("export done in", time.Since(start)) + clilogger.Infoln("import done in", time.Since(start)) return } -- cgit v1.2.3 From 16f417f5af16de8f1c2c140f8b249bd989200bd3 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 2 Jan 2015 22:19:58 +0100 Subject: Fixed bug where logging could crash client during tx adding --- cmd/ethereum/repl/repl.go | 1 + 1 file changed, 1 insertion(+) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/repl/repl.go b/cmd/ethereum/repl/repl.go index 822aaa19d..78bb19cec 100644 --- a/cmd/ethereum/repl/repl.go +++ b/cmd/ethereum/repl/repl.go @@ -86,6 +86,7 @@ func (self *JSRepl) Stop() { } func (self *JSRepl) parseInput(code string) { + value, err := self.re.Run(code) if err != nil { fmt.Println(err) -- cgit v1.2.3 From 09841b1c9b2553a4572590128580df37c8fa83ad Mon Sep 17 00:00:00 2001 From: obscuren Date: Sun, 4 Jan 2015 14:20:16 +0100 Subject: Cleaned up some of that util --- cmd/ethereum/main.go | 48 ++++++++++++++++++------------------------------ 1 file changed, 18 insertions(+), 30 deletions(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 7efee31e7..95060025f 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -25,6 +25,7 @@ import ( "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/logger" ) @@ -48,35 +49,26 @@ func main() { // precedence: code-internal flag default < config file < environment variables < command line Init() // parsing command line - // If the difftool option is selected ignore all other log output - if DiffTool || Dump { - LogLevel = 0 - } - utils.InitConfig(VmType, ConfigFile, Datadir, "ETH") - ethutil.Config.Diff = DiffTool - ethutil.Config.DiffType = DiffType - - utils.InitDataDir(Datadir) - utils.InitLogging(Datadir, LogFile, LogLevel, DebugFile) - - db := utils.NewDatabase() - err := utils.DBSanityCheck(db) + ethereum, err := eth.New(ð.Config{ + Name: ClientIdentifier, + Version: Version, + KeyStore: KeyStore, + DataDir: Datadir, + LogFile: LogFile, + LogLevel: LogLevel, + Identifier: Identifier, + MaxPeers: MaxPeer, + Port: OutboundPort, + NATType: PMPGateway, + PMPGateway: PMPGateway, + KeyRing: KeyRing, + }) if err != nil { - fmt.Println(err) - - os.Exit(1) + clilogger.Fatalln(err) } - - keyManager := utils.NewKeyManager(KeyStore, Datadir, db) - - // create, import, export keys - utils.KeyTasks(keyManager, KeyRing, GenAddr, SecretFile, ExportDir, NonInteractive) - - clientIdentity := utils.NewClientIdentity(ClientIdentifier, Version, Identifier, string(keyManager.PublicKey())) - - ethereum := utils.NewEthereum(db, clientIdentity, keyManager, utils.NatType(NatType, PMPGateway), OutboundPort, MaxPeer) + utils.KeyTasks(ethereum.KeyManager(), KeyRing, GenAddr, SecretFile, ExportDir, NonInteractive) if Dump { var block *types.Block @@ -103,11 +95,7 @@ func main() { fmt.Println(block) - os.Exit(0) - } - - if ShowGenesis { - utils.ShowGenesis(ethereum) + return } if StartMining { -- cgit v1.2.3 From 08b03afa4bb3a40d2faf6543bc884a8ece5be2a1 Mon Sep 17 00:00:00 2001 From: obscuren Date: Sun, 4 Jan 2015 14:28:08 +0100 Subject: Version bump --- cmd/ethereum/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 95060025f..b23852282 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -32,7 +32,7 @@ import ( const ( ClientIdentifier = "Ethereum(G)" - Version = "0.7.11" + Version = "0.8.0" ) var clilogger = logger.NewLogger("CLI") -- cgit v1.2.3 From 6abf8ef78f1474fdeb7a6a6ce084bf994cc055f2 Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 5 Jan 2015 17:10:42 +0100 Subject: Merge --- cmd/ethereum/flags.go | 6 +++++- cmd/ethereum/main.go | 16 +++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/flags.go b/cmd/ethereum/flags.go index d27b739c3..275fcf248 100644 --- a/cmd/ethereum/flags.go +++ b/cmd/ethereum/flags.go @@ -59,6 +59,8 @@ var ( DumpNumber int VmType int ImportChain string + SHH bool + Dial bool ) // flags specific to cli client @@ -94,6 +96,8 @@ func Init() { flag.BoolVar(&StartWebSockets, "ws", false, "start websocket server") flag.BoolVar(&NonInteractive, "y", false, "non-interactive mode (say yes to confirmations)") flag.BoolVar(&UseSeed, "seed", true, "seed peers") + flag.BoolVar(&SHH, "shh", true, "whisper protocol (on)") + flag.BoolVar(&Dial, "dial", true, "dial out connections (on)") flag.BoolVar(&GenAddr, "genaddr", false, "create a new priv/pub key") flag.StringVar(&SecretFile, "import", "", "imports the file given (hex or mnemonic formats)") flag.StringVar(&ExportDir, "export", "", "exports the session keyring to files in the directory given") @@ -105,7 +109,7 @@ func Init() { flag.BoolVar(&DiffTool, "difftool", false, "creates output for diff'ing. Sets LogLevel=0") flag.StringVar(&DiffType, "diff", "all", "sets the level of diff output [vm, all]. Has no effect if difftool=false") flag.BoolVar(&ShowGenesis, "genesis", false, "Dump the genesis block") - flag.StringVar(&ImportChain, "chain", "", "Imports fiven chain") + flag.StringVar(&ImportChain, "chain", "", "Imports given chain") flag.BoolVar(&Dump, "dump", false, "output the ethereum state in JSON format. Sub args [number, hash]") flag.StringVar(&DumpHash, "hash", "", "specify arg in hex") diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index b23852282..8b83bbd37 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -64,10 +64,14 @@ func main() { NATType: PMPGateway, PMPGateway: PMPGateway, KeyRing: KeyRing, + Shh: SHH, + Dial: Dial, }) + if err != nil { clilogger.Fatalln(err) } + utils.KeyTasks(ethereum.KeyManager(), KeyRing, GenAddr, SecretFile, ExportDir, NonInteractive) if Dump { @@ -112,13 +116,6 @@ func main() { return } - // better reworked as cases - if StartJsConsole { - InitJsConsole(ethereum) - } else if len(InputFile) > 0 { - ExecJsFile(ethereum, InputFile) - } - if StartRpc { utils.StartRpc(ethereum, RpcPort) } @@ -129,6 +126,11 @@ func main() { utils.StartEthereum(ethereum, UseSeed) + if StartJsConsole { + InitJsConsole(ethereum) + } else if len(InputFile) > 0 { + ExecJsFile(ethereum, InputFile) + } // this blocks the thread ethereum.WaitForShutdown() } -- cgit v1.2.3 From c9985bf563888d5f346408d2ff174167e8b65880 Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 5 Jan 2015 19:53:53 +0100 Subject: Fixed peer window. Minor tweaks and fixes --- cmd/ethereum/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 8b83bbd37..3c143aca1 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -32,7 +32,7 @@ import ( const ( ClientIdentifier = "Ethereum(G)" - Version = "0.8.0" + Version = "0.8.1" ) var clilogger = logger.NewLogger("CLI") -- cgit v1.2.3 From 117f66e82375b752cc6a9ff22aa0d398ac337bb4 Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 6 Jan 2015 12:13:57 +0100 Subject: Added license headers --- cmd/ethereum/cmd.go | 35 +++++++++++++++++++---------------- cmd/ethereum/flags.go | 35 +++++++++++++++++++---------------- cmd/ethereum/main.go | 37 ++++++++++++++++++++----------------- 3 files changed, 58 insertions(+), 49 deletions(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/cmd.go b/cmd/ethereum/cmd.go index d8b9ea487..8ffd868ed 100644 --- a/cmd/ethereum/cmd.go +++ b/cmd/ethereum/cmd.go @@ -1,20 +1,23 @@ -// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301 USA +/* + This file is part of go-ethereum + go-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + go-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with go-ethereum. If not, see . +*/ +/** + * @authors + * Jeffrey Wilcke + */ package main import ( diff --git a/cmd/ethereum/flags.go b/cmd/ethereum/flags.go index 275fcf248..57e5d8b8c 100644 --- a/cmd/ethereum/flags.go +++ b/cmd/ethereum/flags.go @@ -1,20 +1,23 @@ -// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301 USA +/* + This file is part of go-ethereum + go-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + go-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with go-ethereum. If not, see . +*/ +/** + * @authors + * Jeffrey Wilcke + */ package main import ( diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 3c143aca1..481914aea 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -1,20 +1,23 @@ -// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301 USA - +/* + This file is part of go-ethereum + + go-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + go-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with go-ethereum. If not, see . +*/ +/** + * @authors + * Jeffrey Wilcke + */ package main import ( -- cgit v1.2.3 From 032ab665299d75bffc25260e8fa477ace19db06a Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 7 Jan 2015 01:21:55 +0100 Subject: Added version flag --- cmd/ethereum/flags.go | 2 ++ cmd/ethereum/main.go | 15 +++++++++++++++ 2 files changed, 17 insertions(+) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/flags.go b/cmd/ethereum/flags.go index 57e5d8b8c..f829744dc 100644 --- a/cmd/ethereum/flags.go +++ b/cmd/ethereum/flags.go @@ -64,6 +64,7 @@ var ( ImportChain string SHH bool Dial bool + PrintVersion bool ) // flags specific to cli client @@ -120,6 +121,7 @@ func Init() { flag.BoolVar(&StartMining, "mine", false, "start dagger mining") flag.BoolVar(&StartJsConsole, "js", false, "launches javascript console") + flag.BoolVar(&PrintVersion, "version", false, "prints version number") flag.Parse() diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 481914aea..3243cc7fb 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -52,6 +52,11 @@ func main() { // precedence: code-internal flag default < config file < environment variables < command line Init() // parsing command line + if PrintVersion { + printVersion() + return + } + utils.InitConfig(VmType, ConfigFile, Datadir, "ETH") ethereum, err := eth.New(ð.Config{ @@ -137,3 +142,13 @@ func main() { // this blocks the thread ethereum.WaitForShutdown() } + +func printVersion() { + fmt.Printf(`%v %v +PV=%d +GOOS=%s +GO=%s +GOPATH=%s +GOROOT=%s +`, ClientIdentifier, Version, eth.ProtocolVersion, runtime.GOOS, runtime.Version(), os.Getenv("GOPATH"), runtime.GOROOT()) +} -- cgit v1.2.3 From fed3e6a808921fb8274b50043c5c39a24a1bbccf Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 7 Jan 2015 13:17:48 +0100 Subject: Refactored ethutil.Config.Db out --- cmd/ethereum/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 3243cc7fb..b816c678e 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -31,6 +31,7 @@ import ( "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/logger" + "github.com/ethereum/go-ethereum/state" ) const ( @@ -103,7 +104,8 @@ func main() { } // Leave the Println. This needs clean output for piping - fmt.Printf("%s\n", block.State().Dump()) + statedb := state.New(block.Root(), ethereum.Db()) + fmt.Printf("%s\n", statedb.Dump()) fmt.Println(block) -- cgit v1.2.3 From acc8f7fadcf7fcb382a84c65c488e615edcfeb36 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 16 Jan 2015 14:51:38 +0100 Subject: Add defer rescued back in --- cmd/ethereum/repl/repl.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/repl/repl.go b/cmd/ethereum/repl/repl.go index 78bb19cec..4a7880ff4 100644 --- a/cmd/ethereum/repl/repl.go +++ b/cmd/ethereum/repl/repl.go @@ -86,6 +86,11 @@ func (self *JSRepl) Stop() { } func (self *JSRepl) parseInput(code string) { + defer func() { + if r := recover(); r != nil { + fmt.Println("[native] error", r) + } + }() value, err := self.re.Run(code) if err != nil { -- cgit v1.2.3 From 5f50fe7a4a6218bedf78333d751b57166932464a Mon Sep 17 00:00:00 2001 From: Taylor Gerring Date: Tue, 27 Jan 2015 12:28:58 -0600 Subject: Update CLI to use new Websocket RPC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use “wsport” flag to change default port --- cmd/ethereum/flags.go | 2 ++ cmd/ethereum/main.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/flags.go b/cmd/ethereum/flags.go index f829744dc..e0fbbb008 100644 --- a/cmd/ethereum/flags.go +++ b/cmd/ethereum/flags.go @@ -41,6 +41,7 @@ var ( StartRpc bool StartWebSockets bool RpcPort int + WsPort int NatType string PMPGateway string OutboundPort string @@ -96,6 +97,7 @@ func Init() { flag.StringVar(&PMPGateway, "pmp", "", "Gateway IP for PMP") flag.IntVar(&MaxPeer, "maxpeer", 30, "maximum desired peers") flag.IntVar(&RpcPort, "rpcport", 8080, "port to start json-rpc server on") + flag.IntVar(&WsPort, "wsport", 40404, "port to start websocket rpc server on") flag.BoolVar(&StartRpc, "rpc", false, "start rpc server") flag.BoolVar(&StartWebSockets, "ws", false, "start websocket server") flag.BoolVar(&NonInteractive, "y", false, "non-interactive mode (say yes to confirmations)") diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index b816c678e..92dbf5a6f 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -131,7 +131,7 @@ func main() { } if StartWebSockets { - utils.StartWebSockets(ethereum) + utils.StartWebSockets(ethereum, WsPort) } utils.StartEthereum(ethereum, UseSeed) -- cgit v1.2.3 From 3847e248dfc36dbc9d63f5388ad771a665dff793 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 30 Jan 2015 14:37:07 +0100 Subject: Bumped version number --- cmd/ethereum/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/ethereum') diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 92dbf5a6f..288040ee7 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -36,7 +36,7 @@ import ( const ( ClientIdentifier = "Ethereum(G)" - Version = "0.8.1" + Version = "0.8.2" ) var clilogger = logger.NewLogger("CLI") -- cgit v1.2.3