docs: fix attach --exec (#26028)

This commit is contained in:
billchenchina 2022-10-23 02:24:40 +08:00 committed by GitHub
parent 428576604a
commit ce39a4d936
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -128,9 +128,9 @@ geth attach --exec eth.blockNumber
The same syntax can be used to execute a local script file with more complex statements on a remote node over http, for example: The same syntax can be used to execute a local script file with more complex statements on a remote node over http, for example:
```shell ```shell
geth attach http://geth.example.org:8545 --exec 'loadScript("/tmp/checkbalances.js")' geth attach --exec 'loadScript("/tmp/checkbalances.js")' http://geth.example.org:8545
geth attach http://geth.example.org:8545 --jspath "/tmp" --exec 'loadScript("checkbalances.js")' geth attach --jspath "/tmp" --exec 'loadScript("checkbalances.js")' http://geth.example.org:8545
``` ```
The `--jspath` flag is used to set a library directory for the Javascript scripts. Any parameters passed to `loadScript()` The `--jspath` flag is used to set a library directory for the Javascript scripts. Any parameters passed to `loadScript()`

View File

@ -175,7 +175,7 @@ geth --datadir data --networkid 15 --nat extip:172.16.254.4
The 'node record' of the bootnode can be extracted using the JS console: The 'node record' of the bootnode can be extracted using the JS console:
```shell ```shell
geth attach data/geth.ipc --exec admin.nodeInfo.enr geth attach --exec admin.nodeInfo.enr data/geth.ipc
``` ```
This command should print a base64 string such as the following example. Other nodes will use the information contained in the bootstrap node record to connect to the peer-to-peer network. This command should print a base64 string such as the following example. Other nodes will use the information contained in the bootstrap node record to connect to the peer-to-peer network.
@ -206,7 +206,7 @@ geth --datadir data2 --networkid 12345 --port 30305 --bootnodes <bootstrap-node-
With the member node running, it is possible to check that it is connected to the bootstrap node or any other node in the network by attaching a console and running `admin.peers`. It may take up to a few seconds for the nodes to get connected. With the member node running, it is possible to check that it is connected to the bootstrap node or any other node in the network by attaching a console and running `admin.peers`. It may take up to a few seconds for the nodes to get connected.
```shell ```shell
geth attach data2/geth.ipc --exec admin.peers geth attach --exec admin.peers data2/geth.ipc
``` ```
### Running A Signer (Clique) ### Running A Signer (Clique)