mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
rpc/eth,personal: typo
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
dcc5b35612
commit
1f04bc29af
2 changed files with 84 additions and 83 deletions
|
|
@ -17,15 +17,15 @@ Executes a new message call immediately, without creating a transaction on the b
|
|||
|
||||
The method takes 3 parameters: an unsigned transaction object to execute in read-only mode; the block number to execute the call against; and an optional state override-set to allow executing the call against a modified chain state.
|
||||
|
||||
##### 1. `Object` - Transaction call object
|
||||
1. `Object` - Transaction call object
|
||||
|
||||
The _transaction call object_ is mandatory. Please see [here](/docs/interacting-with-geth/rpc/objects) for details.
|
||||
|
||||
##### 2. `Quantity | Tag` - Block number or the string `latest` or `pending`
|
||||
2. `Quantity | Tag` - Block number or the string `latest` or `pending`
|
||||
|
||||
The _block number_ is mandatory and defines the context (state) against which the specified transaction should be executed. It is not possible to execute calls against reorged blocks; or blocks older than 128 (unless the node is an archive node).
|
||||
|
||||
##### 3. `Object` - State override set
|
||||
3. `Object` - State override set
|
||||
|
||||
The _state override set_ is an optional address-to-state mapping, where each entry specifies some state to be ephemerally overridden prior to executing the call. Each address maps to an object containing:
|
||||
|
||||
|
|
@ -41,7 +41,6 @@ The goal of the _state override set_ is manyfold:
|
|||
|
||||
- It can be used by DApps to reduce the amount of contract code needed to be deployed on chain. Code that simply returns internal state or does pre-defined validations can be kept off chain and fed to the node on-demand.
|
||||
- It can be used for smart contract analysis by extending the code deployed on chain with custom methods and invoking them. This avoids having to download and reconstruct the entire state in a sandbox to run custom code against.
|
||||
|
||||
- It can be used to debug smart contracts in an already deployed large suite of contracts by selectively overriding some code or state and seeing how execution changes. Specialized tooling will probably be necessary.
|
||||
|
||||
**Example:**
|
||||
|
|
@ -60,11 +59,11 @@ The goal of the _state override set_ is manyfold:
|
|||
}
|
||||
```
|
||||
|
||||
#### Return Values
|
||||
**Response:**
|
||||
|
||||
The method returns a single `Binary` consisting the return value of the executed contract call.
|
||||
|
||||
#### Simple example
|
||||
#### eth_call Simple example
|
||||
|
||||
**note that this example uses the Rinkeby network, which is now deprecated**
|
||||
|
||||
|
|
@ -93,7 +92,7 @@ Just for the sake of completeness, decoded the response is:
|
|||
0xb86e2b0ab5a4b1373e40c51a7c712c70ba2f9f8e
|
||||
```
|
||||
|
||||
#### Override example
|
||||
#### eth_call Override example
|
||||
|
||||
The above _simple example_ showed how to call a method already exposed by an on-chain smart contract. What if we want to access some data not exposed by it?
|
||||
|
||||
|
|
@ -183,7 +182,7 @@ Returns a block header.
|
|||
**Parameters:**
|
||||
|
||||
| Field | Type | Description |
|
||||
| :----------------- | :--------- | :--------------------------------- |
|
||||
| :------------ | :--------- | :----------- |
|
||||
| `blockNumber` | `Quantity` | Block number |
|
||||
|
||||
**Usage:**
|
||||
|
|
@ -196,26 +195,26 @@ curl localhost:8545 -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"
|
|||
|
||||
```json
|
||||
{
|
||||
baseFeePerGas: "0x6c3f71624",
|
||||
difficulty: "0x0",
|
||||
extraData: "0x496c6c756d696e61746520446d6f63726174697a6520447374726962757465",
|
||||
gasLimit: "0x1c9c380",
|
||||
gasUsed: "0x1312759",
|
||||
hash: "0x4574b6f248bf3295f76ae797454f4ec21c8ef5b53c0f7fee8534b65623d9360a",
|
||||
logsBloom: "0x04a13010898372c9ca19007ccd04eed1f707098f04123de47da9d0b67ce1a60ab8ea324cd8291c36a8ca5a520893d1552711012dba82ad817332008d90ac788047c0fcd2d1200cb82bd1690b32b6d7ab8ab28a86b1f7095a19b59104d062882093746d041b510537a4d0015518c1583de073045981792d0030aa5cd5089a0a700160f74b0b250a9e30ea90596fdf851732815da30d800ace471e2768e09bc0d45e79f97238136523021a4bd52d45a5e184c8c810a9c22afa8670b6bab0eb2636ea1981120a400040829021a3e96cbe0262d8a6ba06006b37249117230968eecc0c16a7ae4090e888673f1101a27159d5cd12a190f5aa85cb524dbc72f5d4ed14",
|
||||
miner: "0xdafea492d9c6733ae3d56b7ed1adb60692c98bc5",
|
||||
mixHash: "0xec33ce424110ddd8f7e7db1cbc1261a63e44dacd158b4e801566cd6d5849295b",
|
||||
nonce: "0x0000000000000000",
|
||||
number: "0x10823a8",
|
||||
parentHash: "0x956846b5012b1df4f4c928b85db2f6456b2faed2c0ca136e89c928a87ceec69c",
|
||||
receiptsRoot: "0x89b73c221ca0d721f8805edbecbf55524b0556dc5111680bac1c4dd02a286457",
|
||||
sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
|
||||
size: "0x25e",
|
||||
stateRoot: "0xe38ef58ddfbf00b03f7bd431fca306e5fcaecc138f4208501d2588657a65a0f3",
|
||||
timestamp: "0x646a982b",
|
||||
totalDifficulty: "0xc70d815d562d3cfa955",
|
||||
transactionsRoot: "0xe44699ea734cee851a852db4d257617c8369b8a7e68bd54b6de829377234017b",
|
||||
withdrawalsRoot: "0x917f5a8e4d652233a80b0973ff20bde517ed2a6a93defe7e99c5263089453e17"
|
||||
"baseFeePerGas": "0x6c3f71624",
|
||||
"difficulty": "0x0",
|
||||
"extraData": "0x496c6c756d696e61746520446d6f63726174697a6520447374726962757465",
|
||||
"gasLimit": "0x1c9c380",
|
||||
"gasUsed": "0x1312759",
|
||||
"hash": "0x4574b6f248bf3295f76ae797454f4ec21c8ef5b53c0f7fee8534b65623d9360a",
|
||||
"logsBloom": "0x04a13010898372c9ca19007ccd04eed1f707098f04123de47da9d0b67ce1a60ab8ea324cd8291c36a8ca5a520893d1552711012dba82ad817332008d90ac788047c0fcd2d1200cb82bd1690b32b6d7ab8ab28a86b1f7095a19b59104d062882093746d041b510537a4d0015518c1583de073045981792d0030aa5cd5089a0a700160f74b0b250a9e30ea90596fdf851732815da30d800ace471e2768e09bc0d45e79f97238136523021a4bd52d45a5e184c8c810a9c22afa8670b6bab0eb2636ea1981120a400040829021a3e96cbe0262d8a6ba06006b37249117230968eecc0c16a7ae4090e888673f1101a27159d5cd12a190f5aa85cb524dbc72f5d4ed14",
|
||||
"miner": "0xdafea492d9c6733ae3d56b7ed1adb60692c98bc5",
|
||||
"mixHash": "0xec33ce424110ddd8f7e7db1cbc1261a63e44dacd158b4e801566cd6d5849295b",
|
||||
"nonce": "0x0000000000000000",
|
||||
"number": "0x10823a8",
|
||||
"parentHash": "0x956846b5012b1df4f4c928b85db2f6456b2faed2c0ca136e89c928a87ceec69c",
|
||||
"receiptsRoot": "0x89b73c221ca0d721f8805edbecbf55524b0556dc5111680bac1c4dd02a286457",
|
||||
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
|
||||
"size": "0x25e",
|
||||
"stateRoot": "0xe38ef58ddfbf00b03f7bd431fca306e5fcaecc138f4208501d2588657a65a0f3",
|
||||
"timestamp": "0x646a982b",
|
||||
"totalDifficulty": "0xc70d815d562d3cfa955",
|
||||
"transactionsRoot": "0xe44699ea734cee851a852db4d257617c8369b8a7e68bd54b6de829377234017b",
|
||||
"withdrawalsRoot": "0x917f5a8e4d652233a80b0973ff20bde517ed2a6a93defe7e99c5263089453e17"
|
||||
}
|
||||
```
|
||||
|
||||
|
|
@ -226,7 +225,7 @@ Returns a block header.
|
|||
**Parameters:**
|
||||
|
||||
| Field | Type | Description |
|
||||
| :----------------- | :--------- | :--------------------------------- |
|
||||
| :---------- | :------- | :---------- |
|
||||
| `blockHash` | `string` | Block hash |
|
||||
|
||||
**Usage:**
|
||||
|
|
@ -239,25 +238,25 @@ curl localhost:8545 -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"
|
|||
|
||||
```json
|
||||
{
|
||||
baseFeePerGas: "0x6c3f71624",
|
||||
difficulty: "0x0",
|
||||
extraData: "0x496c6c756d696e61746520446d6f63726174697a6520447374726962757465",
|
||||
gasLimit: "0x1c9c380",
|
||||
gasUsed: "0x1312759",
|
||||
hash: "0x4574b6f248bf3295f76ae797454f4ec21c8ef5b53c0f7fee8534b65623d9360a",
|
||||
logsBloom: "0x04a13010898372c9ca19007ccd04eed1f707098f04123de47da9d0b67ce1a60ab8ea324cd8291c36a8ca5a520893d1552711012dba82ad817332008d90ac788047c0fcd2d1200cb82bd1690b32b6d7ab8ab28a86b1f7095a19b59104d062882093746d041b510537a4d0015518c1583de073045981792d0030aa5cd5089a0a700160f74b0b250a9e30ea90596fdf851732815da30d800ace471e2768e09bc0d45e79f97238136523021a4bd52d45a5e184c8c810a9c22afa8670b6bab0eb2636ea1981120a400040829021a3e96cbe0262d8a6ba06006b37249117230968eecc0c16a7ae4090e888673f1101a27159d5cd12a190f5aa85cb524dbc72f5d4ed14",
|
||||
miner: "0xdafea492d9c6733ae3d56b7ed1adb60692c98bc5",
|
||||
mixHash: "0xec33ce424110ddd8f7e7db1cbc1261a63e44dacd158b4e801566cd6d5849295b",
|
||||
nonce: "0x0000000000000000",
|
||||
number: "0x10823a8",
|
||||
parentHash: "0x956846b5012b1df4f4c928b85db2f6456b2faed2c0ca136e89c928a87ceec69c",
|
||||
receiptsRoot: "0x89b73c221ca0d721f8805edbecbf55524b0556dc5111680bac1c4dd02a286457",
|
||||
sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
|
||||
size: "0x25e",
|
||||
stateRoot: "0xe38ef58ddfbf00b03f7bd431fca306e5fcaecc138f4208501d2588657a65a0f3",
|
||||
timestamp: "0x646a982b",
|
||||
totalDifficulty: "0xc70d815d562d3cfa955",
|
||||
transactionsRoot: "0xe44699ea734cee851a852db4d257617c8369b8a7e68bd54b6de829377234017b",
|
||||
withdrawalsRoot: "0x917f5a8e4d652233a80b0973ff20bde517ed2a6a93defe7e99c5263089453e17"
|
||||
"baseFeePerGas": "0x6c3f71624",
|
||||
"difficulty": "0x0",
|
||||
"extraData": "0x496c6c756d696e61746520446d6f63726174697a6520447374726962757465",
|
||||
"gasLimit": "0x1c9c380",
|
||||
"gasUsed": "0x1312759",
|
||||
"hash": "0x4574b6f248bf3295f76ae797454f4ec21c8ef5b53c0f7fee8534b65623d9360a",
|
||||
"logsBloom": "0x04a13010898372c9ca19007ccd04eed1f707098f04123de47da9d0b67ce1a60ab8ea324cd8291c36a8ca5a520893d1552711012dba82ad817332008d90ac788047c0fcd2d1200cb82bd1690b32b6d7ab8ab28a86b1f7095a19b59104d062882093746d041b510537a4d0015518c1583de073045981792d0030aa5cd5089a0a700160f74b0b250a9e30ea90596fdf851732815da30d800ace471e2768e09bc0d45e79f97238136523021a4bd52d45a5e184c8c810a9c22afa8670b6bab0eb2636ea1981120a400040829021a3e96cbe0262d8a6ba06006b37249117230968eecc0c16a7ae4090e888673f1101a27159d5cd12a190f5aa85cb524dbc72f5d4ed14",
|
||||
"miner": "0xdafea492d9c6733ae3d56b7ed1adb60692c98bc5",
|
||||
"mixHash": "0xec33ce424110ddd8f7e7db1cbc1261a63e44dacd158b4e801566cd6d5849295b",
|
||||
"nonce": "0x0000000000000000",
|
||||
"number": "0x10823a8",
|
||||
"parentHash": "0x956846b5012b1df4f4c928b85db2f6456b2faed2c0ca136e89c928a87ceec69c",
|
||||
"receiptsRoot": "0x89b73c221ca0d721f8805edbecbf55524b0556dc5111680bac1c4dd02a286457",
|
||||
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
|
||||
"size": "0x25e",
|
||||
"stateRoot": "0xe38ef58ddfbf00b03f7bd431fca306e5fcaecc138f4208501d2588657a65a0f3",
|
||||
"timestamp": "0x646a982b",
|
||||
"totalDifficulty": "0xc70d815d562d3cfa955",
|
||||
"transactionsRoot": "0xe44699ea734cee851a852db4d257617c8369b8a7e68bd54b6de829377234017b",
|
||||
"withdrawalsRoot": "0x917f5a8e4d652233a80b0973ff20bde517ed2a6a93defe7e99c5263089453e17"
|
||||
}
|
||||
```
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ The following list shows each method from the `personal` namespace and the inten
|
|||
|
||||
`personal_listAccounts` displays the addresses of all accounts in the keystore. It is identical to `eth.accounts`. Calling `eth.accounts` requires manual approval in Clef (unless a rule for it has been attested). There is also Clef's `list-accounts` command that can be called from the terminal.
|
||||
|
||||
Examples:
|
||||
**Examples:**
|
||||
|
||||
```sh
|
||||
# eth_accounts using curl
|
||||
|
|
@ -38,7 +38,7 @@ clef list-accounts
|
|||
|
||||
`personal_ecRecover` returns the address for the account that was used to create a signature. An equivalent method, `account_ecRecover` is available on the Clef external API.
|
||||
|
||||
Example call:
|
||||
**Example call (curl):**
|
||||
|
||||
```sh
|
||||
curl --data '{"id": 4, "jsonrpc": "2.0", "method": "account_ecRecover","params": ["0xaabbccdd", "0x5b6693f153b48ec1c706ba4169960386dbaa6903e249cc79a8e6ddc434451d417e1e57327872c7f538beeb323c300afa9999a3d4a5de6caf3be0d5ef832b67ef1c"]}' -X POST localhost:8550
|
||||
|
|
@ -64,13 +64,13 @@ clef list-wallets
|
|||
|
||||
`personal_newAccount` was used to create a new account and save it in the keystore. Clef has an equivalent method, `account_new`. It can be accessed on the terminal using an http request or using a Clef command:
|
||||
|
||||
Example call (curl):
|
||||
**Example call (curl):**
|
||||
|
||||
```sh
|
||||
curl --data '{"id": 1, "jsonrpc": "2.0", "method": "account_new", "params": []}' -X POST localhost:8550
|
||||
```
|
||||
|
||||
Example call (Clef command):
|
||||
**Example call (Clef command):**
|
||||
|
||||
```sh
|
||||
clef newaccount
|
||||
|
|
@ -86,7 +86,7 @@ Both require manual approval in Clef unless a custom ruleset is in place.
|
|||
|
||||
`personal_sendTransaction` ws used to sign and submit a transaction. This can be done using `eth_sendTransaction`, requiring manual approval in Clef.
|
||||
|
||||
Example call (Javascript console):
|
||||
**Example call (Javascript console):**
|
||||
|
||||
```js
|
||||
// this command requires 2x approval in Clef because it loads account data via eth.accounts[0]
|
||||
|
|
@ -97,7 +97,7 @@ var tx = { from: eth.accounts[0], to: eth.accounts[1], value: web3.toWei(0.1, 'e
|
|||
eth.sendTransaction(tx);
|
||||
```
|
||||
|
||||
Example call (terminal)
|
||||
**Example call (curl):**
|
||||
|
||||
```sh
|
||||
curl --data '{"id":1, "jsonrpc":"2.0", "method":"eth_sendTransaction", "params":[{"from": "0xE70CAD05D0D54Ae3C9Fe5442f901E0433f9bd14B", "to":"0x4FDc03d09Ffca5Bba3138149E29D85C8A9E2Ac42", "gas":"21000","gasPrice":"20000000000", "nonce":"94"}]}' -H "Content-Type: application/json" -X POST localhost:8545
|
||||
|
|
@ -109,7 +109,7 @@ The sign method calculates an Ethereum specific signature with `sign(keccak256("
|
|||
|
||||
`personal.sign` is equivalent to Clef's `account_signData`. It returns the calculated signature.
|
||||
|
||||
Example call:
|
||||
**Example call (curl):**
|
||||
|
||||
```sh
|
||||
curl --data {"id": 3, "jsonrpc": "2.0", "method": "account_signData", "params": ["data/plain", "0x1923f626bb8dc025849e00f99c25fe2b2f7fb0db","0xaabbccdd"]} -X POST localhost:8550
|
||||
|
|
@ -117,7 +117,9 @@ curl --data {"id": 3, "jsonrpc": "2.0", "method": "account_signData", "params":
|
|||
|
||||
Clef also has `account_signTypedData` that signs data structured according to [EIP-712](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md) and returns the signature.
|
||||
|
||||
Example call (use the following as a template for `<data>` in `curl --data <data> -X POST localhost:8550 -H "Content-Type: application/json"`)
|
||||
**Example call (curl):**
|
||||
|
||||
Use the following as a template for `<data>` in `curl --data <data> -X POST localhost:8550 -H "Content-Type: application/json"`
|
||||
|
||||
```json
|
||||
{
|
||||
|
|
@ -198,7 +200,7 @@ Example call (use the following as a template for `<data>` in `curl --data <data
|
|||
|
||||
`personal_signTransaction` was used to create and sign a transaction from the given arguments. The transaction was returned in RLP-form, not broadcast to other nodes. The equivalent method is Clef's `account_signTransaction` from the external API. The arguments are a transaction object (`{"from": , "to": , "gas": , "maxPriorityFeePerGas": , "MaxFeePerGas": , "value": , "data": , "nonce": }`)) and an optional method signature that enables Clef to decode the calldata and show the user the methods, arguments and values being sent.
|
||||
|
||||
Example call (terminal):
|
||||
**Example call (curl):**
|
||||
|
||||
```sh
|
||||
curl --data '{"id": 2, "jsonrpc": "2.0", "method": "account_signTransaction", "params": [{"from": "0x1923f626bb8dc025849e00f99c25fe2b2f7fb0db", "gas": "0x55555","gasPrice": "0x1234", "input": "0xabcd", "nonce": "0x0", "to": "0x07a565b7ed7d7a678680a4c162885bedbb695fe0", "value": "0x1234"}]}' -X POST -H "Content-Type: application/json" localhost:8550
|
||||
|
|
@ -266,7 +268,7 @@ Returns all the Ethereum account addresses of all keys in the key store.
|
|||
| Console | `personal.listAccounts` |
|
||||
| RPC | `{"method": "personal_listAccounts", "params": []}` |
|
||||
|
||||
#### Example
|
||||
**Example:**
|
||||
|
||||
```js
|
||||
> personal.listAccounts
|
||||
|
|
@ -282,7 +284,7 @@ Returns a list of wallets this node manages.
|
|||
| Console | `personal.listWallets` |
|
||||
| RPC | `{"method": "personal_listWallets", "params": []}` |
|
||||
|
||||
#### Example
|
||||
**Example:**
|
||||
|
||||
```js
|
||||
> personal.listWallets
|
||||
|
|
@ -315,7 +317,7 @@ Returns the address of the new account. At the geth console, `newAccount` will p
|
|||
| Console | `personal.newAccount()` |
|
||||
| RPC | `{"method": "personal_newAccount", "params": [string]}` |
|
||||
|
||||
#### Example
|
||||
**Example:**
|
||||
|
||||
```js
|
||||
> personal.newAccount()
|
||||
|
|
@ -354,7 +356,7 @@ The account can be used with `eth_sign` and `eth_sendTransaction` while it is un
|
|||
| Console | `personal.unlockAccount(address, passphrase, duration)` |
|
||||
| RPC | `{"method": "personal_unlockAccount", "params": [string, string, number]}` |
|
||||
|
||||
#### Examples
|
||||
**Examples:**
|
||||
|
||||
```js
|
||||
> personal.unlockAccount("0x5e97870f263700f46aa00d967821199b9bc5a120")
|
||||
|
|
@ -399,7 +401,7 @@ The transaction is the same argument as for `eth_sendTransaction` (i.e. [transac
|
|||
| Console | `personal.sendTransaction(tx, passphrase)` |
|
||||
| RPC | `{"method": "personal_sendTransaction", "params": [tx, string]}` |
|
||||
|
||||
#### Examples
|
||||
**Example:**
|
||||
|
||||
```js
|
||||
> var tx = {from: "0x391694e7e0b0cce554cb130d723a9d27458f9298", to: "0xafa3f8684e54059998bc3a7b0d2b0da075154d66", value: web3.toWei(1.23, "ether")}
|
||||
|
|
@ -422,7 +424,7 @@ See ecRecover to verify the signature.
|
|||
| Console | `personal.sign(message, account, [password])` |
|
||||
| RPC | `{"method": "personal_sign", "params": [message, account, password]}` |
|
||||
|
||||
#### Examples
|
||||
**Example:**
|
||||
|
||||
```js
|
||||
> personal.sign("0xdeadbeaf", "0x9b2055d370f73ec7d8a03e965129118dc8f5bf83", "")
|
||||
|
|
@ -447,7 +449,7 @@ SignTransaction will create a transaction from the given arguments and tries to
|
|||
| Console | `personal.ecRecover(message, signature)` |
|
||||
| RPC | `{"method": "personal_ecRecover", "params": [message, signature]}` |
|
||||
|
||||
#### Examples
|
||||
**Example:**
|
||||
|
||||
```js
|
||||
> personal.sign("0xdeadbeaf", "0x9b2055d370f73ec7d8a03e965129118dc8f5bf83", "")
|
||||
|
|
|
|||
Loading…
Reference in a new issue