Crypto-Expert / stratum-mining

AIO Stratum mining server for various coins
Other
364 stars 348 forks source link

I'get this error #21

Closed ghost closed 10 years ago

ghost commented 10 years ago

Coin: Betacoin The Betacoin is running local, and i'dont know what i have do wrong. But i'get this error!!!!! and no client can connect.

twistd -ny launcher.tac 2013-12-16 07:18:27,119 DEBUG bitcoin_rpc # Logging initialized 2013-12-16 07:18:27,119 DEBUG interfaces # Logging initialized 2013-12-16 07:18:27,119 DEBUG DBInterface # Logging initialized 2013-12-16 07:18:27,119 DEBUG DBInterface # DB_Mysql INIT 2013-12-16 07:18:27,119 DEBUG DB_Mysql # Logging initialized 2013-12-16 07:18:27,122 DEBUG DB_Mysql # Connecting to DB 2013-12-16 07:18:27,128 DEBUG DB_Mysql # Checking Database 2013-12-16 07:18:27,129 DEBUG DBInterface # DBInterface.clearusercache called 2013-12-16 07:18:27,129 DEBUG subscription # Logging initialized 2013-12-16 07:18:27,129 DEBUG mining # Logging initialized 2013-12-16 07:18:27,130 DEBUG work_log_pruner # Logging initialized 2013-12-16 07:18:27,130 DEBUG mining # Logging initialized 2013-12-16 07:18:27,130 DEBUG block_updater # Logging initialized 2013-12-16 07:18:27,130 DEBUG template_registry # Logging initialized 2013-12-16 07:18:27,131 DEBUG bitcoin_rpc_manager # Logging initialized

NOT Loading LTC Scrypt Module
NOT Loading POS Support
Loading SHA256 Transaction Message Support

2013-12-16 07:18:27,132 DEBUG halfnode # Logging initialized 2013-12-16 07:18:27,133 DEBUG coinbaser # Logging initialized Unhandled error in Deferred: Unhandled Error Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/twisted/application/service.py", line 405, in loadApplication application = sob.loadValueFromFile(filename, 'application', passphrase) File "/usr/lib/python2.7/dist-packages/twisted/persisted/sob.py", line 210, in loadValueFromFile exec fileObj in d, d File "launcher.tac", line 36, in mining.setup(on_startup) File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1181, in unwindGenerator return _inlineCallbacks(None, gen, Deferred()) --- --- File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks result = g.send(result) File "/root/stratum-mining/mining/init.py", line 33, in setup bitcoin_rpc = BitcoinRPCManager() File "/root/stratum-mining/lib/bitcoin_rpc_manager.py", line 26, in init settings.COINDAEMON_TRUSTED_PASSWORD) File "/root/stratum-mining/lib/bitcoin_rpc.py", line 17, in init self.bitcoin_url = 'http://%s:%d' % (host, port) exceptions.TypeError: %d format: a number is required, not str 2013-12-16 07:18:27+0100 [-] Log opened. 2013-12-16 07:18:27+0100 [-] twistd 11.1.0 (/usr/bin/python 2.7.3) starting up. 2013-12-16 07:18:27+0100 [-] reactor class: twisted.internet.epollreactor.EPollReactor. 2013-12-16 07:18:42,142 DEBUG DBInterface # run_import_thread current size: 0 2013-12-16 07:18:57,156 DEBUG DBInterface # run_import_thread current size: 0 ^C2013-12-16 07:19:08+0100 [-] SIGINT Detected, shutting down 2013-12-16 07:19:08,093 DEBUG DBInterface # DBInterface.do_import called. force: yes, queue size: 0 2013-12-16 07:19:08+0100 [-] Main loop terminated. 2013-12-16 07:19:08+0100 [-] Server Shut Down.

and here the config:

**** BASIC SETTINGS ***

These are the MUST BE SET parameters!

