Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os, sys
- sys.path = [os.path.join(os.getcwd(), 'conf'),os.path.join(os.getcwd(), 'extern$
- from twisted.internet import defer
- # Run listening when mining service is ready
- on_startup = defer.Deferred()
- import stratum
- import lib.settings as settings
- # Bootstrap Stratum framework
- application = stratum.setup(on_startup)
- # Load mining service into stratum framework
- import mining
- from mining.interfaces import Interfaces
- from mining.interfaces import WorkerManagerInterface, TimestamperInterface, \
- ShareManagerInterface, ShareLimiterInterface
- if settings.VARIABLE_DIFF == True:
- from mining.basic_share_limiter import BasicShareLimiter
- Interfaces.set_share_limiter(BasicShareLimiter())
- else:
- from mining.interfaces import ShareLimiterInterface
- Interfaces.set_share_limiter(ShareLimiterInterface())
- Interfaces.set_share_manager(ShareManagerInterface())
- Interfaces.set_worker_manager(WorkerManagerInterface())
- Interfaces.set_timestamper(TimestamperInterface())
- mining.setup(on_startup)
- =======
- from twisted.python import log
- import stratum
- import stratum.settings as settings
- # This variable is used as an application handler by twistd
- application = stratum.setup()
- from twisted.internet import reactor
- def heartbeat():
- log.msg('heartbeat')
- reactor.callLater(60, heartbeat)
- if settings.DEBUG:
- reactor.callLater(0, heartbeat)
- # Load all services from service_repository module.
- try:
- import service_repository
- except ImportError:
- print "***** Is service_repository missing? Add service_repository module to your python path!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement