Skip to content

Debug

Entity Version
Source 1.11.23-unstable/generated-at:2021-04-30T19:24:24+03: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 []byte

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of a variable length byte array`
- pattern: `^0x([a-fA-F0-9]?)+$`
- title: `bytes`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of a variable length byte array",
    "pattern": "^0x([a-fA-F0-9]?)+$",
    "title": "bytes",
    "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
- additionalProperties: `false`
- properties: 
    - accounts: 
        - patternProperties: 
            - .*: 
                - additionalProperties: `false`
                - properties: 
                    - address: 
                        - pattern: `^0x[a-fA-F\d]{64}$`
                        - title: `keccak`
                        - type: `string`

                    - balance: 
                        - type: `string`

                    - code: 
                        - type: `string`

                    - codeHash: 
                        - 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: 
                        - 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
{
    "additionalProperties": false,
    "properties": {
        "accounts": {
            "patternProperties": {
                ".*": {
                    "additionalProperties": false,
                    "properties": {
                        "address": {
                            "pattern": "^0x[a-fA-F\\d]{64}$",
                            "title": "keccak",
                            "type": "string"
                        },
                        "balance": {
                            "type": "string"
                        },
                        "code": {
                            "type": "string"
                        },
                        "codeHash": {
                            "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": {
                            "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
func (api *PublicDebugAPI) AccountRange(blockNrOrHash rpc.BlockNumberOrHash, start [ // AccountRange enumerates all accounts in the given block and start point in paging request
]byte, 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 {
                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")
    }
    if maxResults > AccountRangeMaxResults || maxResults <= 0 {
        maxResults = AccountRangeMaxResults
    }
    return stateDb.IteratorDump(nocode, nostorage, incompletes, start, maxResults), nil
}
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 *PrivateDebugAPI) 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 *PrivateDebugAPI) 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_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
- additionalProperties: `false`
- properties: 
    - accounts: 
        - patternProperties: 
            - .*: 
                - additionalProperties: `false`
                - properties: 
                    - address: 
                        - pattern: `^0x[a-fA-F\d]{64}$`
                        - title: `keccak`
                        - type: `string`

                    - balance: 
                        - type: `string`

                    - code: 
                        - type: `string`

                    - codeHash: 
                        - 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: 
                        - 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
{
    "additionalProperties": false,
    "properties": {
        "accounts": {
            "patternProperties": {
                ".*": {
                    "additionalProperties": false,
                    "properties": {
                        "address": {
                            "pattern": "^0x[a-fA-F\\d]{64}$",
                            "title": "keccak",
                            "type": "string"
                        },
                        "balance": {
                            "type": "string"
                        },
                        "code": {
                            "type": "string"
                        },
                        "codeHash": {
                            "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": {
                            "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
func (api *PublicDebugAPI) DumpBlock(blockNr rpc.BlockNumber) (state.Dump, error) {
    if blockNr == rpc.PendingBlockNumber {
        _, stateDb := api.eth.miner.Pending()
        return stateDb.RawDump(false, false, true), nil
    }
    var block *types.Block
    if blockNr == rpc.LatestBlockNumber {
        block = api.eth.blockchain.CurrentBlock()
    } 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(false, false, true), 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_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
- items: 

        - additionalProperties: `false`
        - properties: 
            - block: 
                - additionalProperties: `false`
                - properties: 
                    - 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
{
    "items": [
        {
            "additionalProperties": false,
            "properties": {
                "block": {
                    "additionalProperties": false,
                    "properties": {
                        "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 *PrivateDebugAPI) 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); 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

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_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
 8
 9
10
11
func (api *PublicDebugAPI) GetBlockRlp(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)
    }
    encoded, err := rlp.EncodeToBytes(block)
    if err != nil {
        return "", err
    }
    return fmt.Sprintf("%x", encoded), nil
}// GetBlockRlp retrieves the RLP encoded for of a single block.
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 *PrivateDebugAPI) 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 *PrivateDebugAPI) 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_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_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 *PrivateDebugAPI) 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 *PublicDebugAPI) 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 *PrivateDebugAPI) 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 *PublicDebugAPI) 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 *PrivateDebugAPI) 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.

Params (0)

None

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": []}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_stacks", "params": []}'
1
debug.stacks();
Source code

1
2
3
4
5
func (*HandlerT) Stacks() string {
    buf := new(bytes.Buffer)
    pprof.Lookup("goroutine").WriteTo(buf, 2)
    return buf.String()
}// Stacks returns a printed representation of the stacks of all goroutines.
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`

    - DisableMemory: 
        - type: `boolean`

    - DisableReturnData: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - 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"
        },
        "DisableMemory": {
            "type": "boolean"
        },
        "DisableReturnData": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "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
11
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) {
    for _, block := range rawdb.ReadAllBadBlocks(api.backend.ChainDb()) {
        if block.Hash() == hash {
            return api.standardTraceBlockToFile(ctx, block, config)
        }
    }
    return nil, fmt.Errorf("bad block %#x not found", hash)
}
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`

    - DisableMemory: 
        - type: `boolean`

    - DisableReturnData: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - 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"
        },
        "DisableMemory": {
            "type": "boolean"
        },
        "DisableReturnData": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "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
16
func (api *PrivateDebugAPI) 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, release, err := api.eth.stateAtTransaction(block, txIndex, 0)
    if err != nil {
        return StorageRangeResult{}, err
    }
    defer release()
    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_testSignCliqueBlock

TestSignCliqueBlock fetches the given block number, and attempts to sign it as a clique header with the given address, returning the address of the recovered signature

This is a temporary method to debug the externalsigner integration, TODO: Remove this method when the integration is mature

Params (2)

Parameters must be given by position.

1: address 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"
    ]
}

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

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"
    ]
}

Client Method Invocation Examples

1
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "debug_testSignCliqueBlock", "params": [<address>, <number>]}'
1
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_testSignCliqueBlock", "params": [<address>, <number>]}'
1
debug.testSignCliqueBlock(address,number);
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
func (api *PublicDebugAPI) TestSignCliqueBlock(ctx context.Context, address common.Address, number uint64) (common.Address, error) {
    block, _ := api.b.BlockByNumber(ctx, rpc.BlockNumber(number))
    if block == nil {
        return common.Address{}, fmt.Errorf("block #%d not found", number)
    }
    header := block.Header()
    header.Extra = make([ // TestSignCliqueBlock fetches the given block number, and attempts to sign it as a clique header with the
    // given address, returning the address of the recovered signature
    //
    // This is a temporary method to debug the externalsigner integration,
    // TODO: Remove this method when the integration is mature
    ]byte, 32+65)
    encoded := clique.CliqueRLP(header)
    account := accounts.Account{Address: address}
    wallet, err := api.b.AccountManager().Find(account)
    if err != nil {
        return common.Address{}, err
    }
    signature, err := wallet.SignData(account, accounts.MimetypeClique, encoded)
    if err != nil {
        return common.Address{}, err
    }
    sealHash := clique.SealHash(header).Bytes()
    log.Info("test signing of clique block", "Sealhash", fmt.Sprintf("%x", sealHash), "signature", fmt.Sprintf("%x", signature))
    pubkey, err := crypto.Ecrecover(sealHash, signature)
    if err != nil {
        return common.Address{}, err
    }
    var signer common.Address
    copy(signer[:], crypto.Keccak256(pubkey[1:])[12:])
    return signer, nil
}
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`

    - DisableMemory: 
        - type: `boolean`

    - DisableReturnData: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - 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"
        },
        "DisableMemory": {
            "type": "boolean"
        },
        "DisableReturnData": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "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
11
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) {
    for _, block := range rawdb.ReadAllBadBlocks(api.backend.ChainDb()) {
        if block.Hash() == hash {
            return api.traceBlock(ctx, block, config)
        }
    }
    return nil, fmt.Errorf("bad block %#x not found", hash)
}
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 []byte

  • Required: ✓ Yes
