diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/ethereum/flags.go | 6 | ||||
-rw-r--r-- | cmd/ethereum/main.go | 16 | ||||
-rw-r--r-- | cmd/mist/assets/qml/main.qml | 1 | ||||
-rw-r--r-- | cmd/mist/gui.go | 2 | ||||
-rw-r--r-- | cmd/mist/ui_lib.go | 4 | ||||
-rw-r--r-- | cmd/utils/cmd.go | 6 |
6 files changed, 24 insertions, 11 deletions
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() } diff --git a/cmd/mist/assets/qml/main.qml b/cmd/mist/assets/qml/main.qml index 5df4c8aad..0848d13d5 100644 --- a/cmd/mist/assets/qml/main.qml +++ b/cmd/mist/assets/qml/main.qml @@ -866,6 +866,7 @@ ApplicationWindow { model: ListModel { id: pastPeers } Component.onCompleted: { + pastPeers.insert(0, {text: "poc-8.ethdev.com:30303"}) /* var ips = eth.pastPeers() for(var i = 0; i < ips.length; i++) { diff --git a/cmd/mist/gui.go b/cmd/mist/gui.go index 8e533d977..9efec6527 100644 --- a/cmd/mist/gui.go +++ b/cmd/mist/gui.go @@ -112,7 +112,7 @@ func (gui *Gui) Start(assetPath string) { // Expose the eth library and the ui library to QML context.SetVar("gui", gui) context.SetVar("eth", gui.uiLib) - //context.SetVar("shh", gui.whisper) + context.SetVar("shh", gui.whisper) // Load the main QML interface data, _ := ethutil.Config.Db.Get([]byte("KeyRing")) diff --git a/cmd/mist/ui_lib.go b/cmd/mist/ui_lib.go index 4a92f6479..0aabb87d0 100644 --- a/cmd/mist/ui_lib.go +++ b/cmd/mist/ui_lib.go @@ -195,7 +195,9 @@ func (ui *UiLib) Connect(button qml.Object) { } func (ui *UiLib) ConnectToPeer(addr string) { - ui.eth.SuggestPeer(addr) + if err := ui.eth.SuggestPeer(addr); err != nil { + guilogger.Infoln(err) + } } func (ui *UiLib) AssetPath(p string) string { diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go index 7e6dd5f91..d01d9da9f 100644 --- a/cmd/utils/cmd.go +++ b/cmd/utils/cmd.go @@ -100,7 +100,11 @@ func exit(err error) { func StartEthereum(ethereum *eth.Ethereum, UseSeed bool) { clilogger.Infof("Starting %s", ethereum.ClientIdentity()) - ethereum.Start(UseSeed) + err := ethereum.Start(UseSeed) + if err != nil { + exit(err) + } + RegisterInterrupt(func(sig os.Signal) { ethereum.Stop() logger.Flush() |