Skip to content

Debug

Entity Version
Source 1.12.9-unstable/generated-at:2022-07-13T09:50:34-07:00
OpenRPC 1.2.6

debug_accountRange

AccountRange enumerates all accounts in the given block and start point in paging request

Params (6)

Parameters must be given by position.

1: blockNrOrHash rpc.BlockNumberOrHash

  • Required: ✓ Yes

2: start hexutil.Bytes

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of some bytes`
- pattern: `^0x([a-fA-F\d])+$`
- title: `dataWord`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of some bytes",
    "pattern": "^0x([a-fA-F\\d])+$",
    "title": "dataWord",
    "type": [
        "string"
    ]
}

3: maxResults int

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

4: nocode bool

  • Required: ✓ Yes

5: nostorage bool

  • Required: ✓ Yes

6: incompletes bool

  • Required: ✓ Yes

Result

state.IteratorDump

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
- additionalProperties: `false`
- properties: 
    - accounts: 
        - patternProperties: 
            - .*: 
                - additionalProperties: `false`
                - properties: 
                    - address: 
                        - pattern: `^0x[a-fA-F\d]{64}$`
                        - title: `keccak`
                        - type: `string`

                    - balance: 
                        - type: `string`

                    - code: 
                        - pattern: `^0x([a-fA-F\d])+$`
                        - title: `dataWord`
                        - type: `string`

                    - codeHash: 
                        - pattern: `^0x([a-fA-F\d])+$`
                        - title: `dataWord`
                        - type: `string`

                    - key: 
                        - pattern: `^0x([a-fA-F\d])+$`
                        - title: `dataWord`
                        - type: `string`

                    - nonce: 
                        - pattern: `^0x[a-fA-F0-9]+$`
                        - title: `integer`
                        - type: `string`

                    - root: 
                        - pattern: `^0x([a-fA-F\d])+$`
                        - title: `dataWord`
                        - type: `string`

                    - storage: 
                        - patternProperties: 
                            - .*: 
                                - type: `string`


                        - type: `object`


                - type: `object`


        - type: `object`

    - next: 
        - pattern: `^0x([a-fA-F0-9]?)+$`
        - title: `bytes`
        - type: `string`

    - root: 
        - type: `string`


- type: object
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{
    "additionalProperties": false,
    "properties": {
        "accounts": {
            "patternProperties": {
                ".*": {
                    "additionalProperties": false,
                    "properties": {
                        "address": {
                            "pattern": "^0x[a-fA-F\\d]{64}$",
                            "title": "keccak",
                            "type": "string"
                        },
                        "balance": {
                            "type": "string"
                        },
                        "code": {
                            "pattern": "^0x([a-fA-F\\d])+$",
                            "title": "dataWord",
                            "type": "string"
                        },
                        "codeHash": {
                            "pattern": "^0x([a-fA-F\\d])+$",
                            "title": "dataWord",
                            "type": "string"
                        },
                        "key": {
                            "pattern": "^0x([a-fA-F\\d])+$",
                            "title": "dataWord",
                            "type": "string"
                        },
                        "nonce": {
                            "pattern": "^0x[a-fA-F0-9]+$",
                            "title": "integer",
                            "type": "string"
                        },
                        "root": {
                            "pattern": "^0x([a-fA-F\\d])+$",
                            "title": "dataWord",
                            "type": "string"
                        },
                        "storage": {
                            "patternProperties": {
                                ".*": {
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "type": "object"
                }
            },
            "type": "object"
        },
        "next": {
            "pattern": "^0x([a-fA-F0-9]?)+$",
            "title": "bytes",
            "type": "string"
        },
        "root": {
            "type": "string"
        }
    },
    "type": [
        "object"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_accountRange", "params": [<blockNrOrHash>, <start>, <maxResults>, <nocode>, <nostorage>, <incompletes>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_accountRange", "params": [<blockNrOrHash>, <start>, <maxResults>, <nocode>, <nostorage>, <incompletes>]}'
1
debug.accountRange(blockNrOrHash,start,maxResults,nocode,nostorage,incompletes);
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
func (api *DebugAPI) AccountRange(blockNrOrHash rpc.BlockNumberOrHash, start hexutil.Bytes, maxResults int, nocode, nostorage, incompletes bool) (state.IteratorDump, error) {
    var stateDb *state.StateDB
    var err error
    if number, ok := blockNrOrHash.Number(); ok {
        if number == rpc.PendingBlockNumber {
            _, stateDb = api.eth.miner.Pending()
        } else {
            var block *types.Block
            if number == rpc.LatestBlockNumber {
                block = api.eth.blockchain.CurrentBlock()
            } else if number == rpc.FinalizedBlockNumber {
                block = api.eth.blockchain.CurrentFinalizedBlock()
            } else {
                block = api.eth.blockchain.GetBlockByNumber(uint64(number))
            }
            if block == nil {
                return state.IteratorDump{}, fmt.Errorf("block #%d not found", number)
            }
            stateDb, err = api.eth.BlockChain().StateAt(block.Root())
            if err != nil {
                return state.IteratorDump{}, err
            }
        }
    } else if hash, ok := blockNrOrHash.Hash(); ok {
        block := api.eth.blockchain.GetBlockByHash(hash)
        if block == nil {
            return state.IteratorDump{}, fmt.Errorf("block %s not found", hash.Hex())
        }
        stateDb, err = api.eth.BlockChain().StateAt(block.Root())
        if err != nil {
            return state.IteratorDump{}, err
        }
    } else {
        return state.IteratorDump{}, errors.New("either block number or block hash must be specified")
    }
    opts := &state.DumpConfig{SkipCode: nocode, SkipStorage: nostorage, OnlyWithAddresses: !incompletes, Start: start, Max: uint64(maxResults)}
    if maxResults > AccountRangeMaxResults || maxResults <= 0 {
        opts.Max = AccountRangeMaxResults
    }
    return stateDb.IteratorDump(opts), nil
}// AccountRange enumerates all accounts in the given block and start point in paging request
View on GitHub →


debug_backtraceAt

BacktraceAt sets the log backtrace location. See package log for details on the pattern syntax.

Params (1)

Parameters must be given by position.

1: location string

  • Required: ✓ Yes

Result

None

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_backtraceAt", "params": [<location>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_backtraceAt", "params": [<location>]}'
1
debug.backtraceAt(location);
Source code

1
2
3
4
func (*HandlerT) BacktraceAt(location string) error {
    return glogger.BacktraceAt(location)
}// BacktraceAt sets the log backtrace location. See package log for details on
// the pattern syntax.
View on GitHub →


debug_blockProfile

BlockProfile turns on goroutine profiling for nsec seconds and writes profile data to file. It uses a profile rate of 1 for most accurate information. If a different rate is desired, set the rate and write the profile manually.

Params (2)

Parameters must be given by position.

1: file string

  • Required: ✓ Yes

2: nsec uint

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

Result

None

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_blockProfile", "params": [<file>, <nsec>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_blockProfile", "params": [<file>, <nsec>]}'
1
debug.blockProfile(file,nsec);
Source code

1
2
3
4
5
6
7
8
func (*HandlerT) BlockProfile(file string, nsec uint) error {
    runtime.SetBlockProfileRate(1)
    time.Sleep(time.Duration(nsec) * time.Second)
    defer runtime.SetBlockProfileRate(0)
    return writeProfile("block", file)
}// BlockProfile turns on goroutine profiling for nsec seconds and writes profile data to
// file. It uses a profile rate of 1 for most accurate information. If a different rate is
// desired, set the rate and write the profile manually.
View on GitHub →


debug_chaindbCompact

ChaindbCompact flattens the entire key-value database into a single level, removing all unused slots and merging all keys.

Params (0)

None

Result

None

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_chaindbCompact", "params": []}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_chaindbCompact", "params": []}'
1
debug.chaindbCompact();
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
func (api *DebugAPI) ChaindbCompact() error {
    for b := byte(0); b < 255; b++ {
        log.Info("Compacting chain database", "range", fmt.Sprintf("0x%0.2X-0x%0.2X", b, b+1))
        if err := api.b.ChainDb().Compact([ // ChaindbCompact flattens the entire key-value database into a single level,
        // removing all unused slots and merging all keys.
        ]byte{b}, []byte{b + 1}); err != nil {
            log.Error("Database compaction failed", "err", err)
            return err
        }
    }
    return nil
}
View on GitHub →


debug_chaindbProperty

ChaindbProperty returns leveldb properties of the key-value database.

Params (1)

Parameters must be given by position.

1: property string

  • Required: ✓ Yes

Result

string

  • Required: ✓ Yes

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_chaindbProperty", "params": [<property>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_chaindbProperty", "params": [<property>]}'
1
debug.chaindbProperty(property);
Source code

1
2
3
4
5
6
7
8
func (api *DebugAPI) ChaindbProperty(property string) (string, error) {
    if property == "" {
        property = "leveldb.stats"
    } else if !strings.HasPrefix(property, "leveldb.") {
        property = "leveldb." + property
    }
    return api.b.ChainDb().Stat(property)
}// ChaindbProperty returns leveldb properties of the key-value database.
View on GitHub →


debug_cpuProfile

CpuProfile turns on CPU profiling for nsec seconds and writes profile data to file.

Params (2)

Parameters must be given by position.

1: file string

  • Required: ✓ Yes

2: nsec uint

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

Result

None

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_cpuProfile", "params": [<file>, <nsec>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_cpuProfile", "params": [<file>, <nsec>]}'
1
debug.cpuProfile(file,nsec);
Source code

1
2
3
4
5
6
7
8
9
func (h *HandlerT) CpuProfile(file string, nsec uint) error {
    if err := h.StartCPUProfile(file); err != nil {
        return err
    }
    time.Sleep(time.Duration(nsec) * time.Second)
    h.StopCPUProfile()
    return nil
}// CpuProfile turns on CPU profiling for nsec seconds and writes
// profile data to file.
View on GitHub →


debug_dbAncient

DbAncient retrieves an ancient binary blob from the append-only immutable files. It is a mapping to the AncientReaderOp.Ancient method

Params (2)

Parameters must be given by position.

1: kind string

  • Required: ✓ Yes

2: number uint64

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

Result

hexutil.Bytes

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of some bytes`
- pattern: `^0x([a-fA-F\d])+$`
- title: `dataWord`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of some bytes",
    "pattern": "^0x([a-fA-F\\d])+$",
    "title": "dataWord",
    "type": [
        "string"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_dbAncient", "params": [<kind>, <number>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_dbAncient", "params": [<kind>, <number>]}'
1
debug.dbAncient(kind,number);
Source code

1
2
3
4
func (api *DebugAPI) DbAncient(kind string, number uint64) (hexutil.Bytes, error) {
    return api.b.ChainDb().Ancient(kind, number)
}// DbAncient retrieves an ancient binary blob from the append-only immutable files.
// It is a mapping to the `AncientReaderOp.Ancient` method
View on GitHub →


debug_dbAncients

DbAncients returns the ancient item numbers in the ancient store. It is a mapping to the AncientReaderOp.Ancients method

Params (0)

None

Result

uint64

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_dbAncients", "params": []}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_dbAncients", "params": []}'
1
debug.dbAncients();
Source code

1
2
3
4
func (api *DebugAPI) DbAncients() (uint64, error) {
    return api.b.ChainDb().Ancients()
}// DbAncients returns the ancient item numbers in the ancient store.
// It is a mapping to the `AncientReaderOp.Ancients` method
View on GitHub →


debug_dbGet

DbGet returns the raw value of a key stored in the database.

Params (1)

Parameters must be given by position.

1: key string

  • Required: ✓ Yes

Result

hexutil.Bytes

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of some bytes`
- pattern: `^0x([a-fA-F\d])+$`
- title: `dataWord`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of some bytes",
    "pattern": "^0x([a-fA-F\\d])+$",
    "title": "dataWord",
    "type": [
        "string"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_dbGet", "params": [<key>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_dbGet", "params": [<key>]}'
1
debug.dbGet(key);
Source code

1
2
3
4
5
6
7
func (api *DebugAPI) DbGet(key string) (hexutil.Bytes, error) {
    blob, err := common.ParseHexOrString(key)
    if err != nil {
        return nil, err
    }
    return api.b.ChainDb().Get(blob)
}// DbGet returns the raw value of a key stored in the database.
View on GitHub →


debug_dumpBlock

DumpBlock retrieves the entire state of the database at a given block.

Params (1)

Parameters must be given by position.

1: blockNr rpc.BlockNumber

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
- oneOf: 

        - description: `The block height description`
        - enum: earliest, latest, pending
        - title: `blockNumberTag`
        - type: string


        - description: `Hex representation of a uint64`
        - pattern: `^0x([a-fA-F\d])+$`
        - title: `uint64`
        - type: string


- title: `blockNumberIdentifier`
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
    "oneOf": [
        {
            "description": "The block height description",
            "enum": [
                "earliest",
                "latest",
                "pending"
            ],
            "title": "blockNumberTag",
            "type": [
                "string"
            ]
        },
        {
            "description": "Hex representation of a uint64",
            "pattern": "^0x([a-fA-F\\d])+$",
            "title": "uint64",
            "type": [
                "string"
            ]
        }
    ],
    "title": "blockNumberIdentifier"
}

Result

state.Dump

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
- additionalProperties: `false`
- properties: 
    - accounts: 
        - patternProperties: 
            - .*: 
                - additionalProperties: `false`
                - properties: 
                    - address: 
                        - pattern: `^0x[a-fA-F\d]{64}$`
                        - title: `keccak`
                        - type: `string`

                    - balance: 
                        - type: `string`

                    - code: 
                        - pattern: `^0x([a-fA-F\d])+$`
                        - title: `dataWord`
                        - type: `string`

                    - codeHash: 
                        - pattern: `^0x([a-fA-F\d])+$`
                        - title: `dataWord`
                        - type: `string`

                    - key: 
                        - pattern: `^0x([a-fA-F\d])+$`
                        - title: `dataWord`
                        - type: `string`

                    - nonce: 
                        - pattern: `^0x[a-fA-F0-9]+$`
                        - title: `integer`
                        - type: `string`

                    - root: 
                        - pattern: `^0x([a-fA-F\d])+$`
                        - title: `dataWord`
                        - type: `string`

                    - storage: 
                        - patternProperties: 
                            - .*: 
                                - type: `string`


                        - type: `object`


                - type: `object`


        - type: `object`

    - root: 
        - type: `string`


- type: object
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
    "additionalProperties": false,
    "properties": {
        "accounts": {
            "patternProperties": {
                ".*": {
                    "additionalProperties": false,
                    "properties": {
                        "address": {
                            "pattern": "^0x[a-fA-F\\d]{64}$",
                            "title": "keccak",
                            "type": "string"
                        },
                        "balance": {
                            "type": "string"
                        },
                        "code": {
                            "pattern": "^0x([a-fA-F\\d])+$",
                            "title": "dataWord",
                            "type": "string"
                        },
                        "codeHash": {
                            "pattern": "^0x([a-fA-F\\d])+$",
                            "title": "dataWord",
                            "type": "string"
                        },
                        "key": {
                            "pattern": "^0x([a-fA-F\\d])+$",
                            "title": "dataWord",
                            "type": "string"
                        },
                        "nonce": {
                            "pattern": "^0x[a-fA-F0-9]+$",
                            "title": "integer",
                            "type": "string"
                        },
                        "root": {
                            "pattern": "^0x([a-fA-F\\d])+$",
                            "title": "dataWord",
                            "type": "string"
                        },
                        "storage": {
                            "patternProperties": {
                                ".*": {
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "type": "object"
                }
            },
            "type": "object"
        },
        "root": {
            "type": "string"
        }
    },
    "type": [
        "object"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_dumpBlock", "params": [<blockNr>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_dumpBlock", "params": [<blockNr>]}'
1
debug.dumpBlock(blockNr);
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
func (api *DebugAPI) DumpBlock(blockNr rpc.BlockNumber) (state.Dump, error) {
    opts := &state.DumpConfig{OnlyWithAddresses: true, Max: AccountRangeMaxResults}
    if blockNr == rpc.PendingBlockNumber {
        _, stateDb := api.eth.miner.Pending()
        return stateDb.RawDump(opts), nil
    }
    var block *types.Block
    if blockNr == rpc.LatestBlockNumber {
        block = api.eth.blockchain.CurrentBlock()
    } else if blockNr == rpc.FinalizedBlockNumber {
        block = api.eth.blockchain.CurrentFinalizedBlock()
    } else {
        block = api.eth.blockchain.GetBlockByNumber(uint64(blockNr))
    }
    if block == nil {
        return state.Dump{}, fmt.Errorf("block #%d not found", blockNr)
    }
    stateDb, err := api.eth.BlockChain().StateAt(block.Root())
    if err != nil {
        return state.Dump{}, err
    }
    return stateDb.RawDump(opts), nil
}// DumpBlock retrieves the entire state of the database at a given block.
View on GitHub →


debug_freeOSMemory

FreeOSMemory forces a garbage collection.

Params (0)

None

Result

None

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_freeOSMemory", "params": []}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_freeOSMemory", "params": []}'
1
debug.freeOSMemory();
Source code

1
2
3
func (*HandlerT) FreeOSMemory() {
    debug.FreeOSMemory()
}// FreeOSMemory forces a garbage collection.
View on GitHub →


debug_gcStats

GcStats returns GC statistics.

Params (0)

None

Result

*debug.GCStats

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
- additionalProperties: `false`
- properties: 
    - LastGC: 
        - format: `date-time`
        - type: `string`

    - NumGC: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - Pause: 
        - items: 
            - description: `Hex representation of the integer`
            - pattern: `^0x[a-fA-F0-9]+$`
            - title: `integer`
            - type: `string`

        - type: `array`

    - PauseEnd: 
        - items: 
            - format: `date-time`
            - type: `string`

        - type: `array`

    - PauseQuantiles: 
        - items: 
            - description: `Hex representation of the integer`
            - pattern: `^0x[a-fA-F0-9]+$`
            - title: `integer`
            - type: `string`

        - type: `array`

    - PauseTotal: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`


- type: object
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
    "additionalProperties": false,
    "properties": {
        "LastGC": {
            "format": "date-time",
            "type": "string"
        },
        "NumGC": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "Pause": {
            "items": {
                "description": "Hex representation of the integer",
                "pattern": "^0x[a-fA-F0-9]+$",
                "title": "integer",
                "type": "string"
            },
            "type": "array"
        },
        "PauseEnd": {
            "items": {
                "format": "date-time",
                "type": "string"
            },
            "type": "array"
        },
        "PauseQuantiles": {
            "items": {
                "description": "Hex representation of the integer",
                "pattern": "^0x[a-fA-F0-9]+$",
                "title": "integer",
                "type": "string"
            },
            "type": "array"
        },
        "PauseTotal": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        }
    },
    "type": [
        "object"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_gcStats", "params": []}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_gcStats", "params": []}'
1
debug.gcStats();
Source code

1
2
3
4
5
func (*HandlerT) GcStats() *debug.GCStats {
    s := new(debug.GCStats)
    debug.ReadGCStats(s)
    return s
}// GcStats returns GC statistics.
View on GitHub →


debug_getAccessibleState

GetAccessibleState returns the first number where the node has accessible state on disk. Note this being the post-state of that block and the pre-state of the next block. The (from, to) parameters are the sequence of blocks to search, which can go either forwards or backwards

Params (2)

Parameters must be given by position.

1: from rpc.BlockNumber

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
- oneOf: 

        - description: `The block height description`
        - enum: earliest, latest, pending
        - title: `blockNumberTag`
        - type: string


        - description: `Hex representation of a uint64`
        - pattern: `^0x([a-fA-F\d])+$`
        - title: `uint64`
        - type: string


- title: `blockNumberIdentifier`
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
    "oneOf": [
        {
            "description": "The block height description",
            "enum": [
                "earliest",
                "latest",
                "pending"
            ],
            "title": "blockNumberTag",
            "type": [
                "string"
            ]
        },
        {
            "description": "Hex representation of a uint64",
            "pattern": "^0x([a-fA-F\\d])+$",
            "title": "uint64",
            "type": [
                "string"
            ]
        }
    ],
    "title": "blockNumberIdentifier"
}

2: to rpc.BlockNumber

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
- oneOf: 

        - description: `The block height description`
        - enum: earliest, latest, pending
        - title: `blockNumberTag`
        - type: string


        - description: `Hex representation of a uint64`
        - pattern: `^0x([a-fA-F\d])+$`
        - title: `uint64`
        - type: string


- title: `blockNumberIdentifier`
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
    "oneOf": [
        {
            "description": "The block height description",
            "enum": [
                "earliest",
                "latest",
                "pending"
            ],
            "title": "blockNumberTag",
            "type": [
                "string"
            ]
        },
        {
            "description": "Hex representation of a uint64",
            "pattern": "^0x([a-fA-F\\d])+$",
            "title": "uint64",
            "type": [
                "string"
            ]
        }
    ],
    "title": "blockNumberIdentifier"
}

Result

uint64

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_getAccessibleState", "params": [<from>, <to>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_getAccessibleState", "params": [<from>, <to>]}'
1
debug.getAccessibleState(from,to);
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
func (api *DebugAPI) GetAccessibleState(from, to rpc.BlockNumber) (uint64, error) {
    db := api.eth.ChainDb()
    var pivot uint64
    if p := rawdb.ReadLastPivotNumber(db); p != nil {
        pivot = *p
        log.Info("Found fast-sync pivot marker", "number", pivot)
    }
    var resolveNum = func(num rpc.BlockNumber) (uint64, error) {
        if num.Int64() < 0 {
            block := api.eth.blockchain.CurrentBlock()
            if block == nil {
                return 0, fmt.Errorf("current block missing")
            }
            return block.NumberU64(), nil
        }
        return uint64(num.Int64()), nil
    }
    var (
        start   uint64
        end uint64
        delta   = int64(1)
        lastLog time.Time
        err error
    )
    if start, err = resolveNum(from); err != nil {
        return 0, err
    }
    if end, err = resolveNum(to); err != nil {
        return 0, err
    }
    if start == end {
        return 0, fmt.Errorf("from and to needs to be different")
    }
    if start > end {
        delta = -1
    }
    for i := int64(start); i != int64(end); i += delta {
        if time.Since(lastLog) > 8*time.Second {
            log.Info("Finding roots", "from", start, "to", end, "at", i)
            lastLog = time.Now()
        }
        if i < int64(pivot) {
            continue
        }
        h := api.eth.BlockChain().GetHeaderByNumber(uint64(i))
        if h == nil {
            return 0, fmt.Errorf("missing header %d", i)
        }
        if ok, _ := api.eth.ChainDb().Has(h.Root[ // GetAccessibleState returns the first number where the node has accessible
        // state on disk. Note this being the post-state of that block and the pre-state
        // of the next block.
        // The (from, to) parameters are the sequence of blocks to search, which can go
        // either forwards or backwards
        :]); ok {
            return uint64(i), nil
        }
    }
    return 0, fmt.Errorf("No state found")
}
View on GitHub →


debug_getBadBlocks

GetBadBlocks returns a list of the last ‘bad blocks’ that the client has seen on the network and returns them as a JSON list of block hashes.

Params (0)

None

Result

BadBlockArgs []*BadBlockArgs

  • Required: ✓ Yes
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
- items: 

        - additionalProperties: `false`
        - properties: 
            - block: 
                - additionalProperties: `false`
                - properties: 
                    - baseFeePerGas: 
                        - pattern: `^0x[a-fA-F0-9]+$`
                        - title: `integer`
                        - type: `string`

                    - difficulty: 
                        - pattern: `^0x[a-fA-F0-9]+$`
                        - title: `integer`
                        - type: `string`

                    - error: 
                        - type: `string`

                    - extraData: 
                        - pattern: `^0x([a-fA-F\d])+$`
                        - title: `dataWord`
                        - type: `string`

                    - gasLimit: 
                        - pattern: `^0x([a-fA-F\d])+$`
                        - title: `uint64`
                        - type: `string`

                    - gasUsed: 
                        - pattern: `^0x([a-fA-F\d])+$`
                        - title: `uint64`
                        - type: `string`

                    - hash: 
                        - pattern: `^0x[a-fA-F\d]{64}$`
                        - title: `keccak`
                        - type: `string`

                    - logsBloom: 
                        - items: 
                            - description: `Hex representation of the integer`
                            - pattern: `^0x[a-fA-F0-9]+$`
                            - title: `integer`
                            - type: `string`

                        - maxItems: `256`
                        - minItems: `256`
                        - type: `array`

                    - miner: 
                        - pattern: `^0x[a-fA-F\d]{64}$`
                        - title: `keccak`
                        - type: `string`

                    - mixHash: 
                        - pattern: `^0x[a-fA-F\d]{64}$`
                        - title: `keccak`
                        - type: `string`

                    - nonce: 
                        - pattern: `^0x[a-fA-F0-9]+$`
                        - title: `integer`
                        - type: `string`

                    - number: 
                        - pattern: `^0x[a-fA-F0-9]+$`
                        - title: `integer`
                        - type: `string`

                    - parentHash: 
                        - pattern: `^0x[a-fA-F\d]{64}$`
                        - title: `keccak`
                        - type: `string`

                    - receiptsRoot: 
                        - pattern: `^0x[a-fA-F\d]{64}$`
                        - title: `keccak`
                        - type: `string`

                    - sha3Uncles: 
                        - pattern: `^0x[a-fA-F\d]{64}$`
                        - title: `keccak`
                        - type: `string`

                    - size: 
                        - pattern: `^0x([a-fA-F\d])+$`
                        - title: `uint64`
                        - type: `string`

                    - stateRoot: 
                        - pattern: `^0x[a-fA-F\d]{64}$`
                        - title: `keccak`
                        - type: `string`

                    - timestamp: 
                        - pattern: `^0x([a-fA-F\d])+$`
                        - title: `uint64`
                        - type: `string`

                    - totalDifficulty: 
                        - pattern: `^0x[a-fA-F0-9]+$`
                        - title: `integer`
                        - type: `string`

                    - transactions: 
                        - items: 
                            - additionalProperties: `true`

                        - type: `array`

                    - transactionsRoot: 
                        - pattern: `^0x[a-fA-F\d]{64}$`
                        - title: `keccak`
                        - type: `string`

                    - uncles: 
                        - items: 
                            - description: `Hex representation of a Keccak 256 hash`
                            - pattern: `^0x[a-fA-F\d]{64}$`
                            - title: `keccak`
                            - type: `string`

                        - type: `array`


                - type: `object`

            - hash: 
                - pattern: `^0x[a-fA-F\d]{64}$`
                - title: `keccak`
                - type: `string`

            - rlp: 
                - type: `string`


        - type: object


- type: array
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
{
    "items": [
        {
            "additionalProperties": false,
            "properties": {
                "block": {
                    "additionalProperties": false,
                    "properties": {
                        "baseFeePerGas": {
                            "pattern": "^0x[a-fA-F0-9]+$",
                            "title": "integer",
                            "type": "string"
                        },
                        "difficulty": {
                            "pattern": "^0x[a-fA-F0-9]+$",
                            "title": "integer",
                            "type": "string"
                        },
                        "error": {
                            "type": "string"
                        },
                        "extraData": {
                            "pattern": "^0x([a-fA-F\\d])+$",
                            "title": "dataWord",
                            "type": "string"
                        },
                        "gasLimit": {
                            "pattern": "^0x([a-fA-F\\d])+$",
                            "title": "uint64",
                            "type": "string"
                        },
                        "gasUsed": {
                            "pattern": "^0x([a-fA-F\\d])+$",
                            "title": "uint64",
                            "type": "string"
                        },
                        "hash": {
                            "pattern": "^0x[a-fA-F\\d]{64}$",
                            "title": "keccak",
                            "type": "string"
                        },
                        "logsBloom": {
                            "items": {
                                "description": "Hex representation of the integer",
                                "pattern": "^0x[a-fA-F0-9]+$",
                                "title": "integer",
                                "type": "string"
                            },
                            "maxItems": 256,
                            "minItems": 256,
                            "type": "array"
                        },
                        "miner": {
                            "pattern": "^0x[a-fA-F\\d]{64}$",
                            "title": "keccak",
                            "type": "string"
                        },
                        "mixHash": {
                            "pattern": "^0x[a-fA-F\\d]{64}$",
                            "title": "keccak",
                            "type": "string"
                        },
                        "nonce": {
                            "pattern": "^0x[a-fA-F0-9]+$",
                            "title": "integer",
                            "type": "string"
                        },
                        "number": {
                            "pattern": "^0x[a-fA-F0-9]+$",
                            "title": "integer",
                            "type": "string"
                        },
                        "parentHash": {
                            "pattern": "^0x[a-fA-F\\d]{64}$",
                            "title": "keccak",
                            "type": "string"
                        },
                        "receiptsRoot": {
                            "pattern": "^0x[a-fA-F\\d]{64}$",
                            "title": "keccak",
                            "type": "string"
                        },
                        "sha3Uncles": {
                            "pattern": "^0x[a-fA-F\\d]{64}$",
                            "title": "keccak",
                            "type": "string"
                        },
                        "size": {
                            "pattern": "^0x([a-fA-F\\d])+$",
                            "title": "uint64",
                            "type": "string"
                        },
                        "stateRoot": {
                            "pattern": "^0x[a-fA-F\\d]{64}$",
                            "title": "keccak",
                            "type": "string"
                        },
                        "timestamp": {
                            "pattern": "^0x([a-fA-F\\d])+$",
                            "title": "uint64",
                            "type": "string"
                        },
                        "totalDifficulty": {
                            "pattern": "^0x[a-fA-F0-9]+$",
                            "title": "integer",
                            "type": "string"
                        },
                        "transactions": {
                            "items": {
                                "additionalProperties": true
                            },
                            "type": "array"
                        },
                        "transactionsRoot": {
                            "pattern": "^0x[a-fA-F\\d]{64}$",
                            "title": "keccak",
                            "type": "string"
                        },
                        "uncles": {
                            "items": {
                                "description": "Hex representation of a Keccak 256 hash",
                                "pattern": "^0x[a-fA-F\\d]{64}$",
                                "title": "keccak",
                                "type": "string"
                            },
                            "type": "array"
                        }
                    },
                    "type": "object"
                },
                "hash": {
                    "pattern": "^0x[a-fA-F\\d]{64}$",
                    "title": "keccak",
                    "type": "string"
                },
                "rlp": {
                    "type": "string"
                }
            },
            "type": [
                "object"
            ]
        }
    ],
    "type": [
        "array"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_getBadBlocks", "params": []}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_getBadBlocks", "params": []}'
1
debug.getBadBlocks();
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
func (api *DebugAPI) GetBadBlocks(ctx context.Context) ([ // GetBadBlocks returns a list of the last 'bad blocks' that the client has seen on the network
// and returns them as a JSON list of block hashes.
]*BadBlockArgs, error) {
    var (
        err error
        blocks  = rawdb.ReadAllBadBlocks(api.eth.chainDb)
        results = make([]*BadBlockArgs, 0, len(blocks))
    )
    for _, block := range blocks {
        var (
            blockRlp    string
            blockJSON   *ethapi.RPCMarshalBlockT
        )
        if rlpBytes, err := rlp.EncodeToBytes(block); err != nil {
            blockRlp = err.Error()
        } else {
            blockRlp = fmt.Sprintf("0x%x", rlpBytes)
        }
        if blockJSON, err = ethapi.RPCMarshalBlock(block, true, true, api.eth.APIBackend.ChainConfig()); err != nil {
            blockJSON = &ethapi.RPCMarshalBlockT{Error: err.Error()}
        }
        results = append(results, &BadBlockArgs{Hash: block.Hash(), RLP: blockRlp, Block: blockJSON})
    }
    return results, nil
}
View on GitHub →


debug_getBlockRlp

GetBlockRlp retrieves the RLP encoded for of a single block.

Params (1)

Parameters must be given by position.

1: number uint64

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

Result

hexutil.Bytes

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of some bytes`
- pattern: `^0x([a-fA-F\d])+$`
- title: `dataWord`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of some bytes",
    "pattern": "^0x([a-fA-F\\d])+$",
    "title": "dataWord",
    "type": [
        "string"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_getBlockRlp", "params": [<number>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_getBlockRlp", "params": [<number>]}'
1
debug.getBlockRlp(number);
Source code

1
2
3
4
5
6
7
func (api *DebugAPI) GetBlockRlp(ctx context.Context, number uint64) (hexutil.Bytes, error) {
    block, _ := api.b.BlockByNumber(ctx, rpc.BlockNumber(number))
    if block == nil {
        return nil, fmt.Errorf("block #%d not found", number)
    }
    return rlp.EncodeToBytes(block)
}// GetBlockRlp retrieves the RLP encoded for of a single block.
View on GitHub →


debug_getHeaderRlp

GetHeaderRlp retrieves the RLP encoded for of a single header.

Params (1)

Parameters must be given by position.

1: number uint64

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

Result

hexutil.Bytes

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of some bytes`
- pattern: `^0x([a-fA-F\d])+$`
- title: `dataWord`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of some bytes",
    "pattern": "^0x([a-fA-F\\d])+$",
    "title": "dataWord",
    "type": [
        "string"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_getHeaderRlp", "params": [<number>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_getHeaderRlp", "params": [<number>]}'
1
debug.getHeaderRlp(number);
Source code

1
2
3
4
5
6
7
func (api *DebugAPI) GetHeaderRlp(ctx context.Context, number uint64) (hexutil.Bytes, error) {
    header, _ := api.b.HeaderByNumber(ctx, rpc.BlockNumber(number))
    if header == nil {
        return nil, fmt.Errorf("header #%d not found", number)
    }
    return rlp.EncodeToBytes(header)
}// GetHeaderRlp retrieves the RLP encoded for of a single header.
View on GitHub →


debug_getModifiedAccountsByHash

GetModifiedAccountsByHash returns all accounts that have changed between the two blocks specified. A change is defined as a difference in nonce, balance, code hash, or storage hash.

With one parameter, returns the list of accounts modified in the specified block.

Params (2)

Parameters must be given by position.

1: startHash common.Hash

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of a Keccak 256 hash`
- pattern: `^0x[a-fA-F\d]{64}$`
- title: `keccak`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of a Keccak 256 hash",
    "pattern": "^0x[a-fA-F\\d]{64}$",
    "title": "keccak",
    "type": [
        "string"
    ]
}

2: endHash *common.Hash

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of a Keccak 256 hash`
- pattern: `^0x[a-fA-F\d]{64}$`
- title: `keccak`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of a Keccak 256 hash",
    "pattern": "^0x[a-fA-F\\d]{64}$",
    "title": "keccak",
    "type": [
        "string"
    ]
}

Result

commonAddress []common.Address

  • Required: ✓ Yes
1
2
3
4
5
6
7
8
9
- items: 

        - description: `Hex representation of a Keccak 256 hash POINTER`
        - pattern: `^0x[a-fA-F\d]{64}$`
        - title: `keccak`
        - type: string


- type: array
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
{
    "items": [
        {
            "description": "Hex representation of a Keccak 256 hash POINTER",
            "pattern": "^0x[a-fA-F\\d]{64}$",
            "title": "keccak",
            "type": [
                "string"
            ]
        }
    ],
    "type": [
        "array"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_getModifiedAccountsByHash", "params": [<startHash>, <endHash>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_getModifiedAccountsByHash", "params": [<startHash>, <endHash>]}'
1
debug.getModifiedAccountsByHash(startHash,endHash);
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
func (api *DebugAPI) GetModifiedAccountsByHash(startHash common.Hash, endHash *common.Hash) ([ // GetModifiedAccountsByHash returns all accounts that have changed between the
// two blocks specified. A change is defined as a difference in nonce, balance,
// code hash, or storage hash.
//
// With one parameter, returns the list of accounts modified in the specified block.
]common.Address, error) {
    var startBlock, endBlock *types.Block
    startBlock = api.eth.blockchain.GetBlockByHash(startHash)
    if startBlock == nil {
        return nil, fmt.Errorf("start block %x not found", startHash)
    }
    if endHash == nil {
        endBlock = startBlock
        startBlock = api.eth.blockchain.GetBlockByHash(startBlock.ParentHash())
        if startBlock == nil {
            return nil, fmt.Errorf("block %x has no parent", endBlock.Number())
        }
    } else {
        endBlock = api.eth.blockchain.GetBlockByHash(*endHash)
        if endBlock == nil {
            return nil, fmt.Errorf("end block %x not found", *endHash)
        }
    }
    return api.getModifiedAccounts(startBlock, endBlock)
}
View on GitHub →


debug_getModifiedAccountsByNumber

GetModifiedAccountsByNumber returns all accounts that have changed between the two blocks specified. A change is defined as a difference in nonce, balance, code hash, or storage hash.

With one parameter, returns the list of accounts modified in the specified block.

Params (2)

Parameters must be given by position.

1: startNum uint64

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

2: endNum *uint64

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

Result

commonAddress []common.Address

  • Required: ✓ Yes
1
2
3
4
5
6
7
8
9
- items: 

        - description: `Hex representation of a Keccak 256 hash POINTER`
        - pattern: `^0x[a-fA-F\d]{64}$`
        - title: `keccak`
        - type: string


- type: array
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
{
    "items": [
        {
            "description": "Hex representation of a Keccak 256 hash POINTER",
            "pattern": "^0x[a-fA-F\\d]{64}$",
            "title": "keccak",
            "type": [
                "string"
            ]
        }
    ],
    "type": [
        "array"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_getModifiedAccountsByNumber", "params": [<startNum>, <endNum>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_getModifiedAccountsByNumber", "params": [<startNum>, <endNum>]}'
1
debug.getModifiedAccountsByNumber(startNum,endNum);
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
func (api *DebugAPI) GetModifiedAccountsByNumber(startNum uint64, endNum *uint64) ([ // GetModifiedAccountsByNumber returns all accounts that have changed between the
// two blocks specified. A change is defined as a difference in nonce, balance,
// code hash, or storage hash.
//
// With one parameter, returns the list of accounts modified in the specified block.
]common.Address, error) {
    var startBlock, endBlock *types.Block
    startBlock = api.eth.blockchain.GetBlockByNumber(startNum)
    if startBlock == nil {
        return nil, fmt.Errorf("start block %x not found", startNum)
    }
    if endNum == nil {
        endBlock = startBlock
        startBlock = api.eth.blockchain.GetBlockByHash(startBlock.ParentHash())
        if startBlock == nil {
            return nil, fmt.Errorf("block %x has no parent", endBlock.Number())
        }
    } else {
        endBlock = api.eth.blockchain.GetBlockByNumber(*endNum)
        if endBlock == nil {
            return nil, fmt.Errorf("end block %d not found", *endNum)
        }
    }
    return api.getModifiedAccounts(startBlock, endBlock)
}
View on GitHub →


debug_getRawReceipts

GetRawReceipts retrieves the binary-encoded raw receipts of a single block.

Params (1)

Parameters must be given by position.

1: blockNrOrHash rpc.BlockNumberOrHash

  • Required: ✓ Yes

Result

hexutilBytes []hexutil.Bytes

  • Required: ✓ Yes
1
2
3
4
5
6
7
8
9
- items: 

        - description: `Hex representation of some bytes`
        - pattern: `^0x([a-fA-F\d])+$`
        - title: `dataWord`
        - type: string


- type: array
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
{
    "items": [
        {
            "description": "Hex representation of some bytes",
            "pattern": "^0x([a-fA-F\\d])+$",
            "title": "dataWord",
            "type": [
                "string"
            ]
        }
    ],
    "type": [
        "array"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_getRawReceipts", "params": [<blockNrOrHash>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_getRawReceipts", "params": [<blockNrOrHash>]}'
1
debug.getRawReceipts(blockNrOrHash);
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
func (api *DebugAPI) GetRawReceipts(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) ([ // GetRawReceipts retrieves the binary-encoded raw receipts of a single block.
]hexutil.Bytes, error) {
    var hash common.Hash
    if h, ok := blockNrOrHash.Hash(); ok {
        hash = h
    } else {
        block, err := api.b.BlockByNumberOrHash(ctx, blockNrOrHash)
        if err != nil {
            return nil, err
        }
        hash = block.Hash()
    }
    receipts, err := api.b.GetReceipts(ctx, hash)
    if err != nil {
        return nil, err
    }
    result := make([]hexutil.Bytes, len(receipts))
    for i, receipt := range receipts {
        b, err := receipt.MarshalBinary()
        if err != nil {
            return nil, err
        }
        result[i] = b
    }
    return result, nil
}
View on GitHub →


debug_goTrace

GoTrace turns on tracing for nsec seconds and writes trace data to file.

Params (2)

Parameters must be given by position.

1: file string

  • Required: ✓ Yes

2: nsec uint

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

Result

None

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_goTrace", "params": [<file>, <nsec>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_goTrace", "params": [<file>, <nsec>]}'
1
debug.goTrace(file,nsec);
Source code

1
2
3
4
5
6
7
8
9
func (h *HandlerT) GoTrace(file string, nsec uint) error {
    if err := h.StartGoTrace(file); err != nil {
        return err
    }
    time.Sleep(time.Duration(nsec) * time.Second)
    h.StopGoTrace()
    return nil
}// GoTrace turns on tracing for nsec seconds and writes
// trace data to file.
View on GitHub →


debug_intermediateRoots

IntermediateRoots executes a block (bad- or canon- or side-), and returns a list of intermediate roots: the stateroot after each transaction.

Params (2)

Parameters must be given by position.

1: hash common.Hash

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of a Keccak 256 hash`
- pattern: `^0x[a-fA-F\d]{64}$`
- title: `keccak`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of a Keccak 256 hash",
    "pattern": "^0x[a-fA-F\\d]{64}$",
    "title": "keccak",
    "type": [
        "string"
    ]
}

2: config *TraceConfig

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
- additionalProperties: `false`
- properties: 
    - Debug: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - type: `boolean`

    - EnableMemory: 
        - type: `boolean`

    - EnableReturnData: 
        - type: `boolean`

    - Limit: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - NestedTraceOutput: 
        - type: `boolean`

    - Reexec: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - Timeout: 
        - type: `string`

    - Tracer: 
        - type: `string`

    - overrides: 
        - additionalProperties: `true`


- type: object
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
    "additionalProperties": false,
    "properties": {
        "Debug": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "type": "boolean"
        },
        "EnableMemory": {
            "type": "boolean"
        },
        "EnableReturnData": {
            "type": "boolean"
        },
        "Limit": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "NestedTraceOutput": {
            "type": "boolean"
        },
        "Reexec": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "Timeout": {
            "type": "string"
        },
        "Tracer": {
            "type": "string"
        },
        "overrides": {
            "additionalProperties": true
        }
    },
    "type": [
        "object"
    ]
}

Result

commonHash []common.Hash

  • Required: ✓ Yes
1
2
3
4
5
6
7
8
9
- items: 

        - description: `Hex representation of a Keccak 256 hash`
        - pattern: `^0x[a-fA-F\d]{64}$`
        - title: `keccak`
        - type: string


- type: array
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
{
    "items": [
        {
            "description": "Hex representation of a Keccak 256 hash",
            "pattern": "^0x[a-fA-F\\d]{64}$",
            "title": "keccak",
            "type": [
                "string"
            ]
        }
    ],
    "type": [
        "array"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_intermediateRoots", "params": [<hash>, <config>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_intermediateRoots", "params": [<hash>, <config>]}'
1
debug.intermediateRoots(hash,config);
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
func (api *API) IntermediateRoots(ctx context.Context, hash common.Hash, config *TraceConfig) ([ // IntermediateRoots executes a block (bad- or canon- or side-), and returns a list
// of intermediate roots: the stateroot after each transaction.
]common.Hash, error) {
    block, _ := api.blockByHash(ctx, hash)
    if block == nil {
        block = rawdb.ReadBadBlock(api.backend.ChainDb(), hash)
    }
    if block == nil {
        return nil, fmt.Errorf("block %#x not found", hash)
    }
    if block.NumberU64() == 0 {
        return nil, errors.New("genesis is not traceable")
    }
    parent, err := api.blockByNumberAndHash(ctx, rpc.BlockNumber(block.NumberU64()-1), block.ParentHash())
    if err != nil {
        return nil, err
    }
    reexec := defaultTraceReexec
    if config != nil && config.Reexec != nil {
        reexec = *config.Reexec
    }
    statedb, err := api.backend.StateAtBlock(ctx, parent, reexec, nil, true, false)
    if err != nil {
        return nil, err
    }
    var (
        roots           []common.Hash
        signer          = types.MakeSigner(api.backend.ChainConfig(), block.Number())
        chainConfig     = api.backend.ChainConfig()
        vmctx           = core.NewEVMBlockContext(block.Header(), api.chainContext(ctx), nil)
        deleteEmptyObjects  = api.backend.ChainConfig().IsEnabled(api.backend.ChainConfig().GetEIP161dTransition, block.Number())
    )
    for i, tx := range block.Transactions() {
        var (
            msg, _      = tx.AsMessage(signer, block.BaseFee())
            txContext   = core.NewEVMTxContext(msg)
            vmenv       = vm.NewEVM(vmctx, txContext, statedb, chainConfig, vm.Config{})
        )
        statedb.Prepare(tx.Hash(), i)
        if _, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(msg.Gas())); err != nil {
            log.Warn("Tracing intermediate roots did not complete", "txindex", i, "txhash", tx.Hash(), "err", err)
            return roots, nil
        }
        roots = append(roots, statedb.IntermediateRoot(deleteEmptyObjects))
    }
    return roots, nil
}
View on GitHub →


debug_memStats

MemStats returns detailed runtime memory statistics.

Params (0)

None

Result

*runtime.MemStats

  • Required: ✓ Yes
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
- additionalProperties: `false`
- properties: 
    - Alloc: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - BuckHashSys: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - BySize: 
        - items: 
            - additionalProperties: `false`
            - properties: 
                - Frees: 
                    - pattern: `^0x[a-fA-F0-9]+$`
                    - title: `integer`
                    - type: `string`

                - Mallocs: 
                    - pattern: `^0x[a-fA-F0-9]+$`
                    - title: `integer`
                    - type: `string`

                - Size: 
                    - pattern: `^0x[a-fA-F0-9]+$`
                    - title: `integer`
                    - type: `string`


            - type: `object`

        - maxItems: `61`
        - minItems: `61`
        - type: `array`

    - DebugGC: 
        - type: `boolean`

    - EnableGC: 
        - type: `boolean`

    - Frees: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - GCCPUFraction: 
        - type: `number`

    - GCSys: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - HeapAlloc: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - HeapIdle: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - HeapInuse: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - HeapObjects: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - HeapReleased: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - HeapSys: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - LastGC: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - Lookups: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - MCacheInuse: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - MCacheSys: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - MSpanInuse: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - MSpanSys: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - Mallocs: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - NextGC: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - NumForcedGC: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - NumGC: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - OtherSys: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - PauseEnd: 
        - items: 
            - description: `Hex representation of the integer`
            - pattern: `^0x[a-fA-F0-9]+$`
            - title: `integer`
            - type: `string`

        - maxItems: `256`
        - minItems: `256`
        - type: `array`

    - PauseNs: 
        - items: 
            - description: `Hex representation of the integer`
            - pattern: `^0x[a-fA-F0-9]+$`
            - title: `integer`
            - type: `string`

        - maxItems: `256`
        - minItems: `256`
        - type: `array`

    - PauseTotalNs: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - StackInuse: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - StackSys: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - Sys: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - TotalAlloc: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`


- type: object
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
{
    "additionalProperties": false,
    "properties": {
        "Alloc": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "BuckHashSys": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "BySize": {
            "items": {
                "additionalProperties": false,
                "properties": {
                    "Frees": {
                        "pattern": "^0x[a-fA-F0-9]+$",
                        "title": "integer",
                        "type": "string"
                    },
                    "Mallocs": {
                        "pattern": "^0x[a-fA-F0-9]+$",
                        "title": "integer",
                        "type": "string"
                    },
                    "Size": {
                        "pattern": "^0x[a-fA-F0-9]+$",
                        "title": "integer",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "maxItems": 61,
            "minItems": 61,
            "type": "array"
        },
        "DebugGC": {
            "type": "boolean"
        },
        "EnableGC": {
            "type": "boolean"
        },
        "Frees": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "GCCPUFraction": {
            "type": "number"
        },
        "GCSys": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "HeapAlloc": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "HeapIdle": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "HeapInuse": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "HeapObjects": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "HeapReleased": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "HeapSys": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "LastGC": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "Lookups": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "MCacheInuse": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "MCacheSys": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "MSpanInuse": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "MSpanSys": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "Mallocs": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "NextGC": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "NumForcedGC": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "NumGC": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "OtherSys": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "PauseEnd": {
            "items": {
                "description": "Hex representation of the integer",
                "pattern": "^0x[a-fA-F0-9]+$",
                "title": "integer",
                "type": "string"
            },
            "maxItems": 256,
            "minItems": 256,
            "type": "array"
        },
        "PauseNs": {
            "items": {
                "description": "Hex representation of the integer",
                "pattern": "^0x[a-fA-F0-9]+$",
                "title": "integer",
                "type": "string"
            },
            "maxItems": 256,
            "minItems": 256,
            "type": "array"
        },
        "PauseTotalNs": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "StackInuse": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "StackSys": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "Sys": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "TotalAlloc": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        }
    },
    "type": [
        "object"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_memStats", "params": []}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_memStats", "params": []}'
1
debug.memStats();
Source code

1
2
3
4
5
func (*HandlerT) MemStats() *runtime.MemStats {
    s := new(runtime.MemStats)
    runtime.ReadMemStats(s)
    return s
}// MemStats returns detailed runtime memory statistics.
View on GitHub →


debug_mutexProfile

MutexProfile turns on mutex profiling for nsec seconds and writes profile data to file. It uses a profile rate of 1 for most accurate information. If a different rate is desired, set the rate and write the profile manually.

Params (2)

Parameters must be given by position.

1: file string

  • Required: ✓ Yes

2: nsec uint

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

Result

None

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_mutexProfile", "params": [<file>, <nsec>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_mutexProfile", "params": [<file>, <nsec>]}'
1
debug.mutexProfile(file,nsec);
Source code

1
2
3
4
5
6
7
8
func (*HandlerT) MutexProfile(file string, nsec uint) error {
    runtime.SetMutexProfileFraction(1)
    time.Sleep(time.Duration(nsec) * time.Second)
    defer runtime.SetMutexProfileFraction(0)
    return writeProfile("mutex", file)
}// MutexProfile turns on mutex profiling for nsec seconds and writes profile data to file.
// It uses a profile rate of 1 for most accurate information. If a different rate is
// desired, set the rate and write the profile manually.
View on GitHub →


debug_preimage

Preimage is a debug API function that returns the preimage for a sha3 hash, if known.

Params (1)

Parameters must be given by position.

1: hash common.Hash

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of a Keccak 256 hash`
- pattern: `^0x[a-fA-F\d]{64}$`
- title: `keccak`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of a Keccak 256 hash",
    "pattern": "^0x[a-fA-F\\d]{64}$",
    "title": "keccak",
    "type": [
        "string"
    ]
}

Result

hexutil.Bytes

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of some bytes`
- pattern: `^0x([a-fA-F\d])+$`
- title: `dataWord`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of some bytes",
    "pattern": "^0x([a-fA-F\\d])+$",
    "title": "dataWord",
    "type": [
        "string"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_preimage", "params": [<hash>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_preimage", "params": [<hash>]}'
1
debug.preimage(hash);
Source code

1
2
3
4
5
6
func (api *DebugAPI) Preimage(ctx context.Context, hash common.Hash) (hexutil.Bytes, error) {
    if preimage := rawdb.ReadPreimage(api.eth.ChainDb(), hash); preimage != nil {
        return preimage, nil
    }
    return nil, errors.New("unknown preimage")
}// Preimage is a debug API function that returns the preimage for a sha3 hash, if known.
View on GitHub →


debug_printBlock

PrintBlock retrieves a block and returns its pretty printed form.

Params (1)

Parameters must be given by position.

1: number uint64

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

Result

string

  • Required: ✓ Yes

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_printBlock", "params": [<number>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_printBlock", "params": [<number>]}'
1
debug.printBlock(number);
Source code

1
2
3
4
5
6
7
func (api *DebugAPI) PrintBlock(ctx context.Context, number uint64) (string, error) {
    block, _ := api.b.BlockByNumber(ctx, rpc.BlockNumber(number))
    if block == nil {
        return "", fmt.Errorf("block #%d not found", number)
    }
    return spew.Sdump(block), nil
}// PrintBlock retrieves a block and returns its pretty printed form.
View on GitHub →


debug_removePendingTransaction

RemovePendingTransaction removes a transaction from the txpool. It returns the transaction removed, if any.

Params (1)

Parameters must be given by position.

1: hash common.Hash

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of a Keccak 256 hash`
- pattern: `^0x[a-fA-F\d]{64}$`
- title: `keccak`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of a Keccak 256 hash",
    "pattern": "^0x[a-fA-F\\d]{64}$",
    "title": "keccak",
    "type": [
        "string"
    ]
}

Result

*types.Transaction

  • Required: ✓ Yes
1
2
- additionalProperties: `false`
- type: object
1
2
3
4
5
6
{
    "additionalProperties": false,
    "type": [
        "object"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_removePendingTransaction", "params": [<hash>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_removePendingTransaction", "params": [<hash>]}'
1
debug.removePendingTransaction(hash);
Source code

1
2
3
4
func (api *DebugAPI) RemovePendingTransaction(hash common.Hash) (*types.Transaction, error) {
    return api.eth.txPool.RemoveTx(hash), nil
}// RemovePendingTransaction removes a transaction from the txpool.
// It returns the transaction removed, if any.
View on GitHub →


debug_seedHash

SeedHash retrieves the seed hash of a block.

Params (1)

Parameters must be given by position.

1: number uint64

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

Result

string

  • Required: ✓ Yes

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_seedHash", "params": [<number>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_seedHash", "params": [<number>]}'
1
debug.seedHash(number);
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
func (api *DebugAPI) SeedHash(ctx context.Context, number uint64) (string, error) {
    block, _ := api.b.BlockByNumber(ctx, rpc.BlockNumber(number))
    if block == nil {
        return "", fmt.Errorf("block #%d not found", number)
    }
    ecip1099FBlock := api.b.ChainConfig().GetEthashECIP1099Transition()
    epochLength := ethash.CalcEpochLength(number, ecip1099FBlock)
    epoch := ethash.CalcEpoch(number, epochLength)
    return fmt.Sprintf("0x%x", ethash.SeedHash(epoch, epochLength)), nil
}// SeedHash retrieves the seed hash of a block.
View on GitHub →


debug_setBlockProfileRate

SetBlockProfileRate sets the rate of goroutine block profile data collection. rate 0 disables block profiling.

Params (1)

Parameters must be given by position.

1: rate int

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

Result

None

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_setBlockProfileRate", "params": [<rate>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_setBlockProfileRate", "params": [<rate>]}'
1
debug.setBlockProfileRate(rate);
Source code

1
2
3
4
func (*HandlerT) SetBlockProfileRate(rate int) {
    runtime.SetBlockProfileRate(rate)
}// SetBlockProfileRate sets the rate of goroutine block profile data collection.
// rate 0 disables block profiling.
View on GitHub →


debug_setGCPercent

SetGCPercent sets the garbage collection target percentage. It returns the previous setting. A negative value disables GC.

Params (1)

Parameters must be given by position.

1: v int

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

Result

int

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_setGCPercent", "params": [<v>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_setGCPercent", "params": [<v>]}'
1
debug.setGCPercent(v);
Source code

1
2
3
4
func (*HandlerT) SetGCPercent(v int) int {
    return debug.SetGCPercent(v)
}// SetGCPercent sets the garbage collection target percentage. It returns the previous
// setting. A negative value disables GC.
View on GitHub →


debug_setHead

SetHead rewinds the head of the blockchain to a previous block.

Params (1)

Parameters must be given by position.

1: number hexutil.Uint64

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of a uint64`
- pattern: `^0x([a-fA-F\d])+$`
- title: `uint64`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of a uint64",
    "pattern": "^0x([a-fA-F\\d])+$",
    "title": "uint64",
    "type": [
        "string"
    ]
}

Result

None

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_setHead", "params": [<number>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_setHead", "params": [<number>]}'
1
debug.setHead(number);
Source code

1
2
3
func (api *DebugAPI) SetHead(number hexutil.Uint64) {
    api.b.SetHead(uint64(number))
}// SetHead rewinds the head of the blockchain to a previous block.
View on GitHub →


debug_setMutexProfileFraction

SetMutexProfileFraction sets the rate of mutex profiling.

Params (1)

Parameters must be given by position.

1: rate int

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

Result

None

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_setMutexProfileFraction", "params": [<rate>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_setMutexProfileFraction", "params": [<rate>]}'
1
debug.setMutexProfileFraction(rate);
Source code

1
2
3
func (*HandlerT) SetMutexProfileFraction(rate int) {
    runtime.SetMutexProfileFraction(rate)
}// SetMutexProfileFraction sets the rate of mutex profiling.
View on GitHub →


debug_stacks

Stacks returns a printed representation of the stacks of all goroutines. It also permits the following optional filters to be used: - filter: boolean expression of packages to filter for

Params (1)

Parameters must be given by position.

1: filter *string

  • Required: ✓ Yes

Result

string

  • Required: ✓ Yes

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_stacks", "params": [<filter>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_stacks", "params": [<filter>]}'
1
debug.stacks(filter);
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
func (*HandlerT) Stacks(filter *string) string {
    buf := new(bytes.Buffer)
    pprof.Lookup("goroutine").WriteTo(buf, 2)
    if filter != nil && len(*filter) > 0 {
        expanded := *filter
        expanded = regexp.MustCompile(`[:/\.A-Za-z0-9_-]+`).ReplaceAllString(expanded, "`$0` in Value")
        expanded = regexp.MustCompile("!(`[:/\\.A-Za-z0-9_-]+`)").ReplaceAllString(expanded, "$1 not")
        expanded = strings.ReplaceAll(expanded, "||", "or")
        expanded = strings.ReplaceAll(expanded, "&&", "and")
        log.Info("Expanded filter expression", "filter", *filter, "expanded", expanded)
        expr, err := bexpr.CreateEvaluator(expanded)
        if err != nil {
            log.Error("Failed to parse filter expression", "expanded", expanded, "err", err)
            return ""
        }
        dump := buf.String()
        buf.Reset()
        for _, trace := // Stacks returns a printed representation of the stacks of all goroutines. It
        // also permits the following optional filters to be used:
        //   - filter: boolean expression of packages to filter for
        range strings.Split(dump, "\n\n") {
            if ok, _ := expr.Evaluate(map[string]string{"Value": trace}); ok {
                buf.WriteString(trace)
                buf.WriteString("\n\n")
            }
        }
    }
    return buf.String()
}
View on GitHub →


