Author

Topic: [UPDATED] [HIRING] Python Programmer for stratum-mining improvements (Read 554 times)

newbie
Activity: 19
Merit: 0
Due to an unfortunate turn of events, I have reposted this with some changes.  Please see OP for new terms.
sr. member
Activity: 714
Merit: 253
newbie
Activity: 19
Merit: 0
Received some replies but nothing final yet.  This is still open.  I've gone ahead and started some of the work...

poller.py

Code:
# Manually compares the 'prevhash' to detect a new block and/or update the Merkle tree.  

class Poller(object):
def _init_(self, _rpc, _block_chain, _interval = 60):
self.RPC = _rpc
self.BLOCK_CHAIN = _block_chain
self.INTERVAL = _interval

def setInterval(self, _interval):
self.INTERVAL = _interval

updater.py

Code:
# Retrieves data via the 'getblocktemplate' RPC call

class Updater(object):
def _init_(self, _rpc):
self.RPC = _rpc

def Update(self, force = False):
raise NotImplementedError("Not implimented")

block_chain_interface.py
Code:
class InterfaceBlockChain(object):
def _init_(self):
raise NotImplementedError("This interface must be implimented")

def Submit(self, finalized_block):
raise NotImplementedError("This interface must be implimented")

def Update(self):
raise NotImplementedError("This interface must be implimented")

def GetData(self):
raise NotImplementedError("This interface must be implimented")

def Set_OnSubmit(self, _call_back):
raise NotImplementedError("This interface must be implimented")

def Set_OnUpdate(self, _call_back):
raise NotImplementedError("This interface must be implimented")

A 'finalized_block' will have these methods:

Code:
class FinalizedBlock(object):
def getHash(self):
def getHex(self):
def getRaw(self):
newbie
Activity: 19
Merit: 0
More details about the design as requested.  Anyone is free to submit feedback and offer suggestions.

BlockChain
Interface for implementation of PrimaryBlockChain and AuxiluryBlockChain objects.  This is already complete (source will be provided), these methods should be implemented when extending this object.

Code:
	def Submit(self, solution):
def Update(self):
def GetData(self):
def Set_OnSubmit(self, _call_back):
def Set_OnUpdate(self, _call_back):

PrimaryBlockChain
Implements a BlockChain Interface.  It is used by the Engineer object as a means of data retrieval and block submission for the network where PoW is being performed.  

Public Methods

Submit
The engineer will 'submit' a solution (aka: share/block) to the PrimaryBlockChain object using this method.  The solution has already been validated and finalized into a submittable block by the Engineer.  
This should be a deferred method where the program does not block execution while the PrimaryBlockChain processes the submission.  When the block is accepted/rejected the method specified by 'Set_OnSubmit' should be called with the resulting information.
If the block is accepted, the PrimaryBlockChain object should perform an update request.

Update
The engineer may call this method upon program initialization for initial construction of a block template.  It's also possible that this method may be called by the engineer via an external process (such as a new block notification mechanism)
This should be a  deferred where the program does not block execution while the PrimaryBlockChain waits for data.  Once data is received the method specified by 'Set_OnUpdate' should be called with the resulting information.

GetData
Allows the on demand retrieval of the currently loaded data (cached)  from when the last update was run.  This method may be called by the Engineer when checking for block candidates and may be called by the Poller when comparing cached data with live data.

Set_OnSubmit
This method allows the Engineer to set a callback method to be executed upon a successful or failed block submission.

Set_OnUpdate
This method allows the Engineer to set a callback method to be executed any time new data is received from the upstream network.

Call Backs
These are the callbacks as set by the 'Set_OnXXXX' public methods.


Return an indication of a successful or failed block submission with block hash and height as additional information.  If submission failed, then no additional data is provided.


Returns a data package containing all the information necessary to construct a block template.  Basically it should be whatever the 'getblocktemplate' RPC call returns.

Object Initialization
The constructor should require that an RPC object be provided during initialization.

Updater
Internal object responsible for retrieving data via the 'getblocktemplate' RPC call.  Used by BlockChain implementing objects and Poller.  

Public Methods

Update
This is what begins the actual 'update' process.  An optional parameter is passed indicating if this should be a 'forced' update (false by default).

Object Initialization
The constructor should require that an RPC object be provided during initialization.

Poller
Internal object responsible for manually comparing the 'prevhash' to detect a new block and/or update the Merkle tree.  

Public Methods

SetInterval
Self Explanatory, allows the ability to specify a polling interval.

Object Initialization
The constructor should require that an RPC object be provided during initialization.

RPC
The Updater, Poller, and PrimaryBlockChain objects utilize this as a means of communicating with the upstream network.  This is already implemented, the following methods are exposed:

Code:
def call(self, method, params):
def submitblock(self, block_hex, hash_hex, raw_hex, method, num_retries):
def getinfo(self):
def getblocktemplate(self, num_retries):
def prevhash(self):
def validateaddress(self, address):
def getdifficulty(self):
def blockexists(self, hash_hex):
def set_getblocktemplate_pollformat(self, format):
def set_has_submitblock(self, enabled):

legendary
Activity: 1120
Merit: 1002
hello;

i'm interested. could you please send me more details in PM on what you exactly need in Python.

best regards.
newbie
Activity: 19
Merit: 0
Design Discussion

The design can be publicly discussed here.  Lets start with the following image:

http://s16.postimg.org/6eza6g0a9/New_Merge_Mine_Design.jpg

You will be working on writing code to implement the BOTTOM RIGHT corner.  
To be clear, you will be programming:

  • PrimaryBlockChain
  • Poller
  • Updater

* The RPC object is already complete.

Anyone is free to post thoughts.
newbie
Activity: 19
Merit: 0
EDITED:

Shame on me for originally offering a 0.2 acceptance payment.   Oh well, live and learn.

Anyway, I need someone (preferably a senior forum member, but not required) who is familiar with Python and Twisted to assist me in finalizing some customizations for a forked version of slush0's stratum-mining server.

Please make sure you read through my posts in this topic as they provide full details of the work that is to be done.

Need
I require a Python programmer for a 4 hour gig. No more no less.

Compensation
Payment is 0.5 BTC.  Divided into 4 parts.

Payment Schedule
  • 0.125 BTC paid upon submission of first milestone - Completion of poller.py
  • 0.125 BTC paid upon submission of second milestone - Completion of updater.py
  • 0.125 BTC paid upon submission of third milestone - Completion of PrimaryBlockChain.py
  • 0.125 BTC paid upon job completion - Code is tested and determined to be working to my needs.

Requirements:

- Advanced level Python programmer (you use design patterns such as dependency injection and factories)
- Familiarity with Python Twisted (deferred calls, callbacks, HTTP client)
- Very knowledgeable about Bitcoin blockchain technology (for example, you know how to build a valid coinbase transaction, you know what a merkle tree is, you understand merge mining)
- Familiar with slush0/stratum-mining

Info:

The 'design' is already complete. Your job is to write code in Python.  An experienced programmer can do this in less than 2 hours, but I am paying for 4 hours regardless.

I maintain a fork of a heavily improved and modified version of 'stratum-mining'.  Currently being used in production on a popular well known mining pool.  The code is of course open source but not yet public.

You will be completing some enhancements to this codebase.  Rest assured that the code you will be working with is not currently part of the existing slush0/stratum-mining release.
Jump to: