Skip to content

Commit

Permalink
fixes and updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Blade Doyle committed Dec 17, 2020
1 parent 5bc4bd4 commit 8df6123
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Grin Nicehash Defender

Current Project Status: Beta Release
Current Project Status:
* Release 1.0
* Community-Funded instance is running at <a href="https://grindefender.online/">grindefender.online</a>

Grin Nicehash Defender is a bot that Grin community members can use to help defend the Grin network. If abnormal activity is taking place the bot will rent C32 hashpower from Nicehash to increase Grin network security for the duration of the attack.

What it does:
* Monitors grin network for 51% attack (choose between Grin51 and grin-health detection algorithms)
* Monitors grin network for 51% attack (Supports detection algorithms: Grin51 and grin-health)
* If an attack is detected a NiceHash C32 order will be created on both EU and USA markets
* While the attack is active, the order limit prices will be increased to keep miners working
* After the attack ends, the two orders will be deleted
Expand All @@ -18,7 +20,7 @@ How to use it:
* Get NiceHash "API keys": Needs "Market place Permissions"
* Set environment variables NICEHASH_API_ID and NICEHASH_API_KEY (or add to config.yml)
* Clone this git project
* Install required python modules: ```pip -r requirements.txt```
* Install required python modules: ```pip install -r requirements.txt```
* Edit "config.yml" and update settings
* Run: ```python grin_nicehash_defender.py```

Expand Down
6 changes: 3 additions & 3 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
# NiceHash Order Config
POOL_NAME: "defender" # Must exist in "MY POOLS" NiceHash configuration and point to a C32 pool
MAX_SPEED: 0.5 # kG/s - NiceHash order limit speed
ORDER_AMOUNT: 0.005 # BTC - Amount to spend (max) on an order
MAX_PRICE: 0.275 # BTC/kG/day - Never exceed this Nicehash order price bid (capitulation)
ORDER_AMOUNT: 0.002 # BTC - Amount to spend (max) on an order
MAX_PRICE: 0.375 # BTC/kG/day - Never exceed this Nicehash order price bid (capitulation)
ADD_ORDER_DURATION: 10 # Minutes - Additional amount of time to mine after an attack has ended

# Advanced Config
VERBOSE: False # Print lots of debugging data - WARNINIG: "True" Prints NiceHash API keys!!
ORDER_PRICE_ADD: 0.0005 # BTC - Amount to set order price over the absolute minimum
LOOP_INTERVAL: 60 # Seconds - Sleep this long between control loop runs
CHECK_TYPE: "all" # Method of detecting an attack:
CHECK_TYPE: "all" # Method of detecting an attack:
# "grin51": run the grin51 detection algorithm locally
# "grin-health": use the public grin-health score service api
# "file": for debugging, check for file called "./attack"
Expand Down
2 changes: 1 addition & 1 deletion grin51.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def run(self):

def main():
# A few tests
g51 = Grin51(threashold=1.01)
g51 = Grin51(threashold=1.01, min_history=1)
g51.run()
print("Running")
print("Under Attack: {}".format(g51.under_attack))
Expand Down

0 comments on commit 8df6123

Please sign in to comment.