debug_standardTraceBadBlockToFile

StandardTraceBadBlockToFile dumps the structured logs created during the execution of EVM against a block pulled from the pool of bad ones to the local file system and returns a list of files to the caller.

Params (2)

Parameters must be given by position.

1: hash common.Hash

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of a Keccak 256 hash`
- pattern: `^0x[a-fA-F\d]{64}$`
- title: `keccak`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of a Keccak 256 hash",
    "pattern": "^0x[a-fA-F\\d]{64}$",
    "title": "keccak",
    "type": [
        "string"
    ]
}

2: config *StdTraceConfig

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
- additionalProperties: `false`
- properties: 
    - Debug: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - type: `boolean`

    - EnableMemory: 
        - type: `boolean`

    - EnableReturnData: 
        - type: `boolean`

    - Limit: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - Reexec: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - TxHash: 
        - pattern: `^0x[a-fA-F\d]{64}$`
        - title: `keccak`
        - type: `string`

    - overrides: 
        - additionalProperties: `true`


- type: object
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
    "additionalProperties": false,
    "properties": {
        "Debug": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "type": "boolean"
        },
        "EnableMemory": {
            "type": "boolean"
        },
        "EnableReturnData": {
            "type": "boolean"
        },
        "Limit": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "Reexec": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "TxHash": {
            "pattern": "^0x[a-fA-F\\d]{64}$",
            "title": "keccak",
            "type": "string"
        },
        "overrides": {
            "additionalProperties": true
        }
    },
    "type": [
        "object"
    ]
}

Result

string []string

  • Required: ✓ Yes
1
2
3
4
5
6
- items: 

        - type: string


- type: array
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
    "items": [
        {
            "type": [
                "string"
            ]
        }
    ],
    "type": [
        "array"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_standardTraceBadBlockToFile", "params": [<hash>, <config>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_standardTraceBadBlockToFile", "params": [<hash>, <config>]}'
1
debug.standardTraceBadBlockToFile(hash,config);
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
func (api *API) StandardTraceBadBlockToFile(ctx context.Context, hash common.Hash, config *StdTraceConfig) ([ // StandardTraceBadBlockToFile dumps the structured logs created during the
// execution of EVM against a block pulled from the pool of bad ones to the
// local file system and returns a list of files to the caller.
]string, error) {
    block := rawdb.ReadBadBlock(api.backend.ChainDb(), hash)
    if block == nil {
        return nil, fmt.Errorf("bad block %#x not found", hash)
    }
    return api.standardTraceBlockToFile(ctx, block, config)
}
View on GitHub →


debug_standardTraceBlockToFile

StandardTraceBlockToFile dumps the structured logs created during the execution of EVM to the local file system and returns a list of files to the caller.

Params (2)

Parameters must be given by position.

1: hash common.Hash

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of a Keccak 256 hash`
- pattern: `^0x[a-fA-F\d]{64}$`
- title: `keccak`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of a Keccak 256 hash",
    "pattern": "^0x[a-fA-F\\d]{64}$",
    "title": "keccak",
    "type": [
        "string"
    ]
}

2: config *StdTraceConfig

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
- additionalProperties: `false`
- properties: 
    - Debug: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - type: `boolean`

    - EnableMemory: 
        - type: `boolean`

    - EnableReturnData: 
        - type: `boolean`

    - Limit: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - Reexec: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - TxHash: 
        - pattern: `^0x[a-fA-F\d]{64}$`
        - title: `keccak`
        - type: `string`

    - overrides: 
        - additionalProperties: `true`


- type: object
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
    "additionalProperties": false,
    "properties": {
        "Debug": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "type": "boolean"
        },
        "EnableMemory": {
            "type": "boolean"
        },
        "EnableReturnData": {
            "type": "boolean"
        },
        "Limit": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "Reexec": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "TxHash": {
            "pattern": "^0x[a-fA-F\\d]{64}$",
            "title": "keccak",
            "type": "string"
        },
        "overrides": {
            "additionalProperties": true
        }
    },
    "type": [
        "object"
    ]
}

Result

string []string

  • Required: ✓ Yes
1
2
3
4
5
6
- items: 

        - type: string


- type: array
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
    "items": [
        {
            "type": [
                "string"
            ]
        }
    ],
    "type": [
        "array"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_standardTraceBlockToFile", "params": [<hash>, <config>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_standardTraceBlockToFile", "params": [<hash>, <config>]}'
1
debug.standardTraceBlockToFile(hash,config);
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
func (api *API) StandardTraceBlockToFile(ctx context.Context, hash common.Hash, config *StdTraceConfig) ([ // StandardTraceBlockToFile dumps the structured logs created during the
// execution of EVM to the local file system and returns a list of files
// to the caller.
]string, error) {
    block, err := api.blockByHash(ctx, hash)
    if err != nil {
        return nil, err
    }
    return api.standardTraceBlockToFile(ctx, block, config)
}
View on GitHub →


debug_startCPUProfile

StartCPUProfile turns on CPU profiling, writing to the given file.

Params (1)

Parameters must be given by position.

1: file string

  • Required: ✓ Yes

Result

None

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_startCPUProfile", "params": [<file>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_startCPUProfile", "params": [<file>]}'
1
debug.startCPUProfile(file);
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
func (h *HandlerT) StartCPUProfile(file string) error {
    h.mu.Lock()
    defer h.mu.Unlock()
    if h.cpuW != nil {
        return errors.New("CPU profiling already in progress")
    }
    f, err := os.Create(expandHome(file))
    if err != nil {
        return err
    }
    if err := pprof.StartCPUProfile(f); err != nil {
        f.Close()
        return err
    }
    h.cpuW = f
    h.cpuFile = file
    log.Info("CPU profiling started", "dump", h.cpuFile)
    return nil
}// StartCPUProfile turns on CPU profiling, writing to the given file.
View on GitHub →


debug_startGoTrace

StartGoTrace turns on tracing, writing to the given file.

Params (1)

Parameters must be given by position.

1: file string

  • Required: ✓ Yes

Result

None

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_startGoTrace", "params": [<file>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_startGoTrace", "params": [<file>]}'
1
debug.startGoTrace(file);
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
func (h *HandlerT) StartGoTrace(file string) error {
    h.mu.Lock()
    defer h.mu.Unlock()
    if h.traceW != nil {
        return errors.New("trace already in progress")
    }
    f, err := os.Create(expandHome(file))
    if err != nil {
        return err
    }
    if err := trace.Start(f); err != nil {
        f.Close()
        return err
    }
    h.traceW = f
    h.traceFile = file
    log.Info("Go tracing started", "dump", h.traceFile)
    return nil
}// StartGoTrace turns on tracing, writing to the given file.
View on GitHub →


debug_stopCPUProfile

StopCPUProfile stops an ongoing CPU profile.

Params (0)

None

Result

None

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_stopCPUProfile", "params": []}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_stopCPUProfile", "params": []}'
1
debug.stopCPUProfile();
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
func (h *HandlerT) StopCPUProfile() error {
    h.mu.Lock()
    defer h.mu.Unlock()
    pprof.StopCPUProfile()
    if h.cpuW == nil {
        return errors.New("CPU profiling not in progress")
    }
    log.Info("Done writing CPU profile", "dump", h.cpuFile)
    h.cpuW.Close()
    h.cpuW = nil
    h.cpuFile = ""
    return nil
}// StopCPUProfile stops an ongoing CPU profile.
View on GitHub →


debug_stopGoTrace

StopTrace stops an ongoing trace.

Params (0)

None

Result

None

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_stopGoTrace", "params": []}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_stopGoTrace", "params": []}'
1
debug.stopGoTrace();
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
func (h *HandlerT) StopGoTrace() error {
    h.mu.Lock()
    defer h.mu.Unlock()
    trace.Stop()
    if h.traceW == nil {
        return errors.New("trace not in progress")
    }
    log.Info("Done writing Go trace", "dump", h.traceFile)
    h.traceW.Close()
    h.traceW = nil
    h.traceFile = ""
    return nil
}// StopTrace stops an ongoing trace.
View on GitHub →


debug_storageRangeAt

StorageRangeAt returns the storage at the given block height and transaction index.

Params (5)

Parameters must be given by position.

1: blockHash common.Hash

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of a Keccak 256 hash`
- pattern: `^0x[a-fA-F\d]{64}$`
- title: `keccak`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of a Keccak 256 hash",
    "pattern": "^0x[a-fA-F\\d]{64}$",
    "title": "keccak",
    "type": [
        "string"
    ]
}

2: txIndex int

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

3: contractAddress common.Address

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of a Keccak 256 hash POINTER`
- pattern: `^0x[a-fA-F\d]{64}$`
- title: `keccak`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of a Keccak 256 hash POINTER",
    "pattern": "^0x[a-fA-F\\d]{64}$",
    "title": "keccak",
    "type": [
        "string"
    ]
}

4: keyStart hexutil.Bytes

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of some bytes`
- pattern: `^0x([a-fA-F\d])+$`
- title: `dataWord`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of some bytes",
    "pattern": "^0x([a-fA-F\\d])+$",
    "title": "dataWord",
    "type": [
        "string"
    ]
}

5: maxResult int

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

Result

StorageRangeResult

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
- additionalProperties: `false`
- properties: 
    - nextKey: 
        - pattern: `^0x[a-fA-F\d]{64}$`
        - title: `keccak`
        - type: `string`

    - storage: 
        - patternProperties: 
            - .*: 
                - additionalProperties: `false`
                - properties: 
                    - key: 
                        - pattern: `^0x[a-fA-F\d]{64}$`
                        - title: `keccak`
                        - type: `string`

                    - value: 
                        - pattern: `^0x[a-fA-F\d]{64}$`
                        - title: `keccak`
                        - type: `string`


                - type: `object`


        - type: `object`


- type: object
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
    "additionalProperties": false,
    "properties": {
        "nextKey": {
            "pattern": "^0x[a-fA-F\\d]{64}$",
            "title": "keccak",
            "type": "string"
        },
        "storage": {
            "patternProperties": {
                ".*": {
                    "additionalProperties": false,
                    "properties": {
                        "key": {
                            "pattern": "^0x[a-fA-F\\d]{64}$",
                            "title": "keccak",
                            "type": "string"
                        },
                        "value": {
                            "pattern": "^0x[a-fA-F\\d]{64}$",
                            "title": "keccak",
                            "type": "string"
                        }
                    },
                    "type": "object"
                }
            },
            "type": "object"
        }
    },
    "type": [
        "object"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_storageRangeAt", "params": [<blockHash>, <txIndex>, <contractAddress>, <keyStart>, <maxResult>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_storageRangeAt", "params": [<blockHash>, <txIndex>, <contractAddress>, <keyStart>, <maxResult>]}'
1
debug.storageRangeAt(blockHash,txIndex,contractAddress,keyStart,maxResult);
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
func (api *DebugAPI) StorageRangeAt(blockHash common.Hash, txIndex int, contractAddress common.Address, keyStart hexutil.Bytes, maxResult int) (StorageRangeResult, error) {
    block := api.eth.blockchain.GetBlockByHash(blockHash)
    if block == nil {
        return StorageRangeResult{}, fmt.Errorf("block %#x not found", blockHash)
    }
    _, _, statedb, err := api.eth.stateAtTransaction(block, txIndex, 0)
    if err != nil {
        return StorageRangeResult{}, err
    }
    st := statedb.StorageTrie(contractAddress)
    if st == nil {
        return StorageRangeResult{}, fmt.Errorf("account %x doesn't exist", contractAddress)
    }
    return storageRangeAt(st, keyStart, maxResult)
}// StorageRangeAt returns the storage at the given block height and transaction index.
View on GitHub →


debug_subscribe

Subscribe creates a subscription to an event channel. Subscriptions are not available over HTTP; they are only available over WS, IPC, and Process connections.

Params (2)

Parameters must be given by position.

1: subscriptionName RPCDebugSubscriptionParamsName

  • Required: ✓ Yes
1
2
3
4
5
6
7
8
- oneOf: 

        - description: `Returns transaction traces within a range of blocks.`
        - enum: traceChain
        - type: string


- title: `subscriptionName`
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
    "oneOf": [
        {
            "description": "Returns transaction traces within a range of blocks.",
            "enum": [
                "traceChain"
            ],
            "type": [
                "string"
            ]
        }
    ],
    "title": "subscriptionName"
}

2: subscriptionOptions interface{}

  • Required: No

Result

subscriptionID rpc.ID

  • Required: ✓ Yes
1
2
3
- description: `Subscription identifier`
- title: `subscriptionID`
- type: string
1
2
3
4
5
6
7
{
    "description": "Subscription identifier",
    "title": "subscriptionID",
    "type": [
        "string"
    ]
}

Client Method Invocation Examples

1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_subscribe", "params": [<subscriptionName>, <subscriptionOptions>]}'
Source code

1
2
3
4
func (sub *RPCDebugSubscription) Subscribe(subscriptionName RPCDebugSubscriptionParamsName, subscriptionOptions interface{}) (subscriptionID rpc.ID, err error) {
    return
}// Subscribe creates a subscription to an event channel.
// Subscriptions are not available over HTTP; they are only available over WS, IPC, and Process connections.
View on GitHub →


debug_traceBadBlock

TraceBadBlock returns the structured logs created during the execution of EVM against a block pulled from the pool of bad ones and returns them as a JSON object.

Params (2)

Parameters must be given by position.

1: hash common.Hash

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of a Keccak 256 hash`
- pattern: `^0x[a-fA-F\d]{64}$`
- title: `keccak`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of a Keccak 256 hash",
    "pattern": "^0x[a-fA-F\\d]{64}$",
    "title": "keccak",
    "type": [
        "string"
    ]
}

2: config *TraceConfig

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
- additionalProperties: `false`
- properties: 
    - Debug: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - type: `boolean`

    - EnableMemory: 
        - type: `boolean`

    - EnableReturnData: 
        - type: `boolean`

    - Limit: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - NestedTraceOutput: 
        - type: `boolean`

    - Reexec: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - Timeout: 
        - type: `string`

    - Tracer: 
        - type: `string`

    - overrides: 
        - additionalProperties: `true`


- type: object
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
    "additionalProperties": false,
    "properties": {
        "Debug": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "type": "boolean"
        },
        "EnableMemory": {
            "type": "boolean"
        },
        "EnableReturnData": {
            "type": "boolean"
        },
        "Limit": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "NestedTraceOutput": {
            "type": "boolean"
        },
        "Reexec": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "Timeout": {
            "type": "string"
        },
        "Tracer": {
            "type": "string"
        },
        "overrides": {
            "additionalProperties": true
        }
    },
    "type": [
        "object"
    ]
}

Result

txTraceResult []*txTraceResult

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
- items: 

        - additionalProperties: `false`
        - properties: 
            - error: 
                - type: `string`

            - result: 
                - additionalProperties: `true`


        - type: object


