Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 7b5728a

Browse files
authored
Merge pull request #2678 from princesinha19/debug-methods
Implementation of Geth node debugging API's (web3-eth-debug).
2 parents 42f9126 + e2be9d0 commit 7b5728a

File tree

66 files changed

+3118
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+3118
-1
lines changed

packages/web3-core-method/src/index.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,33 @@ export SetMaxMessageSizeMethod from './methods/shh/SetMaxMessageSizeMethod';
120120
export SetMinPoWMethod from './methods/shh/SetMinPoWMethod';
121121
export ShhVersionMethod from './methods/shh/ShhVersionMethod';
122122

123+
// Debug
124+
export BackTraceAtMethod from './methods/debug/BackTraceAtMethod';
125+
export BlockProfileMethod from './methods/debug/BlockProfileMethod';
126+
export CpuProfileMethod from './methods/debug/CpuProfileMethod';
127+
export DumpBlockMethod from './methods/debug/DumpBlockMethod';
128+
export GcStatsMethod from './methods/debug/GcStatsMethod';
129+
export GetBlockRlpMethod from './methods/debug/GetBlockRlpMethod';
130+
export GoTraceMethod from './methods/debug/GoTraceMethod';
131+
export MemStatsMethod from './methods/debug/MemStatsMethod';
132+
export SeedHashMethod from './methods/debug/SeedHashMethod';
133+
export SetBlockProfileRateMethod from './methods/debug/SetBlockProfileRateMethod';
134+
export SetHeadMethod from './methods/debug/SetHeadMethod';
135+
export StacksMethod from './methods/debug/StacksMethod';
136+
export StartCpuProfileMethod from './methods/debug/StartCpuProfileMethod';
137+
export StartGoTraceMethod from './methods/debug/StartGoTraceMethod';
138+
export StopCpuProfileMethod from './methods/debug/StopCpuProfileMethod';
139+
export StopGoTraceMethod from './methods/debug/StopGoTraceMethod';
140+
export TraceBlockByHashMethod from './methods/debug/TraceBlockByHashMethod';
141+
export TraceBlockByNumberMethod from './methods/debug/TraceBlockByNumberMethod';
142+
export TraceBlockFromFileMethod from './methods/debug/TraceBlockFromFileMethod';
143+
export TraceBlockMethod from './methods/debug/TraceBlockMethod';
144+
export TraceTransactionMethod from './methods/debug/TraceTransactionMethod';
145+
export VerbosityMethod from './methods/debug/VerbosityMethod';
146+
export VmoduleMethod from './methods/debug/VmoduleMethod';
147+
export WriteBlockProfileMethod from './methods/debug/WriteBlockProfileMethod';
148+
export WriteMemProfileMethod from './methods/debug/WriteMemProfileMethod';
149+
123150
// Txpool
124151
export ContentMethod from './methods/txpool/ContentMethod';
125152
export InspectMethod from './methods/txpool/InspectMethod';
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
This file is part of web3.js.
3+
4+
web3.js is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU Lesser General Public License as published by
6+
the Free Software Foundation, either version 3 of the License, or
7+
(at your option) any later version.
8+
9+
web3.js is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public License
15+
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
/**
18+
* @file BackTraceAtMethod.js
19+
* @author Prince Sinha <[email protected]>
20+
* @date 2019
21+
*/
22+
23+
import AbstractMethod from '../../../lib/methods/AbstractMethod';
24+
25+
export default class BackTraceAtMethod extends AbstractMethod {
26+
/**
27+
* @param {Utils} utils
28+
* @param {Object} formatters
29+
* @param {AbstractWeb3Module} moduleInstance
30+
*
31+
* @constructor
32+
*/
33+
constructor(utils, formatters, moduleInstance) {
34+
super('debug_backtraceAt', 1, utils, formatters, moduleInstance);
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
This file is part of web3.js.
3+
4+
web3.js is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU Lesser General Public License as published by
6+
the Free Software Foundation, either version 3 of the License, or
7+
(at your option) any later version.
8+
9+
web3.js is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public License
15+
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
/**
18+
* @file BlockProfileMethod.js
19+
* @author Prince Sinha <[email protected]>
20+
* @date 2019
21+
*/
22+
23+
import AbstractMethod from '../../../lib/methods/AbstractMethod';
24+
25+
export default class BlockProfileMethod extends AbstractMethod {
26+
/**
27+
* @param {Utils} utils
28+
* @param {Object} formatters
29+
* @param {AbstractWeb3Module} moduleInstance
30+
*
31+
* @constructor
32+
*/
33+
constructor(utils, formatters, moduleInstance) {
34+
super('debug_blockProfile', 2, utils, formatters, moduleInstance);
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
This file is part of web3.js.
3+
4+
web3.js is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU Lesser General Public License as published by
6+
the Free Software Foundation, either version 3 of the License, or
7+
(at your option) any later version.
8+
9+
web3.js is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public License
15+
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
/**
18+
* @file CpuProfileMethod.js
19+
* @author Prince Sinha <[email protected]>
20+
* @date 2019
21+
*/
22+
23+
import AbstractMethod from '../../../lib/methods/AbstractMethod';
24+
25+
export default class CpuProfileMethod extends AbstractMethod {
26+
/**
27+
* @param {Utils} utils
28+
* @param {Object} formatters
29+
* @param {AbstractWeb3Module} moduleInstance
30+
*
31+
* @constructor
32+
*/
33+
constructor(utils, formatters, moduleInstance) {
34+
super('debug_cpuProfile', 2, utils, formatters, moduleInstance);
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
This file is part of web3.js.
3+
4+
web3.js is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU Lesser General Public License as published by
6+
the Free Software Foundation, either version 3 of the License, or
7+
(at your option) any later version.
8+
9+
web3.js is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public License
15+
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
/**
18+
* @file DumpBlockMethod.js
19+
* @author Prince Sinha <[email protected]>
20+
* @date 2019
21+
*/
22+
23+
import AbstractMethod from '../../../lib/methods/AbstractMethod';
24+
25+
export default class DumpBlockMethod extends AbstractMethod {
26+
/**
27+
* @param {Utils} utils
28+
* @param {Object} formatters
29+
* @param {AbstractWeb3Module} moduleInstance
30+
*
31+
* @constructor
32+
*/
33+
constructor(utils, formatters, moduleInstance) {
34+
super('debug_dumpBlock', 1, utils, formatters, moduleInstance);
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
This file is part of web3.js.
3+
4+
web3.js is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU Lesser General Public License as published by
6+
the Free Software Foundation, either version 3 of the License, or
7+
(at your option) any later version.
8+
9+
web3.js is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public License
15+
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
/**
18+
* @file GcStatsMethod.js
19+
* @author Prince Sinha <[email protected]>
20+
* @date 2019
21+
*/
22+
23+
import AbstractMethod from '../../../lib/methods/AbstractMethod';
24+
25+
export default class GcStatsMethod extends AbstractMethod {
26+
/**
27+
* @param {Utils} utils
28+
* @param {Object} formatters
29+
* @param {AbstractWeb3Module} moduleInstance
30+
*
31+
* @constructor
32+
*/
33+
constructor(utils, formatters, moduleInstance) {
34+
super('debug_gcStats', 0, utils, formatters, moduleInstance);
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
This file is part of web3.js.
3+
4+
web3.js is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU Lesser General Public License as published by
6+
the Free Software Foundation, either version 3 of the License, or
7+
(at your option) any later version.
8+
9+
web3.js is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public License
15+
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
/**
18+
* @file GetBlockRlpMethod.js
19+
* @author Prince Sinha <[email protected]>
20+
* @date 2019
21+
*/
22+
23+
import AbstractMethod from '../../../lib/methods/AbstractMethod';
24+
25+
export default class GetBlockRlpMethod extends AbstractMethod {
26+
/**
27+
* @param {Utils} utils
28+
* @param {Object} formatters
29+
* @param {AbstractWeb3Module} moduleInstance
30+
*
31+
* @constructor
32+
*/
33+
constructor(utils, formatters, moduleInstance) {
34+
super('debug_getBlockRlp', 1, utils, formatters, moduleInstance);
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
This file is part of web3.js.
3+
4+
web3.js is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU Lesser General Public License as published by
6+
the Free Software Foundation, either version 3 of the License, or
7+
(at your option) any later version.
8+
9+
web3.js is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public License
15+
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
/**
18+
* @file GoTraceMethod.js
19+
* @author Prince Sinha <[email protected]>
20+
* @date 2019
21+
*/
22+
23+
import AbstractMethod from '../../../lib/methods/AbstractMethod';
24+
25+
export default class GoTraceMethod extends AbstractMethod {
26+
/**
27+
* @param {Utils} utils
28+
* @param {Object} formatters
29+
* @param {AbstractWeb3Module} moduleInstance
30+
*
31+
* @constructor
32+
*/
33+
constructor(utils, formatters, moduleInstance) {
34+
super('debug_goTrace', 2, utils, formatters, moduleInstance);
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
This file is part of web3.js.
3+
4+
web3.js is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU Lesser General Public License as published by
6+
the Free Software Foundation, either version 3 of the License, or
7+
(at your option) any later version.
8+
9+
web3.js is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public License
15+
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
/**
18+
* @file MemStatsMethod.js
19+
* @author Prince Sinha <[email protected]>
20+
* @date 2019
21+
*/
22+
23+
import AbstractMethod from '../../../lib/methods/AbstractMethod';
24+
25+
export default class MemStatsMethod extends AbstractMethod {
26+
/**
27+
* @param {Utils} utils
28+
* @param {Object} formatters
29+
* @param {AbstractWeb3Module} moduleInstance
30+
*
31+
* @constructor
32+
*/
33+
constructor(utils, formatters, moduleInstance) {
34+
super('debug_memStats', 0, utils, formatters, moduleInstance);
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
This file is part of web3.js.
3+
4+
web3.js is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU Lesser General Public License as published by
6+
the Free Software Foundation, either version 3 of the License, or
7+
(at your option) any later version.
8+
9+
web3.js is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public License
15+
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
/**
18+
* @file SeedHashMethod.js
19+
* @author Prince Sinha <[email protected]>
20+
* @date 2019
21+
*/
22+
23+
import AbstractMethod from '../../../lib/methods/AbstractMethod';
24+
25+
export default class SeedHashMethod extends AbstractMethod {
26+
/**
27+
* @param {Utils} utils
28+
* @param {Object} formatters
29+
* @param {AbstractWeb3Module} moduleInstance
30+
*
31+
* @constructor
32+
*/
33+
constructor(utils, formatters, moduleInstance) {
34+
super('debug_seedHash', 0, utils, formatters, moduleInstance);
35+
}
36+
}

0 commit comments

Comments
 (0)