Skip to content

Commit

Permalink
add line about js command
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcook1186 authored May 30, 2022
1 parent e3939e1 commit 881fbe4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/_interface/JavaScript-Console.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@ The `--jspath` flag is used to set a library directory for the Javascript script
that do not explicitly define an absolute path will be interpreted relative to the `jspath` directory.


Another alternative way to run scripts is using Geth's `js` flag. In this case, run Geth with the `js` flag pass the path to the scripts, e.g.

```
geth js myscript.js
```

## Timers

In addition to the full functionality of JS (as per ECMA5), the Ethereum Javascript Runtime Environment (JSRE) is augmented with various timers. It implements `setInterval`, `clearInterval`, `setTimeout`, `clearTimeout` which some users will be familiar with from browser windows. It also provides implementation for `admin.sleep(seconds)` and a block based timer, `admin.sleepBlocks(n)` which sleeps till the number of new blocks added is equal to or greater than `n`.
Expand Down

0 comments on commit 881fbe4

Please sign in to comment.