├── test ├── test.bat └── config.json ├── .node-xmlhttprequest-sync-6792 ├── startEthBrowser.bat ├── tools ├── startStats.bat ├── .node-xmlhttprequest-sync-6600 ├── startGrabber.bat ├── priTools │ ├── node_bloom_filter │ │ ├── .gitignore │ │ ├── index.js │ │ └── package.json │ ├── dealCount.js │ ├── countRichListBalance.js │ ├── getLessAddr.js │ ├── updateWitnessVersion.js │ ├── collectRichestAddr.js │ ├── updateWitness.js │ ├── updateAddrBalanceLH10.js │ ├── test.js │ ├── dealContractAddr.js │ ├── updateContractAddr.js │ ├── clearDB谨慎上传.js │ ├── updateAddrBalanceBT10.js │ ├── updateAddrBalance.js │ └── internalTX_txhash.js ├── check_restart.sh ├── config.json ├── config-fix.json ├── restart.sh ├── blockTimeTest.js └── fix_tx.js ├── profileStart.bat ├── .DS_Store ├── profile2json.bat ├── public ├── favicon.ico ├── img │ ├── FAIL.png │ ├── logo.png │ ├── loading.gif │ ├── logo-round.png │ ├── social │ │ ├── rss.png │ │ ├── vk.png │ │ ├── Thumbs.db │ │ ├── quora.png │ │ ├── skype.png │ │ ├── vimeo.png │ │ ├── xing.png │ │ ├── yahoo.png │ │ ├── behance.png │ │ ├── blogger.png │ │ ├── facebook.png │ │ ├── flickr.png │ │ ├── github.png │ │ ├── gravatar.png │ │ ├── linkedin.png │ │ ├── picasa.png │ │ ├── pintrest.png │ │ ├── reddit.png │ │ ├── tumblr.png │ │ ├── twitter.png │ │ ├── youtube.png │ │ ├── googleplus.png │ │ ├── instagram.png │ │ ├── wordpress.png │ │ └── stumbleupon.png │ ├── comment-white.png │ ├── explorer-logo.png │ ├── loading-spinner-grey.gif │ └── explorer-logo-beta-590x243.png ├── js │ ├── custom.js │ ├── controllers │ │ ├── ErrController.js │ │ ├── PublicAPIDocController.js │ │ ├── StatsController.js │ │ ├── ContractListController.js │ │ ├── WitnessListController.js │ │ ├── TokenListController.js │ │ ├── BlockController.js │ │ ├── AddressListController.js │ │ ├── TxController.js │ │ └── DAOController.js │ ├── stats │ │ └── package.json │ ├── web3utils.js │ ├── filters.js │ └── directives.js ├── css │ ├── fonts │ │ ├── Roboto-Bold.ttf │ │ ├── Roboto-Light.ttf │ │ ├── Roboto-Regular.ttf │ │ ├── fontawesome-webfont.ttf │ │ └── fontawesome-webfont.woff │ ├── default.css │ ├── stats.css │ └── custom.css ├── plugins │ ├── morris │ │ ├── examples │ │ │ ├── lib │ │ │ │ ├── example.js │ │ │ │ └── example.css │ │ │ ├── _template.html │ │ │ ├── donut.html │ │ │ ├── bar-no-axes.html │ │ │ ├── goals.html │ │ │ ├── stacked_bars.html │ │ │ ├── dst.html │ │ │ ├── area-as-line.html │ │ │ ├── bar.html │ │ │ ├── donut-formatter.html │ │ │ ├── area.html │ │ │ ├── donut-colors.html │ │ │ ├── negative.html │ │ │ ├── decimal-custom-hover.html │ │ │ ├── non-date.html │ │ │ ├── bar-colors.html │ │ │ ├── updating.html │ │ │ ├── years.html │ │ │ ├── days.html │ │ │ ├── months-no-smooth.html │ │ │ ├── no-grid.html │ │ │ ├── diagonal-xlabels.html │ │ │ ├── diagonal-xlabels-bar.html │ │ │ ├── timestamps.html │ │ │ ├── resize.html │ │ │ ├── non-continuous.html │ │ │ ├── weeks.html │ │ │ ├── events.html │ │ │ └── quarters.html │ │ ├── spec │ │ │ ├── viz │ │ │ │ ├── exemplary │ │ │ │ │ ├── area0.png │ │ │ │ │ ├── bar0.png │ │ │ │ │ ├── line0.png │ │ │ │ │ └── stacked_bar0.png │ │ │ │ ├── run.sh │ │ │ │ ├── test.html │ │ │ │ ├── examples.js │ │ │ │ └── visual_specs.js │ │ │ ├── support │ │ │ │ └── placeholder.coffee │ │ │ ├── lib │ │ │ │ ├── grid │ │ │ │ │ ├── y_label_format_spec.coffee │ │ │ │ │ └── auto_grid_lines_spec.coffee │ │ │ │ ├── pad_spec.coffee │ │ │ │ ├── bar │ │ │ │ │ └── colours.coffee │ │ │ │ ├── commas_spec.coffee │ │ │ │ ├── parse_time_spec.coffee │ │ │ │ ├── area │ │ │ │ │ └── area_spec.coffee │ │ │ │ ├── hover_spec.coffee │ │ │ │ └── donut │ │ │ │ │ └── donut_spec.coffee │ │ │ └── specs.html │ │ ├── morris.css │ │ ├── less │ │ │ └── morris.core.less │ │ └── lib │ │ │ ├── morris.coffee │ │ │ ├── morris.hover.coffee │ │ │ └── morris.area.coffee │ ├── uniform │ │ └── images │ │ │ ├── sprite.png │ │ │ ├── bg-input.png │ │ │ ├── bg-input-focus.png │ │ │ └── sprite_original.png │ ├── datatables │ │ └── images │ │ │ ├── sort_asc.png │ │ │ ├── sort_both.png │ │ │ ├── sort_desc.png │ │ │ ├── Sorting icons.psd │ │ │ ├── back_disabled.png │ │ │ ├── back_enabled.png │ │ │ ├── forward_enabled.png │ │ │ ├── back_enabled_hover.png │ │ │ ├── forward_disabled.png │ │ │ ├── sort_asc_disabled.png │ │ │ ├── sort_desc_disabled.png │ │ │ └── forward_enabled_hover.png │ ├── simple-line-icons │ │ ├── License.txt │ │ ├── fonts │ │ │ ├── Simple-Line-Icons.eot │ │ │ ├── Simple-Line-Icons.ttf │ │ │ └── Simple-Line-Icons.woff │ │ └── Readme.txt │ ├── font-awesome │ │ └── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ ├── bootstrap │ │ └── fonts │ │ │ └── bootstrap │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ ├── jquery-slimscroll │ │ ├── README.md │ │ └── slimScroll.jquery.json │ ├── bootstrap-hover-dropdown │ │ ├── LICENSE │ │ ├── bootstrap-hover-dropdown.min.js │ │ └── bootstrap-hover-dropdown.js │ ├── angularjs │ │ └── angular-cookies.min.js │ └── jquery.cokie.min.js ├── fonts │ └── fontawesome │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ └── fontawesome-webfont.woff ├── tpl │ ├── page-head.html │ └── footer.html └── views │ ├── stats │ └── index.html │ ├── err_404.html │ ├── created-tokens.html │ ├── transfer-tokens.html │ ├── tokenlist.html │ ├── addressList.html │ ├── contract-source.html │ ├── contractlist.html │ ├── witnessList.html │ ├── block.html │ └── witness.html ├── views └── error.ejs ├── Dockerfile ├── restartApp.sh ├── routes ├── eventLog.js ├── contracts.js ├── fiat.js ├── contractListData.js ├── tokenListData.js ├── tokenTransfer.js └── addressListData.js ├── .travis.yml ├── db-stats.js ├── db-dao.js ├── .gitignore ├── package.json ├── LICENSE.md ├── check_restart.sh ├── db-internal.js ├── ecosystem.config.js ├── lib ├── consoleTimestamp.js ├── etherUnits.js └── murmurHash3.js └── README.md /test/test.bat: -------------------------------------------------------------------------------- 1 | node test.js -------------------------------------------------------------------------------- /.node-xmlhttprequest-sync-6792: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /startEthBrowser.bat: -------------------------------------------------------------------------------- 1 | node app.js -------------------------------------------------------------------------------- /tools/startStats.bat: -------------------------------------------------------------------------------- 1 | node stats.js -------------------------------------------------------------------------------- /profileStart.bat: -------------------------------------------------------------------------------- 1 | node --prof app.js -------------------------------------------------------------------------------- /tools/.node-xmlhttprequest-sync-6600: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tools/startGrabber.bat: -------------------------------------------------------------------------------- 1 | node grabber.js -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/.DS_Store -------------------------------------------------------------------------------- /tools/priTools/node_bloom_filter/.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | node_modules/ 3 | -------------------------------------------------------------------------------- /tools/priTools/node_bloom_filter/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./bloomfilter'); -------------------------------------------------------------------------------- /profile2json.bat: -------------------------------------------------------------------------------- 1 | node --prof-process --preprocess -j isolate-00000218C0780E20-v8.log > v8.json -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /public/img/FAIL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/FAIL.png -------------------------------------------------------------------------------- /public/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/logo.png -------------------------------------------------------------------------------- /public/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/loading.gif -------------------------------------------------------------------------------- /tools/check_restart.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/tools/check_restart.sh -------------------------------------------------------------------------------- /public/img/logo-round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/logo-round.png -------------------------------------------------------------------------------- /public/img/social/rss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/rss.png -------------------------------------------------------------------------------- /public/img/social/vk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/vk.png -------------------------------------------------------------------------------- /views/error.ejs: -------------------------------------------------------------------------------- 1 |

<%= message %>

2 |

<%= error.status %>