- type: array
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
{
    "items": [
        {
            "additionalProperties": false,
            "properties": {
                "error": {
                    "type": "string"
                },
                "result": {
                    "additionalProperties": true
                }
            },
            "type": [
                "object"
            ]
        }
    ],
    "type": [
        "array"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_traceBadBlock", "params": [<hash>, <config>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_traceBadBlock", "params": [<hash>, <config>]}'
1
debug.traceBadBlock(hash,config);
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
func (api *API) TraceBadBlock(ctx context.Context, hash common.Hash, config *TraceConfig) ([ // TraceBadBlock returns the structured logs created during the execution of
// EVM against a block pulled from the pool of bad ones and returns them as a JSON
// object.
]*txTraceResult, error) {
    block := rawdb.ReadBadBlock(api.backend.ChainDb(), hash)
    if block == nil {
        return nil, fmt.Errorf("bad block %#x not found", hash)
    }
    return api.traceBlock(ctx, block, config)
}
View on GitHub →


debug_traceBlock

TraceBlock returns the structured logs created during the execution of EVM and returns them as a JSON object.

Params (2)

Parameters must be given by position.

1: blob hexutil.Bytes

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of some bytes`
- pattern: `^0x([a-fA-F\d])+$`
- title: `dataWord`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of some bytes",
    "pattern": "^0x([a-fA-F\\d])+$",
    "title": "dataWord",
    "type": [
        "string"
    ]
}

2: config *TraceConfig

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
- additionalProperties: `false`
- properties: 
    - Debug: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - type: `boolean`

    - EnableMemory: 
        - type: `boolean`

    - EnableReturnData: 
        - type: `boolean`

    - Limit: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - NestedTraceOutput: 
        - type: `boolean`

    - Reexec: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - Timeout: 
        - type: `string`

    - Tracer: 
        - type: `string`

    - overrides: 
        - additionalProperties: `true`


- type: object
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
    "additionalProperties": false,
    "properties": {
        "Debug": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "type": "boolean"
        },
        "EnableMemory": {
            "type": "boolean"
        },
        "EnableReturnData": {
            "type": "boolean"
        },
        "Limit": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "NestedTraceOutput": {
            "type": "boolean"
        },
        "Reexec": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "Timeout": {
            "type": "string"
        },
        "Tracer": {
            "type": "string"
        },
        "overrides": {
            "additionalProperties": true
        }
    },
    "type": [
        "object"
    ]
}

Result

txTraceResult []*txTraceResult

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
- items: 

        - additionalProperties: `false`
        - properties: 
            - error: 
                - type: `string`

            - result: 
                - additionalProperties: `true`


        - type: object


- type: array
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
{
    "items": [
        {
            "additionalProperties": false,
            "properties": {
                "error": {
                    "type": "string"
                },
                "result": {
                    "additionalProperties": true
                }
            },
            "type": [
                "object"
            ]
        }
    ],
    "type": [
        "array"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_traceBlock", "params": [<blob>, <config>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_traceBlock", "params": [<blob>, <config>]}'
1
debug.traceBlock(blob,config);
Source code

1
2
3
4
5
6
7
8
9
func (api *API) TraceBlock(ctx context.Context, blob hexutil.Bytes, config *TraceConfig) ([ // TraceBlock returns the structured logs created during the execution of EVM
// and returns them as a JSON object.
]*txTraceResult, error) {
    block := new(types.Block)
    if err := rlp.Decode(bytes.NewReader(blob), block); err != nil {
        return nil, fmt.Errorf("could not decode block: %v", err)
    }
    return api.traceBlock(ctx, block, config)
}
View on GitHub →


debug_traceBlockByHash

TraceBlockByHash returns the structured logs created during the execution of EVM and returns them as a JSON object.

Params (2)

Parameters must be given by position.

1: hash common.Hash

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of a Keccak 256 hash`
- pattern: `^0x[a-fA-F\d]{64}$`
- title: `keccak`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of a Keccak 256 hash",
    "pattern": "^0x[a-fA-F\\d]{64}$",
    "title": "keccak",
    "type": [
        "string"
    ]
}

2: config *TraceConfig

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
- additionalProperties: `false`
- properties: 
    - Debug: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - type: `boolean`

    - EnableMemory: 
        - type: `boolean`

    - EnableReturnData: 
        - type: `boolean`

    - Limit: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - NestedTraceOutput: 
        - type: `boolean`

    - Reexec: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - Timeout: 
        - type: `string`

    - Tracer: 
        - type: `string`

    - overrides: 
        - additionalProperties: `true`


- type: object
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
    "additionalProperties": false,
    "properties": {
        "Debug": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "type": "boolean"
        },
        "EnableMemory": {
            "type": "boolean"
        },
        "EnableReturnData": {
            "type": "boolean"
        },
        "Limit": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "NestedTraceOutput": {
            "type": "boolean"
        },
        "Reexec": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "Timeout": {
            "type": "string"
        },
        "Tracer": {
            "type": "string"
        },
        "overrides": {
            "additionalProperties": true
        }
    },
    "type": [
        "object"
    ]
}

Result

txTraceResult []*txTraceResult

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
- items: 

        - additionalProperties: `false`
        - properties: 
            - error: 
                - type: `string`

            - result: 
                - additionalProperties: `true`


        - type: object


- type: array
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
{
    "items": [
        {
            "additionalProperties": false,
            "properties": {
                "error": {
                    "type": "string"
                },
                "result": {
                    "additionalProperties": true
                }
            },
            "type": [
                "object"
            ]
        }
    ],
    "type": [
        "array"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_traceBlockByHash", "params": [<hash>, <config>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_traceBlockByHash", "params": [<hash>, <config>]}'
1
debug.traceBlockByHash(hash,config);
Source code

1
2
3
4
5
6
7
8
9
func (api *API) TraceBlockByHash(ctx context.Context, hash common.Hash, config *TraceConfig) ([ // TraceBlockByHash returns the structured logs created during the execution of
// EVM and returns them as a JSON object.
]*txTraceResult, error) {
    block, err := api.blockByHash(ctx, hash)
    if err != nil {
        return nil, err
    }
    return api.traceBlock(ctx, block, config)
}
View on GitHub →


debug_traceBlockByNumber

TraceBlockByNumber returns the structured logs created during the execution of EVM and returns them as a JSON object.

Params (2)

Parameters must be given by position.

1: number rpc.BlockNumber

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
- oneOf: 

        - description: `The block height description`
        - enum: earliest, latest, pending
        - title: `blockNumberTag`
        - type: string


        - description: `Hex representation of a uint64`
        - pattern: `^0x([a-fA-F\d])+$`
        - title: `uint64`
        - type: string


- title: `blockNumberIdentifier`
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
    "oneOf": [
        {
            "description": "The block height description",
            "enum": [
                "earliest",
                "latest",
                "pending"
            ],
            "title": "blockNumberTag",
            "type": [
                "string"
            ]
        },
        {
            "description": "Hex representation of a uint64",
            "pattern": "^0x([a-fA-F\\d])+$",
            "title": "uint64",
            "type": [
                "string"
            ]
        }
    ],
    "title": "blockNumberIdentifier"
}

2: config *TraceConfig

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
- additionalProperties: `false`
- properties: 
    - Debug: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - type: `boolean`

    - EnableMemory: 
        - type: `boolean`

    - EnableReturnData: 
        - type: `boolean`

    - Limit: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - NestedTraceOutput: 
        - type: `boolean`

    - Reexec: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - Timeout: 
        - type: `string`

    - Tracer: 
        - type: `string`

    - overrides: 
        - additionalProperties: `true`


- type: object
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
    "additionalProperties": false,
    "properties": {
        "Debug": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "type": "boolean"
        },
        "EnableMemory": {
            "type": "boolean"
        },
        "EnableReturnData": {
            "type": "boolean"
        },
        "Limit": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "NestedTraceOutput": {
            "type": "boolean"
        },
        "Reexec": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "Timeout": {
            "type": "string"
        },
        "Tracer": {
            "type": "string"
        },
        "overrides": {
            "additionalProperties": true
        }
    },
    "type": [
        "object"
    ]
}

Result

txTraceResult []*txTraceResult

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
- items: 

        - additionalProperties: `false`
        - properties: 
            - error: 
                - type: `string`

            - result: 
                - additionalProperties: `true`


        - type: object


- type: array
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
{
    "items": [
        {
            "additionalProperties": false,
            "properties": {
                "error": {
                    "type": "string"
                },
                "result": {
                    "additionalProperties": true
                }
            },
            "type": [
                "object"
            ]
        }
    ],
    "type": [
        "array"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_traceBlockByNumber", "params": [<number>, <config>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_traceBlockByNumber", "params": [<number>, <config>]}'
1
debug.traceBlockByNumber(number,config);
Source code

1
2
3
4
5
6
7
8
9
func (api *API) TraceBlockByNumber(ctx context.Context, number rpc.BlockNumber, config *TraceConfig) ([ // TraceBlockByNumber returns the structured logs created during the execution of
// EVM and returns them as a JSON object.
]*txTraceResult, error) {
    block, err := api.blockByNumber(ctx, number)
    if err != nil {
        return nil, err
    }
    return api.traceBlock(ctx, block, config)
}
View on GitHub →


debug_traceBlockFromFile

TraceBlockFromFile returns the structured logs created during the execution of EVM and returns them as a JSON object.

Params (2)

Parameters must be given by position.

1: file string

  • Required: ✓ Yes

2: config *TraceConfig

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
- additionalProperties: `false`
- properties: 
    - Debug: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - type: `boolean`

    - EnableMemory: 
        - type: `boolean`

    - EnableReturnData: 
        - type: `boolean`

    - Limit: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - NestedTraceOutput: 
        - type: `boolean`

    - Reexec: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - Timeout: 
        - type: `string`

    - Tracer: 
        - type: `string`

    - overrides: 
        - additionalProperties: `true`


- type: object
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
    "additionalProperties": false,
    "properties": {
        "Debug": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "type": "boolean"
        },
        "EnableMemory": {
            "type": "boolean"
        },
        "EnableReturnData": {
            "type": "boolean"
        },
        "Limit": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "NestedTraceOutput": {
            "type": "boolean"
        },
        "Reexec": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "Timeout": {
            "type": "string"
        },
        "Tracer": {
            "type": "string"
        },
        "overrides": {
            "additionalProperties": true
        }
    },
    "type": [
        "object"
    ]
}

Result

txTraceResult []*txTraceResult

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
- items: 

        - additionalProperties: `false`
        - properties: 
            - error: 
                - type: `string`

            - result: 
                - additionalProperties: `true`


        - type: object


- type: array
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
{
    "items": [
        {
            "additionalProperties": false,
            "properties": {
                "error": {
                    "type": "string"
                },
                "result": {
                    "additionalProperties": true
                }
            },
            "type": [
                "object"
            ]
        }
    ],
    "type": [
        "array"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_traceBlockFromFile", "params": [<file>, <config>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_traceBlockFromFile", "params": [<file>, <config>]}'
1
debug.traceBlockFromFile(file,config);
Source code

1
2
3
4
5
6
7
8
9
func (api *API) TraceBlockFromFile(ctx context.Context, file string, config *TraceConfig) ([ // TraceBlockFromFile returns the structured logs created during the execution of
// EVM and returns them as a JSON object.
]*txTraceResult, error) {
    blob, err := os.ReadFile(file)
    if err != nil {
        return nil, fmt.Errorf("could not read file: %v", err)
    }
    return api.TraceBlock(ctx, blob, config)
}
View on GitHub →


debug_traceCall

TraceCall lets you trace a given eth_call. It collects the structured logs created during the execution of EVM if the given transaction was added on top of the provided block and returns them as a JSON object.

Params (3)

Parameters must be given by position.

1: args ethapi.TransactionArgs

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
- additionalProperties: `false`
- properties: 
    - accessList: 
        - items: 
            - additionalProperties: `false`
            - properties: 
                - address: 
                    - pattern: `^0x[a-fA-F\d]{64}$`
                    - title: `keccak`
                    - type: `string`

                - storageKeys: 
                    - items: 
                        - description: `Hex representation of a Keccak 256 hash`
                        - pattern: `^0x[a-fA-F\d]{64}$`
                        - title: `keccak`
                        - type: `string`

                    - type: `array`


            - type: `object`

        - type: `array`

    - chainId: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - data: 
        - pattern: `^0x([a-fA-F\d])+$`
        - title: `dataWord`
        - type: `string`

    - from: 
        - pattern: `^0x[a-fA-F\d]{64}$`
        - title: `keccak`
        - type: `string`

    - gas: 
        - pattern: `^0x([a-fA-F\d])+$`
        - title: `uint64`
        - type: `string`

    - gasPrice: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - input: 
        - pattern: `^0x([a-fA-F\d])+$`
        - title: `dataWord`
        - type: `string`

    - maxFeePerGas: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - maxPriorityFeePerGas: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - nonce: 
        - pattern: `^0x([a-fA-F\d])+$`
        - title: `uint64`
        - type: `string`

    - to: 
        - pattern: `^0x[a-fA-F\d]{64}$`
        - title: `keccak`
        - type: `string`

    - value: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`


- type: object
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{
    "additionalProperties": false,
    "properties": {
        "accessList": {
            "items": {
                "additionalProperties": false,
                "properties": {
                    "address": {
                        "pattern": "^0x[a-fA-F\\d]{64}$",
                        "title": "keccak",
                        "type": "string"
                    },
                    "storageKeys": {
                        "items": {
                            "description": "Hex representation of a Keccak 256 hash",
                            "pattern": "^0x[a-fA-F\\d]{64}$",
                            "title": "keccak",
                            "type": "string"
                        },
                        "type": "array"
                    }
                },
                "type": "object"
            },
            "type": "array"
        },
        "chainId": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "data": {
            "pattern": "^0x([a-fA-F\\d])+$",
            "title": "dataWord",
            "type": "string"
        },
        "from": {
            "pattern": "^0x[a-fA-F\\d]{64}$",
            "title": "keccak",
            "type": "string"
        },
        "gas": {
            "pattern": "^0x([a-fA-F\\d])+$",
            "title": "uint64",
            "type": "string"
        },
        "gasPrice": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "input": {
            "pattern": "^0x([a-fA-F\\d])+$",
            "title": "dataWord",
            "type": "string"
        },
        "maxFeePerGas": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "maxPriorityFeePerGas": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "nonce": {
            "pattern": "^0x([a-fA-F\\d])+$",
            "title": "uint64",
            "type": "string"
        },
        "to": {
            "pattern": "^0x[a-fA-F\\d]{64}$",
            "title": "keccak",
            "type": "string"
        },
        "value": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        }
    },
    "type": [
        "object"
    ]
}

2: blockNrOrHash rpc.BlockNumberOrHash

  • Required: ✓ Yes

3: config *TraceCallConfig

  • Required: ✓ Yes
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
- additionalProperties: `false`
- properties: 
    - BlockOverrides: 
        - additionalProperties: `false`
        - properties: 
            - Coinbase: 
                - pattern: `^0x[a-fA-F\d]{64}$`
                - title: `keccak`
                - type: `string`

            - Difficulty: 
                - pattern: `^0x[a-fA-F0-9]+$`
                - title: `integer`
                - type: `string`

            - GasLimit: 
                - pattern: `^0x([a-fA-F\d])+$`
                - title: `uint64`
                - type: `string`

            - Number: 
                - pattern: `^0x[a-fA-F0-9]+$`
                - title: `integer`
                - type: `string`

            - Random: 
                - pattern: `^0x[a-fA-F\d]{64}$`
                - title: `keccak`
                - type: `string`

            - Time: 
                - pattern: `^0x[a-fA-F0-9]+$`
                - title: `integer`
                - type: `string`


        - type: `object`

    - Debug: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - type: `boolean`

    - EnableMemory: 
        - type: `boolean`

    - EnableReturnData: 
        - type: `boolean`

    - Limit: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - NestedTraceOutput: 
        - type: `boolean`

    - Reexec: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - StateOverrides: 
        - patternProperties: 
            - .*: 
                - additionalProperties: `false`
                - properties: 
                    - balance: 
                        - pattern: `^0x[a-fA-F0-9]+$`
                        - title: `integer`
                        - type: `string`

                    - code: 
                        - pattern: `^0x([a-fA-F\d])+$`
                        - title: `dataWord`
                        - type: `string`

                    - nonce: 
                        - pattern: `^0x([a-fA-F\d])+$`
                        - title: `uint64`
                        - type: `string`

                    - state: 
                        - patternProperties: 
                            - .*: 
                                - description: `Hex representation of a Keccak 256 hash`
                                - pattern: `^0x[a-fA-F\d]{64}$`
                                - title: `keccak`
                                - type: `string`


                        - type: `object`

                    - stateDiff: 
                        - patternProperties: 
                            - .*: 
                                - description: `Hex representation of a Keccak 256 hash`
                                - pattern: `^0x[a-fA-F\d]{64}$`
                                - title: `keccak`
                                - type: `string`


                        - type: `object`


                - type: `object`


        - type: `object`

    - Timeout: 
        - type: `string`

    - Tracer: 
        - type: `string`

    - overrides: 
        - additionalProperties: `true`


- type: object
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
{
    "additionalProperties": false,
    "properties": {
        "BlockOverrides": {
            "additionalProperties": false,
            "properties": {
                "Coinbase": {
                    "pattern": "^0x[a-fA-F\\d]{64}$",
                    "title": "keccak",
                    "type": "string"
                },
                "Difficulty": {
                    "pattern": "^0x[a-fA-F0-9]+$",
                    "title": "integer",
                    "type": "string"
                },
                "GasLimit": {
                    "pattern": "^0x([a-fA-F\\d])+$",
                    "title": "uint64",
                    "type": "string"
                },
                "Number": {
                    "pattern": "^0x[a-fA-F0-9]+$",
                    "title": "integer",
                    "type": "string"
                },
                "Random": {
                    "pattern": "^0x[a-fA-F\\d]{64}$",
                    "title": "keccak",
                    "type": "string"
                },
                "Time": {
                    "pattern": "^0x[a-fA-F0-9]+$",
                    "title": "integer",
                    "type": "string"
                }
            },
            "type": "object"
        },
        "Debug": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "type": "boolean"
        },
        "EnableMemory": {
            "type": "boolean"
        },
        "EnableReturnData": {
            "type": "boolean"
        },
        "Limit": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "NestedTraceOutput": {
            "type": "boolean"
        },
        "Reexec": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "StateOverrides": {
            "patternProperties": {
                ".*": {
                    "additionalProperties": false,
                    "properties": {
                        "balance": {
                            "pattern": "^0x[a-fA-F0-9]+$",
                            "title": "integer",
                            "type": "string"
                        },
                        "code": {
                            "pattern": "^0x([a-fA-F\\d])+$",
                            "title": "dataWord",
                            "type": "string"
                        },
                        "nonce": {
                            "pattern": "^0x([a-fA-F\\d])+$",
                            "title": "uint64",
                            "type": "string"
                        },
                        "state": {
                            "patternProperties": {
                                ".*": {
                                    "description": "Hex representation of a Keccak 256 hash",
                                    "pattern": "^0x[a-fA-F\\d]{64}$",
                                    "title": "keccak",
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        },
                        "stateDiff": {
                            "patternProperties": {
                                ".*": {
                                    "description": "Hex representation of a Keccak 256 hash",
                                    "pattern": "^0x[a-fA-F\\d]{64}$",
                                    "title": "keccak",
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "type": "object"
                }
            },
            "type": "object"
        },
        "Timeout": {
            "type": "string"
        },
        "Tracer": {
            "type": "string"
        },
        "overrides": {
            "additionalProperties": true
        }
    },
    "type": [
        "object"
    ]
}

Result

interface interface{}

  • Required: ✓ Yes

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_traceCall", "params": [<args>, <blockNrOrHash>, <config>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_traceCall", "params": [<args>, <blockNrOrHash>, <config>]}'
1
debug.traceCall(args,blockNrOrHash,config);
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
func (api *API) TraceCall(ctx context.Context, args ethapi.TransactionArgs, blockNrOrHash rpc.BlockNumberOrHash, config *TraceCallConfig) (interface{}, error) {
    var (
        err error
        block   *types.Block
    )
    if hash, ok := blockNrOrHash.Hash(); ok {
        block, err = api.blockByHash(ctx, hash)
    } else if number, ok := blockNrOrHash.Number(); ok {
        if number == rpc.PendingBlockNumber {
            return nil, errors.New("tracing on top of pending is not supported")
        }
        block, err = api.blockByNumber(ctx, number)
    } else {
        return nil, errors.New("invalid arguments; neither block nor hash specified")
    }
    if err != nil {
        return nil, err
    }
    reexec := defaultTraceReexec
    if config != nil && config.Reexec != nil {
        reexec = *config.Reexec
    }
    statedb, err := api.backend.StateAtBlock(ctx, block, reexec, nil, true, false)
    if err != nil {
        return nil, err
    }
    vmctx := core.NewEVMBlockContext(block.Header(), api.chainContext(ctx), nil)
    if config != nil {
        if err := config.StateOverrides.Apply(statedb); err != nil {
            return nil, err
        }
        config.BlockOverrides.Apply(&vmctx)
    }
    msg, err := args.ToMessage(api.backend.RPCGasCap(), block.BaseFee())
    if err != nil {
        return nil, err
    }
    traceConfig := getTraceConfigFromTraceCallConfig(config)
    return api.traceTx(ctx, msg, new(Context), vmctx, statedb, traceConfig)
}// TraceCall lets you trace a given eth_call. It collects the structured logs
// created during the execution of EVM if the given transaction was added on
// top of the provided block and returns them as a JSON object.
// Try to retrieve the specified block
View on GitHub →


debug_traceCallMany

TraceCallMany lets you trace a given eth_call. It collects the structured logs created during the execution of EVM if the given transaction was added on top of the provided block and returns them as a JSON object. You can provide -2 as a block number to trace on top of the pending block.

Params (3)

Parameters must be given by position.

1: txs []ethapi.TransactionArgs

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
- items: 

        - additionalProperties: `false`
        - properties: 
            - accessList: 
                - items: 
                    - additionalProperties: `false`
                    - properties: 
                        - address: 
                            - pattern: `^0x[a-fA-F\d]{64}$`
                            - title: `keccak`
                            - type: `string`

                        - storageKeys: 
                            - items: 
                                - description: `Hex representation of a Keccak 256 hash`
                                - pattern: `^0x[a-fA-F\d]{64}$`
                                - title: `keccak`
                                - type: `string`

                            - type: `array`


                    - type: `object`

                - type: `array`

            - chainId: 
                - pattern: `^0x[a-fA-F0-9]+$`
                - title: `integer`
                - type: `string`

            - data: 
                - pattern: `^0x([a-fA-F\d])+$`
                - title: `dataWord`
                - type: `string`

            - from: 
                - pattern: `^0x[a-fA-F\d]{64}$`
                - title: `keccak`
                - type: `string`

            - gas: 
                - pattern: `^0x([a-fA-F\d])+$`
                - title: `uint64`
                - type: `string`

            - gasPrice: 
                - pattern: `^0x[a-fA-F0-9]+$`
                - title: `integer`
                - type: `string`

            - input: 
                - pattern: `^0x([a-fA-F\d])+$`
                - title: `dataWord`
                - type: `string`

            - maxFeePerGas: 
                - pattern: `^0x[a-fA-F0-9]+$`
                - title: `integer`
                - type: `string`

            - maxPriorityFeePerGas: 
                - pattern: `^0x[a-fA-F0-9]+$`
                - title: `integer`
                - type: `string`

            - nonce: 
                - pattern: `^0x([a-fA-F\d])+$`
                - title: `uint64`
                - type: `string`

            - to: 
                - pattern: `^0x[a-fA-F\d]{64}$`
                - title: `keccak`
                - type: `string`

            - value: 
                - pattern: `^0x[a-fA-F0-9]+$`
                - title: `integer`
                - type: `string`


        - type: object


- type: array
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{
    "items": [
        {
            "additionalProperties": false,
            "properties": {
                "accessList": {
                    "items": {
                        "additionalProperties": false,
                        "properties": {
                            "address": {
                                "pattern": "^0x[a-fA-F\\d]{64}$",
                                "title": "keccak",
                                "type": "string"
                            },
                            "storageKeys": {
                                "items": {
                                    "description": "Hex representation of a Keccak 256 hash",
                                    "pattern": "^0x[a-fA-F\\d]{64}$",
                                    "title": "keccak",
                                    "type": "string"
                                },
                                "type": "array"
                            }
                        },
                        "type": "object"
                    },
                    "type": "array"
                },
                "chainId": {
                    "pattern": "^0x[a-fA-F0-9]+$",
                    "title": "integer",
                    "type": "string"
                },
                "data": {
                    "pattern": "^0x([a-fA-F\\d])+$",
                    "title": "dataWord",
                    "type": "string"
                },
                "from": {
                    "pattern": "^0x[a-fA-F\\d]{64}$",
                    "title": "keccak",
                    "type": "string"
                },
                "gas": {
                    "pattern": "^0x([a-fA-F\\d])+$",
                    "title": "uint64",
                    "type": "string"
                },
                "gasPrice": {
                    "pattern": "^0x[a-fA-F0-9]+$",
                    "title": "integer",
                    "type": "string"
                },
                "input": {
                    "pattern": "^0x([a-fA-F\\d])+$",
                    "title": "dataWord",
                    "type": "string"
                },
                "maxFeePerGas": {
                    "pattern": "^0x[a-fA-F0-9]+$",
                    "title": "integer",
                    "type": "string"
                },
                "maxPriorityFeePerGas": {
                    "pattern": "^0x[a-fA-F0-9]+$",
                    "title": "integer",
                    "type": "string"
                },
                "nonce": {
                    "pattern": "^0x([a-fA-F\\d])+$",
                    "title": "uint64",
                    "type": "string"
                },
                "to": {
                    "pattern": "^0x[a-fA-F\\d]{64}$",
                    "title": "keccak",
                    "type": "string"
                },
                "value": {
                    "pattern": "^0x[a-fA-F0-9]+$",
                    "title": "integer",
                    "type": "string"
                }
            },
            "type": [
                "object"
            ]
        }
    ],
    "type": [
        "array"
    ]
}

2: blockNrOrHash rpc.BlockNumberOrHash

  • Required: ✓ Yes

3: config *TraceCallConfig

  • Required: ✓ Yes
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
- additionalProperties: `false`
- properties: 
    - BlockOverrides: 
        - additionalProperties: `false`
        - properties: 
            - Coinbase: 
                - pattern: `^0x[a-fA-F\d]{64}$`
                - title: `keccak`
                - type: `string`

            - Difficulty: 
                - pattern: `^0x[a-fA-F0-9]+$`
                - title: `integer`
                - type: `string`

            - GasLimit: 
                - pattern: `^0x([a-fA-F\d])+$`
                - title: `uint64`
                - type: `string`

            - Number: 
                - pattern: `^0x[a-fA-F0-9]+$`
                - title: `integer`
                - type: `string`

            - Random: 
                - pattern: `^0x[a-fA-F\d]{64}$`
                - title: `keccak`
                - type: `string`

            - Time: 
                - pattern: `^0x[a-fA-F0-9]+$`
                - title: `integer`
                - type: `string`


        - type: `object`

    - Debug: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - type: `boolean`

    - EnableMemory: 
        - type: `boolean`

    - EnableReturnData: 
        - type: `boolean`

    - Limit: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - NestedTraceOutput: 
        - type: `boolean`

    - Reexec: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - StateOverrides: 
        - patternProperties: 
            - .*: 
                - additionalProperties: `false`
                - properties: 
                    - balance: 
                        - pattern: `^0x[a-fA-F0-9]+$`
                        - title: `integer`
                        - type: `string`

                    - code: 
                        - pattern: `^0x([a-fA-F\d])+$`
                        - title: `dataWord`
                        - type: `string`

                    - nonce: 
                        - pattern: `^0x([a-fA-F\d])+$`
                        - title: `uint64`
                        - type: `string`

                    - state: 
                        - patternProperties: 
                            - .*: 
                                - description: `Hex representation of a Keccak 256 hash`
                                - pattern: `^0x[a-fA-F\d]{64}$`
                                - title: `keccak`
                                - type: `string`


                        - type: `object`

                    - stateDiff: 
                        - patternProperties: 
                            - .*: 
                                - description: `Hex representation of a Keccak 256 hash`
                                - pattern: `^0x[a-fA-F\d]{64}$`
                                - title: `keccak`
                                - type: `string`


                        - type: `object`


                - type: `object`


        - type: `object`

    - Timeout: 
        - type: `string`

    - Tracer: 
        - type: `string`

    - overrides: 
        - additionalProperties: `true`


- type: object
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
{
    "additionalProperties": false,
    "properties": {
        "BlockOverrides": {
            "additionalProperties": false,
            "properties": {
                "Coinbase": {
                    "pattern": "^0x[a-fA-F\\d]{64}$",
                    "title": "keccak",
                    "type": "string"
                },
                "Difficulty": {
                    "pattern": "^0x[a-fA-F0-9]+$",
                    "title": "integer",
                    "type": "string"
                },
                "GasLimit": {
                    "pattern": "^0x([a-fA-F\\d])+$",
                    "title": "uint64",
                    "type": "string"
                },
                "Number": {
                    "pattern": "^0x[a-fA-F0-9]+$",
                    "title": "integer",
                    "type": "string"
                },
                "Random": {
                    "pattern": "^0x[a-fA-F\\d]{64}$",
                    "title": "keccak",
                    "type": "string"
                },
                "Time": {
                    "pattern": "^0x[a-fA-F0-9]+$",
                    "title": "integer",
                    "type": "string"
                }
            },
            "type": "object"
        },
        "Debug": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "type": "boolean"
        },
        "EnableMemory": {
            "type": "boolean"
        },
        "EnableReturnData": {
            "type": "boolean"
        },
        "Limit": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "NestedTraceOutput": {
            "type": "boolean"
        },
        "Reexec": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "StateOverrides": {
            "patternProperties": {
                ".*": {
                    "additionalProperties": false,
                    "properties": {
                        "balance": {
                            "pattern": "^0x[a-fA-F0-9]+$",
                            "title": "integer",
                            "type": "string"
                        },
                        "code": {
                            "pattern": "^0x([a-fA-F\\d])+$",
                            "title": "dataWord",
                            "type": "string"
                        },
                        "nonce": {
                            "pattern": "^0x([a-fA-F\\d])+$",
                            "title": "uint64",
                            "type": "string"
                        },
                        "state": {
                            "patternProperties": {
                                ".*": {
                                    "description": "Hex representation of a Keccak 256 hash",
                                    "pattern": "^0x[a-fA-F\\d]{64}$",
                                    "title": "keccak",
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        },
                        "stateDiff": {
                            "patternProperties": {
                                ".*": {
                                    "description": "Hex representation of a Keccak 256 hash",
                                    "pattern": "^0x[a-fA-F\\d]{64}$",
                                    "title": "keccak",
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "type": "object"
                }
            },
            "type": "object"
        },
        "Timeout": {
            "type": "string"
        },
        "Tracer": {
            "type": "string"
        },
        "overrides": {
            "additionalProperties": true
        }
    },
    "type": [
        "object"
    ]
}

Result

interface interface{}

  • Required: ✓ Yes

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_traceCallMany", "params": [<txs>, <blockNrOrHash>, <config>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_traceCallMany", "params": [<txs>, <blockNrOrHash>, <config>]}'
1
debug.traceCallMany(txs,blockNrOrHash,config);
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
func (api *API) TraceCallMany(ctx context.Context, txs [ // TraceCallMany lets you trace a given eth_call. It collects the structured logs created during the execution of EVM
// if the given transaction was added on top of the provided block and returns them as a JSON object.
// You can provide -2 as a block number to trace on top of the pending block.
]ethapi.TransactionArgs, blockNrOrHash rpc.BlockNumberOrHash, config *TraceCallConfig) (interface{}, error) {
    var (
        err error
        block   *types.Block
    )
    if hash, ok := blockNrOrHash.Hash(); ok {
        block, err = api.blockByHash(ctx, hash)
    } else if number, ok := blockNrOrHash.Number(); ok {
        block, err = api.blockByNumber(ctx, number)
    } else {
        return nil, errors.New("invalid arguments; neither block nor hash specified")
    }
    if err != nil {
        return nil, err
    }
    reexec := defaultTraceReexec
    if config != nil && config.Reexec != nil {
        reexec = *config.Reexec
    }
    statedb, err := api.backend.StateAtBlock(ctx, block, reexec, nil, true, false)
    if err != nil {
        return nil, err
    }
    if config != nil {
        if err := config.StateOverrides.Apply(statedb); err != nil {
            return nil, err
        }
    }
    traceConfig := getTraceConfigFromTraceCallConfig(config)
    var results = make([ // Try to retrieve the specified block
    ]interface{}, len(txs))
    for idx, args := range txs {
        msg, err := args.ToMessage(api.backend.RPCGasCap(), block.BaseFee())
        if err != nil {
            results[idx] = &txTraceResult{Error: err.Error()}
            continue
        }
        vmctx := core.NewEVMBlockContext(block.Header(), api.chainContext(ctx), nil)
        res, err := api.traceTx(ctx, msg, new(Context), vmctx, statedb, traceConfig)
        if err != nil {
            results[idx] = &txTraceResult{Error: err.Error()}
            continue
        }
        res, err = decorateResponse(res, traceConfig)
        if err != nil {
            return nil, fmt.Errorf("failed to decorate response for transaction at index %d with error %v", idx, err)
        }
        results[idx] = res
    }
    return results, nil
}
View on GitHub →


debug_traceChain

TraceChain returns the structured logs created during the execution of EVM between two blocks (excluding start) and returns them as a JSON object.

Params (3)

Parameters must be given by position.

1: start rpc.BlockNumber

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
- oneOf: 

        - description: `The block height description`
        - enum: earliest, latest, pending
        - title: `blockNumberTag`
        - type: string


        - description: `Hex representation of a uint64`
        - pattern: `^0x([a-fA-F\d])+$`
        - title: `uint64`
        - type: string


- title: `blockNumberIdentifier`
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
    "oneOf": [
        {
            "description": "The block height description",
            "enum": [
                "earliest",
                "latest",
                "pending"
            ],
            "title": "blockNumberTag",
            "type": [
                "string"
            ]
        },
        {
            "description": "Hex representation of a uint64",
            "pattern": "^0x([a-fA-F\\d])+$",
            "title": "uint64",
            "type": [
                "string"
            ]
        }
    ],
    "title": "blockNumberIdentifier"
}

2: end rpc.BlockNumber

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
- oneOf: 

        - description: `The block height description`
        - enum: earliest, latest, pending
        - title: `blockNumberTag`
        - type: string


        - description: `Hex representation of a uint64`
        - pattern: `^0x([a-fA-F\d])+$`
        - title: `uint64`
        - type: string


- title: `blockNumberIdentifier`
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
    "oneOf": [
        {
            "description": "The block height description",
            "enum": [
                "earliest",
                "latest",
                "pending"
            ],
            "title": "blockNumberTag",
            "type": [
                "string"
            ]
        },
        {
            "description": "Hex representation of a uint64",
            "pattern": "^0x([a-fA-F\\d])+$",
            "title": "uint64",
            "type": [
                "string"
            ]
        }
    ],
    "title": "blockNumberIdentifier"
}

3: config *TraceConfig

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
- additionalProperties: `false`
- properties: 
    - Debug: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - type: `boolean`

    - EnableMemory: 
        - type: `boolean`

    - EnableReturnData: 
        - type: `boolean`

    - Limit: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - NestedTraceOutput: 
        - type: `boolean`

    - Reexec: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - Timeout: 
        - type: `string`

    - Tracer: 
        - type: `string`

    - overrides: 
        - additionalProperties: `true`


- type: object
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
    "additionalProperties": false,
    "properties": {
        "Debug": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "type": "boolean"
        },
        "EnableMemory": {
            "type": "boolean"
        },
        "EnableReturnData": {
            "type": "boolean"
        },
        "Limit": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "NestedTraceOutput": {
            "type": "boolean"
        },
        "Reexec": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "Timeout": {
            "type": "string"
        },
        "Tracer": {
            "type": "string"
        },
        "overrides": {
            "additionalProperties": true
        }
    },
    "type": [
        "object"
    ]
}

Result

*rpc.Subscription

  • Required: ✓ Yes
1
2
3
- description: `Subscription identifier`
- title: `subscriptionID`
- type: string
1
2
3
4
5
6
7
{
    "description": "Subscription identifier",
    "title": "subscriptionID",
    "type": [
        "string"
    ]
}

Client Method Invocation Examples

1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_subscribe", "params": ["traceChain", <start>, <end>, <config>]}'
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
func (api *API) TraceChain(ctx context.Context, start, end rpc.BlockNumber, config *TraceConfig) (*rpc.Subscription, error) {
    from, err := api.blockByNumber(ctx, start)
    if err != nil {
        return nil, err
    }
    to, err := api.blockByNumber(ctx, end)
    if err != nil {
        return nil, err
    }
    if from.Number().Cmp(to.Number()) >= 0 {
        return nil, fmt.Errorf("end block (#%d) needs to come after start block (#%d)", end, start)
    }
    return api.traceChain(ctx, from, to, config)
}// TraceChain returns the structured logs created during the execution of EVM
// between two blocks (excluding start) and returns them as a JSON object.
View on GitHub →


debug_traceTransaction

TraceTransaction returns the structured logs created during the execution of EVM and returns them as a JSON object.

Params (2)

Parameters must be given by position.

1: hash common.Hash

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of a Keccak 256 hash`
- pattern: `^0x[a-fA-F\d]{64}$`
- title: `keccak`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of a Keccak 256 hash",
    "pattern": "^0x[a-fA-F\\d]{64}$",
    "title": "keccak",
    "type": [
        "string"
    ]
}

2: config *TraceConfig

  • Required: ✓ Yes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
- additionalProperties: `false`
- properties: 
    - Debug: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - type: `boolean`

    - EnableMemory: 
        - type: `boolean`

    - EnableReturnData: 
        - type: `boolean`

    - Limit: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - NestedTraceOutput: 
        - type: `boolean`

    - Reexec: 
        - pattern: `^0x[a-fA-F0-9]+$`
        - title: `integer`
        - type: `string`

    - Timeout: 
        - type: `string`

    - Tracer: 
        - type: `string`

    - overrides: 
        - additionalProperties: `true`


- type: object
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
    "additionalProperties": false,
    "properties": {
        "Debug": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "type": "boolean"
        },
        "EnableMemory": {
            "type": "boolean"
        },
        "EnableReturnData": {
            "type": "boolean"
        },
        "Limit": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "NestedTraceOutput": {
            "type": "boolean"
        },
        "Reexec": {
            "pattern": "^0x[a-fA-F0-9]+$",
            "title": "integer",
            "type": "string"
        },
        "Timeout": {
            "type": "string"
        },
        "Tracer": {
            "type": "string"
        },
        "overrides": {
            "additionalProperties": true
        }
    },
    "type": [
        "object"
    ]
}

Result

interface interface{}

  • Required: ✓ Yes

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_traceTransaction", "params": [<hash>, <config>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_traceTransaction", "params": [<hash>, <config>]}'
1
debug.traceTransaction(hash,config);
Source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
func (api *API) TraceTransaction(ctx context.Context, hash common.Hash, config *TraceConfig) (interface{}, error) {
    _, blockHash, blockNumber, index, err := api.backend.GetTransaction(ctx, hash)
    if err != nil {
        return nil, err
    }
    if blockNumber == 0 {
        return nil, errors.New("genesis is not traceable")
    }
    reexec := defaultTraceReexec
    if config != nil && config.Reexec != nil {
        reexec = *config.Reexec
    }
    block, err := api.blockByNumberAndHash(ctx, rpc.BlockNumber(blockNumber), blockHash)
    if err != nil {
        return nil, err
    }
    msg, vmctx, statedb, err := api.backend.StateAtTransaction(ctx, block, int(index), reexec)
    if err != nil {
        return nil, err
    }
    txctx := &Context{BlockHash: blockHash, TxIndex: int(index), TxHash: hash}
    return api.traceTx(ctx, msg, txctx, vmctx, statedb, config)
}// TraceTransaction returns the structured logs created during the execution of EVM
// and returns them as a JSON object.
View on GitHub →


debug_unsubscribe

Unsubscribe terminates an existing subscription by ID.

Params (1)

Parameters must be given by position.

1: id rpc.ID

  • Required: ✓ Yes
1
2
3
- description: `Subscription identifier`
- title: `subscriptionID`
- type: string
1
2
3
4
5
6
7
{
    "description": "Subscription identifier",
    "title": "subscriptionID",
    "type": [
        "string"
    ]
}

Result

None

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_unsubscribe", "params": [<id>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_unsubscribe", "params": [<id>]}'
1
debug.unsubscribe(id);
Source code

1
2
3
func (sub *RPCDebugSubscription) Unsubscribe(id rpc.ID) error {
    return nil
}// Unsubscribe terminates an existing subscription by ID.
View on GitHub →


debug_verbosity

Verbosity sets the log verbosity ceiling. The verbosity of individual packages and source files can be raised using Vmodule.

Params (1)

Parameters must be given by position.

1: level int

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of the integer`
- pattern: `^0x[a-fA-F0-9]+$`
- title: `integer`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of the integer",
    "pattern": "^0x[a-fA-F0-9]+$",
    "title": "integer",
    "type": [
        "string"
    ]
}

Result

None

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_verbosity", "params": [<level>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_verbosity", "params": [<level>]}'
1
debug.verbosity(level);
Source code

1
2
3
4
func (*HandlerT) Verbosity(level int) {
    glogger.Verbosity(log.Lvl(level))
}// Verbosity sets the log verbosity ceiling. The verbosity of individual packages
// and source files can be raised using Vmodule.
View on GitHub →


debug_vmodule

Vmodule sets the log verbosity pattern. See package log for details on the pattern syntax.

Params (1)

Parameters must be given by position.

1: pattern string

  • Required: ✓ Yes

Result

None

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_vmodule", "params": [<pattern>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_vmodule", "params": [<pattern>]}'
1
debug.vmodule(pattern);
Source code

1
2
3
4
func (*HandlerT) Vmodule(pattern string) error {
    return glogger.Vmodule(pattern)
}// Vmodule sets the log verbosity pattern. See package log for details on the
// pattern syntax.
View on GitHub →


debug_writeBlockProfile

WriteBlockProfile writes a goroutine blocking profile to the given file.

Params (1)

Parameters must be given by position.

1: file string

  • Required: ✓ Yes

Result

None

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_writeBlockProfile", "params": [<file>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_writeBlockProfile", "params": [<file>]}'
1
debug.writeBlockProfile(file);
Source code

1
2
3
func (*HandlerT) WriteBlockProfile(file string) error {
    return writeProfile("block", file)
}// WriteBlockProfile writes a goroutine blocking profile to the given file.
View on GitHub →


debug_writeMemProfile

WriteMemProfile writes an allocation profile to the given file. Note that the profiling rate cannot be set through the API, it must be set on the command line.

Params (1)

Parameters must be given by position.

1: file string

  • Required: ✓ Yes

Result

None

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_writeMemProfile", "params": [<file>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_writeMemProfile", "params": [<file>]}'
1
debug.writeMemProfile(file);
Source code

1
2
3
4
5
func (*HandlerT) WriteMemProfile(file string) error {
    return writeProfile("heap", file)
}// WriteMemProfile writes an allocation profile to the given file.
// Note that the profiling rate cannot be set through the API,
// it must be set on the command line.
View on GitHub →


debug_writeMutexProfile

WriteMutexProfile writes a goroutine blocking profile to the given file.

Params (1)

Parameters must be given by position.

1: file string

  • Required: ✓ Yes

Result

None

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_writeMutexProfile", "params": [<file>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_writeMutexProfile", "params": [<file>]}'
1
debug.writeMutexProfile(file);
Source code

1
2
3
func (*HandlerT) WriteMutexProfile(file string) error {
    return writeProfile("mutex", file)
}// WriteMutexProfile writes a goroutine blocking profile to the given file.
View on GitHub →



Last update: 2022-10-05