Created
November 17, 2018 05:28
-
-
Save scottjbarr/508d1fba186d6eff34f6480b500642b3 to your computer and use it in GitHub Desktop.
List of Bitcoin SV node addresses out blockchain API data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Return a list of Bitcoin SV nodes. | |
// | |
// Usage: | |
// | |
// node ./nodes.js nodes.json | |
// | |
// where "nodes.js" is the name of this file, and "nodes.json" was | |
// created from the following command. | |
// | |
// curl https://api.blockchair.com/bitcoin-cash/nodes > nodes.json | |
// | |
// Author : Scott Barr | |
// Date : 17 Nov 2018 | |
const fs = require('fs'); | |
// get the filename from the args (assumes you give the filename as the arg) | |
const filename = process.argv[2]; | |
// read the file | |
const content = fs.readFileSync(filename); | |
// parse the JSON | |
const nodes = JSON.parse(content).data.nodes; | |
// get the addressess | |
const addresses = Object.keys(nodes); | |
addresses.forEach(function(address) { | |
// get the node by address | |
const n = nodes[address]; | |
// show the address if it is a Bitcoin SV node | |
if (n.version.startsWith('/Bitcoin SV')) { | |
console.log(address); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment