aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBas van Kervel <bas@ethdev.com>2015-06-10 16:24:22 +0800
committerBas van Kervel <basvankervel@gmail.com>2015-06-11 20:01:41 +0800
commitc6c443385b3e9998d3090785e4287e3836c70219 (patch)
treed19c11c904d2c8c142dc26d2ad4ba14a4154a279
parent5f8e5a487588bab49fb3c9321fd8903132426c47 (diff)
downloaddexon-c6c443385b3e9998d3090785e4287e3836c70219.tar
dexon-c6c443385b3e9998d3090785e4287e3836c70219.tar.gz
dexon-c6c443385b3e9998d3090785e4287e3836c70219.tar.bz2
dexon-c6c443385b3e9998d3090785e4287e3836c70219.tar.lz
dexon-c6c443385b3e9998d3090785e4287e3836c70219.tar.xz
dexon-c6c443385b3e9998d3090785e4287e3836c70219.tar.zst
dexon-c6c443385b3e9998d3090785e4287e3836c70219.zip
changed console welcome message
-rw-r--r--cmd/console/js.go21
1 files changed, 9 insertions, 12 deletions
diff --git a/cmd/console/js.go b/cmd/console/js.go
index ea0961a39..4229a95a2 100644
--- a/cmd/console/js.go
+++ b/cmd/console/js.go
@@ -234,18 +234,15 @@ func (self *jsre) suportedApis(ipcpath string) ([]string, error) {
// show summary of current geth instance
func (self *jsre) welcome(ipcpath string) {
- self.re.Eval(`
- console.log(' Connected to: ' + web3.version.client);
- `)
-
- if apis, err := self.suportedApis(ipcpath); err == nil {
- apisStr := ""
- for _, api := range apis {
- apisStr += api + " "
- }
- self.re.Eval(fmt.Sprintf(`console.log("Available api's: %s");`, apisStr))
- } else {
- utils.Fatalf("unable to determine supported api's - %v", err)
+ self.re.Eval(`console.log('instance: ' + web3.version.client);`)
+ self.re.Eval(`console.log("coinbase: " + eth.coinbase);`)
+ self.re.Eval(`var lastBlockTimestamp = 1000 * eth.getBlock(eth.blockNumber).timestamp`)
+ self.re.Eval(`console.log("at block: " + eth.blockNumber + " (" + new Date(lastBlockTimestamp).toLocaleDateString()
+ + " " + new Date(lastBlockTimestamp).toLocaleTimeString() + ")");`)
+
+ if modules, err := self.suportedApis(ipcpath); err == nil {
+ self.re.Eval(fmt.Sprintf("var modules = '%s';", strings.Join(modules, " ")))
+ self.re.Eval(`console.log(" modules: " + modules);`)
}
}