Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only one link per pool #71

Merged
merged 1 commit into from
Dec 19, 2022
Merged

Only one link per pool #71

merged 1 commit into from
Dec 19, 2022

Conversation

0xB10C
Copy link
Collaborator

@0xB10C 0xB10C commented Dec 19, 2022

We don't need multiple links per pool. This just makes it harder to generate dataset for downstream tools.

I've used this python script for this patch:

#!/usr/bin/env python3

import json
import glob
import sys

entity_files = glob.glob("pools/*.json")

addresses = dict()
tags = dict()

for file_path in entity_files:
    with open(file_path, "r") as f:
        e = json.load(f)

        link = ""

        if len(e["links"]) == 0:
            print(f"No links for pool {e['name']}")
        elif len(e["links"]) == 1:
            link = e["links"][0]
        elif len(e["links"]) > 1:
            link = e["links"][0]
            print(f"Using {link} for pool {e['name']} out of", e["links"])

        content = {
            "name": e["name"],
            "addresses": sorted(e["addresses"]),
            "tags": sorted(e["tags"]),
            "link": link,
        }

        with open(file_path, "w") as out:
            json.dump(content, out, indent=2, ensure_ascii=False)
            out.write('\n')

It did output:

No links for pool tigerpool.net
No links for pool Helix
Using https://mybtccoin.com for pool myBTCcoin Pool out of ['https://mybtccoin.com', 'https://www.mybtccoin.com']
Using https://btc.top for pool BTC.TOP out of ['https://btc.top', 'https://www.btc.top']
No links for pool tiger
No links for pool SecretSuperstar
No links for pool ArkPool
Using https://www.bitarms.io for pool Bitfarms out of ['https://www.bitarms.io', 'https://www.bitfarms.io']
No links for pool BTCPool
Using https://sbicrypto.com for pool SBI Crypto out of ['https://sbicrypto.com', 'https://www.sbicrypto.com']
No links for pool BTPOOL
No links for pool CN/TT
Using https://btc.canoepool.com for pool CanoePool out of ['https://btc.canoepool.com', 'https://www.canoepool.com']

I've manually changed

  • bitarms.io -> bitfarms.io
  • btc.canoepool.com -> canoepool.com

We don't need multiple links per pool. This just makes it harder to
generate dataset for downstream tools.

I've used this python script for this patch:

```python3
 #!/usr/bin/env python3

import json
import glob
import sys

entity_files = glob.glob("pools/*.json")

addresses = dict()
tags = dict()

for file_path in entity_files:
    with open(file_path, "r") as f:
        e = json.load(f)

        link = ""

        if len(e["links"]) == 0:
            print(f"No links for pool {e['name']}")
        elif len(e["links"]) == 1:
            link = e["links"][0]
        elif len(e["links"]) > 1:
            link = e["links"][0]
            print(f"Using {link} for pool {e['name']} out of", e["links"])

        content = {
            "name": e["name"],
            "addresses": sorted(e["addresses"]),
            "tags": sorted(e["tags"]),
            "link": link,
        }

        with open(file_path, "w") as out:
            json.dump(content, out, indent=2, ensure_ascii=False)
            out.write('\n')
```

It did output:

```
No links for pool tigerpool.net
No links for pool Helix
Using https://mybtccoin.com for pool myBTCcoin Pool out of ['https://mybtccoin.com', 'https://www.mybtccoin.com']
Using https://btc.top for pool BTC.TOP out of ['https://btc.top', 'https://www.btc.top']
No links for pool tiger
No links for pool SecretSuperstar
No links for pool ArkPool
Using https://www.bitarms.io for pool Bitfarms out of ['https://www.bitarms.io', 'https://www.bitfarms.io']
No links for pool BTCPool
Using https://sbicrypto.com for pool SBI Crypto out of ['https://sbicrypto.com', 'https://www.sbicrypto.com']
No links for pool BTPOOL
No links for pool CN/TT
Using https://btc.canoepool.com for pool CanoePool out of ['https://btc.canoepool.com', 'https://www.canoepool.com']
```

I've manually changed
- bitarms.io -> bitfarms.io
- btc.canoepool.com -> canoepool.com
@0xB10C 0xB10C merged commit 9318876 into master Dec 19, 2022
@0xB10C 0xB10C deleted the 2022-12-only-one-link-per-pool branch December 19, 2022 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant