From 19a5fcf74600ece236eb947a6d667c53471bf70d Mon Sep 17 00:00:00 2001 From: Nup Date: Sat, 22 Jul 2017 23:21:54 +1000 Subject: [PATCH] Support for Go Hash, Go Hash is a hash server proxy that enables a pay per hash model. --- config.example.py | 6 +++++- monocle/sanitized.py | 3 +++ scan.py | 7 ++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/config.example.py b/config.example.py index 99eae37d..8f0d3408 100644 --- a/config.example.py +++ b/config.example.py @@ -70,9 +70,13 @@ #from shapely.geometry import Polygon #BOUNDARIES = Polygon(((40.799609, -111.948556), (40.792749, -111.887341), (40.779264, -111.838078), (40.761410, -111.817908), (40.728636, -111.805293), (40.688833, -111.785564), (40.689768, -111.919389), (40.750461, -111.949938))) -# key for Bossland's hashing server, otherwise the old hashing lib will be used +# key for Bossland's hashing server, needed if you're not using Go Hash. #HASH_KEY = '9d87af14461b93cb3605' # this key is fake +GO_HASH = False +# key for Go Hash a new hashing service that acts as a hash surge buffer on top of Bosslands hash server with a pay per hash model. Needed if you're not using a key direct from Bossland +#GO_HASH_KEY = 'PH7B03W1LSD4S2LHY8UH' # this is a fake key + # Skip PokéStop spinning and egg incubation if your request rate is too high # for your hashing subscription. # e.g. diff --git a/monocle/sanitized.py b/monocle/sanitized.py index 05aff696..dd36181d 100644 --- a/monocle/sanitized.py +++ b/monocle/sanitized.py @@ -53,6 +53,8 @@ 'GRID': sequence, 'HASHTAGS': set_sequence, 'HASH_KEY': (str,) + set_sequence, + 'GO_HASH': bool, + 'GO_HASH_KEY': (str,) + set_sequence, 'HEATMAP': bool, 'IGNORE_IVS': bool, 'IGNORE_RARITY': bool, @@ -159,6 +161,7 @@ 'FULL_TIME': 1800, 'GIVE_UP_KNOWN': 75, 'GIVE_UP_UNKNOWN': 60, + 'GO_HASH': False, 'GOOD_ENOUGH': 0.1, 'GOOGLE_MAPS_KEY': '', 'HASHTAGS': None, diff --git a/scan.py b/scan.py index 433929a3..26bc323a 100755 --- a/scan.py +++ b/scan.py @@ -202,7 +202,12 @@ def main(): overseer = Overseer(manager) overseer.start(args.status_bar) launcher = LOOP.create_task(overseer.launch(args.bootstrap, args.pickle)) - activate_hash_server(conf.HASH_KEY) + + if conf.GO_HASH: + hashkey = conf.GO_HASH_KEY + else: + hashkey = conf.HASH_KEY + activate_hash_server(hashkey, go_hash=conf.GO_HASH) if platform != 'win32': LOOP.add_signal_handler(SIGINT, launcher.cancel) LOOP.add_signal_handler(SIGTERM, launcher.cancel)