Skip to content

Commit

Permalink
v2.6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
roks0n committed Feb 4, 2020
1 parent ec80289 commit ddb133c
Show file tree
Hide file tree
Showing 6 changed files with 565 additions and 368 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ If you find this or other plugins useful please consider

to support development new plugins and tools for Ark's Ecosystem and maintenance of existing ones. Full list of contributions can be found on [https://arkdelegatesio/delegate/deadlock/](https://arkdelegates.io/delegate/deadlock/contributions/). 🖖

**Branches**
- master: is for Ark v2.4 node and higher which **uses websockets** for p2p instead of api
- v2.3: is for any Ark node that's lower than v2.4 which **does not use websockets** yet

## Installation

`npm install`
Expand Down
18 changes: 9 additions & 9 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ const report = (crawler) => {
const maxDelay = Math.max(...allDelays)
const minDelay = Math.min(...allDelays)

console.log(`===========================================`)
console.log('===========================================')
console.log(`All nodes: ${Object.keys(crawler.nodes).length}`)
console.log(`Nodes online: ${crawler.heights.length}`)
console.log(`Nodes offline: ${Object.keys(crawler.nodes).length - crawler.heights.length}`)

// height/block stats
console.log(``)
console.log(`Height and block stats:`)
console.log('')
console.log('Height and block stats:')
for (const stat of orderBy(Object.values(blockStats), ['height'], ['desc'])) {
console.log(` ${stat.height} with ${stat.count} nodes. Block hashes:`)
for (const hash in stat.ids) {
Expand All @@ -59,26 +59,26 @@ const report = (crawler) => {
}

// version stats
console.log(``)
console.log(`Version stats:`)
console.log('')
console.log('Version stats:')
for (const stat of orderBy(Object.values(versionStats), ['version'], ['desc'])) {
console.log(` - ${stat.version} on ${stat.count} nodes`)
}

// delay stats
console.log(``)
console.log(`Delay`)
console.log('')
console.log('Delay')
console.log(` Avg: ${averageDelay}ms`)
console.log(` Min: ${minDelay}ms`)
console.log(` Max: ${maxDelay}ms`)

console.log(`------------------------------------------`)
console.log('------------------------------------------')
console.log(`Finished scanning in ${new Date() - crawler.startTime}ms`)

process.exit(0)
}

let node = { ip: undefined, port: undefined }
const node = { ip: undefined, port: undefined }
if (args.length === 1) {
const url = new URL(args[0])
node.ip = url.hostname
Expand Down
Loading

0 comments on commit ddb133c

Please sign in to comment.