コード例 #1
0
	server.getBlockTemplate = getBlockTemplate
	server.receiveShare = receiveShare
	server.RaiseRedFlags = RaiseRedFlags
	server.ShareTarget = config.ShareTarget
	
	if hasattr(config, 'TrustedForwarders'):
		server.TrustedForwarders = config.TrustedForwarders
	server.ServerName = config.ServerName
	
	stratumsrv = StratumServer()
	stratumsrv.getStratumJob = getStratumJob
	stratumsrv.getExistingStratumJob = getExistingStratumJob
	stratumsrv.receiveShare = receiveShare
	stratumsrv.getTarget = getTarget
	stratumsrv.checkAuthentication = checkAuthentication
	stratumsrv.defaultTarget = config.ShareTarget
    stratumsrv.IsJobValid = IsJobValid
	if not hasattr(config, 'StratumAddresses'):
		config.StratumAddresses = ()
	for a in config.StratumAddresses:
		NetworkListener(stratumsrv, a)
	
	MM.start()
	
	restoreState()
	
	prune_thr = threading.Thread(target=WorkLogPruner, args=(workLog,))
	prune_thr.daemon = True
	prune_thr.start()
	
	bcnode_thr = threading.Thread(target=bcnode.serve_forever)
コード例 #2
0
	server.getBlockTemplate = getBlockTemplate
	server.receiveShare = receiveShare
	server.RaiseRedFlags = RaiseRedFlags
	server.ShareTarget = config.ShareTarget
	server.checkAuthentication = checkAuthentication
	
	if hasattr(config, 'TrustedForwarders'):
		server.TrustedForwarders = config.TrustedForwarders
	server.ServerName = config.ServerName
	
	stratumsrv = StratumServer()
	stratumsrv.getStratumJob = getStratumJob
	stratumsrv.getExistingStratumJob = getExistingStratumJob
	stratumsrv.receiveShare = receiveShare
	stratumsrv.getTarget = getTarget
	stratumsrv.defaultTarget = config.ShareTarget
	stratumsrv.IsJobValid = IsJobValid
	stratumsrv.checkAuthentication = checkAuthentication
	if not hasattr(config, 'StratumAddresses'):
		config.StratumAddresses = ()
	for a in config.StratumAddresses:
		NetworkListener(stratumsrv, a)
	
	MM.start()
	
	restoreState(config.SaveStateFilename)
	
	prune_thr = threading.Thread(target=WorkLogPruner, args=(workLog,))
	prune_thr.daemon = True
	prune_thr.start()
	
コード例 #3
0
ファイル: eloipool.py プロジェクト: rsksmart/eloipool
    if hasattr(config, 'TrustedForwarders'):
        server.TrustedForwarders = config.TrustedForwarders
    server.ServerName = config.ServerName

    stratumsrv = StratumServer()
    stratumsrv.getStratumJob = getStratumJob
    stratumsrv.setLogGbtCall = setLogGbtCall
    stratumsrv.getLogGbtCall = getLogGbtCall
    stratumsrv.getExistingStratumJob = getExistingStratumJob
    stratumsrv.receiveShare = receiveShare
    stratumsrv.RaiseRedFlags = RaiseRedFlags
    stratumsrv.getTarget = getTarget

    if hasattr(config, 'DEV_MODE_ON') and config.DEV_MODE_ON:
        stratumsrv.defaultTarget = bdiff2target(config.MINER_DIFF)
    else:
        stratumsrv.defaultTarget = config.ShareTarget
    stratumsrv.IsJobValid = IsJobValid
    stratumsrv.checkAuthentication = checkAuthentication
    stratumsrv.WorkUpdateInterval = config.WorkUpdateInterval
    if not hasattr(config, 'StratumAddresses'):
        config.StratumAddresses = ()
    for a in config.StratumAddresses:
        NetworkListener(stratumsrv, a)

    configLogger = logging.getLogger("ConfigLogger")
    configFile = open("config.py", "r")
    configLogger.info("ROOTSTOCK: version 1.3.0")
    configLogger.info("ROOTSTOCK: config.py_log_start \n" + configFile.read())
    configFile.close()