rpc: Usage,Response the same ad Example

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
jsvisa 2023-08-10 16:38:06 +08:00
parent 05bd30e4f8
commit 91f78a1c5d
2 changed files with 9 additions and 9 deletions

View file

@ -251,11 +251,11 @@ And these fields are only available for tracing mined transactions (i.e. not ava
- `getOutput()` - returns the output as a buffer
- `getError()` - returns an error if one occurred during execution and `undefined` otherwise
### Usage
**Usage:**
Note that several values are Golang big.Int objects, not JavaScript numbers or JS bigints. As such, they have the same interface as described in the godocs. Their default serialization to JSON is as a Javascript number; to serialize large numbers accurately call `.String()` on them. For convenience, `big.NewInt(x)` is provided, and will convert a uint to a Go BigInt.
Note that several values are Golang `big.Int` objects, not JavaScript numbers or JS bigints. As such, they have the same interface as described in the godocs. Their default serialization to JSON is as a Javascript number; to serialize large numbers accurately call `.String()` on them. For convenience, `big.NewInt(x)` is provided, and will convert a uint to a Go BigInt.
Usage example, returns the top element of the stack at each CALL opcode only:
Here is an example, returns the top element of the stack at each CALL opcode only:
```js
debug.traceTransaction(txhash, {

View file

@ -148,13 +148,13 @@ This method creates an [EIP2930](https://eips.ethereum.org/EIPS/eip-2930) type `
| `transaction` | `Object` | `TransactionCall` object |
| `blockNumberOrTag` | `Object` | Optional, blocknumber or `latest` or `pending` |
#### Usage
**Usage:**
```
curl --data '{"method":"eth_createAccessList","params":[{"from": "0x8cd02c6cbd8375b39b06577f8d50c51d86e8d5cd", "data": "0x608060806080608155"}, "pending"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
```
#### Response
**Response:**
The method `eth_createAccessList` returns list of addresses and storage keys used by the transaction, plus the gas consumed when the access list is added.
@ -186,13 +186,13 @@ Returns a block header.
| :----------------- | :--------- | :--------------------------------- |
| `blockNumber` | `Quantity` | Block number |
#### Usage
**Usage:**
```
curl localhost:8545 -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getHeaderByNumber","params":["0x10823a8"],"id":0}'
```
#### Response
**Response:**
```json
{
@ -229,13 +229,13 @@ Returns a block header.
| :----------------- | :--------- | :--------------------------------- |
| `blockHash` | `string` | Block hash |
#### Usage
**Usage:**
```
curl localhost:8545 -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getHeaderByHash","params":["0x4574b6f248bf3295f76ae797454f4ec21c8ef5b53c0f7fee8534b65623d9360a"],"id":0}'
```
#### Response
**Response:**
```json
{