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
5556f0ea
Commit
5556f0ea
authored
Apr 13, 2016
by
LianaHus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added transaction browser
parent
bf750ce4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
319 additions
and
4 deletions
+319
-4
debugger.js
src/debugger.js
+7
-2
index.js
src/index.js
+8
-2
txBrowser.js
src/txBrowser.js
+34
-0
web3Admin.js
src/web3Admin.js
+270
-0
No files found.
src/debugger.js
View file @
5556f0ea
var
React
=
require
(
'react'
);
var
React
=
require
(
'react'
);
var
TxBrowser
=
require
(
'./txBrowser'
);
module
.
exports
=
React
.
createClass
({
module
.
exports
=
React
.
createClass
({
render
:
function
()
{
render
:
function
()
{
return
<
p
>
Sample
other
Text
<
/p>
;
return
(
<
div
>
<
p
>
Debugger
<
/p
>
<
TxBrowser
/>
<
/div
>
);
}
}
});
});
src/index.js
View file @
5556f0ea
var
ReactDOM
=
require
(
'react-dom'
);
var
ReactDOM
=
require
(
'react-dom'
);
var
React
=
require
(
'react'
);
var
React
=
require
(
'react'
);
var
Web3
=
require
(
'web3'
);
var
Web3Admin
=
require
(
'./web3Admin'
)
web3
=
new
Web3
();
web3
.
setProvider
(
new
web3
.
providers
.
HttpProvider
(
'http://localhost:8545'
));
Web3Admin
.
extend
(
web3
);
var
Debugger
=
require
(
'./debugger'
);
var
Debugger
=
require
(
'./debugger'
);
ReactDOM
.
render
(
ReactDOM
.
render
(
<
Debugger
/>
,
<
Debugger
/>
,
document
.
getElementById
(
'app'
)
document
.
getElementById
(
'app'
)
...
...
src/txBrowser.js
0 → 100644
View file @
5556f0ea
var
React
=
require
(
'react'
);
module
.
exports
=
React
.
createClass
({
getInitialState
:
function
()
{
return
{
blockNumber
:
"1160004"
,
txNumber
:
"1"
}
},
submit
:
function
()
{
var
vmTrace
=
web3
.
admin
.
vmTrace
(
this
.
state
.
blockNumber
,
parseInt
(
this
.
state
.
txNumber
),
"TmrjdiILLn0="
);
console
.
log
(
JSON
.
stringify
(
vmTrace
));
},
updateBlockN
:
function
(
ev
)
{
this
.
state
.
blockNumber
=
ev
.
target
.
value
;
},
updateTxN
:
function
(
ev
)
{
this
.
state
.
txNumber
=
ev
.
target
.
value
;
},
render
:
function
()
{
return
(
<
div
>
<
div
>
Trasnaction
details
<
/div
>
<
input
onChange
=
{
this
.
updateBlockN
}
type
=
"text"
placeholder
=
{
this
.
state
.
blockNumber
}
><
/input
>
<
input
onChange
=
{
this
.
updateTxN
}
type
=
"text"
placeholder
=
{
this
.
state
.
txNumber
}
><
/input
>
<
button
onClick
=
{
this
.
submit
}
>
Get
<
/button
>
<
/div
>
);
}
})
\ No newline at end of file
src/web3Admin.js
0 → 100644
View file @
5556f0ea
module
.
exports
=
{
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
,
null
],
params
:
3
}),
],
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
:
[
]
});
// 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
})
]
});
// 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
})
]
});
// TX POOL
web3
.
_extend
({
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