Created
January 25, 2021 11:42
-
-
Save gballet/e602ae53a68eec9e95348b05738fc81c to your computer and use it in GitHub Desktop.
This file contains 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
DIFFICULTY | 0x9765fea9752505a685c1bce137ae5b2efe8ddf62 | 605 | |
---|---|---|---|
DIFFICULTY | 0xf8a4d3a0b5859a24cd1320ba014ab17f623612e2 | 153 | |
DIFFICULTY | 0x0000000000009480cded7b47d438e73edf0f67e5 | 27 | |
DIFFICULTY | 0x0635e7362e13215d6dcc0e63a0007eebecc408e4 | 12 | |
BLOCKHASH | 0x5650ca3f0289c762f83dde1894faa9b6d0d89798 | 17 | |
BLOCKHASH | 0xd1ceeeeee83f8bcf3bedad437202b6154e9f5405 | 208 | |
BLOCKHASH | 0xb6ed7644c69416d67b522e20bc294a9a9b405b31 | 33 | |
BLOCKHASH | 0x1edc9ba729ef6fb017ef9c687b1a37d48b6a166c | 9 | |
BLOCKHASH | 0x4f8e54e2e840561e5aa8a296ad5f7b0ae18e6eff | 1 | |
BLOCKHASH | 0x1738b62e403090666687243e758b1c29edffc90e | 4 | |
BLOCKHASH | 0x0ba45a8b5d5575935b8158a88c631e9f9c95a2e5 | 47 | |
BLOCKHASH | 0x3b9a790dfc910447d6557001f96b997c1efb01f8 | 64 | |
BLOCKHASH | 0x404a03728afd06fb934e4b6f0eaf67796912733a | 6 | |
BLOCKHASH | 0x26946ada5ecb57f3a1f91605050ce45c482c9eb1 | 5 | |
BLOCKHASH | 0x896b516eb300e61cfc96ee1de4b297374e7b70ed | 4 | |
BLOCKHASH | 0x00000000a8f806c754549943b6550a2594c9a126 | 4 | |
BLOCKHASH | 0xb77feddb7e627a78140a2a32cac65a49ed1dba8e | 11 | |
BLOCKHASH | 0x588ca95d76c6a7ab121746bd209f2994b7ba5f10 | 33 | |
BLOCKHASH | 0xc89137ceeb35115ed3a3cb0e3f5e865da963c51c | 8 | |
BLOCKHASH | 0x65381eb4d3a832a457110167f2620ecf9f3506c3 | 1 | |
BLOCKHASH | 0xa1c0fa73c39cfbcc11ec9eb1afc665aba9996e2c | 2 | |
BLOCKHASH | 0xdbbdeea2a23f2e0d621b223cb35cc4ab9a8032d8 | 4 | |
BLOCKHASH | 0xeff0fe81794418c57adb259d0af708104accf553 | 2 | |
BLOCKHASH | 0xc85306056a212863b6f6413bba6669d62a70f31a | 1 | |
BLOCKHASH | 0x14c8b27e7331b0874fd87d21f862e46e11e3c4ed | 6 | |
BLOCKHASH | 0xff488fd296c38a24cccc60b43dd7254810dab64e | 2 | |
BLOCKHASH | 0x90418e54b46a71ad49a36c0ec8d7df90a9ca9d29 | 2 | |
BLOCKHASH | 0x36f379400de6c6bcdf4408b282f8b685c56adc60 | 6 | |
BLOCKHASH | 0x3ae323c0589d32067c07b4a351b10bc900d8b50d | 1 | |
BLOCKHASH | 0x685b9cfb5e5de7ac73c152b2bc72ff9238f6f005 | 1 | |
BLOCKHASH | 0xcb56383ce19adfe53dbd93a7bebcc242bd3de47e | 1 | |
BLOCKHASH | 0x4a974d25dbd8cbbca513444263bdd8881168e082 | 3 |
This file contains 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
require "json" | |
difficulties = {} | |
blockhashes = {} | |
errcnt = 0 | |
lastblock = 0 | |
data = JSON.parse(File.read(ARGV[0])) | |
data.each do |block| | |
blocknum = block.keys[0] | |
lastblock = blocknum.to_i if blocknum.to_i > lastblock | |
block[blocknum].each do |x| | |
if x.has_key?("result") | |
x["result"].each do |k,v| | |
unless v.empty? | |
case k | |
when "DIFFICULTY" | |
v.each do |addr,c| | |
difficulties[addr] = 0 unless difficulties.has_key?(addr) | |
difficulties[addr] += c.to_i | |
end | |
when "BLOCKHASH" | |
v.each do |addr,c| | |
blockhashes[addr] = 0 unless blockhashes.has_key?(addr) | |
blockhashes[addr] += c.to_i | |
end | |
end | |
end | |
end | |
end | |
errcnt += 1 if x.has_key?("error") | |
end | |
end | |
fd = File.open("addresses.csv", "w+") | |
difficulties.each do |addr,count| | |
fd.puts "DIFFICULTY,#{addr},#{count}" | |
end | |
blockhashes.each do |addr,count| | |
fd.puts "BLOCKHASH,#{addr},#{count}" | |
end | |
puts "encountered #{errcnt} errors " | |
puts "lat block = #{lastblock}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment