Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
1164dc67
Commit
1164dc67
authored
Apr 14, 2016
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
indentation
parent
9e107f8b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
337 additions
and
337 deletions
+337
-337
assemblyItemsBrowser.js
src/assemblyItemsBrowser.js
+64
-64
debugger.js
src/debugger.js
+16
-16
index.js
src/index.js
+2
-2
txBrowser.js
src/txBrowser.js
+5
-5
vmTraceBrowser.js
src/vmTraceBrowser.js
+2
-2
web3Admin.js
src/web3Admin.js
+248
-248
No files found.
src/assemblyItemsBrowser.js
View file @
1164dc67
...
...
@@ -2,52 +2,52 @@ var React = require('react');
module
.
exports
=
React
.
createClass
({
getInitialState
:
function
()
{
return
{
currentSelected
:
null
,
currentAddress
:
null
};
},
getInitialState
:
function
()
{
return
{
currentSelected
:
null
,
currentAddress
:
null
};
},
getDefaultProps
:
function
()
{
return
{
vmTrace
:
null
};
},
return
{
vmTrace
:
null
};
},
render
:
function
()
{
if
(
!
this
.
props
.
vmTrace
||
!
this
.
props
.
vmTrace
.
vmtrace
||
this
.
props
.
vmTrace
.
vmtrace
.
length
===
0
)
return
null
;
this
.
state
.
currentAddress
=
this
.
props
.
vmTrace
.
vmtrace
[
0
].
address
this
.
state
.
currentSelected
=
this
.
props
.
vmTrace
.
codesmap
[
this
.
state
.
currentAddress
][
this
.
props
.
vmTrace
.
vmtrace
[
0
].
pc
]
return
(
<
div
>
if
(
!
this
.
props
.
vmTrace
||
!
this
.
props
.
vmTrace
.
vmtrace
||
this
.
props
.
vmTrace
.
vmtrace
.
length
===
0
)
return
null
;
this
.
state
.
currentAddress
=
this
.
props
.
vmTrace
.
vmtrace
[
0
].
address
this
.
state
.
currentSelected
=
this
.
props
.
vmTrace
.
codesmap
[
this
.
state
.
currentAddress
][
this
.
props
.
vmTrace
.
vmtrace
[
0
].
pc
]
return
(
<
div
>
<
div
id
=
"action"
>
<
button
onClick
=
{
this
.
stepIntoBack
}
>
stepIntoBack
<
/button
>
<
button
onClick
=
{
this
.
stepOverBack
}
>
stepOverBack
<
/button
>
<
button
onClick
=
{
this
.
stepOverForward
}
>
stepOverForward
<
/button
>
<
button
onClick
=
{
this
.
stepIntoForward
}
>
stepIntoForward
<
/button
>
<
button
onClick
=
{
this
.
stepIntoBack
}
>
stepIntoBack
<
/button
>
<
button
onClick
=
{
this
.
stepOverBack
}
>
stepOverBack
<
/button
>
<
button
onClick
=
{
this
.
stepOverForward
}
>
stepOverForward
<
/button
>
<
button
onClick
=
{
this
.
stepIntoForward
}
>
stepIntoForward
<
/button
>
<
/div
>
<
div
>
<
select
size
=
"10"
ref
=
'itemsList'
value
=
{
this
.
state
.
currentSelected
}
>
{
this
.
renderAssemblyItems
()
}
<
/select
>
<
select
size
=
"10"
ref
=
'itemsList'
value
=
{
this
.
state
.
currentSelected
}
>
{
this
.
renderAssemblyItems
()
}
<
/select
>
<
/div
>
<
/div
>
);
<
/div
>
);
},
renderAssemblyItems
:
function
()
{
if
(
this
.
props
.
vmTrace
)
{
var
selectedItem
=
this
.
state
.
currentSelected
var
selectedItem
=
this
.
state
.
currentSelected
return
this
.
props
.
vmTrace
.
vmtrace
.
map
(
function
(
item
,
i
)
{
return
<
option
key
=
{
i
}
value
=
{
i
}
>
{
item
.
instname
}
<
/option>
;
return
<
option
key
=
{
i
}
value
=
{
i
}
>
{
item
.
instname
}
<
/option>
;
});
}
},
...
...
@@ -55,7 +55,7 @@ module.exports = React.createClass({
stepIntoBack
:
function
()
{
this
.
moveSelection
(
-
1
)
this
.
moveSelection
(
-
1
)
},
stepOverBack
:
function
()
...
...
@@ -116,39 +116,39 @@ module.exports = React.createClass({
if
(
depth
==
0
)
break
;
else
depth
--
;
else
if
(
this
.
isReturnInstruction
(
i
))
depth
++
;
}
this
.
selectState
(
i
);
},
stepOutForward
:
function
()
{
var
i
=
this
.
state
.
currentSelected
;
var
depth
=
0
;
while
(
++
i
<
this
.
props
.
vmTrace
.
vmtrace
.
length
)
{
if
(
this
.
isReturnInstruction
(
i
))
if
(
depth
==
0
)
break
;
else
depth
--
;
else
if
(
this
.
isCallInstruction
(
i
))
depth
++
;
}
this
.
selectState
(
i
+
1
);
},
moveSelection
:
function
(
incr
)
{
this
.
selectState
(
this
.
state
.
currentSelected
+
incr
)
},
else
if
(
this
.
isReturnInstruction
(
i
))
depth
++
;
}
this
.
selectState
(
i
);
},
stepOutForward
:
function
()
{
var
i
=
this
.
state
.
currentSelected
;
var
depth
=
0
;
while
(
++
i
<
this
.
props
.
vmTrace
.
vmtrace
.
length
)
{
if
(
this
.
isReturnInstruction
(
i
))
if
(
depth
==
0
)
break
;
else
depth
--
;
else
if
(
this
.
isCallInstruction
(
i
))
depth
++
;
}
this
.
selectState
(
i
+
1
);
},
moveSelection
:
function
(
incr
)
{
this
.
selectState
(
this
.
state
.
currentSelected
+
incr
)
},
selectState
:
function
(
index
)
{
var
newIndex
=
this
.
props
.
vmTrace
.
codesmap
[
this
.
state
.
currentAddress
][
this
.
props
.
vmTrace
.
vmtrace
[
index
].
pc
]
this
.
state
.
currentSelected
=
index
this
.
refs
.
itemsList
.
value
=
this
.
state
.
currentSelected
if
(
this
.
props
.
vmTrace
.
vmtrace
[
index
].
address
&&
this
.
state
.
currentAddress
!==
this
.
props
.
vmTrace
.
vmtrace
[
index
].
address
)
this
.
state
.
currentAddress
=
this
.
props
.
vmTrace
.
vmtrace
[
index
].
address
},
})
selectState
:
function
(
index
)
{
var
newIndex
=
this
.
props
.
vmTrace
.
codesmap
[
this
.
state
.
currentAddress
][
this
.
props
.
vmTrace
.
vmtrace
[
index
].
pc
]
this
.
state
.
currentSelected
=
index
this
.
refs
.
itemsList
.
value
=
this
.
state
.
currentSelected
if
(
this
.
props
.
vmTrace
.
vmtrace
[
index
].
address
&&
this
.
state
.
currentAddress
!==
this
.
props
.
vmTrace
.
vmtrace
[
index
].
address
)
this
.
state
.
currentAddress
=
this
.
props
.
vmTrace
.
vmtrace
[
index
].
address
},
})
src/debugger.js
View file @
1164dc67
...
...
@@ -4,22 +4,22 @@ var VmTraceManager = require('./vmTraceManager');
var
VmTraceBrowser
=
require
(
'./vmTraceBrowser'
);
module
.
exports
=
React
.
createClass
({
getInitialState
:
function
()
{
return
{
vmTrace
:
null
}
},
getInitialState
:
function
()
{
return
{
vmTrace
:
null
}
},
render
:
function
()
{
return
(
<
div
>
<
h1
>
Debugger
<
/h1
>
<
TxBrowser
onNewTxRequested
=
{
this
.
retrieveVmTrace
}
/
>
<
VmTraceBrowser
vmTrace
=
{
this
.
state
.
vmTrace
}
/
>
<
/div
>
);
},
render
:
function
()
{
return
(
<
div
>
<
h1
>
Debugger
<
/h1
>
<
TxBrowser
onNewTxRequested
=
{
this
.
retrieveVmTrace
}
/
>
<
VmTraceBrowser
vmTrace
=
{
this
.
state
.
vmTrace
}
/
>
<
/div
>
);
},
retrieveVmTrace
:
function
(
blockNumber
,
txNumber
)
{
this
.
setState
({
vmTrace
:
VmTraceManager
.
retrieveVmTrace
(
blockNumber
,
txNumber
)});
}
retrieveVmTrace
:
function
(
blockNumber
,
txNumber
)
{
this
.
setState
({
vmTrace
:
VmTraceManager
.
retrieveVmTrace
(
blockNumber
,
txNumber
)});
}
});
src/index.js
View file @
1164dc67
...
...
@@ -10,6 +10,6 @@ Web3Admin.extend(web3);
var
Debugger
=
require
(
'./debugger'
);
ReactDOM
.
render
(
<
Debugger
/>
,
document
.
getElementById
(
'app'
)
<
Debugger
/>
,
document
.
getElementById
(
'app'
)
);
src/txBrowser.js
View file @
1164dc67
...
...
@@ -15,21 +15,21 @@ module.exports = React.createClass({
},
updateBlockN
:
function
(
ev
)
{
this
.
state
.
blockNumber
=
ev
.
target
.
value
;
this
.
state
.
blockNumber
=
ev
.
target
.
value
;
},
updateTxN
:
function
(
ev
)
{
this
.
state
.
txNumber
=
ev
.
target
.
value
;
this
.
state
.
txNumber
=
ev
.
target
.
value
;
},
render
:
function
()
{
return
(
<
div
>
<
div
>
<
div
><
h3
>
Transaction
details
<
/h3></
div
>
<
input
onChange
=
{
this
.
updateBlockN
}
type
=
"text"
placeholder
=
{
"Block number e.g. : "
+
this
.
state
.
blockNumber
}
><
/input
>
<
input
onChange
=
{
this
.
updateTxN
}
type
=
"text"
placeholder
=
{
"Transaction Number e.g. : "
+
this
.
state
.
txNumber
}
><
/input
>
<
button
onClick
=
{
this
.
submit
}
>
Get
<
/button
>
<
/div
>
);
<
/div
>
);
}
})
src/vmTraceBrowser.js
View file @
1164dc67
...
...
@@ -2,7 +2,7 @@ var React = require('react');
var
AssemblyItemsBrowser
=
require
(
'./assemblyItemsBrowser'
);
module
.
exports
=
React
.
createClass
({
render
:
function
()
{
return
(
<
AssemblyItemsBrowser
vmTrace
=
{
this
.
props
.
vmTrace
}
/>
)
render
:
function
()
{
return
(
<
AssemblyItemsBrowser
vmTrace
=
{
this
.
props
.
vmTrace
}
/>
)
}
});
src/web3Admin.js
View file @
1164dc67
module
.
exports
=
{
extend
:
function
(
web3
)
{
extend
:
function
(
web3
)
{
// ADMIN
web3
.
_extend
({
property
:
'admin'
,
methods
:
[
new
web3
.
_extend
.
Method
({
name
:
'addPeer'
,
call
:
'admin_addPeer'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
utils
.
fromDecimal
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'exportChain'
,
call
:
'admin_exportChain'
,
params
:
1
,
inputFormatter
:
[
null
],
outputFormatter
:
function
(
obj
)
{
return
obj
;
}
}),
new
web3
.
_extend
.
Method
({
name
:
'importChain'
,
call
:
'admin_importChain'
,
params
:
1
,
inputFormatter
:
[
null
],
outputFormatter
:
function
(
obj
)
{
return
obj
;
}
}),
new
web3
.
_extend
.
Method
({
name
:
'verbosity'
,
call
:
'admin_verbosity'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
utils
.
formatInputInt
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'setSolc'
,
call
:
'admin_setSolc'
,
params
:
1
,
inputFormatter
:
[
null
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputString
}),
new
web3
.
_extend
.
Method
({
name
:
'startRPC'
,
call
:
'admin_startRPC'
,
params
:
4
,
inputFormatter
:
[
null
,
web3
.
_extend
.
utils
.
formatInputInteger
,
null
,
null
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'stopRPC'
,
call
:
'admin_stopRPC'
,
params
:
0
,
inputFormatter
:
[],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'vmTrace'
,
call
:
'admin_eth_vmTrace'
,
inputFormatter
:
[
null
,
null
],
params
:
2
}),
],
properties
:
[
new
web3
.
_extend
.
Property
({
name
:
'nodeInfo'
,
getter
:
'admin_nodeInfo'
,
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputString
}),
new
web3
.
_extend
.
Property
({
name
:
'peers'
,
getter
:
'admin_peers'
,
outputFormatter
:
function
(
obj
)
{
return
obj
;
}
}),
new
web3
.
_extend
.
Property
({
name
:
'datadir'
,
getter
:
'admin_datadir'
,
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputString
}),
new
web3
.
_extend
.
Property
({
name
:
'chainSyncStatus'
,
getter
:
'admin_chainSyncStatus'
,
outputFormatter
:
function
(
obj
)
{
return
obj
;
}
})
]
property
:
'admin'
,
methods
:
[
new
web3
.
_extend
.
Method
({
name
:
'addPeer'
,
call
:
'admin_addPeer'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
utils
.
fromDecimal
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'exportChain'
,
call
:
'admin_exportChain'
,
params
:
1
,
inputFormatter
:
[
null
],
outputFormatter
:
function
(
obj
)
{
return
obj
;
}
}),
new
web3
.
_extend
.
Method
({
name
:
'importChain'
,
call
:
'admin_importChain'
,
params
:
1
,
inputFormatter
:
[
null
],
outputFormatter
:
function
(
obj
)
{
return
obj
;
}
}),
new
web3
.
_extend
.
Method
({
name
:
'verbosity'
,
call
:
'admin_verbosity'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
utils
.
formatInputInt
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'setSolc'
,
call
:
'admin_setSolc'
,
params
:
1
,
inputFormatter
:
[
null
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputString
}),
new
web3
.
_extend
.
Method
({
name
:
'startRPC'
,
call
:
'admin_startRPC'
,
params
:
4
,
inputFormatter
:
[
null
,
web3
.
_extend
.
utils
.
formatInputInteger
,
null
,
null
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'stopRPC'
,
call
:
'admin_stopRPC'
,
params
:
0
,
inputFormatter
:
[],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'vmTrace'
,
call
:
'admin_eth_vmTrace'
,
inputFormatter
:
[
null
,
null
],
params
:
2
}),
],
properties
:
[
new
web3
.
_extend
.
Property
({
name
:
'nodeInfo'
,
getter
:
'admin_nodeInfo'
,
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputString
}),
new
web3
.
_extend
.
Property
({
name
:
'peers'
,
getter
:
'admin_peers'
,
outputFormatter
:
function
(
obj
)
{
return
obj
;
}
}),
new
web3
.
_extend
.
Property
({
name
:
'datadir'
,
getter
:
'admin_datadir'
,
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputString
}),
new
web3
.
_extend
.
Property
({
name
:
'chainSyncStatus'
,
getter
:
'admin_chainSyncStatus'
,
outputFormatter
:
function
(
obj
)
{
return
obj
;
}
})
]
});
// DEBUG
web3
.
_extend
({
property
:
'debug'
,
methods
:
[
new
web3
.
_extend
.
Method
({
name
:
'printBlock'
,
call
:
'debug_printBlock'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
formatters
.
formatInputInt
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputString
}),
new
web3
.
_extend
.
Method
({
name
:
'getBlockRlp'
,
call
:
'debug_getBlockRlp'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
formatters
.
formatInputInt
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputString
}),
new
web3
.
_extend
.
Method
({
name
:
'setHead'
,
call
:
'debug_setHead'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
formatters
.
formatInputInt
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'processBlock'
,
call
:
'debug_processBlock'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
formatters
.
formatInputInt
],
outputFormatter
:
function
(
obj
)
{
return
obj
;
}
}),
new
web3
.
_extend
.
Method
({
name
:
'seedHash'
,
call
:
'debug_seedHash'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
formatters
.
formatInputInt
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputString
})
,
new
web3
.
_extend
.
Method
({
name
:
'dumpBlock'
,
call
:
'debug_dumpBlock'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
formatters
.
formatInputInt
],
outputFormatter
:
function
(
obj
)
{
return
obj
;
}
})
],
properties
:
[
]
property
:
'debug'
,
methods
:
[
new
web3
.
_extend
.
Method
({
name
:
'printBlock'
,
call
:
'debug_printBlock'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
formatters
.
formatInputInt
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputString
}),
new
web3
.
_extend
.
Method
({
name
:
'getBlockRlp'
,
call
:
'debug_getBlockRlp'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
formatters
.
formatInputInt
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputString
}),
new
web3
.
_extend
.
Method
({
name
:
'setHead'
,
call
:
'debug_setHead'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
formatters
.
formatInputInt
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'processBlock'
,
call
:
'debug_processBlock'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
formatters
.
formatInputInt
],
outputFormatter
:
function
(
obj
)
{
return
obj
;
}
}),
new
web3
.
_extend
.
Method
({
name
:
'seedHash'
,
call
:
'debug_seedHash'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
formatters
.
formatInputInt
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputString
})
,
new
web3
.
_extend
.
Method
({
name
:
'dumpBlock'
,
call
:
'debug_dumpBlock'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
formatters
.
formatInputInt
],
outputFormatter
:
function
(
obj
)
{
return
obj
;
}
})
],
properties
:
[
]
});
// MINER
web3
.
_extend
({
property
:
'miner'
,
methods
:
[
new
web3
.
_extend
.
Method
({
name
:
'start'
,
call
:
'miner_start'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
formatters
.
formatInputInt
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'stop'
,
call
:
'miner_stop'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
formatters
.
formatInputInt
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'setExtra'
,
call
:
'miner_setExtra'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
utils
.
formatInputString
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'setGasPrice'
,
call
:
'miner_setGasPrice'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
utils
.
formatInputString
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'startAutoDAG'
,
call
:
'miner_startAutoDAG'
,
params
:
0
,
inputFormatter
:
[],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'stopAutoDAG'
,
call
:
'miner_stopAutoDAG'
,
params
:
0
,
inputFormatter
:
[],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'makeDAG'
,
call
:
'miner_makeDAG'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
formatters
.
inputDefaultBlockNumberFormatter
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
})
],
properties
:
[
new
web3
.
_extend
.
Property
({
name
:
'hashrate'
,
getter
:
'miner_hashrate'
,
outputFormatter
:
web3
.
_extend
.
utils
.
toDecimal
})
]
property
:
'miner'
,
methods
:
[
new
web3
.
_extend
.
Method
({
name
:
'start'
,
call
:
'miner_start'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
formatters
.
formatInputInt
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'stop'
,
call
:
'miner_stop'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
formatters
.
formatInputInt
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'setExtra'
,
call
:
'miner_setExtra'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
utils
.
formatInputString
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'setGasPrice'
,
call
:
'miner_setGasPrice'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
utils
.
formatInputString
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'startAutoDAG'
,
call
:
'miner_startAutoDAG'
,
params
:
0
,
inputFormatter
:
[],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'stopAutoDAG'
,
call
:
'miner_stopAutoDAG'
,
params
:
0
,
inputFormatter
:
[],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'makeDAG'
,
call
:
'miner_makeDAG'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
formatters
.
inputDefaultBlockNumberFormatter
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
})
],
properties
:
[
new
web3
.
_extend
.
Property
({
name
:
'hashrate'
,
getter
:
'miner_hashrate'
,
outputFormatter
:
web3
.
_extend
.
utils
.
toDecimal
})
]
});
// NETWORK
web3
.
_extend
({
property
:
'network'
,
methods
:
[
new
web3
.
_extend
.
Method
({
name
:
'addPeer'
,
call
:
'net_addPeer'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
utils
.
formatInputString
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'getPeerCount'
,
call
:
'net_peerCount'
,
params
:
0
,
inputFormatter
:
[],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputString
})
],
properties
:
[
new
web3
.
_extend
.
Property
({
name
:
'listening'
,
getter
:
'net_listening'
,
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Property
({
name
:
'peerCount'
,
getter
:
'net_peerCount'
,
outputFormatter
:
web3
.
_extend
.
utils
.
toDecimal
}),
new
web3
.
_extend
.
Property
({
name
:
'peers'
,
getter
:
'net_peers'
,
outputFormatter
:
function
(
obj
)
{
return
obj
;
}
}),
new
web3
.
_extend
.
Property
({
name
:
'version'
,
getter
:
'net_version'
,
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputString
})
]
property
:
'network'
,
methods
:
[
new
web3
.
_extend
.
Method
({
name
:
'addPeer'
,
call
:
'net_addPeer'
,
params
:
1
,
inputFormatter
:
[
web3
.
_extend
.
utils
.
formatInputString
],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Method
({
name
:
'getPeerCount'
,
call
:
'net_peerCount'
,
params
:
0
,
inputFormatter
:
[],
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputString
})
],
properties
:
[
new
web3
.
_extend
.
Property
({
name
:
'listening'
,
getter
:
'net_listening'
,
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputBool
}),
new
web3
.
_extend
.
Property
({
name
:
'peerCount'
,
getter
:
'net_peerCount'
,
outputFormatter
:
web3
.
_extend
.
utils
.
toDecimal
}),
new
web3
.
_extend
.
Property
({
name
:
'peers'
,
getter
:
'net_peers'
,
outputFormatter
:
function
(
obj
)
{
return
obj
;
}
}),
new
web3
.
_extend
.
Property
({
name
:
'version'
,
getter
:
'net_version'
,
outputFormatter
:
web3
.
_extend
.
formatters
.
formatOutputString
})
]
});
// TX POOL
web3
.
_extend
({
property
:
'txpool'
,
methods
:
[
],
properties
:
[
new
web3
.
_extend
.
Property
({
name
:
'status'
,
getter
:
'txpool_status'
,
outputFormatter
:
function
(
obj
)
{
return
obj
;
}
})
]
property
:
'txpool'
,
methods
:
[
],
properties
:
[
new
web3
.
_extend
.
Property
({
name
:
'status'
,
getter
:
'txpool_status'
,
outputFormatter
:
function
(
obj
)
{
return
obj
;
}
})
]
});
}
};
}
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment