aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/geth/js.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/geth/js.go')
-rw-r--r--cmd/geth/js.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/cmd/geth/js.go b/cmd/geth/js.go
index 6e4e3e0c1..761943b63 100644
--- a/cmd/geth/js.go
+++ b/cmd/geth/js.go
@@ -220,6 +220,25 @@ func (self *jsre) loadAutoCompletion() {
}
}
+func (self *jsre) batch(statement string) {
+ val, err := self.re.Run(statement)
+
+ if err != nil {
+ fmt.Printf("error: %v", err)
+ } else if val.IsDefined() && val.IsObject() {
+ obj, _ := self.re.Get("ret_result")
+ fmt.Printf("%v", obj)
+ } else if val.IsDefined() {
+ fmt.Printf("%v", val)
+ }
+
+ if self.atexit != nil {
+ self.atexit()
+ }
+
+ self.re.Stop(false)
+}
+
// show summary of current geth instance
func (self *jsre) welcome() {
self.re.Eval(`console.log('instance: ' + web3.version.client);`)