slush0/stratum-mining-proxy — pull request #63 by p4u (2014-03-04 17:58:11+00:00)
Title: Add sharenotify option with python snippets

Add new option to launch an event when a share is accepted: --sharenotify

Add two examples of python snippets under sharenotify_snippets/ directory, for instance log.py:
```
global slog
slog = open('/var/log/shares.log', 'a')
def on_share(job_id, worker_name, init_time, dif):
log.info("Loging share for %s" %worker_name)
slog.write("[%s] %s %s/%s\n" %(init_time,worker_name,job_id,dif))
slog.flush()
```

Then it can be included executing:
```
./mining_proxy.py (...) --sharenotify sharenotify_snippets/log.py
(...)
INFO proxy share_stats.set_module # Loaded sharenotify module sharenotify_modules/log.py
(...)
```

cat /var/log/shares.log
```
[1393952045.03] magicpool.sm2 e20d/32
[1393952241.04] magicpool.sm2 75b/32
[1393952246.28] magicpool.sm2 75b/32
```