3 |
<%= error.stack %>
-------------------------------------------------------------------------------- /public/img/social/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/Thumbs.db -------------------------------------------------------------------------------- /public/img/social/quora.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/quora.png -------------------------------------------------------------------------------- /public/img/social/skype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/skype.png -------------------------------------------------------------------------------- /public/img/social/vimeo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/vimeo.png -------------------------------------------------------------------------------- /public/img/social/xing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/xing.png -------------------------------------------------------------------------------- /public/img/social/yahoo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/yahoo.png -------------------------------------------------------------------------------- /public/js/custom.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | $('[data-toggle="tooltip"]').tooltip(); 3 | }); 4 | -------------------------------------------------------------------------------- /public/img/comment-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/comment-white.png -------------------------------------------------------------------------------- /public/img/explorer-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/explorer-logo.png -------------------------------------------------------------------------------- /public/img/social/behance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/behance.png -------------------------------------------------------------------------------- /public/img/social/blogger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/blogger.png -------------------------------------------------------------------------------- /public/img/social/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/facebook.png -------------------------------------------------------------------------------- /public/img/social/flickr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/flickr.png -------------------------------------------------------------------------------- /public/img/social/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/github.png -------------------------------------------------------------------------------- /public/img/social/gravatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/gravatar.png -------------------------------------------------------------------------------- /public/img/social/linkedin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/linkedin.png -------------------------------------------------------------------------------- /public/img/social/picasa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/picasa.png -------------------------------------------------------------------------------- /public/img/social/pintrest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/pintrest.png -------------------------------------------------------------------------------- /public/img/social/reddit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/reddit.png -------------------------------------------------------------------------------- /public/img/social/tumblr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/tumblr.png -------------------------------------------------------------------------------- /public/img/social/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/twitter.png -------------------------------------------------------------------------------- /public/img/social/youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/youtube.png -------------------------------------------------------------------------------- /public/css/fonts/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/css/fonts/Roboto-Bold.ttf -------------------------------------------------------------------------------- /public/img/social/googleplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/googleplus.png -------------------------------------------------------------------------------- /public/img/social/instagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/instagram.png -------------------------------------------------------------------------------- /public/img/social/wordpress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/wordpress.png -------------------------------------------------------------------------------- /public/plugins/morris/examples/lib/example.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | eval($('#code').text()); 3 | prettyPrint(); 4 | }); -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:latest 2 | 3 | COPY . / 4 | 5 | RUN npm i 6 | 7 | EXPOSE 3000 8 | 9 | ENTRYPOINT ["node"] 10 | -------------------------------------------------------------------------------- /public/css/fonts/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/css/fonts/Roboto-Light.ttf -------------------------------------------------------------------------------- /public/css/fonts/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/css/fonts/Roboto-Regular.ttf -------------------------------------------------------------------------------- /public/img/loading-spinner-grey.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/loading-spinner-grey.gif -------------------------------------------------------------------------------- /public/img/social/stumbleupon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/social/stumbleupon.png -------------------------------------------------------------------------------- /public/css/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/css/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /public/fonts/fontawesome/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/fonts/fontawesome/FontAwesome.otf -------------------------------------------------------------------------------- /public/plugins/uniform/images/sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/uniform/images/sprite.png -------------------------------------------------------------------------------- /public/css/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/css/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /public/img/explorer-logo-beta-590x243.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/img/explorer-logo-beta-590x243.png -------------------------------------------------------------------------------- /public/plugins/uniform/images/bg-input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/uniform/images/bg-input.png -------------------------------------------------------------------------------- /public/plugins/datatables/images/sort_asc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/datatables/images/sort_asc.png -------------------------------------------------------------------------------- /public/plugins/simple-line-icons/License.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/simple-line-icons/License.txt -------------------------------------------------------------------------------- /public/plugins/datatables/images/sort_both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/datatables/images/sort_both.png -------------------------------------------------------------------------------- /public/plugins/datatables/images/sort_desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/datatables/images/sort_desc.png -------------------------------------------------------------------------------- /public/fonts/fontawesome/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/fonts/fontawesome/fontawesome-webfont.eot -------------------------------------------------------------------------------- /public/fonts/fontawesome/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/fonts/fontawesome/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /public/fonts/fontawesome/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/fonts/fontawesome/fontawesome-webfont.woff -------------------------------------------------------------------------------- /public/plugins/datatables/images/Sorting icons.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/datatables/images/Sorting icons.psd -------------------------------------------------------------------------------- /public/plugins/datatables/images/back_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/datatables/images/back_disabled.png -------------------------------------------------------------------------------- /public/plugins/datatables/images/back_enabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/datatables/images/back_enabled.png -------------------------------------------------------------------------------- /public/plugins/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /public/plugins/morris/spec/viz/exemplary/area0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/morris/spec/viz/exemplary/area0.png -------------------------------------------------------------------------------- /public/plugins/morris/spec/viz/exemplary/bar0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/morris/spec/viz/exemplary/bar0.png -------------------------------------------------------------------------------- /public/plugins/morris/spec/viz/exemplary/line0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/morris/spec/viz/exemplary/line0.png -------------------------------------------------------------------------------- /public/plugins/uniform/images/bg-input-focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/uniform/images/bg-input-focus.png -------------------------------------------------------------------------------- /public/plugins/uniform/images/sprite_original.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/uniform/images/sprite_original.png -------------------------------------------------------------------------------- /public/plugins/datatables/images/forward_enabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/datatables/images/forward_enabled.png -------------------------------------------------------------------------------- /public/plugins/datatables/images/back_enabled_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/datatables/images/back_enabled_hover.png -------------------------------------------------------------------------------- /public/plugins/datatables/images/forward_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/datatables/images/forward_disabled.png -------------------------------------------------------------------------------- /public/plugins/datatables/images/sort_asc_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/datatables/images/sort_asc_disabled.png -------------------------------------------------------------------------------- /public/plugins/datatables/images/sort_desc_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/datatables/images/sort_desc_disabled.png -------------------------------------------------------------------------------- /public/plugins/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /public/plugins/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /public/plugins/morris/spec/viz/exemplary/stacked_bar0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/morris/spec/viz/exemplary/stacked_bar0.png -------------------------------------------------------------------------------- /public/plugins/datatables/images/forward_enabled_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/datatables/images/forward_enabled_hover.png -------------------------------------------------------------------------------- /public/plugins/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /public/plugins/font-awesome/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/font-awesome/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /public/plugins/simple-line-icons/fonts/Simple-Line-Icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/simple-line-icons/fonts/Simple-Line-Icons.eot -------------------------------------------------------------------------------- /public/plugins/simple-line-icons/fonts/Simple-Line-Icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/simple-line-icons/fonts/Simple-Line-Icons.ttf -------------------------------------------------------------------------------- /public/plugins/simple-line-icons/fonts/Simple-Line-Icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/simple-line-icons/fonts/Simple-Line-Icons.woff -------------------------------------------------------------------------------- /tools/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "gethPort": 9646, 3 | "blocks": [ {"start": 4936270, "end": "latest"}], 4 | "quiet": true, 5 | "terminateAtExistingDB": false, 6 | "listenOnly": true 7 | } -------------------------------------------------------------------------------- /public/plugins/bootstrap/fonts/bootstrap/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/bootstrap/fonts/bootstrap/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /public/plugins/bootstrap/fonts/bootstrap/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/bootstrap/fonts/bootstrap/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /public/plugins/bootstrap/fonts/bootstrap/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/bootstrap/fonts/bootstrap/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /public/plugins/bootstrap/fonts/bootstrap/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/etherzero-org/explorer/HEAD/public/plugins/bootstrap/fonts/bootstrap/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /test/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "output":".", 3 | "gethPort": 9646, 4 | "blocks": [ {"start": 0, "end": "latest"}], 5 | "quiet": true, 6 | "terminateAtExistingDB": false, 7 | "listenOnly": true 8 | } -------------------------------------------------------------------------------- /tools/config-fix.json: -------------------------------------------------------------------------------- 1 | { 2 | "gethPort": 9646, 3 | "blocks": [ {"start": 4936270, "end": "latest"}], 4 | "quiet": true, 5 | "terminateAtExistingDB": false, 6 | "listenOnly": false 7 | } 8 | -------------------------------------------------------------------------------- /public/plugins/morris/spec/support/placeholder.coffee: -------------------------------------------------------------------------------- 1 | beforeEach -> 2 | placeholder = $('
') 3 | $('#test').append(placeholder) 4 | 5 | afterEach -> 6 | $('#test').empty() 7 | -------------------------------------------------------------------------------- /public/plugins/morris/examples/lib/example.css: -------------------------------------------------------------------------------- 1 | body { 2 | width: 800px; 3 | margin: 0 auto; 4 | } 5 | #graph { 6 | width: 800px; 7 | height: 250px; 8 | margin: 20px auto 0 auto; 9 | } 10 | pre { 11 | height: 250px; 12 | overflow: auto; 13 | } 14 | -------------------------------------------------------------------------------- /public/js/controllers/ErrController.js: -------------------------------------------------------------------------------- 1 | angular.module('BlocksApp').controller('ErrController', function($stateParams, $rootScope, $scope) { 2 | 3 | $rootScope.$state.current.data["pageSubTitle"] = $stateParams.hash; 4 | $scope.thing = $stateParams.thing; 5 | 6 | }) -------------------------------------------------------------------------------- /restartApp.sh: -------------------------------------------------------------------------------- 1 | mv logs/out.log.txt logs/out.$(date -d "today" +"%Y%m%d_%H%M%S").txt 2 | mv logs/err.log.txt logs/err.$(date -d "today" +"%Y%m%d_%H%M%S").txt 3 | ps aux | grep "app.js" | grep -v grep | awk '{print $2}' | xargs kill 4 | sleep 2 5 | nohup node app.js 1>logs/out.log.txt 2>logs/err.log.txt & 6 | -------------------------------------------------------------------------------- /tools/restart.sh: -------------------------------------------------------------------------------- 1 | mv logs/out.log.txt logs/out.$(date -d "today" +"%Y%m%d_%H%M%S").txt 2 | mv logs/err.log.txt logs/err.$(date -d "today" +"%Y%m%d_%H%M%S").txt 3 | ps aux | grep "PetBCserver.js" | grep -v grep | awk '{print $2}' | xargs kill 4 | sleep 1 5 | nohup node PetBCserver.js 1>logs/out.log.txt 2>logs/err.log.txt & -------------------------------------------------------------------------------- /public/tpl/page-head.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |

5 | 6 | 7 |

8 |
9 | 10 |
-------------------------------------------------------------------------------- /tools/priTools/dealCount.js: -------------------------------------------------------------------------------- 1 | require( '../../db.js' ); 2 | var mongoose = require('mongoose'); 3 | var Address = mongoose.model('Address'); 4 | 5 | Address.find({}, "balance").sort({"balance":-1}).limit(100).lean(true).exec(function(err, docs){ 6 | var totalB = 0; 7 | for(var i=0; i 2 |
3 | 4 |
5 |
6 | 7 |
8 |
9 |
10 | 11 | -------------------------------------------------------------------------------- /public/js/stats/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hashrate", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "hashrate.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "jquery": "^3.1.0", 13 | "lodash": "^4.15.0", 14 | "moment": "^2.14.1", 15 | "request": "^2.74.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /public/plugins/morris/morris.css: -------------------------------------------------------------------------------- 1 | .morris-hover{position:absolute;z-index:1000}.morris-hover.morris-default-style{border-radius:10px;padding:6px;color:#666;background:rgba(255,255,255,0.8);border:solid 2px rgba(230,230,230,0.8);font-family:sans-serif;font-size:12px;text-align:center}.morris-hover.morris-default-style .morris-hover-row-label{font-weight:bold;margin:0.25em 0} 2 | .morris-hover.morris-default-style .morris-hover-point{white-space:nowrap;margin:0.1em 0} 3 | -------------------------------------------------------------------------------- /public/views/err_404.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
404
4 |
5 |

Oops! You're lost.

6 |

We can not find the {{thing}} you are looking for. 7 |

8 | If you believe your {{thing}} is correct,
9 | please report this error. 10 |

11 |
12 |
13 |
-------------------------------------------------------------------------------- /public/plugins/morris/spec/lib/grid/y_label_format_spec.coffee: -------------------------------------------------------------------------------- 1 | describe 'Morris.Grid#yLabelFormat', -> 2 | 3 | it 'should use custom formatter for y labels', -> 4 | formatter = (label) -> 5 | flabel = parseFloat(label) / 1000 6 | "#{flabel.toFixed(1)}k" 7 | line = Morris.Line 8 | element: 'graph' 9 | data: [{x: 1, y: 1500}, {x: 2, y: 2500}] 10 | xkey: 'x' 11 | ykeys: ['y'] 12 | labels: ['dontcare'] 13 | preUnits: "$" 14 | yLabelFormat: formatter 15 | line.yLabelFormat(1500).should.equal "1.5k" 16 | -------------------------------------------------------------------------------- /tools/priTools/countRichListBalance.js: -------------------------------------------------------------------------------- 1 | //update from address balance from rich-list.txt 2 | require( '../../db.js' ); 3 | var mongoose = require( 'mongoose' ); 4 | var Address = mongoose.model('Address'); 5 | 6 | var fs = require("fs"); 7 | var rawFilePath = "./rich-list-100.txt";//w 8 | var content = fs.readFileSync(rawFilePath, "utf8"); 9 | var rawAddrList = JSON.parse(content);//[addr,balance,addr,balance,...] 10 | 11 | var totalETZ = 0; 12 | for(var i=0; i 2 | 3 | it 'should pad numbers', -> 4 | Morris.pad2(0).should.equal("00") 5 | Morris.pad2(1).should.equal("01") 6 | Morris.pad2(2).should.equal("02") 7 | Morris.pad2(3).should.equal("03") 8 | Morris.pad2(4).should.equal("04") 9 | Morris.pad2(5).should.equal("05") 10 | Morris.pad2(6).should.equal("06") 11 | Morris.pad2(7).should.equal("07") 12 | Morris.pad2(8).should.equal("08") 13 | Morris.pad2(9).should.equal("09") 14 | Morris.pad2(10).should.equal("10") 15 | Morris.pad2(12).should.equal("12") 16 | Morris.pad2(34).should.equal("34") 17 | Morris.pad2(123).should.equal("123") -------------------------------------------------------------------------------- /public/plugins/jquery-slimscroll/README.md: -------------------------------------------------------------------------------- 1 | # What is slimScroll? 2 | 3 | slimScroll is a small jQuery plugin that transforms any div into a scrollable area with a nice scrollbar - similar to the one Facebook and Google started using in their products recently. slimScroll doesn't occupy any visual space as it only appears on a user initiated mouse-over. User can drag the scrollbar or use mouse-wheel to change the scroll value. 4 | 5 | Demo and more: http://rocha.la/jQuery-slimScroll 6 | 7 | Copyright (c) 2011 Piotr Rochala (http://rocha.la) 8 | Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. 9 | 10 | -------------------------------------------------------------------------------- /public/js/controllers/PublicAPIDocController.js: -------------------------------------------------------------------------------- 1 | angular.module('BlocksApp').controller('PublicAPIController', function($stateParams, $rootScope, $scope, $http) { 2 | // $scope.$on('$viewContentLoaded', function() { 3 | // // initialize core components 4 | // App.initAjax(); 5 | // }); 6 | 7 | // var executeAPI = function(params){ 8 | // $http({ 9 | // method: 'POST', 10 | // url: '/publicAPIData', 11 | // data: {"params": params} 12 | // }).success(function(data) { 13 | // if (data.error) 14 | // $location.path("/err404/publicAPI/" + params); 15 | // else { 16 | // $scope.data = data; 17 | // } 18 | // }); 19 | // } 20 | 21 | // executeAPI($stateParams.params); 22 | }) -------------------------------------------------------------------------------- /public/js/controllers/StatsController.js: -------------------------------------------------------------------------------- 1 | angular.module('BlocksApp').controller('StatsController', function($stateParams, $rootScope, $scope) { 2 | 3 | $rootScope.isHome = false; 4 | 5 | /* 6 | Chart types: 7 | etc_hashrate: ETZ Hashrate Growth 8 | miner_hashrate: Miner Hashrate Distribution 9 | */ 10 | 11 | const CHART_TYPES = { 12 | "etc_hashrate": { 13 | "title": "ETZ Hashrate Growth" 14 | }, 15 | "miner_hashrate": { 16 | "title": "Miner Hashrate Distribution" 17 | }, 18 | "The_bomb_chart": { 19 | "title": "The bomb chart" 20 | } 21 | } 22 | 23 | $rootScope.$state.current.data["pageSubTitle"] = CHART_TYPES[$stateParams.chart].title; 24 | 25 | }) -------------------------------------------------------------------------------- /public/plugins/morris/examples/_template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

Title

13 |
14 |
15 | // Insert code here:
16 | // it'll get eval()-ed and prettyprinted.
17 | 
18 | 19 | -------------------------------------------------------------------------------- /public/js/controllers/ContractListController.js: -------------------------------------------------------------------------------- 1 | angular.module('BlocksApp').controller('ContractListController', function($stateParams, $rootScope, $scope, $http) { 2 | $scope.$on('$viewContentLoaded', function() { 3 | // initialize core components 4 | App.initAjax(); 5 | }); 6 | 7 | 8 | 9 | $scope.page = 0; 10 | $scope.getInfoList=function(page) { 11 | $http({ 12 | method: 'POST', 13 | url: '/contractListData', 14 | data: {"ERC": -1, "page":page} 15 | }).success(function(repData) { 16 | $scope.page = repData.page; 17 | var pages = []; 18 | for(i=0; i", 16 | "license": "ISC", 17 | "dependencies": { 18 | "murmurhash3": "^0.4.0" 19 | }, 20 | "repository": { 21 | "type": "git", 22 | "url": "git@github.com:raghav-grover/node-bloom-filter.git" 23 | }, 24 | "devDependencies": { 25 | "chai": "^4.1.2", 26 | "mocha": "^4.0.1", 27 | "uuid": "^3.1.0" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /public/plugins/morris/spec/viz/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 20 | 31 | 32 | 33 |
34 | 35 | -------------------------------------------------------------------------------- /tools/priTools/getLessAddr.js: -------------------------------------------------------------------------------- 1 | //update from address balance from rich-list.txt 2 | require( '../../db.js' ); 3 | var mongoose = require( 'mongoose' ); 4 | var Address = mongoose.model('Address'); 5 | 6 | var fs = require("fs"); 7 | var rawFilePath = "./fullAddrList.txt";//w 8 | var content = fs.readFileSync(rawFilePath, "utf8"); 9 | var rawAddrList2 = JSON.parse(content); 10 | var rawAddrList = [] 11 | for(var i=0; i= 1.7" 18 | }, 19 | 20 | "licenses" : [ 21 | { 22 | "type": "MIT", 23 | "url": "http://www.opensource.org/licenses/mit-license.php" 24 | }, 25 | { 26 | "type": "GPL", 27 | "url": "http://www.opensource.org/licenses/gpl-license.php" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /public/js/controllers/BlockController.js: -------------------------------------------------------------------------------- 1 | angular.module('BlocksApp').controller('BlockController', function($stateParams, $rootScope, $scope, $http, $location) { 2 | $scope.$on('$viewContentLoaded', function() { 3 | // initialize core components 4 | App.initAjax(); 5 | //TableAjax.init(); 6 | }); 7 | 8 | $rootScope.$state.current.data["pageSubTitle"] = $stateParams.number; 9 | $scope.blockNum = $stateParams.number; 10 | 11 | //fetch transactions 12 | $http({ 13 | method: 'POST', 14 | url: '/block', 15 | data: {"block": $scope.blockNum} 16 | }).success(function(data) { 17 | if (data.error) 18 | $location.path("/err404/block/" + $scope.blockNum); 19 | else { 20 | // if(data.extraData && data.extraData.length>5){ 21 | // data.extraData = data.extraData.charCodeAt(3)+"."+data.extraData.charCodeAt(4)+"."+data.extraData.charCodeAt(5); 22 | // } 23 | $scope.block = data; 24 | $scope.block.datetime = new Date(data.timestamp*1000); 25 | } 26 | }); 27 | 28 | 29 | }) -------------------------------------------------------------------------------- /public/plugins/simple-line-icons/Readme.txt: -------------------------------------------------------------------------------- 1 | SIMPLE LINE ICONS 2 | ====================================================================================== 3 | 4 | Simple Line Icons is 162 simple stroke icons that are great for mobile applications, 5 | websites, user interfaces, etc. All icons were converted from the same beautiful 6 | simple line icon sets released previously on GraphicBurger. 7 | 8 | You can checkout the vector PSD versions of these icons on the following links 9 | 10 | * http://graphicburger.com/simple-line-icons-set-vol-1/ 11 | * http://graphicburger.com/simple-line-icons-set-vol-2/ 12 | * http://graphicburger.com/simple-line-icons-set-vol-3/ 13 | * http://graphicburger.com/simple-line-icons-set-vol-4/ 14 | 15 | To modify your generated font, use the *dev.svg* file, located in the *fonts* folder in 16 | this package. You can import this dev.svg file to the IcoMoon app. All the tags (class 17 | names) and the Unicode points of your glyphs are saved in this file. 18 | 19 | These fonts converted to SVG using Illustrator, the SVG was then converted into a font 20 | using the awesome Icooon app (http://icomoon.io/app) 21 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | ## EtherZero Explorer License 2 | 3 | Copyright (c) 2016 EtherZero, and contributors to this project 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /check_restart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | step=4 3 | for ((i=0;i<148;i=(i+step)));do 4 | count=`ps aux | grep "app.js" | grep -v "grep" | wc -l` 5 | if [ $count -lt 1 ]; then 6 | mv /var/www/etzBrowser/logs/out.log.txt /var/www/etzBrowser/logs/c_out.$(date -d "today" +"%Y%m%d_%H%M%S").txt 7 | mv /var/www/etzBrowser/logs/err.log.txt /var/www/etzBrowser/logs/c_err.$(date -d "today" +"%Y%m%d_%H%M%S").txt 8 | nohup node /var/www/etzBrowser/app.js 1>/var/www/etzBrowser/logs/out.log.txt 2>/var/www/etzBrowser/logs/err.log.txt & 9 | echo "start app ..." 10 | fi 11 | count_g=`ps aux | grep "grabber.js" | grep -v "grep" | wc -l` 12 | if [ $count_g -lt 1 ]; then 13 | mv /var/www/etzBrowser/tools/logs/out.log.txt /var/www/etzBrowser/tools/logs/c_out.$(date -d "today" +"%Y%m%d_%H%M%S").txt 14 | mv /var/www/etzBrowser/tools/logs/err.log.txt /var/www/etzBrowser/tools/logs/c_err.$(date -d "today" +"%Y%m%d_%H%M%S").txt 15 | nohup node /var/www/etzBrowser/tools/grabber.js 1>/var/www/etzBrowser/tools/logs/out.log.txt 2>/var/www/etzBrowser/tools/logs/err.log.txt & 16 | echo "start grabber ..." 17 | fi 18 | sleep $step 19 | done 20 | exit 0 21 | -------------------------------------------------------------------------------- /public/plugins/morris/examples/donut.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Donut Chart

14 |
15 |
16 | Morris.Donut({
17 |   element: 'graph',
18 |   data: [
19 |     {value: 70, label: 'foo'},
20 |     {value: 15, label: 'bar'},
21 |     {value: 10, label: 'baz'},
22 |     {value: 5, label: 'A really really long label'}
23 |   ],
24 |   formatter: function (x) { return x + "%"}
25 | }).on('click', function(i, row){
26 |   console.log(i, row);
27 | });
28 | 
29 | 30 | -------------------------------------------------------------------------------- /public/plugins/morris/examples/bar-no-axes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Bar charts

14 |
15 |
16 | // Use Morris.Bar
17 | Morris.Bar({
18 |   element: 'graph',
19 |   axes: false,
20 |   data: [
21 |     {x: '2011 Q1', y: 3, z: 2, a: 3},
22 |     {x: '2011 Q2', y: 2, z: null, a: 1},
23 |     {x: '2011 Q3', y: 0, z: 2, a: 4},
24 |     {x: '2011 Q4', y: 2, z: 4, a: 3}
25 |   ],
26 |   xkey: 'x',
27 |   ykeys: ['y', 'z', 'a'],
28 |   labels: ['Y', 'Z', 'A']
29 | });
30 | 
31 | 32 | -------------------------------------------------------------------------------- /public/plugins/morris/examples/goals.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Value Goals

14 |
15 |
16 | var decimal_data = [];
17 | for (var x = 0; x <= 360; x += 10) {
18 |   decimal_data.push({
19 |     x: x,
20 |     y: Math.sin(Math.PI * x / 180).toFixed(4)
21 |   });
22 | }
23 | window.m = Morris.Line({
24 |   element: 'graph',
25 |   data: decimal_data,
26 |   xkey: 'x',
27 |   ykeys: ['y'],
28 |   labels: ['sin(x)'],
29 |   parseTime: false,
30 |   goals: [-1, 0, 1]
31 | });
32 | 
33 | 34 | -------------------------------------------------------------------------------- /public/plugins/morris/examples/stacked_bars.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Stacked Bars chart

14 |
15 |
16 | // Use Morris.Bar
17 | Morris.Bar({
18 |   element: 'graph',
19 |   data: [
20 |     {x: '2011 Q1', y: 3, z: 2, a: 3},
21 |     {x: '2011 Q2', y: 2, z: null, a: 1},
22 |     {x: '2011 Q3', y: 0, z: 2, a: 4},
23 |     {x: '2011 Q4', y: 2, z: 4, a: 3}
24 |   ],
25 |   xkey: 'x',
26 |   ykeys: ['y', 'z', 'a'],
27 |   labels: ['Y', 'Z', 'A'],
28 |   stacked: true
29 | });
30 | 
31 | 32 | -------------------------------------------------------------------------------- /public/plugins/morris/examples/dst.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Daylight-savings time

14 |
15 |
16 | // This crosses a DST boundary in the UK.
17 | Morris.Area({
18 |   element: 'graph',
19 |   data: [
20 |     {x: '2013-03-30 22:00:00', y: 3, z: 3},
21 |     {x: '2013-03-31 00:00:00', y: 2, z: 0},
22 |     {x: '2013-03-31 02:00:00', y: 0, z: 2},
23 |     {x: '2013-03-31 04:00:00', y: 4, z: 4}
24 |   ],
25 |   xkey: 'x',
26 |   ykeys: ['y', 'z'],
27 |   labels: ['Y', 'Z']
28 | });
29 | 
30 | 31 | -------------------------------------------------------------------------------- /public/plugins/morris/examples/area-as-line.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Area charts behaving like line charts

14 |
15 |
16 | // Use Morris.Area instead of Morris.Line
17 | Morris.Area({
18 |   element: 'graph',
19 |   behaveLikeLine: true,
20 |   data: [
21 |     {x: '2011 Q1', y: 3, z: 3},
22 |     {x: '2011 Q2', y: 2, z: 1},
23 |     {x: '2011 Q3', y: 2, z: 4},
24 |     {x: '2011 Q4', y: 3, z: 3}
25 |   ],
26 |   xkey: 'x',
27 |   ykeys: ['y', 'z'],
28 |   labels: ['Y', 'Z']
29 | });
30 | 
31 | 32 | -------------------------------------------------------------------------------- /db-internal.js: -------------------------------------------------------------------------------- 1 | /****** 2 | DEPRECATED -- DO NOT USE 3 | *******/ 4 | var mongoose = require( 'mongoose' ); 5 | var Schema = mongoose.Schema; 6 | 7 | var InternalTransaction = new Schema( 8 | { 9 | "type": String, 10 | "action": { 11 | "from": String, // for call 12 | "to": String, 13 | "value": String, 14 | "gas": Number, 15 | "input":String, 16 | "callType":String, 17 | "init": String, // for create 18 | "address": String, // for suicide 19 | "refundAddress": String, 20 | "balance": String 21 | }, 22 | "result": { 23 | "gasUsed":Number, 24 | "output":String, 25 | "code": String, 26 | "address": String 27 | }, 28 | "error": String, 29 | "traceAddress":[String], 30 | "subtraces":Number, 31 | "transactionPosition":Number, 32 | "transactionHash": {type: String, index: {unique: false}}, // parent transaction 33 | "blockNumber":{type: Number, index: {unique: false}}, 34 | "timestamp": Number, 35 | "blockHash":String 36 | }); 37 | 38 | mongoose.model('InternalTransaction', InternalTransaction); 39 | module.exports.InternalTransaction = mongoose.model('InternalTransaction'); -------------------------------------------------------------------------------- /public/plugins/morris/examples/bar.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Bar charts

14 |
15 |
16 | // Use Morris.Bar
17 | Morris.Bar({
18 |   element: 'graph',
19 |   data: [
20 |     {x: '2011 Q1', y: 3, z: 2, a: 3},
21 |     {x: '2011 Q2', y: 2, z: null, a: 1},
22 |     {x: '2011 Q3', y: 0, z: 2, a: 4},
23 |     {x: '2011 Q4', y: 2, z: 4, a: 3}
24 |   ],
25 |   xkey: 'x',
26 |   ykeys: ['y', 'z', 'a'],
27 |   labels: ['Y', 'Z', 'A']
28 | }).on('click', function(i, row){
29 |   console.log(i, row);
30 | });
31 | 
32 | 33 | -------------------------------------------------------------------------------- /public/plugins/morris/examples/donut-formatter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Donut Chart

14 |
15 |
16 | Morris.Donut({
17 |   element: 'graph',
18 |   data: [
19 |     {value: 70, label: 'foo', formatted: 'at least 70%' },
20 |     {value: 15, label: 'bar', formatted: 'approx. 15%' },
21 |     {value: 10, label: 'baz', formatted: 'approx. 10%' },
22 |     {value: 5, label: 'A really really long label', formatted: 'at most 5%' }
23 |   ],
24 |   formatter: function (x, data) { return data.formatted; }
25 | });
26 | 
27 | 28 | -------------------------------------------------------------------------------- /public/plugins/morris/lib/morris.coffee: -------------------------------------------------------------------------------- 1 | Morris = window.Morris = {} 2 | 3 | $ = jQuery 4 | 5 | # Very simple event-emitter class. 6 | # 7 | # @private 8 | class Morris.EventEmitter 9 | on: (name, handler) -> 10 | unless @handlers? 11 | @handlers = {} 12 | unless @handlers[name]? 13 | @handlers[name] = [] 14 | @handlers[name].push(handler) 15 | @ 16 | 17 | fire: (name, args...) -> 18 | if @handlers? and @handlers[name]? 19 | for handler in @handlers[name] 20 | handler(args...) 21 | 22 | # Make long numbers prettier by inserting commas. 23 | # 24 | # @example 25 | # Morris.commas(1234567) -> '1,234,567' 26 | Morris.commas = (num) -> 27 | if num? 28 | ret = if num < 0 then "-" else "" 29 | absnum = Math.abs(num) 30 | intnum = Math.floor(absnum).toFixed(0) 31 | ret += intnum.replace(/(?=(?:\d{3})+$)(?!^)/g, ',') 32 | strabsnum = absnum.toString() 33 | if strabsnum.length > intnum.length 34 | ret += strabsnum.slice(intnum.length) 35 | ret 36 | else 37 | '-' 38 | 39 | # Zero-pad numbers to two characters wide. 40 | # 41 | # @example 42 | # Morris.pad2(1) -> '01' 43 | Morris.pad2 = (number) -> (if number < 10 then '0' else '') + number 44 | -------------------------------------------------------------------------------- /tools/priTools/updateWitnessVersion.js: -------------------------------------------------------------------------------- 1 | require( '../../db.js' ); 2 | var mongoose = require('mongoose'); 3 | var Witness = mongoose.model('Witness'); 4 | var Block = mongoose.model('Block'); 5 | 6 | var hex2ascii = function (hexIn) { 7 | var hex = hexIn.toString(); 8 | var str = ''; 9 | for (var i = 0; i < hex.length; i += 2) 10 | str += String.fromCharCode(parseInt(hex.substr(i, 2), 16)); 11 | return str; 12 | } 13 | 14 | async function test(){ 15 | let witnesses = await Witness.aggregate([{$lookup:{from:"blocks",localField:"lastCountTo",foreignField:"number",as: "block"}}]).exec() 16 | for (var i = 0; i < witnesses.length; i++) { 17 | let extraData = hex2ascii(witnesses[i].block[0].extraData); 18 | if (extraData && extraData.length > 5) { 19 | // console.log(extraData); 20 | let version = extraData.charCodeAt(3)+"."+extraData.charCodeAt(4)+"."+extraData.charCodeAt(5); 21 | // console.log(witnesses[i].witness, version); 22 | // console.log(witnesses[i].witness, version); 23 | await Witness.update({"witness":witnesses[i].witness}, 24 | {$set:{"version": version}} 25 | ).exec() 26 | } 27 | } 28 | console.log("finished"); 29 | } 30 | 31 | test() 32 | -------------------------------------------------------------------------------- /public/plugins/bootstrap-hover-dropdown/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2012-2014 Cameron Spear http://cameronspear.com 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | -------------------------------------------------------------------------------- /public/plugins/morris/examples/area.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Area charts

14 |
15 |
16 | // Use Morris.Area instead of Morris.Line
17 | Morris.Area({
18 |   element: 'graph',
19 |   data: [
20 |     {x: '2010 Q4', y: 3, z: 7},
21 |     {x: '2011 Q1', y: 3, z: 4},
22 |     {x: '2011 Q2', y: null, z: 1},
23 |     {x: '2011 Q3', y: 2, z: 5},
24 |     {x: '2011 Q4', y: 8, z: 2},
25 |     {x: '2012 Q1', y: 4, z: 4}
26 |   ],
27 |   xkey: 'x',
28 |   ykeys: ['y', 'z'],
29 |   labels: ['Y', 'Z']
30 | }).on('click', function(i, row){
31 |   console.log(i, row);
32 | });
33 | 
34 | 35 | -------------------------------------------------------------------------------- /public/plugins/morris/spec/lib/grid/auto_grid_lines_spec.coffee: -------------------------------------------------------------------------------- 1 | describe 'Morris.Grid#autoGridLines', -> 2 | 3 | beforeEach -> 4 | @subject = Morris.Grid.prototype.autoGridLines 5 | 6 | it 'should draw at fixed intervals', -> 7 | @subject(0, 4, 5).should.deep.equal [0, 1, 2, 3, 4] 8 | @subject(0, 400, 5).should.deep.equal [0, 100, 200, 300, 400] 9 | 10 | it 'should pick intervals that show significant numbers', -> 11 | @subject(102, 499, 5).should.deep.equal [100, 200, 300, 400, 500] 12 | 13 | it 'should draw zero when it falls within [ymin..ymax]', -> 14 | @subject(-100, 300, 5).should.deep.equal [-100, 0, 100, 200, 300] 15 | @subject(-50, 350, 5).should.deep.equal [-125, 0, 125, 250, 375] 16 | @subject(-400, 400, 5).should.deep.equal [-400, -200, 0, 200, 400] 17 | @subject(100, 500, 5).should.deep.equal [100, 200, 300, 400, 500] 18 | @subject(-500, -100, 5).should.deep.equal [-500, -400, -300, -200, -100] 19 | 20 | it 'should generate decimal labels to 2 significant figures', -> 21 | @subject(0, 1, 5).should.deep.equal [0, 0.25, 0.5, 0.75, 1] 22 | @subject(0.1, 0.5, 5).should.deep.equal [0.1, 0.2, 0.3, 0.4, 0.5] 23 | 24 | it 'should use integer intervals for intervals larger than 1', -> 25 | @subject(0, 9, 5).should.deep.equal [0, 3, 6, 9, 12] 26 | -------------------------------------------------------------------------------- /public/plugins/morris/examples/donut-colors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 |

Donut Chart

17 |
18 |
19 | Morris.Donut({
20 |   element: 'graph',
21 |   data: [
22 |     {value: 70, label: 'foo'},
23 |     {value: 15, label: 'bar'},
24 |     {value: 10, label: 'baz'},
25 |     {value: 5, label: 'A really really long label'}
26 |   ],
27 |   backgroundColor: '#ccc',
28 |   labelColor: '#060',
29 |   colors: [
30 |     '#0BA462',
31 |     '#39B580',
32 |     '#67C69D',
33 |     '#95D7BB'
34 |   ],
35 |   formatter: function (x) { return x + "%"}
36 | });
37 | 
38 | 39 | -------------------------------------------------------------------------------- /public/plugins/morris/lib/morris.hover.coffee: -------------------------------------------------------------------------------- 1 | class Morris.Hover 2 | # Displays contextual information in a floating HTML div. 3 | 4 | @defaults: 5 | class: 'morris-hover morris-default-style' 6 | 7 | constructor: (options = {}) -> 8 | @options = $.extend {}, Morris.Hover.defaults, options 9 | @el = $ "
" 10 | @el.hide() 11 | @options.parent.append(@el) 12 | 13 | update: (html, x, y) -> 14 | if not html 15 | @hide() 16 | else 17 | @html(html) 18 | @show() 19 | @moveTo(x, y) 20 | 21 | html: (content) -> 22 | @el.html(content) 23 | 24 | moveTo: (x, y) -> 25 | parentWidth = @options.parent.innerWidth() 26 | parentHeight = @options.parent.innerHeight() 27 | hoverWidth = @el.outerWidth() 28 | hoverHeight = @el.outerHeight() 29 | left = Math.min(Math.max(0, x - hoverWidth / 2), parentWidth - hoverWidth) 30 | if y? 31 | top = y - hoverHeight - 10 32 | if top < 0 33 | top = y + 10 34 | if top + hoverHeight > parentHeight 35 | top = parentHeight / 2 - hoverHeight / 2 36 | else 37 | top = parentHeight / 2 - hoverHeight / 2 38 | @el.css(left: left + "px", top: parseInt(top) + "px") 39 | 40 | show: -> 41 | @el.show() 42 | 43 | hide: -> 44 | @el.hide() 45 | -------------------------------------------------------------------------------- /routes/contractListData.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | module.exports = function(req, res){ 3 | var page = req.body.page; 4 | if(page<0 || page==undefined) 5 | page = 0; 6 | var resultData={"totalPage":0, "list":null, "page":page}; 7 | var respData = ""; 8 | try{ 9 | var pageSize = 10; 10 | var ERC_type = req.body.ERC; 11 | var mongoose = require( 'mongoose' ); 12 | var Contract = mongoose.model('Contract'); 13 | var findCondition; 14 | if(ERC_type==-1) 15 | findCondition = {}; 16 | else 17 | findCondition = {ERC:ERC_type}; 18 | Contract.count(findCondition).exec(function(err,c){ 19 | resultData.totalPage = Math.ceil(c/pageSize); 20 | if(page>=resultData.totalPage){ 21 | resultData.page = 0; 22 | page=0; 23 | } 24 | contractFind = Contract.find(findCondition, "contractName tokenName ERC address").skip(page*pageSize).limit(pageSize).lean(true); 25 | contractFind.exec(function (err, docs) { 26 | resultData.list=docs; 27 | respData = JSON.stringify(resultData); 28 | res.write(respData); 29 | res.end(); 30 | }); 31 | }); 32 | } catch (e) { 33 | console.error(e); 34 | res.write(JSON.stringify(resultData)); 35 | res.end(); 36 | } 37 | }; -------------------------------------------------------------------------------- /public/plugins/morris/examples/negative.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Negative values

14 |
15 |
16 | var neg_data = [
17 |   {"period": "2011-08-12", "a": 100},
18 |   {"period": "2011-03-03", "a": 75},
19 |   {"period": "2010-08-08", "a": 50},
20 |   {"period": "2010-05-10", "a": 25},
21 |   {"period": "2010-03-14", "a": 0},
22 |   {"period": "2010-01-10", "a": -25},
23 |   {"period": "2009-12-10", "a": -50},
24 |   {"period": "2009-10-07", "a": -75},
25 |   {"period": "2009-09-25", "a": -100}
26 | ];
27 | Morris.Line({
28 |   element: 'graph',
29 |   data: neg_data,
30 |   xkey: 'period',
31 |   ykeys: ['a'],
32 |   labels: ['Series A'],
33 |   units: '%'
34 | });
35 | 
36 | 37 | -------------------------------------------------------------------------------- /public/plugins/morris/examples/decimal-custom-hover.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Decimal Data

14 |
15 |
16 | var decimal_data = [];
17 | for (var x = 0; x <= 360; x += 10) {
18 |   decimal_data.push({
19 |     x: x,
20 |     y: 1.5 + 1.5 * Math.sin(Math.PI * x / 180).toFixed(4)
21 |   });
22 | }
23 | window.m = Morris.Line({
24 |   element: 'graph',
25 |   data: decimal_data,
26 |   xkey: 'x',
27 |   ykeys: ['y'],
28 |   labels: ['sin(x)'],
29 |   parseTime: false,
30 |   hoverCallback: function (index, options, default_content, row) {
31 |     return default_content.replace("sin(x)", "1.5 + 1.5 sin(" + row.x + ")");
32 |   },
33 |   xLabelMargin: 10,
34 |   integerYLabels: true
35 | });
36 | 
37 | 38 | -------------------------------------------------------------------------------- /public/plugins/morris/examples/non-date.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Formatting Non-date Arbitrary X-axis

14 |
15 |
16 | var day_data = [
17 |   {"elapsed": "I", "value": 34},
18 |   {"elapsed": "II", "value": 24},
19 |   {"elapsed": "III", "value": 3},
20 |   {"elapsed": "IV", "value": 12},
21 |   {"elapsed": "V", "value": 13},
22 |   {"elapsed": "VI", "value": 22},
23 |   {"elapsed": "VII", "value": 5},
24 |   {"elapsed": "VIII", "value": 26},
25 |   {"elapsed": "IX", "value": 12},
26 |   {"elapsed": "X", "value": 19}
27 | ];
28 | Morris.Line({
29 |   element: 'graph',
30 |   data: day_data,
31 |   xkey: 'elapsed',
32 |   ykeys: ['value'],
33 |   labels: ['value'],
34 |   parseTime: false
35 | });
36 | 
37 | 38 | -------------------------------------------------------------------------------- /public/css/default.css: -------------------------------------------------------------------------------- 1 | /* 2 | #1 = 35A49C 3 | #2 = 79CDC0 4 | */ 5 | a { 6 | color: #35A49C; 7 | } 8 | a:hover { 9 | color: #79CDC0; 10 | } 11 | 12 | /* menu */ 13 | .nav>li>a:hover { 14 | color: #79CDC0; 15 | } 16 | 17 | .navbar .navbar-nav > .active > a { 18 | color: #79CDC0; 19 | } 20 | 21 | /* flexslider */ 22 | .flex-control-paging li a { 23 | background: #35A49C; 24 | } 25 | 26 | .flex-direction-nav a:hover{ 27 | background-color:#35A49C; 28 | } 29 | 30 | .testimonial span.author a { 31 | color: #79CDC0; 32 | } 33 | 34 | /* --- icon box hover --- */ 35 | .hi-icon-effect-5 .hi-icon { 36 | color: #35A49C; 37 | box-shadow: 0 0 0 4px #35A49C; 38 | } 39 | .no-touch .hi-icon-effect-5 .hi-icon:hover { 40 | background: #35A49C; 41 | box-shadow: 0 0 0 8px #79CDC0; 42 | } 43 | 44 | 45 | /* portfolio */ 46 | .portfolio-item .portfolio-desc { 47 | background: #35A49C; 48 | } 49 | 50 | /* btn */ 51 | .btn-theme { 52 | background: #79CDC0; 53 | } 54 | .btn-theme:hover,.btn-theme:focus,.btn-theme:active{ 55 | background: #35A49C; 56 | } 57 | .btn-cta,.btn-cta.btn-lg { 58 | background: #35A49C; 59 | border-color: #79CDC0; 60 | } 61 | 62 | .btn-cta:focus,.btn-cta:active{ 63 | border-color: #35A49C; 64 | } 65 | 66 | /* contact */ 67 | .validation { 68 | color:#35A49C; 69 | } 70 | 71 | /* footer */ 72 | .social-circle li a { 73 | background:#35A49C; 74 | } 75 | 76 | a.scrollup{ 77 | background:#35A49C; 78 | } -------------------------------------------------------------------------------- /public/js/web3utils.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Checks if the given string is strictly an address 4 | * 5 | * @method isStrictAddress 6 | * @param {String} address the given HEX adress 7 | * @return {Boolean} 8 | */ 9 | var isStrictAddress = function (address) { 10 | return /^0x[0-9a-f]{40}$/i.test(address); 11 | }; 12 | 13 | /** 14 | * Checks if the given string is an address 15 | * 16 | * @method isAddress 17 | * @param {String} address the given HEX adress 18 | * @return {Boolean} 19 | */ 20 | var isAddress = function (address) { 21 | if (!/^(0x)?[0-9a-f]{40}$/i.test(address)) { 22 | // check if it has the basic requirements of an address 23 | return false; 24 | } else if (/^(0x)?[0-9a-f]{40}$/.test(address) || /^(0x)?[0-9A-F]{40}$/.test(address)) { 25 | // If it's all small caps or all all caps, return true 26 | return true; 27 | } else { 28 | // Otherwise check each case 29 | return false; 30 | } 31 | }; 32 | 33 | var isTransaction = function (tx) { 34 | if (!/^(0x)?[0-9a-f]{64}$/i.test(tx)) { 35 | // check if it has the basic requirements of an address 36 | return false; 37 | } else if (/^(0x)?[0-9a-f]{64}$/.test(tx) || /^(0x)?[0-9A-F]{64}$/.test(tx)) { 38 | // If it's all small caps or all all caps, return true 39 | return true; 40 | } else { 41 | // Otherwise check each case 42 | return false; 43 | } 44 | }; -------------------------------------------------------------------------------- /tools/priTools/collectRichestAddr.js: -------------------------------------------------------------------------------- 1 | require( '../../db.js' ); 2 | const fs = require('fs'); 3 | var mongoose = require('mongoose'); 4 | var Address = mongoose.model('Address'); 5 | // var web3 = require('./../../routes/web3relay').web3; 6 | var Web3 = require('web3'); 7 | var rpc = "http://localhost:9646"; 8 | var web3 = new Web3(new Web3.providers.HttpProvider(rpc)); 9 | 10 | async function test(num){ 11 | num = Number(num); 12 | let addresses = await Address.find({}).limit(num * 30).sort({balance:-1}).exec(); 13 | let result = new Array(num+1); 14 | result.fill({addr:"",balance:0}); 15 | for (let i = 0; i < addresses.length; i++) { 16 | let balance = web3.eth.getBalance(addresses[i].addr); 17 | balance = web3.fromWei(balance, "ether"); 18 | let balancenum = Number(balance) 19 | result[num] = {addr:addresses[i].addr,balance:balancenum}; 20 | console.log(i); 21 | for (let i = result.length - 1; i > 0; i--) { 22 | if (result[i].balance > result[i-1].balance) { 23 | let temp = result[i]; 24 | result[i] = result[i-1]; 25 | result[i-1] = temp 26 | } else { 27 | break; 28 | } 29 | } 30 | // console.log(addresses[i].addr, balancenum); 31 | } 32 | for (var i = 0; i < result.length; i++) { 33 | result[i] 34 | fs.appendFileSync('rich.txt', `${result[i].addr} ${result[i].balance} 35 | `); 36 | } 37 | console.log('finished'); 38 | } 39 | 40 | test(process.argv[2]) 41 | -------------------------------------------------------------------------------- /public/views/created-tokens.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
TxHash Age Block To Amount
{{t.transactionHash}} {{t.timestamp | timeDuration}} ago {{t.blockNumber}} {{t.to}} {{t.amount | number}} Created
25 | 33 |
-------------------------------------------------------------------------------- /public/plugins/morris/examples/bar-colors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Bar charts

14 |
15 |
16 | // Use Morris.Bar
17 | Morris.Bar({
18 |   element: 'graph',
19 |   data: [
20 |     {x: '2011 Q1', y: 0},
21 |     {x: '2011 Q2', y: 1},
22 |     {x: '2011 Q3', y: 2},
23 |     {x: '2011 Q4', y: 3},
24 |     {x: '2012 Q1', y: 4},
25 |     {x: '2012 Q2', y: 5},
26 |     {x: '2012 Q3', y: 6},
27 |     {x: '2012 Q4', y: 7},
28 |     {x: '2013 Q1', y: 8}
29 |   ],
30 |   xkey: 'x',
31 |   ykeys: ['y'],
32 |   labels: ['Y'],
33 |   barColors: function (row, series, type) {
34 |     if (type === 'bar') {
35 |       var red = Math.ceil(255 * row.y / this.ymax);
36 |       return 'rgb(' + red + ',0,0)';
37 |     }
38 |     else {
39 |       return '#000';
40 |     }
41 |   }
42 | });
43 | 
44 | 45 | -------------------------------------------------------------------------------- /public/plugins/angularjs/angular-cookies.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.4.7 3 | (c) 2010-2015 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(p,c,n){'use strict';function l(b,a,g){var d=g.baseHref(),k=b[0];return function(b,e,f){var g,h;f=f||{};h=f.expires;g=c.isDefined(f.path)?f.path:d;c.isUndefined(e)&&(h="Thu, 01 Jan 1970 00:00:00 GMT",e="");c.isString(h)&&(h=new Date(h));e=encodeURIComponent(b)+"="+encodeURIComponent(e);e=e+(g?";path="+g:"")+(f.domain?";domain="+f.domain:"");e+=h?";expires="+h.toUTCString():"";e+=f.secure?";secure":"";f=e.length+1;4096 4096 bytes)!");k.cookie=e}}c.module("ngCookies",["ng"]).provider("$cookies",[function(){var b=this.defaults={};this.$get=["$$cookieReader","$$cookieWriter",function(a,g){return{get:function(d){return a()[d]},getObject:function(d){return(d=this.get(d))?c.fromJson(d):d},getAll:function(){return a()},put:function(d,a,m){g(d,a,m?c.extend({},b,m):b)},putObject:function(d,b,a){this.put(d,c.toJson(b),a)},remove:function(a,k){g(a,n,k?c.extend({},b,k):b)}}}]}]);c.module("ngCookies").factory("$cookieStore", 8 | ["$cookies",function(b){return{get:function(a){return b.getObject(a)},put:function(a,c){b.putObject(a,c)},remove:function(a){b.remove(a)}}}]);l.$inject=["$document","$log","$browser"];c.module("ngCookies").provider("$$cookieWriter",function(){this.$get=l})})(window,window.angular); 9 | //# sourceMappingURL=angular-cookies.min.js.map -------------------------------------------------------------------------------- /ecosystem.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | apps : [{ 3 | name: 'app', 4 | script: 'app.js', 5 | cwd: '/var/www/etzBrowser', 6 | 7 | // Options reference: https://pm2.io/doc/en/runtime/reference/ecosystem-file/ 8 | // args: 'one two', 9 | instances: 1, 10 | autorestart: true, 11 | watch: false, 12 | max_memory_restart: '4G', 13 | log_date_format: 'YYYY-MM-DD HH:mm:ss ZZ', 14 | env: { 15 | PORT: 80, 16 | NODE_ENV: 'development', 17 | }, 18 | env_production: { 19 | PORT: 80, 20 | NODE_ENV: 'production', 21 | } 22 | }, 23 | { 24 | name: 'grabber', 25 | script: 'tools/grabber.js', 26 | cwd: '/var/www/etzBrowser', 27 | 28 | // Options reference: https://pm2.io/doc/en/runtime/reference/ecosystem-file/ 29 | // args: 'one two', 30 | instances: 1, 31 | autorestart: true, 32 | watch: false, 33 | max_memory_restart: '4G', 34 | log_date_format: 'YYYY-MM-DD HH:mm:ss ZZ', 35 | env: { 36 | NODE_ENV: 'development' 37 | }, 38 | env_production: { 39 | NODE_ENV: 'production' 40 | } 41 | } 42 | ], 43 | 44 | // deploy : { 45 | // production : { 46 | // user : 'node', 47 | // host : '212.83.163.1', 48 | // ref : 'origin/master', 49 | // repo : 'git@github.com:repo.git', 50 | // path : '/var/www/production', 51 | // 'post-deploy' : 'npm install && pm2 reload ecosystem.config.js --env production' 52 | // } 53 | // } 54 | }; 55 | -------------------------------------------------------------------------------- /public/plugins/morris/spec/lib/bar/colours.coffee: -------------------------------------------------------------------------------- 1 | describe 'Morris.Bar#colorFor', -> 2 | 3 | defaults = 4 | element: 'graph' 5 | data: [{x: 'foo', y: 2, z: 3}, {x: 'bar', y: 4, z: 6}] 6 | xkey: 'x' 7 | ykeys: ['y', 'z'] 8 | labels: ['Y', 'Z'] 9 | 10 | it 'should fetch colours from an array', -> 11 | chart = Morris.Bar $.extend {}, defaults, barColors: ['#f00', '#0f0', '#00f'] 12 | chart.colorFor(chart.data[0], 0, 'bar').should.equal '#f00' 13 | chart.colorFor(chart.data[0], 0, 'hover').should.equal '#f00' 14 | chart.colorFor(chart.data[0], 1, 'bar').should.equal '#0f0' 15 | chart.colorFor(chart.data[0], 1, 'hover').should.equal '#0f0' 16 | chart.colorFor(chart.data[0], 2, 'bar').should.equal '#00f' 17 | chart.colorFor(chart.data[0], 2, 'hover').should.equal '#00f' 18 | chart.colorFor(chart.data[0], 3, 'bar').should.equal '#f00' 19 | chart.colorFor(chart.data[0], 4, 'hover').should.equal '#0f0' 20 | 21 | it 'should defer to a callback', -> 22 | stub = sinon.stub().returns '#f00' 23 | chart = Morris.Bar $.extend {}, defaults, barColors: stub 24 | stub.reset() 25 | 26 | chart.colorFor(chart.data[0], 0, 'bar') 27 | stub.should.have.been.calledWith( 28 | {x:0, y:2, label:'foo'}, 29 | {index:0, key:'y', label:'Y'}, 30 | 'bar') 31 | 32 | chart.colorFor(chart.data[0], 1, 'hover') 33 | stub.should.have.been.calledWith( 34 | {x:0, y:3, label:'foo'}, 35 | {index:1, key:'z', label:'Z'}, 36 | 'hover') 37 | -------------------------------------------------------------------------------- /public/plugins/morris/spec/lib/commas_spec.coffee: -------------------------------------------------------------------------------- 1 | describe '#commas', -> 2 | 3 | it 'should insert commas into long numbers', -> 4 | # zero 5 | Morris.commas(0).should.equal("0") 6 | 7 | # positive integers 8 | Morris.commas(1).should.equal("1") 9 | Morris.commas(12).should.equal("12") 10 | Morris.commas(123).should.equal("123") 11 | Morris.commas(1234).should.equal("1,234") 12 | Morris.commas(12345).should.equal("12,345") 13 | Morris.commas(123456).should.equal("123,456") 14 | Morris.commas(1234567).should.equal("1,234,567") 15 | 16 | # negative integers 17 | Morris.commas(-1).should.equal("-1") 18 | Morris.commas(-12).should.equal("-12") 19 | Morris.commas(-123).should.equal("-123") 20 | Morris.commas(-1234).should.equal("-1,234") 21 | Morris.commas(-12345).should.equal("-12,345") 22 | Morris.commas(-123456).should.equal("-123,456") 23 | Morris.commas(-1234567).should.equal("-1,234,567") 24 | 25 | # positive decimals 26 | Morris.commas(1.2).should.equal("1.2") 27 | Morris.commas(12.34).should.equal("12.34") 28 | Morris.commas(123.456).should.equal("123.456") 29 | Morris.commas(1234.56).should.equal("1,234.56") 30 | 31 | # negative decimals 32 | Morris.commas(-1.2).should.equal("-1.2") 33 | Morris.commas(-12.34).should.equal("-12.34") 34 | Morris.commas(-123.456).should.equal("-123.456") 35 | Morris.commas(-1234.56).should.equal("-1,234.56") 36 | 37 | # null 38 | Morris.commas(null).should.equal('-') 39 | -------------------------------------------------------------------------------- /lib/consoleTimestamp.js: -------------------------------------------------------------------------------- 1 | //add timestamp for console.log() 2 | module.exports = (function() { //add timestamp to console.log and console.error(from http://yoyo.play175.com) 3 | var date = new Date(); 4 | 5 | function timeFlag() { 6 | date.setTime(Date.now()); 7 | var m = date.getMonth() + 1; 8 | var d = date.getDate(); 9 | var hour = date.getHours(); 10 | var minutes = date.getMinutes(); 11 | var seconds = date.getSeconds(); 12 | var milliseconds = date.getMilliseconds(); 13 | return '[' + ((m < 10) ? '0' + m : m) + '-' + ((d < 10) ? '0' + d : d) + 14 | ' ' + ((hour < 10) ? '0' + hour : hour) + ':' + ((minutes < 10) ? '0' + minutes : minutes) + 15 | ':' + ((seconds < 10) ? '0' + seconds : seconds) + '.' + ('00' + milliseconds).slice(-3) + '] '; 16 | } 17 | var log = console.log; 18 | console.error = console.log = function() { 19 | var prefix = ''; //cluster.isWorker ? '[WORKER '+cluster.worker.id + '] ' : '[MASTER]'; 20 | if (typeof(arguments[0]) == 'string') { 21 | var first_parameter = arguments[0]; //for this:console.log("%s","str"); 22 | var other_parameters = Array.prototype.slice.call(arguments, 1); 23 | log.apply(console, [prefix + timeFlag() + first_parameter].concat(other_parameters)); 24 | } else { 25 | var args = Array.prototype.slice.call(arguments); 26 | log.apply(console, [prefix + timeFlag()].concat(args)); 27 | } 28 | } 29 | })(); 30 | -------------------------------------------------------------------------------- /public/js/controllers/AddressListController.js: -------------------------------------------------------------------------------- 1 | angular.module('BlocksApp').controller('AddressListController', function($stateParams, $rootScope, $scope, $http) { 2 | $scope.$on('$viewContentLoaded', function() { 3 | // initialize core components 4 | App.initAjax(); 5 | }); 6 | 7 | var addressType = $stateParams.type; 8 | if(!addressType){ 9 | addressType = -1; 10 | }else{ 11 | addressType = addressType.trim(); 12 | if(addressType=="normal"){ 13 | addressType = 0; 14 | }else if(addressType=="contract"){ 15 | addressType=1; 16 | }else if(addressType=="masternode"){ 17 | addressType=2; 18 | }else{ 19 | addressType = -1; 20 | } 21 | } 22 | 23 | $scope.page = 0; 24 | totalPage = 0; 25 | $scope.getInfoList=function(page) { 26 | $http({ 27 | method: 'POST', 28 | url: '/addressListData', 29 | data: {"page":page, "totalPage":totalPage, "addressType":addressType} 30 | }).success(function(repData) { 31 | $scope.page = repData.page; 32 | var pages = []; 33 | for(i=0; i 2 | 3 | 4 | morris.js tests 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 |
28 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /public/views/transfer-tokens.html: -------------------------------------------------------------------------------- 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 |
TxHash Age Block From To Amount
{{t.transactionHash}} {{t.timestamp | timeDuration}} ago {{t.blockNumber}} {{t.from}} {{t.to}} {{t.amount | number}} Transfer
27 | 35 |
-------------------------------------------------------------------------------- /public/plugins/morris/examples/updating.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Updating data

14 |
15 |
16 |
17 | 
18 | var nReloads = 0;
19 | function data(offset) {
20 |   var ret = [];
21 |   for (var x = 0; x <= 360; x += 10) {
22 |     var v = (offset + x) % 360;
23 |     ret.push({
24 |       x: x,
25 |       y: Math.sin(Math.PI * v / 180).toFixed(4),
26 |       z: Math.cos(Math.PI * v / 180).toFixed(4)
27 |     });
28 |   }
29 |   return ret;
30 | }
31 | var graph = Morris.Line({
32 |     element: 'graph',
33 |     data: data(0),
34 |     xkey: 'x',
35 |     ykeys: ['y', 'z'],
36 |     labels: ['sin()', 'cos()'],
37 |     parseTime: false,
38 |     ymin: -1.0,
39 |     ymax: 1.0,
40 |     hideHover: true
41 | });
42 | function update() {
43 |   nReloads++;
44 |   graph.setData(data(5 * nReloads));
45 |   $('#reloadStatus').text(nReloads + ' reloads');
46 | }
47 | setInterval(update, 100);
48 | 
49 | 50 | -------------------------------------------------------------------------------- /public/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Project: Bootstrap Hover Dropdown 3 | * Author: Cameron Spear 4 | * Contributors: Mattia Larentis 5 | * 6 | * Dependencies: Bootstrap's Dropdown plugin, jQuery 7 | * 8 | * A simple plugin to enable Bootstrap dropdowns to active on hover and provide a nice user experience. 9 | * 10 | * License: MIT 11 | * 12 | * http://cameronspear.com/blog/bootstrap-dropdown-on-hover-plugin/ 13 | */(function(b,a,c){var d=b();b.fn.dropdownHover=function(e){if("ontouchstart" in document){return this}d=d.add(this.parent());return this.each(function(){var m=b(this),l=m.parent(),k={delay:500,instantlyCloseOthers:true},i={delay:b(this).data("delay"),instantlyCloseOthers:b(this).data("close-others")},f="show.bs.dropdown",j="hide.bs.dropdown",g=b.extend(true,{},k,e,i),h;l.hover(function(n){if(!l.hasClass("open")&&!m.is(n.target)){return true}d.find(":focus").blur();if(g.instantlyCloseOthers===true){d.removeClass("open")}a.clearTimeout(h);l.addClass("open");m.trigger(f)},function(){h=a.setTimeout(function(){l.removeClass("open");m.trigger(j)},g.delay)});m.hover(function(){d.find(":focus").blur();if(g.instantlyCloseOthers===true){d.removeClass("open")}a.clearTimeout(h);l.addClass("open");m.trigger(f)});l.find(".dropdown-submenu").each(function(){var o=b(this);var n;o.hover(function(){a.clearTimeout(n);o.children(".dropdown-menu").show();o.siblings().children(".dropdown-menu").hide()},function(){var p=o.children(".dropdown-menu");n=a.setTimeout(function(){p.hide()},g.delay)})})})};b(document).ready(function(){b('[data-hover="dropdown"]').dropdownHover()})})(jQuery,this); -------------------------------------------------------------------------------- /public/views/tokenlist.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
TokenName Address
{{t.tokenName}} {{t.address}}
17 |
18 |
    19 | 20 |
21 | 25 |
    26 | 27 |
28 |
29 |
30 |
31 |
-------------------------------------------------------------------------------- /public/plugins/morris/spec/viz/examples.js: -------------------------------------------------------------------------------- 1 | var webpage = require("webpage"), 2 | fs = require("fs"); 3 | 4 | var html_path = fs.absolute("test.html"); 5 | var examples = []; 6 | 7 | function run_example(example_index) { 8 | if (example_index >= examples.length) { 9 | phantom.exit(0); 10 | return; 11 | } 12 | 13 | var example = examples[example_index]; 14 | var snapshot_index = 0; 15 | var page = webpage.create(); 16 | 17 | page.viewportSize = { width: 500, height: 300 }; 18 | page.clipRect = { width: 500, height: 300 }; 19 | page.onAlert = function (msg) { 20 | var e = JSON.parse(msg); 21 | if (e.fn == "snapshot") { 22 | page.render("output/" + example.name + snapshot_index + ".png"); 23 | snapshot_index += 1; 24 | } else if (e.fn == "mousemove") { 25 | page.sendEvent("mousemove", e.x, e.y); 26 | } 27 | }; 28 | 29 | page.open(html_path, function (status) { 30 | if (status == "fail") { 31 | console.log("Failed to load test page: " + example.name); 32 | phantom.exit(1); 33 | } else { 34 | page.evaluate(example.runner); 35 | } 36 | page.close(); 37 | run_example(example_index + 1); 38 | }); 39 | } 40 | 41 | exports.def = function (name, runner) { 42 | examples.push({ name: name, runner: runner }); 43 | }; 44 | 45 | exports.run = function () { 46 | if (fs.isDirectory("output")) { 47 | fs.list("output").forEach(function (path) { 48 | if (path != "." && path != "..") { 49 | fs.remove("output/" + path); 50 | } 51 | }); 52 | } else { 53 | fs.makeDirectory("output"); 54 | } 55 | run_example(0); 56 | }; 57 | -------------------------------------------------------------------------------- /public/plugins/morris/examples/years.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Formatting Dates YYYY

14 |
15 |
16 | /* data stolen from http://howmanyleft.co.uk/vehicle/jaguar_'e'_type */
17 | var year_data = [
18 |   {"period": "2012", "licensed": 3407, "sorned": 660},
19 |   {"period": "2011", "licensed": 3351, "sorned": 629},
20 |   {"period": "2010", "licensed": 3269, "sorned": 618},
21 |   {"period": "2009", "licensed": 3246, "sorned": 661},
22 |   {"period": "2008", "licensed": 3257, "sorned": 667},
23 |   {"period": "2007", "licensed": 3248, "sorned": 627},
24 |   {"period": "2006", "licensed": 3171, "sorned": 660},
25 |   {"period": "2005", "licensed": 3171, "sorned": 676},
26 |   {"period": "2004", "licensed": 3201, "sorned": 656},
27 |   {"period": "2003", "licensed": 3215, "sorned": 622}
28 | ];
29 | Morris.Line({
30 |   element: 'graph',
31 |   data: year_data,
32 |   xkey: 'period',
33 |   ykeys: ['licensed', 'sorned'],
34 |   labels: ['Licensed', 'SORN']
35 | });
36 | 
37 | 38 | -------------------------------------------------------------------------------- /public/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Project: Bootstrap Hover Dropdown 3 | * Author: Cameron Spear 4 | * Contributors: Mattia Larentis 5 | * 6 | * Dependencies: Bootstrap's Dropdown plugin, jQuery 7 | * 8 | * A simple plugin to enable Bootstrap dropdowns to active on hover and provide a nice user experience. 9 | * 10 | * License: MIT 11 | * 12 | * http://cameronspear.com/blog/bootstrap-dropdown-on-hover-plugin/ 13 | */ 14 | !function(e,n){var o=e();e.fn.dropdownHover=function(t){return"ontouchstart"in document?this:(o=o.add(this.parent()),this.each(function(){var i,r=e(this),s=r.parent(),d={delay:500,instantlyCloseOthers:!0},a={delay:e(this).data("delay"),instantlyCloseOthers:e(this).data("close-others")},h="show.bs.dropdown",u="hide.bs.dropdown",l=e.extend(!0,{},d,t,a);s.hover(function(e){return s.hasClass("open")||r.is(e.target)?(o.find(":focus").blur(),l.instantlyCloseOthers===!0&&o.removeClass("open"),n.clearTimeout(i),s.addClass("open"),void r.trigger(h)):!0},function(){i=n.setTimeout(function(){s.removeClass("open"),r.trigger(u)},l.delay)}),r.hover(function(){o.find(":focus").blur(),l.instantlyCloseOthers===!0&&o.removeClass("open"),n.clearTimeout(i),s.addClass("open"),r.trigger(h)}),s.find(".dropdown-submenu").each(function(){var o,t=e(this);t.hover(function(){n.clearTimeout(o),t.children(".dropdown-menu").show(),t.siblings().children(".dropdown-menu").hide()},function(){var e=t.children(".dropdown-menu");o=n.setTimeout(function(){e.hide()},l.delay)})})}))},e(document).ready(function(){e('[data-hover="dropdown"]').not(".hover-initialized").each(function(){e(this).dropdownHover(),e(this).addClass("hover-initialized")})})}(jQuery,this); 15 | -------------------------------------------------------------------------------- /public/css/stats.css: -------------------------------------------------------------------------------- 1 | body { 2 | font: 12px Arial; 3 | } 4 | 5 | text.shadow { 6 | stroke: #fff; 7 | stroke-width: 2.5px; 8 | opacity: 0.9; 9 | } 10 | 11 | path { 12 | stroke: steelblue; 13 | stroke-width: 2; 14 | fill: none; 15 | } 16 | 17 | .axis path, 18 | .axis line { 19 | fill: none; 20 | stroke: grey; 21 | stroke-width: 1; 22 | shape-rendering: crispEdges; 23 | } 24 | 25 | .grid .tick { 26 | stroke: lightgrey; 27 | stroke-opacity: 0.7; 28 | shape-rendering: crispEdges; 29 | } 30 | .grid path { 31 | stroke-width: 0; 32 | } 33 | 34 | .area { 35 | fill: lightsteelblue; 36 | stroke-width: 0; 37 | } 38 | 39 | .overlay { 40 | fill: none; 41 | pointer-events: all; 42 | } 43 | 44 | .focus circle { 45 | fill: none; 46 | stroke: steelblue; 47 | } 48 | 49 | path.slice{ 50 | stroke-width:2px; 51 | } 52 | 53 | polyline{ 54 | opacity: .3; 55 | stroke: black; 56 | stroke-width: 2px; 57 | fill: none; 58 | } 59 | 60 | .labelValue 61 | { 62 | font-size: 60%; 63 | opacity: .5; 64 | 65 | } 66 | 67 | .toolTip { 68 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 69 | position: absolute; 70 | display: none; 71 | width: auto; 72 | height: auto; 73 | background: none repeat scroll 0 0 white; 74 | border: 0 none; 75 | border-radius: 8px 8px 8px 8px; 76 | box-shadow: -3px 3px 15px #888888; 77 | color: black; 78 | font: 12px sans-serif; 79 | padding: 5px; 80 | text-align: center; 81 | } 82 | text { 83 | font: 12px sans-serif; 84 | } -------------------------------------------------------------------------------- /public/plugins/morris/examples/days.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Formatting Dates YYYY-MM-DD

14 |
15 |
16 | /* data stolen from http://howmanyleft.co.uk/vehicle/jaguar_'e'_type */
17 | var day_data = [
18 |   {"period": "2012-10-01", "licensed": 3407, "sorned": 660},
19 |   {"period": "2012-09-30", "licensed": 3351, "sorned": 629},
20 |   {"period": "2012-09-29", "licensed": 3269, "sorned": 618},
21 |   {"period": "2012-09-20", "licensed": 3246, "sorned": 661},
22 |   {"period": "2012-09-19", "licensed": 3257, "sorned": 667},
23 |   {"period": "2012-09-18", "licensed": 3248, "sorned": 627},
24 |   {"period": "2012-09-17", "licensed": 3171, "sorned": 660},
25 |   {"period": "2012-09-16", "licensed": 3171, "sorned": 676},
26 |   {"period": "2012-09-15", "licensed": 3201, "sorned": 656},
27 |   {"period": "2012-09-10", "licensed": 3215, "sorned": 622}
28 | ];
29 | Morris.Line({
30 |   element: 'graph',
31 |   data: day_data,
32 |   xkey: 'period',
33 |   ykeys: ['licensed', 'sorned'],
34 |   labels: ['Licensed', 'SORN']
35 | });
36 | 
37 | 38 | -------------------------------------------------------------------------------- /public/plugins/morris/examples/months-no-smooth.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Formatting Dates with YYYY-MM

14 |
15 |
16 | /* data stolen from http://howmanyleft.co.uk/vehicle/jaguar_'e'_type */
17 | var month_data = [
18 |   {"period": "2012-10", "licensed": 3407, "sorned": 660},
19 |   {"period": "2011-08", "licensed": 3351, "sorned": 629},
20 |   {"period": "2011-03", "licensed": 3269, "sorned": 618},
21 |   {"period": "2010-08", "licensed": 3246, "sorned": 661},
22 |   {"period": "2010-05", "licensed": 3257, "sorned": 667},
23 |   {"period": "2010-03", "licensed": 3248, "sorned": 627},
24 |   {"period": "2010-01", "licensed": 3171, "sorned": 660},
25 |   {"period": "2009-12", "licensed": 3171, "sorned": 676},
26 |   {"period": "2009-10", "licensed": 3201, "sorned": 656},
27 |   {"period": "2009-09", "licensed": 3215, "sorned": 622}
28 | ];
29 | Morris.Line({
30 |   element: 'graph',
31 |   data: month_data,
32 |   xkey: 'period',
33 |   ykeys: ['licensed', 'sorned'],
34 |   labels: ['Licensed', 'SORN'],
35 |   smooth: false
36 | });
37 | 
38 | 39 | -------------------------------------------------------------------------------- /public/plugins/morris/examples/no-grid.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Formatting Dates YYYY-MM-DD

14 |
15 |
16 | /* data stolen from http://howmanyleft.co.uk/vehicle/jaguar_'e'_type */
17 | var day_data = [
18 |   {"period": "2012-10-01", "licensed": 3407, "sorned": 660},
19 |   {"period": "2012-09-30", "licensed": 3351, "sorned": 629},
20 |   {"period": "2012-09-29", "licensed": 3269, "sorned": 618},
21 |   {"period": "2012-09-20", "licensed": 3246, "sorned": 661},
22 |   {"period": "2012-09-19", "licensed": 3257, "sorned": 667},
23 |   {"period": "2012-09-18", "licensed": 3248, "sorned": 627},
24 |   {"period": "2012-09-17", "licensed": 3171, "sorned": 660},
25 |   {"period": "2012-09-16", "licensed": 3171, "sorned": 676},
26 |   {"period": "2012-09-15", "licensed": 3201, "sorned": 656},
27 |   {"period": "2012-09-10", "licensed": 3215, "sorned": 622}
28 | ];
29 | Morris.Line({
30 |   element: 'graph',
31 |   grid: false,
32 |   data: day_data,
33 |   xkey: 'period',
34 |   ykeys: ['licensed', 'sorned'],
35 |   labels: ['Licensed', 'SORN']
36 | });
37 | 
38 | 39 | -------------------------------------------------------------------------------- /public/plugins/jquery.cokie.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * JavaScript Cookie v2.0.3 3 | * https://github.com/js-cookie/js-cookie 4 | * 5 | * Copyright 2006, 2015 Klaus Hartl & Fagner Brack 6 | * Released under the MIT license 7 | */ 8 | !function(e){if("function"==typeof define&&define.amd)define(e);else if("object"==typeof exports)module.exports=e();else{var n=window.Cookies,t=window.Cookies=e();t.noConflict=function(){return window.Cookies=n,t}}}(function(){function e(){for(var e=0,n={};e1){if(i=e({path:"/"},o.defaults,i),"number"==typeof i.expires){var s=new Date;s.setMilliseconds(s.getMilliseconds()+864e5*i.expires),i.expires=s}try{c=JSON.stringify(r),/^[\{\[]/.test(c)&&(r=c)}catch(a){}return r=encodeURIComponent(String(r)),r=r.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=encodeURIComponent(String(n)),n=n.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),n=n.replace(/[\(\)]/g,escape),document.cookie=[n,"=",r,i.expires&&"; expires="+i.expires.toUTCString(),i.path&&"; path="+i.path,i.domain&&"; domain="+i.domain,i.secure?"; secure":""].join("")}n||(c={});for(var p=document.cookie?document.cookie.split("; "):[],u=/(%[0-9A-Z]{2})+/g,d=0;d 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Displaying X Labels Diagonally

14 |
15 |
16 | /* data stolen from http://howmanyleft.co.uk/vehicle/jaguar_'e'_type */
17 | var day_data = [
18 |   {"period": "2012-10-30", "licensed": 3407, "sorned": 660},
19 |   {"period": "2012-09-30", "licensed": 3351, "sorned": 629},
20 |   {"period": "2012-09-29", "licensed": 3269, "sorned": 618},
21 |   {"period": "2012-09-20", "licensed": 3246, "sorned": 661},
22 |   {"period": "2012-09-19", "licensed": 3257, "sorned": 667},
23 |   {"period": "2012-09-18", "licensed": 3248, "sorned": 627},
24 |   {"period": "2012-09-17", "licensed": 3171, "sorned": 660},
25 |   {"period": "2012-09-16", "licensed": 3171, "sorned": 676},
26 |   {"period": "2012-09-15", "licensed": 3201, "sorned": 656},
27 |   {"period": "2012-09-10", "licensed": 3215, "sorned": 622}
28 | ];
29 | Morris.Line({
30 |   element: 'graph',
31 |   data: day_data,
32 |   xkey: 'period',
33 |   ykeys: ['licensed', 'sorned'],
34 |   labels: ['Licensed', 'SORN'],
35 |   xLabelAngle: 60
36 | });
37 | 
38 | 39 | -------------------------------------------------------------------------------- /tools/priTools/updateWitness.js: -------------------------------------------------------------------------------- 1 | require( '../../db.js' ); 2 | var mongoose = require('mongoose'); 3 | var Witness = mongoose.model('Witness'); 4 | var Block = mongoose.model('Block'); 5 | 6 | var witnessList; 7 | Witness.find({}, "-_id,witness").lean(true).exec(function(err, docs){ 8 | witnessList = docs; 9 | updateOne(); 10 | }); 11 | 12 | function updateOne(){ 13 | if(witnessList.length==0){ 14 | process.exit(0); 15 | console.log("update witness finish !"); 16 | return; 17 | } 18 | witness = witnessList.pop().witness; 19 | 20 | var blockCount = 0; 21 | Block.count({'witness':witness}).exec(function (err, c) { 22 | blockCount = c; 23 | console.log(witness, ": ", blockCount); 24 | //find block 25 | Block.find({'witness':witness}).sort('-number').limit(1).exec(function (err, blockDatas) { 26 | if(err){ 27 | console.log(err); 28 | process.exit(0); 29 | } 30 | if(!blockDatas || blockDatas.length==0){ 31 | updateOne(); 32 | return; 33 | } 34 | var blockData = blockDatas[0]; 35 | var reward = 0.3375*blockCount; 36 | Witness.update({"witness":blockData.witness}, 37 | {$set:{"lastCountTo":blockData.number, "hash":blockData.hash, "miner":blockData.miner, "timestamp":blockData.timestamp, "status":true, "blocksNum":blockCount, "reward":reward}}, 38 | {upsert: false}, 39 | function (err, data) { 40 | if(err) 41 | console.log("err:", err); 42 | 43 | setTimeout(updateOne, 200); 44 | } 45 | ); 46 | }); 47 | }); 48 | 49 | } -------------------------------------------------------------------------------- /routes/tokenListData.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var mongoose = require( 'mongoose' ); 3 | var Contract = mongoose.model('Contract'); 4 | var pageSize = 10; 5 | var page = 0; 6 | var totalPage = 0; 7 | var resultData={"totalPage":0, "list":null, "page":0}; 8 | 9 | module.exports = function(req, res){ 10 | page = req.body.page; 11 | if(isNaN(page) || page<0) 12 | page = 0; 13 | 14 | totalPage = req.body.totalPage; 15 | if(isNaN(totalPage) || totalPage<0) 16 | totalPage = 0; 17 | 18 | resultData.totalPage = totalPage; 19 | resultData.page = page; 20 | resultData.list = null; 21 | try{ 22 | if(resultData.totalPage == 0){ 23 | Contract.count({ERC:{$gt:0}}).exec(function(err,c){ 24 | if(err){ 25 | console.log("tokenlist err: ", err); 26 | res.write(JSON.stringify(resultData)); 27 | res.end(); 28 | return; 29 | } 30 | resultData.totalPage = Math.ceil(c/pageSize); 31 | if(page>=resultData.totalPage){ 32 | resultData.page = 0; 33 | page=0; 34 | } 35 | getList(res); 36 | }); 37 | }else{ 38 | getList(res) 39 | } 40 | } catch (e) { 41 | console.error(e); 42 | res.write(JSON.stringify(resultData)); 43 | res.end(); 44 | } 45 | }; 46 | 47 | function getList(res){ 48 | contractFind = Contract.find({ERC:{$gt:0}}, "tokenName address").skip(page*pageSize).limit(pageSize).lean(true); 49 | contractFind.exec(function (err, docs) { 50 | if(err){ 51 | console.log("tokenlist getList err: ", err); 52 | res.write(JSON.stringify(resultData)); 53 | res.end(); 54 | return; 55 | } 56 | resultData.list=docs; 57 | res.write(JSON.stringify(resultData)); 58 | res.end(); 59 | }); 60 | } -------------------------------------------------------------------------------- /tools/fix_tx.js: -------------------------------------------------------------------------------- 1 | /* 2 | Tool for breaking out transactions 3 | 4 | DEPRECATED: DO NOT USE 5 | */ 6 | 7 | var mongoose = require( 'mongoose' ); 8 | require( '../db.js' ); 9 | var async = require('async'); 10 | var Block = mongoose.model( 'Block' ); 11 | var Transaction = mongoose.model( 'Transaction' ); 12 | 13 | var getTx = function() { 14 | mongoose.connection.on("open", function(err,conn) { 15 | 16 | Block.find({}, "transactions timestamp").lean(true).exec(function(err, docs) { 17 | async.forEach(docs, function(doc, cb) { 18 | var bulkOps = []; 19 | if (doc.transactions && doc.transactions.length > 0) { 20 | for (d in doc.transactions) { 21 | var txData = doc.transactions[d]; 22 | txData.timestamp = doc.timestamp; 23 | bulkOps.push(txData); 24 | } 25 | Transaction.collection.insert(bulkOps, function( err, tx ){ 26 | if ( typeof err !== 'undefined' && err ) { 27 | if (err.code == 11000) { 28 | console.log('Skip: Duplicate key ' + 29 | err); 30 | } else { 31 | console.log('Error: Aborted due to error: ' + 32 | err); 33 | process.exit(9); 34 | } 35 | } else { 36 | console.log('DB successfully written for block ' + 37 | tx.length.toString() ); 38 | 39 | } 40 | bulkOps = []; 41 | cb(); 42 | }); 43 | 44 | } 45 | }, function() { return; }); 46 | }); 47 | }) 48 | } 49 | 50 | getTx() -------------------------------------------------------------------------------- /public/plugins/morris/examples/diagonal-xlabels-bar.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Displaying X Labels Diagonally (Bar Chart)

14 |
15 |
16 | /* data stolen from http://howmanyleft.co.uk/vehicle/jaguar_'e'_type */
17 | var day_data = [
18 |   {"period": "2012-10-01", "licensed": 3407, "sorned": 660},
19 |   {"period": "2012-09-30", "licensed": 3351, "sorned": 629},
20 |   {"period": "2012-09-29", "licensed": 3269, "sorned": 618},
21 |   {"period": "2012-09-20", "licensed": 3246, "sorned": 661},
22 |   {"period": "2012-09-19", "licensed": 3257, "sorned": 667},
23 |   {"period": "2012-09-18", "licensed": 3248, "sorned": 627},
24 |   {"period": "2012-09-17", "licensed": 3171, "sorned": 660},
25 |   {"period": "2012-09-16", "licensed": 3171, "sorned": 676},
26 |   {"period": "2012-09-15", "licensed": 3201, "sorned": 656},
27 |   {"period": "2012-09-10", "licensed": 3215, "sorned": 622}
28 | ];
29 | Morris.Bar({
30 |   element: 'graph',
31 |   data: day_data,
32 |   xkey: 'period',
33 |   ykeys: ['licensed', 'sorned'],
34 |   labels: ['Licensed', 'SORN'],
35 |   xLabelAngle: 60
36 | });
37 | 
38 | 39 | -------------------------------------------------------------------------------- /public/plugins/morris/spec/viz/visual_specs.js: -------------------------------------------------------------------------------- 1 | var examples = require('./examples'); 2 | 3 | examples.def('line', function () { 4 | Morris.Line({ 5 | element: 'chart', 6 | data: [ 7 | { x: 0, y: 10, z: 30 }, { x: 1, y: 20, z: 20 }, 8 | { x: 2, y: 30, z: 10 }, { x: 3, y: 30, z: 10 }, 9 | { x: 4, y: 20, z: 20 }, { x: 5, y: 10, z: 30 } 10 | ], 11 | xkey: 'x', 12 | ykeys: ['y', 'z'], 13 | labels: ['y', 'z'], 14 | parseTime: false 15 | }); 16 | window.snapshot(); 17 | }); 18 | 19 | examples.def('area', function () { 20 | Morris.Area({ 21 | element: 'chart', 22 | data: [ 23 | { x: 0, y: 1, z: 1 }, { x: 1, y: 2, z: 1 }, 24 | { x: 2, y: 3, z: 1 }, { x: 3, y: 3, z: 1 }, 25 | { x: 4, y: 2, z: 1 }, { x: 5, y: 1, z: 1 } 26 | ], 27 | xkey: 'x', 28 | ykeys: ['y', 'z'], 29 | labels: ['y', 'z'], 30 | parseTime: false 31 | }); 32 | window.snapshot(); 33 | }); 34 | 35 | examples.def('bar', function () { 36 | Morris.Bar({ 37 | element: 'chart', 38 | data: [ 39 | { x: 0, y: 1, z: 3 }, { x: 1, y: 2, z: 2 }, 40 | { x: 2, y: 3, z: 1 }, { x: 3, y: 3, z: 1 }, 41 | { x: 4, y: 2, z: 2 }, { x: 5, y: 1, z: 3 } 42 | ], 43 | xkey: 'x', 44 | ykeys: ['y', 'z'], 45 | labels: ['y', 'z'] 46 | }); 47 | window.snapshot(); 48 | }); 49 | 50 | examples.def('stacked_bar', function () { 51 | Morris.Bar({ 52 | element: 'chart', 53 | data: [ 54 | { x: 0, y: 1, z: 1 }, { x: 1, y: 2, z: 1 }, 55 | { x: 2, y: 3, z: 1 }, { x: 3, y: 3, z: 1 }, 56 | { x: 4, y: 2, z: 1 }, { x: 5, y: 1, z: 1 } 57 | ], 58 | xkey: 'x', 59 | ykeys: ['y', 'z'], 60 | labels: ['y', 'z'], 61 | stacked: true 62 | }); 63 | window.snapshot(); 64 | }); 65 | 66 | examples.run(); 67 | -------------------------------------------------------------------------------- /public/plugins/morris/examples/timestamps.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Timestamps

14 |
15 |
16 | /* data stolen from http://howmanyleft.co.uk/vehicle/jaguar_'e'_type */
17 | var timestamp_data = [
18 |   {"period": 1349046000000, "licensed": 3407, "sorned": 660},
19 |   {"period": 1313103600000, "licensed": 3351, "sorned": 629},
20 |   {"period": 1299110400000, "licensed": 3269, "sorned": 618},
21 |   {"period": 1281222000000, "licensed": 3246, "sorned": 661},
22 |   {"period": 1273446000000, "licensed": 3257, "sorned": 667},
23 |   {"period": 1268524800000, "licensed": 3248, "sorned": 627},
24 |   {"period": 1263081600000, "licensed": 3171, "sorned": 660},
25 |   {"period": 1260403200000, "licensed": 3171, "sorned": 676},
26 |   {"period": 1254870000000, "licensed": 3201, "sorned": 656},
27 |   {"period": 1253833200000, "licensed": 3215, "sorned": 622}
28 | ];
29 | Morris.Line({
30 |   element: 'graph',
31 |   data: timestamp_data,
32 |   xkey: 'period',
33 |   ykeys: ['licensed', 'sorned'],
34 |   labels: ['Licensed', 'SORN'],
35 |   dateFormat: function (x) { return new Date(x).toDateString(); }
36 | });
37 | 
38 | 39 | -------------------------------------------------------------------------------- /public/plugins/morris/examples/resize.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 15 | 16 | 17 |

Formatting Dates YYYY-MM-DD

18 |
19 |
20 | /* data stolen from http://howmanyleft.co.uk/vehicle/jaguar_'e'_type */
21 | var day_data = [
22 |   {"period": "2012-10-01", "licensed": 3407, "sorned": 660},
23 |   {"period": "2012-09-30", "licensed": 3351, "sorned": 629},
24 |   {"period": "2012-09-29", "licensed": 3269, "sorned": 618},
25 |   {"period": "2012-09-20", "licensed": 3246, "sorned": 661},
26 |   {"period": "2012-09-19", "licensed": 3257, "sorned": 667},
27 |   {"period": "2012-09-18", "licensed": 3248, "sorned": 627},
28 |   {"period": "2012-09-17", "licensed": 3171, "sorned": 660},
29 |   {"period": "2012-09-16", "licensed": 3171, "sorned": 676},
30 |   {"period": "2012-09-15", "licensed": 3201, "sorned": 656},
31 |   {"period": "2012-09-10", "licensed": 3215, "sorned": 622}
32 | ];
33 | Morris.Line({
34 |   element: 'graph',
35 |   data: day_data,
36 |   xkey: 'period',
37 |   ykeys: ['licensed', 'sorned'],
38 |   labels: ['Licensed', 'SORN'],
39 |   resize: true
40 | });
41 | 
42 | 43 | -------------------------------------------------------------------------------- /tools/priTools/updateAddrBalanceLH10.js: -------------------------------------------------------------------------------- 1 | //update from address balance from rich-list.txt 2 | require( '../../db.js' ); 3 | var etherUnits = require("../../lib/etherUnits.js"); 4 | var Web3 = require('web3'); 5 | 6 | var mongoose = require( 'mongoose' ); 7 | var Address = mongoose.model('Address'); 8 | var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:9646")); 9 | var rawAddrList = []; 10 | var index = -1; 11 | var insertNum = 0; 12 | 13 | function getAddrLH10(){ 14 | Address.find({"balance":{$lt:10}}, "-_id addr").exec((err, docs)=>{ 15 | if(err){ 16 | console.log(err); 17 | process.exit(9); 18 | return; 19 | } 20 | for(var i=0; i=rawAddrList.length){ 34 | finish(); 35 | return; 36 | } 37 | 38 | 39 | //更新列表中存在的地址 40 | var balance = web3.eth.getBalance(rawAddrList[index]); 41 | Address.updateOne( 42 | {'addr': rawAddrList[index]}, 43 | {$set:{'balance':Number(etherUnits.toEther(balance, 'wei'))}}, 44 | {multi: false, upsert: false}, 45 | function (err, data) { 46 | if(err){ 47 | console.log("Address.update err:", err); 48 | console.log("index:",index); 49 | finish(); 50 | return; 51 | } 52 | insertNum++; 53 | setTimeout(updateNext, 120); 54 | // updateNext(); 55 | } 56 | ); 57 | 58 | } 59 | 60 | function finish(){ 61 | console.log("insertNum:", insertNum); 62 | console.log("update finish !"); 63 | process.exit(0); 64 | } 65 | 66 | getAddrLH10(); -------------------------------------------------------------------------------- /public/views/addressList.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 21 | 22 | 23 |
Address ETZ Type
{{item.addr}} {{item.balance}} 17 | N 18 | C 19 | M 20 |
24 | 25 |
26 |
    27 | 28 |
29 | 33 |
    34 | 35 |
36 |
37 |
38 |
39 |
-------------------------------------------------------------------------------- /public/js/filters.js: -------------------------------------------------------------------------------- 1 | var getDifficulty = function(hashes) { 2 | /* 3 | borrowed from https://github.com/cubedro/eth-netstats :D 4 | */ 5 | 6 | var result = 0; 7 | var unit = ''; 8 | 9 | if(hashes !== 0 && hashes < 1000) { 10 | result = hashes; 11 | unit = ''; 12 | } 13 | 14 | if(hashes >= 1000 && hashes < Math.pow(1000, 2)) { 15 | result = hashes / 1000; 16 | unit = 'K'; 17 | } 18 | 19 | if(hashes >= Math.pow(1000, 2) && hashes < Math.pow(1000, 3)) { 20 | result = hashes / Math.pow(1000, 2); 21 | unit = 'M'; 22 | } 23 | 24 | if(hashes >= Math.pow(1000, 3) && hashes < Math.pow(1000, 4)) { 25 | result = hashes / Math.pow(1000, 3); 26 | unit = 'G'; 27 | } 28 | 29 | if(hashes >= Math.pow(1000, 4) ) { 30 | result = hashes / Math.pow(1000, 4); 31 | unit = 'T'; 32 | } 33 | return result.toFixed(2) + ' ' + unit + 'H'; 34 | } 35 | 36 | /* 37 | Convert unix timestamp to something that doesn't suck 38 | */ 39 | var getDuration = function(timestamp){ 40 | var millis = Date.now() - timestamp*1000; 41 | var dur = []; 42 | var units = [ 43 | {label:"millis", mod:1000}, 44 | {label:"seconds", mod:60}, 45 | {label:"mins", mod:60}, 46 | {label:"hours", mod:24}, 47 | {label:"days", mod:365}, 48 | {label:"years", mod:1000} 49 | ]; 50 | // calculate the individual unit values 51 | units.forEach(function(u){ 52 | var val = millis % u.mod; 53 | millis = (millis - val) / u.mod; 54 | if (u.label == "millis") 55 | return; 56 | if (val > 0) 57 | dur.push({"label": u.label, "val": val}); 58 | }); 59 | // convert object to string representation 60 | dur.toString = function(){ 61 | return dur.reverse().slice(0,2).map(function(d){ 62 | return d.val + " " + (d.val==1?d.label.slice(0,-1):d.label); 63 | }).join(', '); 64 | }; 65 | return dur; 66 | }; -------------------------------------------------------------------------------- /public/plugins/morris/examples/non-continuous.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Non-continuous data

14 |

Null series values will break the line when rendering, missing values will be skipped

15 |
16 |
17 | /* data stolen from http://howmanyleft.co.uk/vehicle/jaguar_'e'_type */
18 | var day_data = [
19 |   {"period": "2012-10-01", "licensed": 3407},
20 |   {"period": "2012-09-30", "sorned": 0},
21 |   {"period": "2012-09-29", "sorned": 618},
22 |   {"period": "2012-09-20", "licensed": 3246, "sorned": 661},
23 |   {"period": "2012-09-19", "licensed": 3257, "sorned": null},
24 |   {"period": "2012-09-18", "licensed": 3248, "other": 1000},
25 |   {"period": "2012-09-17", "sorned": 0},
26 |   {"period": "2012-09-16", "sorned": 0},
27 |   {"period": "2012-09-15", "licensed": 3201, "sorned": 656},
28 |   {"period": "2012-09-10", "licensed": 3215}
29 | ];
30 | Morris.Line({
31 |   element: 'graph',
32 |   data: day_data,
33 |   xkey: 'period',
34 |   ykeys: ['licensed', 'sorned', 'other'],
35 |   labels: ['Licensed', 'SORN', 'Other'],
36 |   /* custom label formatting with `xLabelFormat` */
37 |   xLabelFormat: function(d) { return (d.getMonth()+1)+'/'+d.getDate()+'/'+d.getFullYear(); },
38 |   /* setting `xLabels` is recommended when using xLabelFormat */
39 |   xLabels: 'day'
40 | });
41 | 
42 | 43 | -------------------------------------------------------------------------------- /public/views/contract-source.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | Contract Source Code Unverified 5 |
6 | Verify And Publish Source Code. 7 |
8 | 9 |
10 |

11 | Contract Source Code Verified 12 |

13 |
14 |
15 |
16 |
17 |
18 | Contract Name: 19 | {{contract.contractName}} 20 |
21 |
22 | Compiler Version: 23 | {{contract.compilerVersion}} 24 |
25 |
26 | Optimization Enabled: 27 | {{contract.optimization}} 28 |
29 |
30 |
31 |
32 |
33 | Contract Source Code 34 |
{{contract.sourceCode}}
35 |
36 | Contract ABI 37 |
{{contract.abi}}

38 |
39 | 40 |
41 | Contract Bytecode 42 |
{{contract.byteCode}}
43 |
44 |
-------------------------------------------------------------------------------- /public/views/contractlist.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
TokenName ContractName Is Token Address
{{t.tokenName}} {{t.contractName}} {{t.ERC==0?'No':'Yes'}} {{t.address}}
21 | 22 |
23 |
    24 | 25 |
26 | 30 |
    31 | 32 |
33 |
34 | 35 |
36 |
37 |
-------------------------------------------------------------------------------- /routes/tokenTransfer.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | module.exports = function(req, res){ 3 | var respData = ""; 4 | var mongoose = require( 'mongoose' ); 5 | var TokenTransfer = mongoose.model( 'TokenTransfer' ); 6 | if(req.body.address){//contract's internal transactions 7 | // try{ 8 | // tokenTransferFind = TokenTransfer.find({contractAdd:req.body.address}).lean(true); 9 | // tokenTransferFind.exec(function (err, docs) { 10 | // respData = JSON.stringify(docs); 11 | // res.write(respData); 12 | // res.end(); 13 | // }); 14 | // } catch (e) { 15 | // console.error(e); 16 | // } 17 | var fromAccount = req.body.fromAccount; 18 | var respData = ""; 19 | try{ 20 | var internalPage = req.body.internalPage; 21 | var mongoose = require( 'mongoose' ); 22 | var TokenTransfer = mongoose.model( 'TokenTransfer' ); 23 | var findCond; 24 | if(fromAccount){ 25 | findCond = {contractAdd:req.body.address, $or:[{"to": fromAccount}, {"from": fromAccount}]}; 26 | }else{ 27 | findCond = {contractAdd:req.body.address}; 28 | } 29 | if(internalPage<0) 30 | internalPage=0; 31 | tokenTransferFind = TokenTransfer.find(findCond).skip(internalPage*10).limit(10).lean(true); 32 | tokenTransferFind.exec(function (err, docs) { 33 | respData = JSON.stringify(docs); 34 | res.write(respData); 35 | res.end(); 36 | }); 37 | } catch (e) { 38 | console.error(e); 39 | res.write("[]"); 40 | res.end(); 41 | } 42 | }else if(req.body.txHash){//transactions detail 43 | try{ 44 | txHash = req.body.txHash.trim(); 45 | tokenTransferFind = TokenTransfer.find({transactionHash:txHash}).lean(true); 46 | tokenTransferFind.exec(function (err, docs) { 47 | respData = JSON.stringify(docs); 48 | res.write(respData); 49 | res.end(); 50 | }); 51 | } catch (e) { 52 | console.error(e); 53 | res.write("[]"); 54 | res.end(); 55 | } 56 | } 57 | 58 | 59 | }; -------------------------------------------------------------------------------- /public/plugins/morris/lib/morris.area.coffee: -------------------------------------------------------------------------------- 1 | class Morris.Area extends Morris.Line 2 | # Initialise 3 | # 4 | areaDefaults = 5 | fillOpacity: 'auto' 6 | behaveLikeLine: false 7 | 8 | constructor: (options) -> 9 | return new Morris.Area(options) unless (@ instanceof Morris.Area) 10 | areaOptions = $.extend {}, areaDefaults, options 11 | 12 | @cumulative = not areaOptions.behaveLikeLine 13 | 14 | if areaOptions.fillOpacity is 'auto' 15 | areaOptions.fillOpacity = if areaOptions.behaveLikeLine then .8 else 1 16 | 17 | super(areaOptions) 18 | 19 | # calculate series data point coordinates 20 | # 21 | # @private 22 | calcPoints: -> 23 | for row in @data 24 | row._x = @transX(row.x) 25 | total = 0 26 | row._y = for y in row.y 27 | if @options.behaveLikeLine 28 | @transY(y) 29 | else 30 | total += (y || 0) 31 | @transY(total) 32 | row._ymax = Math.max row._y... 33 | 34 | # draw the data series 35 | # 36 | # @private 37 | drawSeries: -> 38 | @seriesPoints = [] 39 | if @options.behaveLikeLine 40 | range = [0..@options.ykeys.length-1] 41 | else 42 | range = [@options.ykeys.length-1..0] 43 | 44 | for i in range 45 | @_drawFillFor i 46 | @_drawLineFor i 47 | @_drawPointFor i 48 | 49 | _drawFillFor: (index) -> 50 | path = @paths[index] 51 | if path isnt null 52 | path = path + "L#{@transX(@xmax)},#{@bottom}L#{@transX(@xmin)},#{@bottom}Z" 53 | @drawFilledPath path, @fillForSeries(index) 54 | 55 | fillForSeries: (i) -> 56 | color = Raphael.rgb2hsl @colorFor(@data[i], i, 'line') 57 | Raphael.hsl( 58 | color.h, 59 | if @options.behaveLikeLine then color.s * 0.9 else color.s * 0.75, 60 | Math.min(0.98, if @options.behaveLikeLine then color.l * 1.2 else color.l * 1.25)) 61 | 62 | drawFilledPath: (path, fill) -> 63 | @raphael.path(path) 64 | .attr('fill', fill) 65 | .attr('fill-opacity', @options.fillOpacity) 66 | .attr('stroke', 'none') 67 | -------------------------------------------------------------------------------- /public/views/witnessList.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
Masternode ID Total blocks Masternode Rewards Blocks height Latest detail
0x{{data.witness}} {{data.blocksNum}}{{data.reward}}{{data.lastCountTo}}view
24 |
25 |
    26 | 27 |
28 | 32 |
    33 | 34 |
35 |
36 |
37 |
38 |
-------------------------------------------------------------------------------- /tools/priTools/test.js: -------------------------------------------------------------------------------- 1 | var s1; 2 | var s2; 3 | var elems = []; 4 | var elemLen = 15000000; 5 | var falseRate = 0.00000015; 6 | var makestrTime=0; 7 | 8 | var bloomFilter = require('./node_bloom_filter/bloomfilter'); 9 | // let bFilter = new bloomFilter({ 10 | // nHash:16, 11 | // nBits:1024*64 12 | // }); 13 | let bFilter = new bloomFilter({ 14 | optimize: true,/*This automatically calculates number of hashes and bits to be used internally*/ 15 | falsePositiveRate: falseRate,/*Desired false positive rate,less rate will use more memory internally*/ 16 | isCounting: false,// False by default, 17 | nElements:elemLen 18 | }); 19 | 20 | 21 | // s1=new Date().getTime(); 22 | // for(var i=0; i 46 | 47 | #### Run Grabber: 48 | 49 | ``` node startup 50 | nohup node ./tools/grabber.js >> ./grabber.log 2>&1 & 51 | ``` 52 | -------------------------------------------------------------------------------- /tools/priTools/dealContractAddr.js: -------------------------------------------------------------------------------- 1 | require( '../../db.js' ); 2 | var mongoose = require('mongoose'); 3 | var Address = mongoose.model('Address'); 4 | var Contract = mongoose.model('Contract'); 5 | 6 | var contractAddrs = []; 7 | function getContractAddrs(_cbs){ 8 | Contract.find({}, "address -_id").exec(function(err, docs){ 9 | if(err){ 10 | console.log("getContractAddrs err:",err); 11 | process.exit(9); 12 | return; 13 | } 14 | for(var i=0; i0) 20 | _cbs.shift()(_cbs); 21 | }) 22 | } 23 | 24 | var normalAddr = []; 25 | function getNormalAddr(_cbs){ 26 | Address.find({"type":0}, "addr -_id").lean(true).exec(function(err, docs){ 27 | for(var i=0; i0) 32 | _cbs.shift()(_cbs); 33 | }); 34 | // Address.update({addr:{$in:contractAddrs}},{$set:{type:1}}); 35 | } 36 | 37 | function updateAddr(_cbs){ 38 | var addr = normalAddr.pop(); 39 | console.log("less:", normalAddr.length); 40 | if(contractAddrs.indexOf(addr)>-1){ 41 | Address.update({"addr":addr},{$set:{"type":1}}, function(err, raw){ 42 | console.log("update:",addr); 43 | if(normalAddr.length>0){ 44 | setTimeout(updateAddr, 100, _cbs); 45 | } 46 | else{ 47 | console.log("update finish !"); 48 | process.exit(0); 49 | } 50 | }); 51 | }else{ 52 | if(normalAddr.length>0){ 53 | setTimeout(updateAddr, 100, _cbs); 54 | } 55 | else{ 56 | console.log("update finish !"); 57 | process.exit(0); 58 | } 59 | } 60 | 61 | } 62 | 63 | getContractAddrs([getNormalAddr,updateAddr]); -------------------------------------------------------------------------------- /tools/priTools/updateContractAddr.js: -------------------------------------------------------------------------------- 1 | //update from address balance from rich-list.txt 2 | require('../../lib/consoleTimestamp.js'); 3 | require( '../../db.js' ); 4 | var etherUnits = require("../../lib/etherUnits.js"); 5 | var Web3 = require('web3'); 6 | 7 | var mongoose = require( 'mongoose' ); 8 | var Address = mongoose.model('Address'); 9 | var Contract = mongoose.model('Contract'); 10 | var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:9646")); 11 | var contractAddrs = []; 12 | 13 | var index = -1; 14 | var insertNum = 0; 15 | function updateNext(){ 16 | index+=1; 17 | if(index%10==0){ 18 | console.log("update index:", index); 19 | } 20 | if(index>=contractAddrs.length){ 21 | finish(); 22 | return; 23 | } 24 | 25 | 26 | //更新合约地址的type和balance 27 | var balance = web3.eth.getBalance(contractAddrs[index]); 28 | Address.updateOne( 29 | {'addr': contractAddrs[index]}, 30 | {$set:{'type':1, 'balance':Number(etherUnits.toEther(balance, 'wei'))}}, 31 | {multi: false, upsert: true}, 32 | function (updateErr, data) { 33 | if(updateErr){ 34 | console.log("Address.update err:", updateErr); 35 | console.log("index:",index); 36 | finish(); 37 | return; 38 | } 39 | insertNum++; 40 | setTimeout(updateNext, 150); 41 | } 42 | ); 43 | 44 | 45 | 46 | } 47 | 48 | function getContractAddrs(_cbs){ 49 | Contract.find({}, "address -_id").exec(function(err, docs){ 50 | if(err){ 51 | console.log("getContractAddrs err:",err); 52 | process.exit(9); 53 | return; 54 | } 55 | for(var i=0; i0) 60 | _cbs.shift()(_cbs); 61 | }) 62 | } 63 | 64 | function finish(){ 65 | console.log("insertNum:", insertNum); 66 | console.log("update finish !"); 67 | process.exit(0); 68 | } 69 | 70 | getContractAddrs([updateNext]); -------------------------------------------------------------------------------- /public/plugins/morris/spec/lib/parse_time_spec.coffee: -------------------------------------------------------------------------------- 1 | describe '#parseTime', -> 2 | 3 | it 'should parse years', -> 4 | Morris.parseDate('2012').should.equal(new Date(2012, 0, 1).getTime()) 5 | 6 | it 'should parse quarters', -> 7 | Morris.parseDate('2012 Q1').should.equal(new Date(2012, 2, 1).getTime()) 8 | 9 | it 'should parse months', -> 10 | Morris.parseDate('2012-09').should.equal(new Date(2012, 8, 1).getTime()) 11 | Morris.parseDate('2012-10').should.equal(new Date(2012, 9, 1).getTime()) 12 | 13 | it 'should parse dates', -> 14 | Morris.parseDate('2012-09-15').should.equal(new Date(2012, 8, 15).getTime()) 15 | Morris.parseDate('2012-10-15').should.equal(new Date(2012, 9, 15).getTime()) 16 | 17 | it 'should parse times', -> 18 | Morris.parseDate("2012-10-15 12:34").should.equal(new Date(2012, 9, 15, 12, 34).getTime()) 19 | Morris.parseDate("2012-10-15T12:34").should.equal(new Date(2012, 9, 15, 12, 34).getTime()) 20 | Morris.parseDate("2012-10-15 12:34:55").should.equal(new Date(2012, 9, 15, 12, 34, 55).getTime()) 21 | Morris.parseDate("2012-10-15T12:34:55").should.equal(new Date(2012, 9, 15, 12, 34, 55).getTime()) 22 | 23 | it 'should parse times with timezones', -> 24 | Morris.parseDate("2012-10-15T12:34+0100").should.equal(Date.UTC(2012, 9, 15, 11, 34)) 25 | Morris.parseDate("2012-10-15T12:34+02:00").should.equal(Date.UTC(2012, 9, 15, 10, 34)) 26 | Morris.parseDate("2012-10-15T12:34-0100").should.equal(Date.UTC(2012, 9, 15, 13, 34)) 27 | Morris.parseDate("2012-10-15T12:34-02:00").should.equal(Date.UTC(2012, 9, 15, 14, 34)) 28 | Morris.parseDate("2012-10-15T12:34:55Z").should.equal(Date.UTC(2012, 9, 15, 12, 34, 55)) 29 | Morris.parseDate("2012-10-15T12:34:55+0600").should.equal(Date.UTC(2012, 9, 15, 6, 34, 55)) 30 | Morris.parseDate("2012-10-15T12:34:55+04:00").should.equal(Date.UTC(2012, 9, 15, 8, 34, 55)) 31 | Morris.parseDate("2012-10-15T12:34:55-0600").should.equal(Date.UTC(2012, 9, 15, 18, 34, 55)) 32 | 33 | it 'should pass-through timestamps', -> 34 | Morris.parseDate(new Date(2012, 9, 15, 12, 34, 55, 123).getTime()) 35 | .should.equal(new Date(2012, 9, 15, 12, 34, 55, 123).getTime()) -------------------------------------------------------------------------------- /routes/addressListData.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var mongoose = require( 'mongoose' ); 3 | var Address = mongoose.model('Address'); 4 | var pageSize = 20; 5 | var page = 0; 6 | var totalPage = 0; 7 | var resultData={"totalPage":0, "list":null, "page":0}; 8 | 9 | 10 | function requestParam(req, param){ 11 | if(req.method == "GET"){ 12 | return req.query[param]; 13 | }else{ 14 | return req.body[param]; 15 | } 16 | } 17 | 18 | module.exports = function(req, res){ 19 | try{ 20 | var quereyParam = {}; 21 | var addressType = parseInt(requestParam(req, "addressType")); 22 | if(isNaN(addressType)) 23 | addressType=-1; 24 | if(addressType>0) 25 | quereyParam.type = addressType; 26 | else 27 | quereyParam.type = {$nin:[1,2]}; 28 | 29 | page = parseInt(requestParam(req, "page")); 30 | if(isNaN(page) || page<0) 31 | page = 0; 32 | 33 | totalPage = parseInt(requestParam(req, "totalPage")); 34 | if(isNaN(totalPage) || totalPage<0) 35 | totalPage = 0; 36 | 37 | resultData.totalPage = totalPage; 38 | resultData.page = page; 39 | resultData.list = null; 40 | 41 | if(resultData.totalPage == 0){ 42 | Address.count(quereyParam).exec(function(err,c){ 43 | if(err){ 44 | console.log("Address err: ", err); 45 | res.write(JSON.stringify(resultData)); 46 | res.end(); 47 | return; 48 | } 49 | resultData.totalPage = Math.ceil(c/pageSize); 50 | if(page>=resultData.totalPage){ 51 | resultData.page = 0; 52 | page=0; 53 | } 54 | getList(res, quereyParam); 55 | }); 56 | }else{ 57 | getList(res, quereyParam); 58 | } 59 | } catch (e) { 60 | console.error(e); 61 | res.write(JSON.stringify(resultData)); 62 | res.end(); 63 | } 64 | }; 65 | 66 | function getList(res, quereyParam){ 67 | AddressFind = Address.find(quereyParam, "-_id addr type balance").sort({"balance":-1}).skip(page*pageSize).limit(pageSize).lean(true); 68 | AddressFind.exec(function (err, docs) { 69 | if(err){ 70 | console.log("Address err: ", err); 71 | res.write(JSON.stringify(resultData)); 72 | res.end(); 73 | return; 74 | } 75 | resultData.list=docs; 76 | res.write(JSON.stringify(resultData)); 77 | res.end(); 78 | }); 79 | } -------------------------------------------------------------------------------- /tools/priTools/clearDB谨慎上传.js: -------------------------------------------------------------------------------- 1 | require( '../../db.js' ); 2 | 3 | var mongoose = require( 'mongoose' ); 4 | var Block = mongoose.model( 'Block' ); 5 | var Transaction = mongoose.model( 'Transaction' ); 6 | var LogEvent = mongoose.model('LogEvent'); 7 | var Witness = mongoose.model('Witness'); 8 | var Address = mongoose.model('Address'); 9 | var Contract = mongoose.model('Contract'); 10 | var TokenTransfer = mongoose.model('TokenTransfer'); 11 | var InerTransaction = mongoose.model('InerTransaction'); 12 | 13 | //删除指定Transaction 14 | // Transaction.collection.deleteOne({'hash':'0x30c0291c1d311360fe778544d1cabc0b6547cac6bc8d9b200793713bea168bed'},function(err){console.log(err)}); 15 | // Transaction.collection.deleteOne({'hash':'0xb8e1087aac24e15a3b69bbc11abc885fc2ad1c1222b41f4dcd10b009527430ce'},function(err){console.log(err)}); 16 | // Transaction.collection.deleteOne({'hash':'0xa622d37d71cb0bb11659ab47757d23bfee325a836529c84f5f7814a3512ed41d'},function(err){console.log(err)}); 17 | 18 | //删除指定Contract 19 | // Contract.collection.deleteOne({'address':'0xe7070707fcf115557fa4d0f4410d4964d5b25ebb'},function(err){console.log(err)}); 20 | 21 | //删除制定TokenTransfer 22 | // TokenTransfer.collection.deleteOne({'hash':'0x30c0291c1d311360fe778544d1cabc0b6547cac6bc8d9b200793713bea168bed'},function(err){console.log(err)}); 23 | 24 | //删除指定区块的所有记录 25 | var removeSomeBlock = function(blockNumber){ 26 | Block.collection.remove({"number":blockNumber}, function(err){console.log(err)}); 27 | Transaction.collection.remove({"blockNumber":blockNumber}), function(err){console.log(err)}; 28 | TokenTransfer.collection.remove({"blockNumber":blockNumber}, function(err){console.log(err)}); 29 | Contract.collection.remove({"blockNumber":blockNumber}, function(err){console.log(err)}); 30 | LogEvent.collection.remove({"blockNumber":blockNumber}, function(err){console.log(err)}); 31 | InerTransaction.collection.remove({"blockNumber":blockNumber}, function(err){console.log(err)}); 32 | } 33 | 34 | var clearDB= function(){ 35 | //全部清除 36 | Transaction.collection.remove({}); 37 | TokenTransfer.collection.remove({}); 38 | Contract.collection.remove({}); 39 | Block.collection.remove({}); 40 | LogEvent.collection.remove({}); 41 | Address.collection.remove({}) 42 | InerTransaction.collection.remove({}) 43 | } 44 | 45 | // removeSomeBlock(5607035); 46 | // clearDB(); -------------------------------------------------------------------------------- /public/tpl/footer.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 | 9 | 31 | 38 |
39 |
40 |
41 | 42 | 43 | 46 |
47 | 48 |
49 | -------------------------------------------------------------------------------- /public/views/block.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 | 6 | 7 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
Height 8 | not exist 9 | {{block.number}} 10 |
Time{{block.datetime | date:'yyyy-MM-dd HH:mm:ss Z' }} ({{block.timestamp | timeDuration}} ago)
Hash{{block.hash}}
ParentHash{{block.parentHash}}
Sha3 Uncles{{block.sha3Uncles}}
Mined By{{block.miner}}
Difficulty{{block.difficulty.toString()}}
Total Difficulty{{block.totalDifficulty | teraHashes | number}} TH
Gas Limit{{block.gasLimit | number}}
Gas Used{{block.gasUsed | number}}
Nonce{{block.nonce | number}}
Masternode{{block.witness}}
Extra Data{{block.extraData}}
26 |
27 | 28 | 29 |
30 | 31 |
32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
Transactions
{{t}}
45 |
46 |
47 |
48 | -------------------------------------------------------------------------------- /public/plugins/morris/spec/lib/area/area_spec.coffee: -------------------------------------------------------------------------------- 1 | describe 'Morris.Area', -> 2 | 3 | describe 'svg structure', -> 4 | defaults = 5 | element: 'graph' 6 | data: [{x: '2012 Q1', y: 1}, {x: '2012 Q2', y: 1}] 7 | lineColors: [ '#0b62a4', '#7a92a3'] 8 | gridLineColor: '#aaa' 9 | xkey: 'x' 10 | ykeys: ['y'] 11 | labels: ['Y'] 12 | 13 | it 'should contain a line path for each line', -> 14 | chart = Morris.Area $.extend {}, defaults 15 | $('#graph').find("path[stroke='#0b62a4']").size().should.equal 1 16 | 17 | it 'should contain a path with stroke-width 0 for each line', -> 18 | chart = Morris.Area $.extend {}, defaults 19 | $('#graph').find("path[stroke='#0b62a4']").size().should.equal 1 20 | 21 | it 'should contain 5 grid lines', -> 22 | chart = Morris.Area $.extend {}, defaults 23 | $('#graph').find("path[stroke='#aaaaaa']").size().should.equal 5 24 | 25 | it 'should contain 9 text elements', -> 26 | chart = Morris.Area $.extend {}, defaults 27 | $('#graph').find("text").size().should.equal 9 28 | 29 | describe 'svg attributes', -> 30 | defaults = 31 | element: 'graph' 32 | data: [{x: '2012 Q1', y: 1}, {x: '2012 Q2', y: 1}] 33 | xkey: 'x' 34 | ykeys: ['y'] 35 | labels: ['Y'] 36 | lineColors: [ '#0b62a4', '#7a92a3'] 37 | lineWidth: 3 38 | pointWidths: [5] 39 | pointStrokeColors: ['#ffffff'] 40 | gridLineColor: '#aaa' 41 | gridStrokeWidth: 0.5 42 | gridTextColor: '#888' 43 | gridTextSize: 12 44 | 45 | it 'should not be cumulative if behaveLikeLine', -> 46 | chart = Morris.Area $.extend {}, defaults, behaveLikeLine: true 47 | chart.cumulative.should.equal false 48 | 49 | it 'should have a line with transparent fill if behaveLikeLine', -> 50 | chart = Morris.Area $.extend {}, defaults, behaveLikeLine: true 51 | $('#graph').find("path[fill-opacity='0.8']").size().should.equal 1 52 | 53 | it 'should not have a line with transparent fill', -> 54 | chart = Morris.Area $.extend {}, defaults 55 | $('#graph').find("path[fill-opacity='0.8']").size().should.equal 0 56 | 57 | it 'should have a line with the fill of a modified line color', -> 58 | chart = Morris.Area $.extend {}, defaults 59 | $('#graph').find("path[fill='#0b62a4']").size().should.equal 0 60 | $('#graph').find("path[fill='#7a92a3']").size().should.equal 0 61 | -------------------------------------------------------------------------------- /public/plugins/morris/spec/lib/hover_spec.coffee: -------------------------------------------------------------------------------- 1 | describe "Morris.Hover", -> 2 | 3 | describe "with dummy content", -> 4 | 5 | beforeEach -> 6 | parent = $('
') 7 | .appendTo($('#test')) 8 | @hover = new Morris.Hover(parent: parent) 9 | @element = $('#test .morris-hover') 10 | 11 | it "should initialise a hidden, empty popup", -> 12 | @element.should.exist 13 | @element.should.be.hidden 14 | @element.should.be.empty 15 | 16 | describe "#show", -> 17 | it "should show the popup", -> 18 | @hover.show() 19 | @element.should.be.visible 20 | 21 | describe "#hide", -> 22 | it "should hide the popup", -> 23 | @hover.show() 24 | @hover.hide() 25 | @element.should.be.hidden 26 | 27 | describe "#html", -> 28 | it "should replace the contents of the element", -> 29 | @hover.html('
Foobarbaz
') 30 | @element.should.have.html('
Foobarbaz
') 31 | 32 | describe "#moveTo", -> 33 | beforeEach -> 34 | @hover.html('
') 35 | 36 | it "should place the popup directly above the given point", -> 37 | @hover.moveTo(100, 150) 38 | @element.should.have.css('left', '50px') 39 | @element.should.have.css('top', '40px') 40 | 41 | it "should place the popup below the given point if it does not fit above", -> 42 | @hover.moveTo(100, 50) 43 | @element.should.have.css('left', '50px') 44 | @element.should.have.css('top', '60px') 45 | 46 | it "should center the popup vertically if it will not fit above or below", -> 47 | @hover.moveTo(100, 100) 48 | @element.should.have.css('left', '50px') 49 | @element.should.have.css('top', '40px') 50 | 51 | it "should center the popup vertically if no y value is supplied", -> 52 | @hover.moveTo(100) 53 | @element.should.have.css('left', '50px') 54 | @element.should.have.css('top', '40px') 55 | 56 | describe "#update", -> 57 | it "should update content, show and reposition the popup", -> 58 | hover = new Morris.Hover(parent: $('#test')) 59 | html = "
Hello, Everyone!
" 60 | hover.update(html, 150, 200) 61 | el = $('#test .morris-hover') 62 | el.should.have.css('left', '100px') 63 | el.should.have.css('top', '90px') 64 | el.should.have.text('Hello, Everyone!') 65 | -------------------------------------------------------------------------------- /public/js/controllers/TxController.js: -------------------------------------------------------------------------------- 1 | angular.module('BlocksApp').controller('TxController', function($stateParams, $rootScope, $scope, $http, $location) { 2 | $scope.$on('$viewContentLoaded', function() { 3 | // initialize core components 4 | App.initAjax(); 5 | }); 6 | 7 | $rootScope.$state.current.data["pageSubTitle"] = $stateParams.hash; 8 | $scope.hash = $stateParams.hash; 9 | $scope.tx = {"hash": $scope.hash}; 10 | 11 | //fetch web3 stuff 12 | var isTransfer = false; 13 | if($location.$$search && $location.$$search.isTransfer) 14 | isTransfer = true; 15 | $http({ 16 | method: 'POST', 17 | url: '/transactionRelay', 18 | data: {"tx": $scope.hash, "isTransfer": isTransfer} 19 | }).success(function(data) { 20 | $scope.tx = data; 21 | $scope.isTransfer = data.isTransfer; 22 | if (data.timestamp) 23 | $scope.tx.datetime = new Date(data.timestamp*1000); 24 | if (data.isTrace) // Get internal txs 25 | //fetchInternalTxs(); 26 | $scope.logs=[]; 27 | $scope.getLogs(); 28 | }); 29 | 30 | // var fetchInternalTxs = function() { 31 | // $http({ 32 | // method: 'POST', 33 | // url: '/web3relay', 34 | // data: {"tx_trace": $scope.hash} 35 | // }).success(function(data) { 36 | // $scope.internal_transactions = data; 37 | // }); 38 | // } 39 | 40 | $scope.getLogs = function() { 41 | if($scope.logs){ 42 | return; 43 | } 44 | $http({ 45 | method: 'POST', 46 | url: '/eventLog', 47 | data: {"txHash": $scope.hash} 48 | }).success(function(data) { 49 | $scope.logs = data; 50 | // for(var i=0; i<$scope.logs.length; i++){ 51 | // $scope.logs[i].params = splitParam($scope.logs[i].to); 52 | // } 53 | 54 | }); 55 | } 56 | 57 | // var splitParam = function(paramsStr){ 58 | // var params = []; 59 | // var step = 0; 60 | // var addNum; 61 | // for(var i=0; i=rawAddrList.length){ 24 | finish(); 25 | return; 26 | } 27 | 28 | var balanceInList = rawAddrList[index+1]; 29 | //数据库中地址的balance不等于balanceInList,并且balanceInList大于10,则从节点更新balance 30 | Address.findOne({"addr":rawAddrList[index]}, "-_id balance").exec((err,doc)=>{ 31 | if(err){ 32 | console.log("Address.findOne err:", err); 33 | console.log("index:",index); 34 | finish(); 35 | return; 36 | } 37 | if(!doc || Number(etherUnits.toEther(doc.balance, 'wei')) != balanceInList){ 38 | //更新列表中存在的地址 39 | var balance = web3.eth.getBalance(rawAddrList[index]); 40 | if(balance<10000000000000000000){ 41 | updateNext(); 42 | return; 43 | } 44 | 45 | Address.updateOne( 46 | {'addr': rawAddrList[index]}, 47 | {$set:{'balance':Number(etherUnits.toEther(balance, 'wei'))}}, 48 | {multi: false, upsert: true}, 49 | function (updateErr, data) { 50 | if(updateErr){ 51 | console.log("Address.update err:", updateErr); 52 | console.log("index:",index); 53 | finish(); 54 | return; 55 | } 56 | insertNum++; 57 | setTimeout(updateNext, 150); 58 | } 59 | ); 60 | }else{ 61 | updateNext(); 62 | } 63 | }) 64 | 65 | 66 | 67 | } 68 | 69 | function finish(){ 70 | console.log("insertNum:", insertNum); 71 | console.log("update finish !"); 72 | process.exit(0); 73 | } 74 | 75 | updateNext(); -------------------------------------------------------------------------------- /public/js/directives.js: -------------------------------------------------------------------------------- 1 | /*** 2 | GLobal Directives 3 | ***/ 4 | 5 | // Route State Load Spinner(used on page or content load) 6 | BlocksApp.directive('ngSpinnerBar', ['$rootScope', 7 | function($rootScope) { 8 | return { 9 | link: function(scope, element, attrs) { 10 | // by defult hide the spinner bar 11 | element.addClass('hide'); // hide spinner bar by default 12 | 13 | // display the spinner bar whenever the route changes(the content part started loading) 14 | $rootScope.$on('$stateChangeStart', function() { 15 | element.removeClass('hide'); // show spinner bar 16 | Layout.closeMainMenu(); 17 | }); 18 | 19 | // hide the spinner bar on rounte change success(after the content loaded) 20 | $rootScope.$on('$stateChangeSuccess', function() { 21 | element.addClass('hide'); // hide spinner bar 22 | $('body').removeClass('page-on-load'); // remove page loading indicator 23 | Layout.setMainMenuActiveLink('match'); // activate selected link in the sidebar menu 24 | 25 | // auto scorll to page top 26 | setTimeout(function () { 27 | App.scrollTop(); // scroll to the top on content load 28 | }, $rootScope.settings.layout.pageAutoScrollOnLoad); 29 | }); 30 | 31 | // handle errors 32 | $rootScope.$on('$stateNotFound', function() { 33 | element.addClass('hide'); // hide spinner bar 34 | }); 35 | 36 | // handle errors 37 | $rootScope.$on('$stateChangeError', function() { 38 | element.addClass('hide'); // hide spinner bar 39 | }); 40 | } 41 | }; 42 | } 43 | ]) 44 | 45 | // Handle global LINK click 46 | BlocksApp.directive('a', function() { 47 | return { 48 | restrict: 'E', 49 | link: function(scope, elem, attrs) { 50 | if (attrs.ngClick || attrs.href === '' || attrs.href === '#') { 51 | elem.on('click', function(e) { 52 | e.preventDefault(); // prevent link click for above criteria 53 | }); 54 | } 55 | } 56 | }; 57 | }); 58 | 59 | // Handle Dropdown Hover Plugin Integration 60 | BlocksApp.directive('dropdownMenuHover', function () { 61 | return { 62 | link: function (scope, elem) { 63 | elem.dropdownHover(); 64 | } 65 | }; 66 | }); -------------------------------------------------------------------------------- /public/plugins/morris/examples/weeks.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Formatting Dates With Weeks

14 |
15 |
16 | var week_data = [
17 |   {"period": "2011 W27", "licensed": 3407, "sorned": 660},
18 |   {"period": "2011 W26", "licensed": 3351, "sorned": 629},
19 |   {"period": "2011 W25", "licensed": 3269, "sorned": 618},
20 |   {"period": "2011 W24", "licensed": 3246, "sorned": 661},
21 |   {"period": "2011 W23", "licensed": 3257, "sorned": 667},
22 |   {"period": "2011 W22", "licensed": 3248, "sorned": 627},
23 |   {"period": "2011 W21", "licensed": 3171, "sorned": 660},
24 |   {"period": "2011 W20", "licensed": 3171, "sorned": 676},
25 |   {"period": "2011 W19", "licensed": 3201, "sorned": 656},
26 |   {"period": "2011 W18", "licensed": 3215, "sorned": 622},
27 |   {"period": "2011 W17", "licensed": 3148, "sorned": 632},
28 |   {"period": "2011 W16", "licensed": 3155, "sorned": 681},
29 |   {"period": "2011 W15", "licensed": 3190, "sorned": 667},
30 |   {"period": "2011 W14", "licensed": 3226, "sorned": 620},
31 |   {"period": "2011 W13", "licensed": 3245, "sorned": null},
32 |   {"period": "2011 W12", "licensed": 3289, "sorned": null},
33 |   {"period": "2011 W11", "licensed": 3263, "sorned": null},
34 |   {"period": "2011 W10", "licensed": 3189, "sorned": null},
35 |   {"period": "2011 W09", "licensed": 3079, "sorned": null},
36 |   {"period": "2011 W08", "licensed": 3085, "sorned": null},
37 |   {"period": "2011 W07", "licensed": 3055, "sorned": null},
38 |   {"period": "2011 W06", "licensed": 3063, "sorned": null},
39 |   {"period": "2011 W05", "licensed": 2943, "sorned": null},
40 |   {"period": "2011 W04", "licensed": 2806, "sorned": null},
41 |   {"period": "2011 W03", "licensed": 2674, "sorned": null},
42 |   {"period": "2011 W02", "licensed": 1702, "sorned": null},
43 |   {"period": "2011 W01", "licensed": 1732, "sorned": null}
44 | ];
45 | Morris.Line({
46 |   element: 'graph',
47 |   data: week_data,
48 |   xkey: 'period',
49 |   ykeys: ['licensed', 'sorned'],
50 |   labels: ['Licensed', 'SORN']
51 | });
52 | 
53 | 54 | -------------------------------------------------------------------------------- /tools/priTools/updateAddrBalance.js: -------------------------------------------------------------------------------- 1 | //update from address balance from rich-list.txt 2 | require( '../../db.js' ); 3 | var etherUnits = require("../../lib/etherUnits.js"); 4 | var Web3 = require('web3'); 5 | 6 | var mongoose = require( 'mongoose' ); 7 | var Address = mongoose.model('Address'); 8 | 9 | var fs = require("fs"); 10 | var rawFilePath = "./lessList.txt";//w 11 | var content = fs.readFileSync(rawFilePath, "utf8"); 12 | var rawAddrList = JSON.parse(content);//[addr,balance,addr,balance,...] 13 | var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:9646")); 14 | 15 | var index = -1; 16 | var insertNum = 0; 17 | function updateNext(){ 18 | index+=1; 19 | if(index%100==0){ 20 | console.log("update index:", index); 21 | } 22 | if(index>=rawAddrList.length){ 23 | finish(); 24 | return; 25 | } 26 | 27 | 28 | //更新列表中存在的地址 29 | var balance = web3.eth.getBalance(rawAddrList[index]); 30 | balance = Number(etherUnits.toEther(balance, 'wei')) 31 | Address.updateOne( 32 | {'addr': rawAddrList[index]}, 33 | // {$setOnInsert: witnessDoc}, 34 | // {upsert: true}, 35 | {$set:{'balance':balance}}, 36 | {multi: false, upsert: true}, 37 | function (err, data) { 38 | if(err){ 39 | console.log("Address.update err:", err); 40 | console.log("index:",index); 41 | finish(); 42 | return; 43 | } 44 | insertNum++; 45 | setTimeout(updateNext, 150); 46 | 47 | } 48 | ); 49 | 50 | //插入列表在数据库中不存在的新记录 51 | // Address.findOne({"addr":rawAddrList[index]}, (err, res)=>{ 52 | // if(err){ 53 | // console.log("index:",index); 54 | // console.log("updateNext err: ", err); 55 | // finish(); 56 | // return; 57 | // } 58 | // if(res==null){ 59 | // Address.collection.insertOne({"addr":rawAddrList[index], "type":0, "balance":rawAddrList[index+1]}, (insertErr, res)=>{ 60 | // if(insertErr){ 61 | // console.log("index:",index); 62 | // console.log("insert err: ", insertErr); 63 | // finish(); 64 | // return; 65 | // } 66 | // insertNum++; 67 | // updateNext(); 68 | // }) 69 | // }else{ 70 | // updateNext(); 71 | // } 72 | // }); 73 | 74 | } 75 | 76 | function finish(){ 77 | console.log("insertNum:", insertNum); 78 | console.log("update finish !"); 79 | process.exit(0); 80 | } 81 | 82 | updateNext(); -------------------------------------------------------------------------------- /public/plugins/morris/examples/events.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Time Events

14 |
15 |
16 | var week_data = [
17 |   {"period": "2011 W27", "licensed": 3407, "sorned": 660},
18 |   {"period": "2011 W26", "licensed": 3351, "sorned": 629},
19 |   {"period": "2011 W25", "licensed": 3269, "sorned": 618},
20 |   {"period": "2011 W24", "licensed": 3246, "sorned": 661},
21 |   {"period": "2011 W23", "licensed": 3257, "sorned": 667},
22 |   {"period": "2011 W22", "licensed": 3248, "sorned": 627},
23 |   {"period": "2011 W21", "licensed": 3171, "sorned": 660},
24 |   {"period": "2011 W20", "licensed": 3171, "sorned": 676},
25 |   {"period": "2011 W19", "licensed": 3201, "sorned": 656},
26 |   {"period": "2011 W18", "licensed": 3215, "sorned": 622},
27 |   {"period": "2011 W17", "licensed": 3148, "sorned": 632},
28 |   {"period": "2011 W16", "licensed": 3155, "sorned": 681},
29 |   {"period": "2011 W15", "licensed": 3190, "sorned": 667},
30 |   {"period": "2011 W14", "licensed": 3226, "sorned": 620},
31 |   {"period": "2011 W13", "licensed": 3245, "sorned": null},
32 |   {"period": "2011 W12", "licensed": 3289, "sorned": null},
33 |   {"period": "2011 W11", "licensed": 3263, "sorned": null},
34 |   {"period": "2011 W10", "licensed": 3189, "sorned": null},
35 |   {"period": "2011 W09", "licensed": 3079, "sorned": null},
36 |   {"period": "2011 W08", "licensed": 3085, "sorned": null},
37 |   {"period": "2011 W07", "licensed": 3055, "sorned": null},
38 |   {"period": "2011 W06", "licensed": 3063, "sorned": null},
39 |   {"period": "2011 W05", "licensed": 2943, "sorned": null},
40 |   {"period": "2011 W04", "licensed": 2806, "sorned": null},
41 |   {"period": "2011 W03", "licensed": 2674, "sorned": null},
42 |   {"period": "2011 W02", "licensed": 1702, "sorned": null},
43 |   {"period": "2011 W01", "licensed": 1732, "sorned": null}
44 | ];
45 | Morris.Line({
46 |   element: 'graph',
47 |   data: week_data,
48 |   xkey: 'period',
49 |   ykeys: ['licensed', 'sorned'],
50 |   labels: ['Licensed', 'SORN'],
51 |   events: [
52 |     '2011-04',
53 |     '2011-08'
54 |   ]
55 | });
56 | 
57 | 58 | -------------------------------------------------------------------------------- /public/plugins/morris/examples/quarters.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Formatting Dates with Quarters

14 |
15 |
16 | /* data stolen from http://howmanyleft.co.uk/vehicle/jaguar_e_type */
17 | var quarter_data = [
18 |   {"period": "2011 Q3", "licensed": 3407, "sorned": 660},
19 |   {"period": "2011 Q2", "licensed": 3351, "sorned": 629},
20 |   {"period": "2011 Q1", "licensed": 3269, "sorned": 618},
21 |   {"period": "2010 Q4", "licensed": 3246, "sorned": 661},
22 |   {"period": "2010 Q3", "licensed": 3257, "sorned": 667},
23 |   {"period": "2010 Q2", "licensed": 3248, "sorned": 627},
24 |   {"period": "2010 Q1", "licensed": 3171, "sorned": 660},
25 |   {"period": "2009 Q4", "licensed": 3171, "sorned": 676},
26 |   {"period": "2009 Q3", "licensed": 3201, "sorned": 656},
27 |   {"period": "2009 Q2", "licensed": 3215, "sorned": 622},
28 |   {"period": "2009 Q1", "licensed": 3148, "sorned": 632},
29 |   {"period": "2008 Q4", "licensed": 3155, "sorned": 681},
30 |   {"period": "2008 Q3", "licensed": 3190, "sorned": 667},
31 |   {"period": "2007 Q4", "licensed": 3226, "sorned": 620},
32 |   {"period": "2006 Q4", "licensed": 3245, "sorned": null},
33 |   {"period": "2005 Q4", "licensed": 3289, "sorned": null},
34 |   {"period": "2004 Q4", "licensed": 3263, "sorned": null},
35 |   {"period": "2003 Q4", "licensed": 3189, "sorned": null},
36 |   {"period": "2002 Q4", "licensed": 3079, "sorned": null},
37 |   {"period": "2001 Q4", "licensed": 3085, "sorned": null},
38 |   {"period": "2000 Q4", "licensed": 3055, "sorned": null},
39 |   {"period": "1999 Q4", "licensed": 3063, "sorned": null},
40 |   {"period": "1998 Q4", "licensed": 2943, "sorned": null},
41 |   {"period": "1997 Q4", "licensed": 2806, "sorned": null},
42 |   {"period": "1996 Q4", "licensed": 2674, "sorned": null},
43 |   {"period": "1995 Q4", "licensed": 1702, "sorned": null},
44 |   {"period": "1994 Q4", "licensed": 1732, "sorned": null}
45 | ];
46 | Morris.Line({
47 |   element: 'graph',
48 |   data: quarter_data,
49 |   xkey: 'period',
50 |   ykeys: ['licensed', 'sorned'],
51 |   labels: ['Licensed', 'SORN']
52 | });
53 | 
54 | 55 | -------------------------------------------------------------------------------- /public/js/controllers/DAOController.js: -------------------------------------------------------------------------------- 1 | angular.module('BlocksApp').controller('DAOController', function($stateParams, $rootScope, $scope, $http, $location) { 2 | $scope.$on('$viewContentLoaded', function() { 3 | // initialize core components 4 | App.initAjax(); 5 | }); 6 | var activeTab = $location.url().split('#'); 7 | if (activeTab.length > 1) 8 | $scope.activeTab = activeTab[1]; 9 | 10 | $scope.dao = {"balance": 0, "extra_balance": 0}; 11 | 12 | //fetch dao stuff 13 | $http({ 14 | method: 'POST', 15 | url: '/daorelay', 16 | data: {"action": "info"} 17 | }).success(function(data) { 18 | $scope.dao = data; 19 | }); 20 | 21 | $scope.form = {}; 22 | $scope.errors = {}; 23 | $scope.showTokens = false; 24 | $scope.getBalance = function(a) { 25 | var addr = a.toLowerCase(); 26 | 27 | $scope.form.addrInput=""; 28 | $scope.errors = {}; 29 | 30 | $scope.form.tokens.$setPristine(); 31 | $scope.form.tokens.$setUntouched(); 32 | if (isAddress(addr)) { 33 | $http({ 34 | method: 'POST', 35 | url: '/daorelay', 36 | data: {"action": "balanceOf", "addr": addr} 37 | }).success(function(data) { 38 | console.log(data) 39 | $scope.showTokens = true; 40 | $scope.dao.tokens = data.tokens; 41 | }); 42 | } else 43 | $scope.errors.address = "Invalid Address"; 44 | 45 | } 46 | 47 | }) 48 | .directive('createdTokens', function($http) { 49 | return { 50 | restrict: 'E', 51 | templateUrl: '/views/created-tokens.html', 52 | scope: false, 53 | link: function(scope, elem, attrs){ 54 | // fetch created tokens 55 | scope.getCreatedTokens = function(last) { 56 | var data = {"action": "createdTokens"}; 57 | if (last) 58 | data.last_id = last; 59 | 60 | $http({ 61 | method: 'POST', 62 | url: '/daorelay', 63 | data: data 64 | }).success(function(data) { 65 | scope.created_tokens = data; 66 | }); 67 | } 68 | 69 | scope.getCreatedTokens(); 70 | } 71 | 72 | } 73 | }) 74 | .directive('transferTokens', function($http) { 75 | return { 76 | restrict: 'E', 77 | templateUrl: '/views/transfer-tokens.html', 78 | scope: false, 79 | link: function(scope, elem, attrs){ 80 | // fetch created tokens 81 | scope.getTransferTokens = function(last) { 82 | var data = {"action": "transferTokens"}; 83 | if (last) 84 | data.last_id = last; 85 | 86 | $http({ 87 | method: 'POST', 88 | url: '/daorelay', 89 | data: data 90 | }).success(function(data) { 91 | scope.transfer_tokens = data; 92 | }); 93 | } 94 | 95 | scope.getTransferTokens(); 96 | } 97 | 98 | } 99 | }) 100 | -------------------------------------------------------------------------------- /lib/murmurHash3.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * murmurhash3 3 | * Copyright(c) 2011 Hideaki Ohno 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * Library version. 9 | */ 10 | 11 | exports.version = '0.4.2'; 12 | 13 | var binding; 14 | try { 15 | binding = require(__dirname + '/../build/Release/murmurhash3'); 16 | } catch(e) { 17 | binding = require(__dirname + '/../build/default/murmurhash3'); 18 | } 19 | 20 | var E_CALLBACK_MISSING = "Callback function is missing"; 21 | 22 | //Aync interface 23 | 24 | exports.murmur32 = function(key, seed, cb) { 25 | if ( typeof seed == 'function') { 26 | cb = seed; 27 | seed = 0; 28 | } 29 | if (cb === undefined || typeof cb != 'function') { 30 | throw new Error(E_CALLBACK_MISSING); 31 | } 32 | var res = binding.murmur32(key, seed, false, function(err, res) { 33 | // Cast signed integer to unsigned integer 34 | cb(err, res >>> 0); 35 | }); 36 | return res; 37 | }; 38 | 39 | exports.murmur32Hex = function(key, seed, cb) { 40 | if ( typeof seed == 'function') { 41 | cb = seed; 42 | seed = 0; 43 | } 44 | if (cb === undefined || typeof cb != 'function') { 45 | throw new Error(E_CALLBACK_MISSING); 46 | } 47 | return binding.murmur32(key, seed, true, cb); 48 | }; 49 | 50 | exports.murmur128 = function(key, seed, cb) { 51 | if ( typeof seed == 'function') { 52 | cb = seed; 53 | seed = 0; 54 | } 55 | if (cb === undefined || typeof cb != 'function') { 56 | throw new Error(E_CALLBACK_MISSING); 57 | } 58 | binding.murmur128(key, seed, false, function(err, res) { 59 | for (var i = 0; i < res.length; i++) { 60 | // Cast signed integer to unsigned integer 61 | res[i] = res[i] >>> 0; 62 | } 63 | cb(err, res); 64 | }); 65 | }; 66 | 67 | exports.murmur128Hex = function(key, seed, cb) { 68 | if ( typeof seed == 'function') { 69 | cb = seed; 70 | seed = 0; 71 | } 72 | if (cb === undefined || typeof cb != 'function') { 73 | throw new Error(E_CALLBACK_MISSING); 74 | } 75 | return binding.murmur128(key, seed, true, cb); 76 | }; 77 | 78 | 79 | //Sync interface 80 | 81 | exports.murmur32Sync = function(key, seed) { 82 | // Cast signed integer to unsigned integer 83 | if (seed === undefined) { 84 | seed = 0; 85 | } 86 | var res = binding.murmur32Sync(key, seed, false) >>> 0; 87 | return res; 88 | }; 89 | 90 | exports.murmur32HexSync = function(key, seed) { 91 | if (seed === undefined) { 92 | seed = 0; 93 | } 94 | return binding.murmur32Sync(key, seed, true); 95 | }; 96 | 97 | exports.murmur128Sync = function(key, seed) { 98 | if (seed === undefined) { 99 | seed = 0; 100 | } 101 | var res = binding.murmur128Sync(key, seed, false); 102 | for (var i = 0; i < res.length; i++) { 103 | // Cast signed integer to unsigned integer 104 | res[i] = res[i] >>> 0; 105 | } 106 | return res; 107 | }; 108 | 109 | exports.murmur128HexSync = function(key, seed) { 110 | if (seed === undefined) { 111 | seed = 0; 112 | } 113 | return binding.murmur128Sync(key, seed, true); 114 | }; -------------------------------------------------------------------------------- /tools/priTools/internalTX_txhash.js: -------------------------------------------------------------------------------- 1 | //update from address balance from rich-list.txt 2 | require( '../../db.js' ); 3 | var Web3 = require('web3'); 4 | var etherUnits = require("../../lib/etherUnits.js"); 5 | var BigNumber = require('bignumber.js'); 6 | var mongoose = require( 'mongoose' ); 7 | var Transaction = mongoose.model('Transaction'); 8 | var InerTransaction = mongoose.model('InerTransaction'); 9 | var fromBlock = 1; 10 | var toBlock = 8204323;//查询结束区块(不包含本身) 11 | var txhashList = []; 12 | var internalPage = 0; 13 | var pageSize = 500; 14 | var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:9646")); 15 | 16 | 17 | function quereyTX(){// 18 | var transactionFind = Transaction.find({blockNumber:{$lt:toBlock, $gt:fromBlock}, input:{$ne:"0x"}}, "hash blockNumber timestamp").sort({"blockNumber":1}).skip(internalPage*pageSize).limit(pageSize).lean(true); 19 | transactionFind.exec((err, docs)=>{ 20 | if(err!=null || docs.length==0){ 21 | finish(); 22 | return; 23 | } 24 | txhashList.length = 0; 25 | for(var i=0; i{ 78 | console.log("total innerTx:", num); 79 | }) 80 | } 81 | 82 | // countTX(); 83 | quereyTX(); -------------------------------------------------------------------------------- /public/css/custom.css: -------------------------------------------------------------------------------- 1 | div.page-logo {overflow: visible;} 2 | img.logo-default { 3 | max-height: 150px; 4 | height: 100px; 5 | } 6 | .create{background-color:#36c6d3} 7 | .truncate-txhash, .truncate-addrhash{ 8 | white-space:nowrap; 9 | overflow:hidden; 10 | text-overflow: ellipsis; 11 | max-width:220px; 12 | } 13 | .truncate-addrhash { 14 | max-width:200px; 15 | } 16 | .scrollable { 17 | max-height: 400px; 18 | overflow-y: scroll; 19 | overflow-x: hidden; 20 | } 21 | #table_txs td, #table_internal_txs td { 22 | font-size: 12px; 23 | white-space:nowrap; 24 | overflow:hidden; 25 | text-overflow: ellipsis; 26 | } 27 | .eth-stat { 28 | padding-bottom: 20px; 29 | font-size: 14px; 30 | font-weight: 600; 31 | color: #7f90a4; 32 | } 33 | .eth-stat-title { 34 | font-size: 25px; 35 | text-align: center; 36 | } 37 | .eth-stat-text { 38 | color: #5b9bd1; 39 | font-size: 13px; 40 | font-weight: 800; 41 | text-align: center; 42 | } 43 | .fade {opacity: 0.6} 44 | .portlet { 45 | margin-top: 0; 46 | margin-bottom: 25px; 47 | padding: 0; 48 | border-radius: 4px; 49 | } 50 | .portlet.light { 51 | padding: 12px 20px 15px; 52 | background-color: #fff; 53 | } 54 | .home-tx{ 55 | font-size: 12px; 56 | white-space:nowrap; 57 | overflow:hidden; 58 | text-overflow: ellipsis; 59 | } 60 | .page-404 {text-align: center;} 61 | .page-404 .number { 62 | position: relative; 63 | top: 20px; 64 | display: inline-block; 65 | margin-top: 0; 66 | margin-bottom: 20px; 67 | text-align: right; 68 | letter-spacing: -10px; 69 | line-height: 128px; 70 | font-size: 128px; 71 | font-weight: 300; 72 | } 73 | .page-404 .details { 74 | margin-left: 40px; 75 | display: inline-block; 76 | text-align: left; 77 | } 78 | pre { 79 | margin-top: 5px; 80 | white-space: pre-wrap; 81 | word-wrap: break-word; 82 | } 83 | pre.code-js, .verified{ 84 | max-height: 200px; 85 | } 86 | .code { 87 | font-family: Menlo,Monaco,Consolas,"Courier New",monospace; 88 | font-size: 13px; 89 | } 90 | i.verified:before{ 91 | content:"\f1ce" 92 | } 93 | .page-logo a { 94 | text-decoration: none; 95 | } 96 | tr.ng-scope { 97 | white-space: nowrap; 98 | } 99 | li.ng-scope { 100 | width: calc(100% - 16px); 101 | } 102 | .table-scrollable { 103 | margin: 0 !important; 104 | } 105 | @media(max-width: 487px) { 106 | .container { 107 | margin: 0 !important; 108 | } 109 | .page-header .page-header-top .menu-toggler { 110 | margin: 33px 3px 0 0; 111 | } 112 | } 113 | ::-webkit-scrollbar { 114 | width: 4px; 115 | height: 6px; 116 | } 117 | ::-webkit-scrollbar-button { 118 | height: 0px; 119 | width: 0px; 120 | } 121 | ::-webkit-scrollbar-corner { 122 | background-color: transparent; 123 | height: 0px; 124 | width: 0px; 125 | } 126 | ::-webkit-scrollbar-thumb { 127 | background-color: rgba(68, 77, 88, 0.27); 128 | border-radius: 10px; 129 | } 130 | ::-webkit-scrollbar-track { 131 | background-color: transparent; 132 | } -------------------------------------------------------------------------------- /public/plugins/morris/spec/lib/donut/donut_spec.coffee: -------------------------------------------------------------------------------- 1 | describe 'Morris.Donut', -> 2 | 3 | describe 'svg structure', -> 4 | defaults = 5 | element: 'graph' 6 | data: [ {label: 'Jam', value: 25 }, 7 | {label: 'Frosted', value: 40 }, 8 | {label: 'Custard', value: 25 }, 9 | {label: 'Sugar', value: 10 } ] 10 | formatter: (y) -> "#{y}%" 11 | 12 | it 'should contain 2 paths for each segment', -> 13 | chart = Morris.Donut $.extend {}, defaults 14 | $('#graph').find("path").size().should.equal 8 15 | 16 | it 'should contain 2 text elements for the label', -> 17 | chart = Morris.Donut $.extend {}, defaults 18 | $('#graph').find("text").size().should.equal 2 19 | 20 | describe 'svg attributes', -> 21 | defaults = 22 | element: 'graph' 23 | data: [ {label: 'Jam', value: 25 }, 24 | {label: 'Frosted', value: 40 }, 25 | {label: 'Custard', value: 25 }, 26 | {label: 'Sugar', value: 10 } ] 27 | formatter: (y) -> "#{y}%" 28 | colors: [ '#0B62A4', '#3980B5', '#679DC6', '#95BBD7'] 29 | 30 | it 'should have a label with font size 15', -> 31 | chart = Morris.Donut $.extend {}, defaults 32 | $('#graph').find("text[font-size='15px']").size().should.equal 1 33 | 34 | it 'should have a label with font size 14', -> 35 | chart = Morris.Donut $.extend {}, defaults 36 | $('#graph').find("text[font-size='14px']").size().should.equal 1 37 | 38 | it 'should have a label with font-weight 800', -> 39 | chart = Morris.Donut $.extend {}, defaults 40 | $('#graph').find("text[font-weight='800']").size().should.equal 1 41 | 42 | it 'should have 1 paths with fill of first color', -> 43 | chart = Morris.Donut $.extend {}, defaults 44 | $('#graph').find("path[fill='#0b62a4']").size().should.equal 1 45 | 46 | it 'should have 1 paths with stroke of first color', -> 47 | chart = Morris.Donut $.extend {}, defaults 48 | $('#graph').find("path[stroke='#0b62a4']").size().should.equal 1 49 | 50 | it 'should have a path with white stroke', -> 51 | chart = Morris.Donut $.extend {}, defaults 52 | $('#graph').find("path[stroke='#ffffff']").size().should.equal 4 53 | 54 | it 'should have a path with stroke-width 3', -> 55 | chart = Morris.Donut $.extend {}, defaults 56 | $('#graph').find("path[stroke-width='3']").size().should.equal 4 57 | 58 | it 'should have a path with stroke-width 2', -> 59 | chart = Morris.Donut $.extend {}, defaults 60 | $('#graph').find("path[stroke-width='2']").size().should.equal 4 61 | 62 | describe 'setData', -> 63 | defaults = 64 | element: 'graph' 65 | data: [ {label: 'One', value: 25 }, {label: "Two", value: 30} ] 66 | colors: ['#ff0000', '#00ff00', '#0000ff'] 67 | 68 | it 'should update the chart', -> 69 | chart = Morris.Donut $.extend {}, defaults 70 | $('#graph').find("path[stroke='#0000ff']").size().should.equal 0 71 | chart.setData [ 72 | { label: 'One', value: 25 } 73 | { label: 'Two', value: 30 } 74 | { label: 'Three', value: 35 } 75 | ] 76 | $('#graph').find("path[stroke='#0000ff']").size().should.equal 1 77 | -------------------------------------------------------------------------------- /public/views/witness.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
Masternode ID 0x{{witness}}Masternode Rewards {{reward}} etz
Block Time {{blockTime}} sTotal Blocks {{totalBlocks}}
Week Mean Rewards {{weekMeanRewards}}
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 |
Height Time Gas(wei) Hash Mined By
{{block.number}} ({{block.timestamp | timeDuration}} ago){{block.gasUsed | number}}{{block.hash}}{{block.miner}}
56 | 64 |
65 |
66 | 67 |
68 | --------------------------------------------------------------------------------