add line about `js` command

This commit is contained in:
Joseph Cook 2022-05-30 17:13:51 +01:00 committed by GitHub
parent e3939e182a
commit 881fbe4906
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -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`.