1
2
3
4
- description: `Hex representation of a variable length byte array`
- pattern: `^0x([a-fA-F0-9]?)+$`
- title: `bytes`
- type: string
1
2
3
4
5
6
7
8
{
    "description": "Hex representation of a variable length byte array",
    "pattern": "^0x([a-fA-F0-9]?)+$",
    "title": "bytes",
    "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`

    - DisableMemory: 
        - type: `boolean`

    - DisableReturnData: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - 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"
        },
        "DisableMemory": {
            "type": "boolean"
        },
        "DisableReturnData": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "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 [ // TraceBlock returns the structured logs created during the execution of EVM
// and returns them as a JSON object.
]byte, config *TraceConfig) ([]*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`

    - DisableMemory: 
        - type: `boolean`

    - DisableReturnData: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - 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"
        },
        "DisableMemory": {
            "type": "boolean"
        },
        "DisableReturnData": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "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`

    - DisableMemory: 
        - type: `boolean`

    - DisableReturnData: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - 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"
        },
        "DisableMemory": {
            "type": "boolean"
        },
        "DisableReturnData": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "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`

    - DisableMemory: 
        - type: `boolean`

    - DisableReturnData: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - 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"
        },
        "DisableMemory": {
            "type": "boolean"
        },
        "DisableReturnData": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "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 := ioutil.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. 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: args ethapi.CallArgs

  • 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
- 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`

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

    - 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
{
    "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"
        },
        "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"
        },
        "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 *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`

    - DisableMemory: 
        - type: `boolean`

    - DisableReturnData: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - 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"
        },
        "DisableMemory": {
            "type": "boolean"
        },
        "DisableReturnData": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "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_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
44
45
46
47
48
49
50
51
52
53
func (api *API) TraceCall(ctx context.Context, args ethapi.CallArgs, blockNrOrHash rpc.BlockNumberOrHash, config *TraceConfig) (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)
    }
    if err != nil {
        return nil, err
    }
    reexec := defaultTraceReexec
    if config != nil && config.Reexec != nil {
        reexec = *config.Reexec
    }
    statedb, release, err := api.backend.StateAtBlock(ctx, block, reexec)
    if err != nil {
        return nil, err
    }
    defer release()
    msg := args.ToMessage(api.backend.RPCGasCap())
    vmctx := core.NewEVMBlockContext(block.Header(), api.chainContext(ctx), nil)
    originalCanTransfer := vmctx.CanTransfer
    originalTransfer := vmctx.Transfer
    gasCost := new(big.Int).Mul(new(big.Int).SetUint64(msg.Gas()), msg.GasPrice())
    totalCost := new(big.Int).Add(gasCost, msg.Value())
    hasFromSufficientBalanceForValueAndGasCost := vmctx.CanTransfer(statedb, msg.From(), totalCost)
    hasFromSufficientBalanceForGasCost := vmctx.CanTransfer(statedb, msg.From(), gasCost)
    vmctx.CanTransfer = func(db vm.StateDB, sender common.Address, amount *big.Int) bool {
        if msg.From() == sender {
            return true
        }
        res := originalCanTransfer(db, sender, amount)
        return res
    }
    vmctx.Transfer = func(db vm.StateDB, sender, recipient common.Address, amount *big.Int) {
        toAmount := new(big.Int).Set(amount)
        senderBalance := db.GetBalance(sender)
        if senderBalance.Cmp(toAmount) < 0 {
            toAmount.Set(big.NewInt(0))
        }
        originalTransfer(db, sender, recipient, toAmount)
    }
    taskExtraContext := map // 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.
    // You can provide -2 as a block number to trace on top of the pending block.
    // Try to retrieve the specified block
    [string]interface{}{"hasFromSufficientBalanceForValueAndGasCost": hasFromSufficientBalanceForValueAndGasCost, "hasFromSufficientBalanceForGasCost": hasFromSufficientBalanceForGasCost}
    return api.traceTx(ctx, msg, vmctx, statedb, taskExtraContext, config)
}
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.CallArgs

  • 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