CENTRAL_WALLET = 'xxxxxxxxxxxxx' # local coin address where money goes

COINDAEMON_TRUSTED_HOST = 'localhost' COINDAEMON_TRUSTED_PORT = '9555' COINDAEMON_TRUSTED_USER = 'xxxxxxxxxx' COINDAEMON_TRUSTED_PASSWORD = 'xxxxxxxxxxxxxxxxxx'

Coin Algorithm is the option used to determine the algortithm used by stratum

This currently works with POW and POS coins

The available options are:

scrypt, sha256d, scrypt-jane and quark

If the option does not meet either of these criteria stratum defaults to scrypt

Until AutoReward Selecting Code has been implemented the below options are used to select the type of coin

For Reward type there is POW and POS. please ensure you choose the currect type.

For SHA256 PoS Coins which support TX Messages please enter yes in the TX selection

COINDAEMON_ALGO = 'sha256d' COINDAEMON_Reward = 'POW' COINDAEMON_SHA256_TX = 'yes'

**** GENERAL SETTINGS ***

Enable some verbose debug (logging requests and responses).

DEBUG = False

Destination for application logs, files rotated once per day.

LOGDIR = 'log/'

Main application log file.

LOGFILE = None # eg. 'stratum.log'

Logging Rotation can be enabled with the following settings

It if not enabled here, you can set up logrotate to rotate the files.

For built in log rotation set LOG_ROTATION = True and configrue the variables

LOG_ROTATION = True LOG_SIZE = 10485760 # Rotate every 10M LOG_RETENTION = 10 # Keep 10 Logs

How many threads use for synchronous methods (services).

30 is enough for small installation, for real usage

it should be slightly more, say 100-300.

THREAD_POOL_SIZE = 300

Disable the example service

ENABLE_EXAMPLE_SERVICE = False

**** TRANSPORTS *****

Hostname or external IP to expose

HOSTNAME = 'xxxxxxxxxx'

Port used for Socket transport. Use 'None' for disabling the transport.

LISTEN_SOCKET_TRANSPORT = 3333

Port used for HTTP Poll transport. Use 'None' for disabling the transport

LISTEN_HTTP_TRANSPORT = None

Port used for HTTPS Poll transport

LISTEN_HTTPS_TRANSPORT = None

Port used for WebSocket transport, 'None' for disabling WS

LISTEN_WS_TRANSPORT = None

Port used for secure WebSocket, 'None' for disabling WSS

LISTEN_WSS_TRANSPORT = None

Salt used when hashing passwords

PASSWORD_SALT = 'xxxxxxxxxx'

**** Database *****

MySQL

DB_MYSQL_HOST = '10.10.2.3' DB_MYSQL_DBNAME = 'emampos' DB_MYSQL_USER = 'root' DB_MYSQL_PASS = 'nospam4me'

**** Adv. DB Settings *****

Don't change these unless you know what you are doing

DB_LOADER_CHECKTIME = 15 # How often we check to see if we should run the loader DB_LOADER_REC_MIN = 10 # Min Records before the bulk loader fires DB_LOADER_REC_MAX = 50 # Max Records the bulk loader will commit at a time

DB_LOADER_FORCE_TIME = 300 # How often the cache should be flushed into the DB regardless of size.

DB_STATS_AVG_TIME = 300 # When using the DATABASE_EXTEND option, average speed over X sec

Note: this is also how often it updates

DB_USERCACHE_TIME = 600 # How long the usercache is good for before we refresh

**** Pool Settings *****

User Auth Options

USERS_AUTOADD = False # Automatically add users to db when they connect.

This basically disables User Auth for the pool.

USERS_CHECK_PASSWORD = False # Check the workers password? (Many pools don't)

Transaction Settings

COINBASE_EXTRAS = '/stratumPool/' # Extra Descriptive String to incorporate in solved blocks ALLOW_NONLOCAL_WALLET = True # Allow valid, but NON-Local wallet's

Coin Daemon communication polling settings (In Seconds)

PREVHASH_REFRESH_INTERVAL = 5 # How often to check for new Blocks

If using the blocknotify script (recommended) set = to MERKLE_REFRESH_INTERVAL

                            #       (No reason to poll if we're getting pushed notifications)

MERKLE_REFRESH_INTERVAL = 60 # How often check memorypool

This effectively resets the template and incorporates new transactions.

                            #       This should be "slow"

INSTANCE_ID = 31 # Used for extranonce and needs to be 0-31

**** Pool Difficulty Settings *****

VDIFF_X2_TYPE = False # powers of 2 e.g. 2,4,8,16,32,64,128,256,512,1024 VDIFF_FLOAT = False # Use float difficulty

Pool Target (Base Difficulty)

POOL_TARGET = 1 # Pool-wide difficulty target int >= 1

Variable Difficulty Enable

VARIABLE_DIFF = False # Master variable difficulty enable

Variable diff tuning variables

VARDIFF will start at the POOL_TARGET. It can go as low as the VDIFF_MIN and as high as min(VDIFF_MAX or Liteconin's difficulty)

USE_LITECOIN_DIFF = False # Set the maximum difficulty to the litecoin difficulty. DIFF_UPDATE_FREQUENCY = 86400 # Update the litecoin difficulty once a day for the VARDIFF maximum VDIFF_MIN_TARGET = 16 # Minimum Target difficulty VDIFF_MAX_TARGET = 1024 # Maximum Target difficulty VDIFF_TARGET_TIME = 15 # Target time per share (i.e. try to get 1 share per this many seconds) VDIFF_RETARGET_TIME = 120 # Check to see if we should retarget this often VDIFF_VARIANCE_PERCENT = 30 # Allow average time to very this % from target without retarget

Allow external setting of worker difficulty, checks pool_worker table datarow[6] position for target difficulty

if present or else defaults to pool target, over rides all other difficulty settings, no checks are made

for min or max limits this sould be done by your front end software

ALLOW_EXTERNAL_DIFFICULTY = False

Advanced Option

For backwards compatibility, we send the scrypt hash to the solutions column in the shares table

For block confirmation, we have an option to send the block hash in

Please make sure your front end is compatible with the block hash in the solutions table.

For People using the MPOS frontend enabling this is recommended. It allows the frontend to compare the block hash to the coin daemon reducing the liklihood of missing share error's for blocks

SOLUTION_BLOCK_HASH = False # If enabled, enter the block hash. If false enter the scrypt/sha hash into the shares table

**** Getwork Proxy Settings *****

This enables a copy of slush's getwork proxy for old clients

It will also auto-redirect new clients to the stratum interface

so you can point ALL clients to: http://:

GW_ENABLE = False # Enable the Proxy GW_PORT = 3333 # Getwork Proxy Port GW_DISABLE_MIDSTATE = False # Disable midstate's (Faster but breaks some clients) GW_SEND_REAL_TARGET = False # Propigate >1 difficulty to Clients (breaks some clients)

**** Worker Ban Options *****

ENABLE_WORKER_BANNING = True # enable/disable temporary worker banning WORKER_CACHE_TIME = 600 # How long the worker stats cache is good before we check and refresh WORKER_BAN_TIME = 300 # How long we temporarily ban worker INVALID_SHARES_PERCENT = 50 # Allow average invalid shares vary this % before we ban

**** E-Mail Notification Settings *****

NOTIFY_EMAIL_TO = 'mr@port-x.de' # Where to send Start/Found block notifications NOTIFY_EMAIL_TO_DEADMINER = '' # Where to send dead miner notifications NOTIFY_EMAIL_FROM = 'root@localhost.de' # Sender address NOTIFY_EMAIL_SERVER = 'localhost' # E-Mail Sender NOTIFY_EMAIL_USERNAME = '' # E-Mail server SMTP Logon NOTIFY_EMAIL_PASSWORD = '' NOTIFY_EMAIL_USETLS = False

ahmedbodi commented 10 years ago

trusted host needs to be 127.0.0.1

obigal commented 10 years ago

Remove those quotes around the port number.

ahmedbodi commented 10 years ago

ahh that too :)

