From 94b12f7804bfb32763c9bbbce323af5d84c74910 Mon Sep 17 00:00:00 2001 From: zelig Date: Tue, 15 Jul 2014 00:05:18 +0100 Subject: fix start mining --- utils/cmd.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'utils') diff --git a/utils/cmd.go b/utils/cmd.go index 889726b04..dfd867d64 100644 --- a/utils/cmd.go +++ b/utils/cmd.go @@ -124,6 +124,7 @@ func NewDatabase() ethutil.Database { } func NewClientIdentity(clientIdentifier, version, customIdentifier string) *ethwire.SimpleClientIdentity { + logger.Infoln("identity created") return ethwire.NewSimpleClientIdentity(clientIdentifier, version, customIdentifier) } @@ -209,10 +210,10 @@ var miner ethminer.Miner func StartMining(ethereum *eth.Ethereum) bool { if !ethereum.Mining { ethereum.Mining = true - addr := ethereum.KeyManager().Address() go func() { + logger.Infoln("Start mining") miner = ethminer.NewDefaultMiner(addr, ethereum) // Give it some time to connect with peers time.Sleep(3 * time.Second) @@ -220,8 +221,6 @@ func StartMining(ethereum *eth.Ethereum) bool { time.Sleep(5 * time.Second) } - logger.Infoln("Miner started") - miner := ethminer.NewDefaultMiner(addr, ethereum) miner.Start() }() RegisterInterrupt(func(os.Signal) { @@ -235,7 +234,7 @@ func StartMining(ethereum *eth.Ethereum) bool { func StopMining(ethereum *eth.Ethereum) bool { if ethereum.Mining { miner.Stop() - logger.Infoln("Miner stopped") + logger.Infoln("Stopped mining") ethereum.Mining = false return true } -- cgit v1.2.3 From c59d7a899b0ca121b3f982fa12405629109f1b47 Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 11 Aug 2014 16:24:35 +0200 Subject: Added open js option for repetitive tasks in ethereal --- utils/vm_env.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'utils') diff --git a/utils/vm_env.go b/utils/vm_env.go index 2c40dd7b8..30568c421 100644 --- a/utils/vm_env.go +++ b/utils/vm_env.go @@ -1,9 +1,10 @@ package utils import ( + "math/big" + "github.com/ethereum/eth-go/ethchain" "github.com/ethereum/eth-go/ethstate" - "math/big" ) type VMEnv struct { @@ -29,5 +30,6 @@ func (self *VMEnv) PrevHash() []byte { return self.block.PrevHash } func (self *VMEnv) Coinbase() []byte { return self.block.Coinbase } func (self *VMEnv) Time() int64 { return self.block.Time } func (self *VMEnv) Difficulty() *big.Int { return self.block.Difficulty } +func (self *VMEnv) BlockHash() []byte { return self.block.Hash() } func (self *VMEnv) Value() *big.Int { return self.value } func (self *VMEnv) State() *ethstate.State { return self.state } -- cgit v1.2.3 From 3569e8d7dfa2e7cf2e47a04225208bd928054cdd Mon Sep 17 00:00:00 2001 From: zelig Date: Tue, 12 Aug 2014 14:57:51 +0200 Subject: remove mmenomic words initialisation (mnemonic wordlist now inline to support binary builds without extra asset) --- utils/cmd.go | 1 - 1 file changed, 1 deletion(-) (limited to 'utils') diff --git a/utils/cmd.go b/utils/cmd.go index 0eeb1049e..4b9d0644c 100644 --- a/utils/cmd.go +++ b/utils/cmd.go @@ -194,7 +194,6 @@ func DefaultAssetPath() string { } func KeyTasks(keyManager *ethcrypto.KeyManager, KeyRing string, GenAddr bool, SecretFile string, ExportDir string, NonInteractive bool) { - ethcrypto.InitWords(DefaultAssetPath()) // Init mnemonic word list var err error switch { -- cgit v1.2.3 From c362172567e7bd499ea0d0bcf84c54a9b7788614 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 15 Aug 2014 01:07:40 +0200 Subject: Got rid of warnings and updated storage getters --- utils/cmd.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'utils') diff --git a/utils/cmd.go b/utils/cmd.go index 0eeb1049e..d34348ad8 100644 --- a/utils/cmd.go +++ b/utils/cmd.go @@ -1,8 +1,17 @@ package utils import ( - "bitbucket.org/kardianos/osext" "fmt" + "io" + "log" + "os" + "os/signal" + "path" + "path/filepath" + "runtime" + "time" + + "bitbucket.org/kardianos/osext" "github.com/ethereum/eth-go" "github.com/ethereum/eth-go/ethcrypto" "github.com/ethereum/eth-go/ethdb" @@ -12,14 +21,6 @@ import ( "github.com/ethereum/eth-go/ethrpc" "github.com/ethereum/eth-go/ethutil" "github.com/ethereum/eth-go/ethwire" - "io" - "log" - "os" - "os/signal" - "path" - "path/filepath" - "runtime" - "time" ) var logger = ethlog.NewLogger("CLI") @@ -227,7 +228,7 @@ func KeyTasks(keyManager *ethcrypto.KeyManager, KeyRing string, GenAddr bool, Se func StartRpc(ethereum *eth.Ethereum, RpcPort int) { var err error - ethereum.RpcServer, err = ethrpc.NewJsonRpcServer(ethpub.NewPEthereum(ethereum), RpcPort) + ethereum.RpcServer, err = ethrpc.NewJsonRpcServer(ethpub.New(ethereum), RpcPort) if err != nil { logger.Errorf("Could not start RPC interface (port %v): %v", RpcPort, err) } else { -- cgit v1.2.3 From a6c4543c575b52b943ff54f74c9d650d73175fe0 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 15 Aug 2014 13:16:07 +0200 Subject: Moving over to ethpipe --- utils/cmd.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'utils') diff --git a/utils/cmd.go b/utils/cmd.go index d34348ad8..58e3eed1e 100644 --- a/utils/cmd.go +++ b/utils/cmd.go @@ -8,6 +8,7 @@ import ( "os/signal" "path" "path/filepath" + "regexp" "runtime" "time" @@ -267,6 +268,19 @@ func StartMining(ethereum *eth.Ethereum) bool { return false } +func FormatTransactionData(data string) []byte { + d := ethutil.StringToByteFunc(data, func(s string) (ret []byte) { + slice := regexp.MustCompile("\\n|\\s").Split(s, 1000000000) + for _, dataItem := range slice { + d := ethutil.FormatData(dataItem) + ret = append(ret, d...) + } + return + }) + + return d +} + func StopMining(ethereum *eth.Ethereum) bool { if ethereum.Mining && miner != nil { miner.Stop() -- cgit v1.2.3 From 2eab964a00b998068f49b088949730f4896e256c Mon Sep 17 00:00:00 2001 From: obscuren Date: Sat, 16 Aug 2014 01:38:24 +0200 Subject: Switched over to ethpipe --- utils/cmd.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'utils') diff --git a/utils/cmd.go b/utils/cmd.go index d417d51ca..cda735c27 100644 --- a/utils/cmd.go +++ b/utils/cmd.go @@ -18,7 +18,7 @@ import ( "github.com/ethereum/eth-go/ethdb" "github.com/ethereum/eth-go/ethlog" "github.com/ethereum/eth-go/ethminer" - "github.com/ethereum/eth-go/ethpub" + "github.com/ethereum/eth-go/ethpipe" "github.com/ethereum/eth-go/ethrpc" "github.com/ethereum/eth-go/ethutil" "github.com/ethereum/eth-go/ethwire" @@ -228,7 +228,7 @@ func KeyTasks(keyManager *ethcrypto.KeyManager, KeyRing string, GenAddr bool, Se func StartRpc(ethereum *eth.Ethereum, RpcPort int) { var err error - ethereum.RpcServer, err = ethrpc.NewJsonRpcServer(ethpub.New(ethereum), RpcPort) + ethereum.RpcServer, err = ethrpc.NewJsonRpcServer(ethpipe.NewJSPipe(ethereum), RpcPort) if err != nil { logger.Errorf("Could not start RPC interface (port %v): %v", RpcPort, err) } else { -- cgit v1.2.3