pybitmessage.proofofwork module

Proof of work calculation

class LogOutput(prefix='PoW')[source]

Bases: object

A context manager that block stdout for its scope and appends it’s content to log before exit. Usage:

with LogOutput():
os.system(‘ls -l’)

https://stackoverflow.com/questions/5081657

trial_value(nonce, initialHash)[source]

Calculate PoW trial value

estimate(difficulty, format=False)[source]
getPowType()[source]

Get the proof of work implementation

notifyBuild(tried=False)[source]

Notify the user of the success or otherwise of building the PoW C module

buildCPoW()[source]

Attempt to build the PoW C module

run(target, initialHash)[source]

Run the proof of work thread

resetPoW()[source]

Initialise the OpenCL PoW

init()[source]

Initialise PoW