vijay-sutar commented 10 years ago

Ok Go to the config.py file of stratum. and change the following COINDAEMON_ALGO = 'sha256d' COINDAEMON_TX = 'yes ' by default it looks like ... COINDAEMON_TX = 'no '

ahmedbodi commented 10 years ago

no. he had the quotes around the ip

ryager01 commented 8 years ago

we are having a similar problem.. here's the output. lco@uPool:~/stratum-mining$ twistd -ny launcher.tac /usr/lib/python2.7/dist-packages/zope/init.py:3: UserWarning: Module twisted was already imported from /usr/lib/python2.7/dist-packages/twisted/init.pyc, but /usr/local/lib/python2.7/dist-packages/autobahn-0.10.9-py2.7.egg is being added to sys.path

import pkg_resources

Custom settings: IRC_HOSTNAME : mine.bittrader.club HOSTNAME : mine.bittrader.club SIGNING_ID : mine.bittrader.club

SIGNING_KEY : signing_key.pem

2015-10-29 21:10:27,776 DEBUG example logger.get_logger # Logging initialized 2015-10-29 21:10:27,970 DEBUG bitcoin_rpc # Logging initialized 2015-10-29 21:10:27,970 DEBUG interfaces # Logging initialized 2015-10-29 21:10:27,971 DEBUG Cache # Logging initialized 2015-10-29 21:10:27,987 DEBUG DBInterface # Logging initialized 2015-10-29 21:10:27,988 DEBUG DBInterface # DB_Mysql_Vardiff INIT 2015-10-29 21:10:27,988 DEBUG DB_Mysql # Logging initialized 2015-10-29 21:10:27,990 DEBUG DB_Mysql # Logging initialized 2015-10-29 21:10:27,990 DEBUG DB_Mysql # Connecting to DB 2015-10-29 21:10:27,995 DEBUG DB_Mysql # Checking Database 2015-10-29 21:10:27,996 INFO Cache # Caching initialized 2015-10-29 21:10:27,996 DEBUG subscription # Logging initialized 2015-10-29 21:10:27,997 DEBUG mining # Logging initialized 2015-10-29 21:10:27,997 DEBUG work_log_pruner # Logging initialized 2015-10-29 21:10:27,997 DEBUG BasicShareLimiter # Logging initialized 2015-10-29 21:10:27,997 DEBUG DBInterface # DB_Mysql_Vardiff INIT 2015-10-29 21:10:27,998 DEBUG DB_Mysql # Connecting to DB 2015-10-29 21:10:27,999 DEBUG DB_Mysql # Resetting difficulty for all workers 2015-10-29 21:10:28,042 DEBUG mining # Logging initialized 2015-10-29 21:10:28,042 DEBUG block_updater # Logging initialized 2015-10-29 21:10:28,042 DEBUG template_registry # Logging initialized 2015-10-29 21:10:28,043 DEBUG template_registry # Got to Template Registry 2015-10-29 21:10:28,043 DEBUG extronance # Logging initialized 2015-10-29 21:10:28,043 DEBUG bitcoin_rpc_manager # Logging initialized 2015-10-29 21:10:28,044 DEBUG halfnode # Logging initialized 2015-10-29 21:10:28,044 DEBUG halfnode # Got to Halfnode 2015-10-29 21:10:28,045 DEBUG halfnode # ########################################### Loading SHA256 Support ###################################################### Unhandled error in Deferred:

Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/twisted/application/service.py", line 403, in loadApplication application = sob.loadValueFromFile(filename, 'application', passphrase) File "/usr/lib/python2.7/dist-packages/twisted/persisted/sob.py", line 210, in loadValueFromFile exec fileObj in d, d File "launcher.tac", line 38, in mining.setup(on_startup) File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1274, in unwindGenerator return _inlineCallbacks(None, gen, Deferred()) --- --- File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1128, in _inlineCallbacks result = g.send(result) File "/home/mscalco/stratum-mining/mining/init.py", line 30, in setup from lib.block_template import BlockTemplate File "/home/mscalco/stratum-mining/lib/block_template.py", line 7, in import halfnode File "/home/mscalco/stratum-mining/lib/halfnode.py", line 39, in if settings.COINDAEMON_TX == 'yes': exceptions.AttributeError: 'module' object has no attribute 'COINDAEMON_TX' 2015-10-29 21:10:28-0400 [-] Log opened. 2015-10-29 21:10:28-0400 [-] twistd 15.2.1 (/usr/bin/python 2.7.10) starting up. 2015-10-29 21:10:28-0400 [-] reactor class: twisted.internet.epollreactor.EPollReactor. 2015-10-29 21:10:28-0400 [-] Changing process name to twistd-stratum-mining /usr/lib/python2.7/dist-packages/zope/init.py:3: UserWarning: Module twisted was already imported from /usr/lib/python2.7/dist-packages/twisted/init.pyc, but /usr/local/lib/python2.7/dist-packages/autobahn-0.10.9-py2.7.egg is being added to sys.path

import pkg_resources

Custom settings: IRC_HOSTNAME : mine.bittrader.club HOSTNAME : mine.bittrader.club SIGNING_ID : mine.bittrader.club

SIGNING_KEY : signing_key.pem

2015-10-29 21:10:28,206 DEBUG example logger.get_logger # Logging initialized 2015-10-29 21:10:28,400 DEBUG bitcoin_rpc # Logging initialized 2015-10-29 21:10:28,400 DEBUG interfaces # Logging initialized 2015-10-29 21:10:28,401 DEBUG Cache # Logging initialized 2015-10-29 21:10:28,417 DEBUG DBInterface # Logging initialized 2015-10-29 21:10:28,417 DEBUG DBInterface # DB_Mysql_Vardiff INIT 2015-10-29 21:10:28,418 DEBUG DB_Mysql # Logging initialized 2015-10-29 21:10:28,420 DEBUG DB_Mysql # Logging initialized 2015-10-29 21:10:28,420 DEBUG DB_Mysql # Connecting to DB 2015-10-29 21:10:28,426 DEBUG DB_Mysql # Checking Database 2015-10-29 21:10:28,427 INFO Cache # Caching initialized 2015-10-29 21:10:28,427 DEBUG subscription # Logging initialized 2015-10-29 21:10:28,427 DEBUG mining # Logging initialized 2015-10-29 21:10:28,428 DEBUG work_log_pruner # Logging initialized 2015-10-29 21:10:28,428 DEBUG BasicShareLimiter # Logging initialized 2015-10-29 21:10:28,428 DEBUG DBInterface # DB_Mysql_Vardiff INIT 2015-10-29 21:10:28,428 DEBUG DB_Mysql # Connecting to DB 2015-10-29 21:10:28,429 DEBUG DB_Mysql # Resetting difficulty for all workers 2015-10-29 21:10:28,458 DEBUG mining # Logging initialized 2015-10-29 21:10:28,459 DEBUG block_updater # Logging initialized 2015-10-29 21:10:28,459 DEBUG template_registry # Logging initialized 2015-10-29 21:10:28,459 DEBUG template_registry # Got to Template Registry 2015-10-29 21:10:28,459 DEBUG extronance # Logging initialized 2015-10-29 21:10:28,460 DEBUG bitcoin_rpc_manager # Logging initialized 2015-10-29 21:10:28,461 DEBUG halfnode # Logging initialized 2015-10-29 21:10:28,461 DEBUG halfnode # Got to Halfnode 2015-10-29 21:10:28,461 DEBUG halfnode # ########################################### Loading SHA256 Support ###################################################### Unhandled error in Deferred:

Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/twisted/application/service.py", line 403, in loadApplication application = sob.loadValueFromFile(filename, 'application', passphrase) File "/usr/lib/python2.7/dist-packages/twisted/persisted/sob.py", line 210, in loadValueFromFile exec fileObj in d, d File "launcher.tac", line 38, in mining.setup(on_startup) File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1274, in unwindGenerator return _inlineCallbacks(None, gen, Deferred()) --- --- File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1128, in _inlineCallbacks result = g.send(result) File "/home/mscalco/stratum-mining/mining/init.py", line 30, in setup from lib.block_template import BlockTemplate File "/home/mscalco/stratum-mining/lib/block_template.py", line 7, in import halfnode File "/home/mscalco/stratum-mining/lib/halfnode.py", line 39, in if settings.COINDAEMON_TX == 'yes': exceptions.AttributeError: 'module' object has no attribute 'COINDAEMON_TX' 2015-10-29 21:10:28-0400 [-] Log opened. 2015-10-29 21:10:28-0400 [-] twistd 15.2.1 ( 2.7.10) starting up. 2015-10-29 21:10:28-0400 [-] reactor class: twisted.internet.epollreactor.EPollReactor. 2015-10-29 21:10:43,427 DEBUG DBInterface # run_import_thread current size: 0 2015-10-29 21:10:58,427 DEBUG DBInterface # run_import_thread current size: 0

majeed703 commented 7 years ago

When i running 'twistd -y launcher.tac' i got the following error. Please help me to fix this issue. Your help is apprecaited

Thank you Unhandled Error Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/Twisted-16.7.0rc2-py2.7-linux-x86_64.egg/twisted/application/app.py", line 648, in run runApp(config) File "/usr/local/lib/python2.7/dist-packages/Twisted-16.7.0rc2-py2.7-linux-x86_64.egg/twisted/scripts/twistd.py", line 25, in runApp _SomeApplicationRunner(config).run() File "/usr/local/lib/python2.7/dist-packages/Twisted-16.7.0rc2-py2.7-linux-x86_64.egg/twisted/application/app.py", line 379, in run self.application = self.createOrGetApplication() File "/usr/local/lib/python2.7/dist-packages/Twisted-16.7.0rc2-py2.7-linux-x86_64.egg/twisted/application/app.py", line 444, in createOrGetApplication application = getApplication(self.config, passphrase)


File "/usr/local/lib/python2.7/dist-packages/Twisted-16.7.0rc2-py2.7-linux-x86_64.egg/twisted/application/app.py", line 455, in getApplication application = service.loadApplication(filename, style, passphrase) File "/usr/local/lib/python2.7/dist-packages/Twisted-16.7.0rc2-py2.7-linux-x86_64.egg/twisted/application/service.py", line 411, in loadApplication passphrase) File "/usr/local/lib/python2.7/dist-packages/Twisted-16.7.0rc2-py2.7-linux-x86_64.egg/twisted/persisted/sob.py", line 223, in loadValueFromFile eval(codeObj, d, d) File "launcher.tac", line 15, in import lib.settings as settings exceptions.ImportError: No module named lib.settings Failed to load application: No module named lib.settings

sijina1055 commented 7 years ago

When i running 'twistd -ny launcher.tac' i getting the following message. The connection okay. Please help me to fix this issue.

2017-01-30 19:33:43,094 INFO bitcoin_rpc # Checking for submitblock 2017-01-30 19:33:43,097 DEBUG bitcoin_rpc # submitblock detected. 2017-01-30 19:33:43,097 INFO mining # Found submitblock 2017-01-30 19:33:43,101 ERROR mining # Coind Error: Guncoin is not connected!

Thanks Your help will appreciated!