- 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`

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

            - 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
{
    "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"
                },
                "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"
                },
                "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 *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`

    - DisableMemory: 
        - type: `boolean`

    - DisableReturnData: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - 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"
        },
        "DisableMemory": {
            "type": "boolean"
        },
        "DisableReturnData": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "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_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
55
56
57
58
59
60
61
62
63
64
65
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.CallArgs, blockNrOrHash rpc.BlockNumberOrHash, config *TraceConfig) (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)
    }
    if err != nil {
        return nil, err
    }
    reexec := defaultTraceReexec
    if config != nil && config.Reexec != nil {
        reexec = *config.Reexec
    }
    statedb, release, err := api.backend.StateAtBlock(ctx, block, reexec)
    if err != nil {
        return nil, err
    }
    defer release()
    var results = make([ // Try to retrieve the specified block
    ]interface{}, len(txs))
    for idx, args := range txs {
        msg := args.ToMessage(api.backend.RPCGasCap())
        vmctx := core.NewEVMBlockContext(block.Header(), api.chainContext(ctx), nil)
        originalCanTransfer := vmctx.CanTransfer
        originalTransfer := vmctx.Transfer
        gasCost := new(big.Int).Mul(new(big.Int).SetUint64(msg.Gas()), msg.GasPrice())
        totalCost := new(big.Int).Add(gasCost, msg.Value())
        hasFromSufficientBalanceForValueAndGasCost := vmctx.CanTransfer(statedb, msg.From(), totalCost)
        hasFromSufficientBalanceForGasCost := vmctx.CanTransfer(statedb, msg.From(), gasCost)
        vmctx.CanTransfer = func(db vm.StateDB, sender common.Address, amount *big.Int) bool {
            if msg.From() == sender {
                return true
            }
            res := originalCanTransfer(db, sender, amount)
            return res
        }
        vmctx.Transfer = func(db vm.StateDB, sender, recipient common.Address, amount *big.Int) {
            toAmount := new(big.Int).Set(amount)
            senderBalance := db.GetBalance(sender)
            if senderBalance.Cmp(toAmount) < 0 {
                toAmount.Set(big.NewInt(0))
            }
            originalTransfer(db, sender, recipient, toAmount)
        }
        taskExtraContext := map[string]interface{}{"hasFromSufficientBalanceForValueAndGasCost": hasFromSufficientBalanceForValueAndGasCost, "hasFromSufficientBalanceForGasCost": hasFromSufficientBalanceForGasCost}
        res, err := api.traceTx(ctx, msg, vmctx, statedb, taskExtraContext, config)
        if err != nil {
            results[idx] = &txTraceResult{Error: err.Error()}
            continue
        }
        res, err = decorateResponse(res, config)
        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`

    - DisableMemory: 
        - type: `boolean`

    - DisableReturnData: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - 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"
        },
        "DisableMemory": {
            "type": "boolean"
        },
        "DisableReturnData": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "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`

    - DisableMemory: 
        - type: `boolean`

    - DisableReturnData: 
        - type: `boolean`

    - DisableStack: 
        - type: `boolean`

    - DisableStorage: 
        - 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"
        },
        "DisableMemory": {
            "type": "boolean"
        },
        "DisableReturnData": {
            "type": "boolean"
        },
        "DisableStack": {
            "type": "boolean"
        },
        "DisableStorage": {
            "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
25
26
func (api *API) TraceTransaction(ctx context.Context, hash common.Hash, config *TraceConfig) (interface{}, error) {
    tx, 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, release, err := api.backend.StateAtTransaction(ctx, block, int(index), reexec)
    if err != nil {
        return nil, err
    }
    defer release()
    taskExtraContext := map // TraceTransaction returns the structured logs created during the execution of EVM
    // and returns them as a JSON object.
    [string]interface{}{"blockNumber": block.NumberU64(), "blockHash": blockHash.Hex(), "transactionHash": tx.Hash().Hex(), "transactionPosition": index}
    return api.traceTx(ctx, msg, vmctx, statedb, taskExtraContext, config)
}
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-06-28