Pages:
Author

Topic: [ANN] Eloipool - FAST Python3 pool server software - GBT/stratum/dyntarget/proxy - page 8. (Read 123077 times)

newbie
Activity: 37
Merit: 0
"Interactive Python 3 console so you can inspect and modify the pool while it's running."

interesting... where can I find this?
newbie
Activity: 15
Merit: 0
How do i install the python-bitcoinrpc and python-base58 ?
Thx
It's usually sufficient to just get the git checkout linked under your eloipool directory.

What does "linked" mean exactly? Should I just git clone them while inside eloipool directory?
newbie
Activity: 18
Merit: 0
this seems to be repeating in the logfile.... any ideas as to what i need to do to fix?

Code:
2013-09-12 07:07:32,607 merkleMaker     CRITICAL        Traceback (most recent call last):
  File "/home/dopelabs/eloipool/merklemaker.py", line 692, in run
    self.merkleMaker_I()
  File "/home/dopelabs/eloipool/merklemaker.py", line 682, in merkleMaker_I
    self.merkleMaker_II()
  File "/home/dopelabs/eloipool/merklemaker.py", line 660, in merkleMaker_II
    return self._updateMerkleTree()
  File "/home/dopelabs/eloipool/merklemaker.py", line 548, in _updateMerkleTree
    self._updateMerkleTree_I()
  File "/home/dopelabs/eloipool/merklemaker.py", line 512, in _updateMerkleTree_I
    r = self._updateMerkleTree_fromTS(TS)
  File "/home/dopelabs/eloipool/merklemaker.py", line 477, in _updateMerkleTree_fromTS
    MP = self._CallGBT(TS)
  File "/home/dopelabs/eloipool/merklemaker.py", line 327, in _CallGBT
    MP = access.getblocktemplate(self.GBTReq)
  File "/home/dopelabs/eloipool/bitcoinrpc/authproxy.py", line 112, in __call__
    'Content-type': 'application/json'})
  File "/usr/lib/python3.2/http/client.py", line 967, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.2/http/client.py", line 995, in _send_request
    self.putrequest(method, url, **skips)
  File "/usr/lib/python3.2/http/client.py", line 850, in putrequest
    raise CannotSendRequest(self.__state)
http.client.CannotSendRequest: Request-sent
hero member
Activity: 728
Merit: 500
Hey, I'm considering switching from BTC Guild to eligius. Can you answer some questions for me?
1. Why doesn't your site support https
2. Why does Web Of Trust show a yellow rating for your site. See:


Thanks
legendary
Activity: 1554
Merit: 1008
found error in script authproxy.py
Code: (Python)
       authpair = "%s:%s" % (self.__url.username, self.__url.password)
        authpair = authpair.encode('utf8')
        #         authpair = base64.b64encode(authpair) # here return as bytes
        authpair = str(authpair, encoding='utf-8') # convert bytes to str
        # >
        self.__auth_header = "Basic " + authpair
 

and I load directly authproxy:
Code: (Python3.3)
'''import jsonrpc
try:
import jsonrpc.authproxy
jsonrpc.authproxy.USER_AGENT = 'Eloipool/0.1'
except:
from jsonrpclib import jsonrpc
pass
'''
from authproxy import AuthServiceProxy as ServiceProxy, JSONRPCException

and copy client.py from /usr/lib/python3.3/http into my folder with eloipool

BUT!
when call getblocktemplate  from merklemaker.py
Code:
for TC in TCList:
caccess = TC['access'] # =ServiceProxy(uri)
try:
propose = caccess.getblocktemplate(ProposeReq)

rise error in responce:
Quote
2013-08-28 15:11:39,777   makeCoinbaseTxn_responce   ERROR   {'error': {'message': 'Invalid mode', 'code': -8}, 'result': None, 'id': 1}
2013-08-28 15:11:39,780   merkleMaker   CRITICAL   Traceback (most recent call last):
  File "/home/icreator/pools/eloipool-3/merklemaker.py", line 732, in run
    self.merkleMaker_I()
  File "/home/icreator/pools/eloipool-3/merklemaker.py", line 722, in merkleMaker_I
    self.merkleMaker_II()
  File "/home/icreator/pools/eloipool-3/merklemaker.py", line 700, in merkleMaker_II
    return self._updateMerkleTree()
  File "/home/icreator/pools/eloipool-3/merklemaker.py", line 588, in _updateMerkleTree
    self._updateMerkleTree_I()
  File "/home/icreator/pools/eloipool-3/merklemaker.py", line 552, in _updateMerkleTree_I
    r = self._updateMerkleTree_fromTS(TS)
  File "/home/icreator/pools/eloipool-3/merklemaker.py", line 523, in _updateMerkleTree_fromTS
    (AcceptedScore, TotalScore) = self._CheckTemplate(newMerkleTree, TS)
  File "/home/icreator/pools/eloipool-3/merklemaker.py", line 456, in _CheckTemplate
    propose = caccess.getblocktemplate(ProposeReq)
  File "/home/icreator/pools/eloipool-3/authproxy.py", line 135, in __call__
    raise JSONRPCException(response['error'])
authproxy.JSONRPCException


"mode" set here:
Code:
		ProposeReq = {
"mode": "proposal",
"data": b2a_hex(data).decode('utf8'),
                        }

BUT if I do:
Code:
		ProposeReq = {
"data": b2a_hex(data).decode('utf8'),
                        }

new error:
Code:
2013-08-28 15:35:29,709	merkleMaker	ERROR	Upstream 'primary' rejected proposed block from 'primary': 0000000000000007d8be81c938a2519ba3b2eb8fe1720ad82210d4f82716a6f7
2013-08-28 15:35:29,710 merkleMaker CRITICAL Traceback (most recent call last):
  File "/home/icreator/pools/eloipool-3/merklemaker.py", line 732, in run
    self.merkleMaker_I()
  File "/home/icreator/pools/eloipool-3/merklemaker.py", line 722, in merkleMaker_I
    self.merkleMaker_II()
  File "/home/icreator/pools/eloipool-3/merklemaker.py", line 688, in merkleMaker_II
    return self._updateMerkleTree()
  File "/home/icreator/pools/eloipool-3/merklemaker.py", line 588, in _updateMerkleTree
    self._updateMerkleTree_I()
  File "/home/icreator/pools/eloipool-3/merklemaker.py", line 574, in _updateMerkleTree_I
    raise RuntimeError('Failed to create usable template')
RuntimeError: Failed to create usable template

and how use  jsonrpc_getblocktemplate.py ?? here may  be right code?
legendary
Activity: 1554
Merit: 1008
I have python3.3.2

git clone https://github.com/jgarzik/python-bitcoinrpc.git
python3 setup.py build
sudo python3 setup.py install

then run probe.py
Code:
from jsonrpc.proxy import ServiceProxy, JSONRPCException

aa = ServiceProxy("http://rpcuser:[email protected]:8332")
              
print (aa.getinfo())

errors:
Code:
ile "probe.py", line 17, in 
    aa.getinfo()
  File "/home/icreator/pools/eloipool-3/bitcoinrpc/authproxy.py", line 118, in __call__
    response = self._get_response()
  File "/home/icreator/pools/eloipool-3/bitcoinrpc/authproxy.py", line 156, in _get_response
    parse_float=decimal.Decimal)
  File "/usr/lib/python3.3/json/__init__.py", line 332, in loads
    return cls(**kw).decode(s)
  File "/usr/lib/python3.3/json/decoder.py", line 353, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.3/json/decoder.py", line 371, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

but if I run:
python2.7 probe.py  - all work!

??
legendary
Activity: 1554
Merit: 1008
I have Ubuntu 13.04 and Python3.3

run:
python3.3 eloipool.py

got errors:

Code:
Traceback (most recent call last):
  File "eloipool.py", line 948, in
    MM.start()
  File "/home/icreator/pools/eloipool-3/merklemaker.py", line 697, in start
    self._prepare()
  File "/home/icreator/pools/eloipool-3/merklemaker.py", line 100, in _prepare
    URI2Name.setdefault(a['uri'], a['name'])
TypeError: string indices must be integers
sr. member
Activity: 252
Merit: 250
Code:
Traceback (most recent call last):
  File "./eloipool.py", line 77, in
    bcnode = BitcoinNode(config.UpstreamNetworkId)
  File "/home/eloipool/bitcoin/node.py", line 146, in __init__
    super().__init__(*a, **ka)
TypeError: super() takes at least 1 argument (0 given)

Any idea why it would be throwing that? It's a new clone, config is setup properly.. if you need any other info please let me know and i'll post what I can Smiley
Usually this means an ancient Python version.
You need at least version 3.1 (released over 4 years ago).

You're right I simply didn't run python3 when I ran the command, but this is what I resulted with:

Code:
Traceback (most recent call last):
  File "eloipool.py", line 81, in
    import jsonrpc
ImportError: No module named jsonrpc

So, I found https://bitcointalksearch.org/topic/importerror-no-module-named-jsonrpc-eloipool-installation-113730

But nothing in there has helped me out. Blockchain is up to date and current.  Symlink is done but I'm not even able to run the setup.py in the python-bitcoinrpc directory.
legendary
Activity: 2576
Merit: 1186
Code:
Traceback (most recent call last):
  File "./eloipool.py", line 77, in
    bcnode = BitcoinNode(config.UpstreamNetworkId)
  File "/home/eloipool/bitcoin/node.py", line 146, in __init__
    super().__init__(*a, **ka)
TypeError: super() takes at least 1 argument (0 given)

Any idea why it would be throwing that? It's a new clone, config is setup properly.. if you need any other info please let me know and i'll post what I can Smiley
Usually this means an ancient Python version.
You need at least version 3.1 (released over 4 years ago).
sr. member
Activity: 252
Merit: 250
Code:
Traceback (most recent call last):
  File "./eloipool.py", line 77, in
    bcnode = BitcoinNode(config.UpstreamNetworkId)
  File "/home/eloipool/bitcoin/node.py", line 146, in __init__
    super().__init__(*a, **ka)
TypeError: super() takes at least 1 argument (0 given)

Any idea why it would be throwing that? It's a new clone, config is setup properly.. if you need any other info please let me know and i'll post what I can Smiley
hero member
Activity: 938
Merit: 501
Or do I have to somehow calculate it with the accepted shares logged?
hero member
Activity: 938
Merit: 501
How to estimate the current hashrate of the pool? Is already some stats somewhere?
legendary
Activity: 2576
Merit: 1186
Fixed, had to checkout at commit 770881c8bd9b1f92427290270b37a28751cf9df0 of python-bitcoinrpc.
Is there a way to have the python-bitcoinrpc git updated to the latest commit and still get it to work with eloipool?
No, this is a bug in python-bitcoinrpc and has to be fixed there.
hero member
Activity: 938
Merit: 501
Fixed, had to checkout at commit 770881c8bd9b1f92427290270b37a28751cf9df0 of python-bitcoinrpc.
Is there a way to have the python-bitcoinrpc git updated to the latest commit and still get it to work with eloipool?
hero member
Activity: 938
Merit: 501
What I run:
Code:
root@server:~/pool/# ./bitcoind &
root@server:~/pool/# python3 eloipool.py

I'm getting an infinite loop error! The message doesn't stop and blocks the terminal...

Code:
Traceback (most recent call last):
  File "/root/pool/merklemaker.py", line 692, in run
    self.merkleMaker_I()
  File "/root/pool/merklemaker.py", line 682, in merkleMaker_I
    self.merkleMaker_II()
  File "/root/pool/merklemaker.py", line 648, in merkleMaker_II
    return self._updateMerkleTree()
  File "/root/pool/merklemaker.py", line 548, in _updateMerkleTree
    self._updateMerkleTree_I()
  File "/root/pool/merklemaker.py", line 512, in _updateMerkleTree_I
    r = self._updateMerkleTree_fromTS(TS)
  File "/root/pool/merklemaker.py", line 477, in _updateMerkleTree_fromTS
    MP = self._CallGBT(TS)
  File "/root/pool/merklemaker.py", line 327, in _CallGBT
    MP = access.getblocktemplate(self.GBTReq)
  File "/root/pool/bitcoinrpc/authproxy.py", line 106, in __call__
    response = self._get_response()
  File "/root/pool/bitcoinrpc/authproxy.py", line 132, in _get_response
    parse_float=decimal.Decimal)
  File "/usr/lib/python3.2/json/__init__.py", line 322, in loads
    return cls(**kw).decode(s)
  File "/usr/lib/python3.2/json/decoder.py", line 353, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.2/json/decoder.py", line 371, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

2013-08-07 22:57:02,726 merkleMaker     CRITICAL        Traceback (most recent call last):
  File "/usr/lib/python3.2/json/decoder.py", line 369, in raw_decode
    obj, end = self.scan_once(s, idx)
StopIteration

During handling of the above exception, another exception occurred:

And the message repeats...

bitcoind config:
Code:
rpcuser=y
rpcpassword=x
maxconnections=256
daemon=1

eloipool config.py
Code:
# Please note that config files are Python source code!
# A common mistake is to put an option list (such as TemplateChecks,
# JSONRPCAddresses, etc) excluding the final comma.
# For example (this is WRONG):
#     JSONRPCAddresses = (
#         ('', 8337)  # <-- there must be a comma after EVERY item, even last
#     )
# Without the final comma, should the option list ever have only one item in
# it, Python would interpret the "main" parenthesis as a mere sub-expression
# instead of a list of values. If that occurs, you might get crazy errors, or
# things might just not work correctly. Be careful to not miss the commas.

### Settings relating to server identity

# Name of the server
ServerName = 'Private Pool'

### Settings relating to server scaling/load

# Share hashes must be below this to be valid shares
# If dynamic targetting is enabled, this is a minimum
ShareTarget = 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff

# Automatically adjust targets per username
# 0 = disabled
# 1 = arbitrary targets
# 2 = power of two difficulties (zero bit counts)
DynamicTargetting = 2

# How many shares per minute to try to achieve on average
DynamicTargetGoal = 8

# Number of seconds hashrate is measured over
DynamicTargetWindow = 120

# Minimum and maximum of merkle roots to keep queued
WorkQueueSizeRegular = (0x100, 0x1000)

# Minimum and maximum of BLANK merkle roots to keep queued
# (used if we run out of populated ones)
WorkQueueSizeClear = (0x1000, 0x2000)

# Minimum and maximum of BLANK merkle roots to keep queued, one height up
# (used for longpolls)
WorkQueueSizeLongpoll = (0x1000, 0x2000)

# How long to wait between getmemorypool updates normally
MinimumTxnUpdateWait = 5

# How long to wait between retries if getmemorypool fails
TxnUpdateRetryWait = 1

# How long to sleep in idle loops (temporary!)
IdleSleepTime = 0.1

### Settings relating to reward generation

# Address to generate rewards to
TrackerAddr = '1BVi5pCdE5c37JDiF5tSur9vX1qB8xBLp9'

# Coinbaser command to control reward delegation
# %d is replaced with the total value of the block reward (in satoshis)
# %p is replaced with the previous block hash in hexadecimal
# NOTE: This example donates 1% of block rewards to Luke-Jr for Eloipool development
#CoinbaserCmd = 'echo -e "1\\n$((%d / 100))\\n1579aXhdwvKZEMrAKoCZhzGuqMa8EonuXU"'

### Settings relating to upstream data providers

# JSON-RPC servers to get block templates from
# See https://en.bitcoin.it/wiki/BIP_0023#Logical_Services for key details
TemplateSources = (
{
'name': 'primary',
'uri': 'http://y:x@localhost:8332',
'priority': 0,
'weight': 1,
},
# {
# 'name': 'secondary',
# 'uri': 'http://user:pass@localhost:18332',
# 'priority': 1,
# 'weight': 1,
# },
)

# JSON-RPC servers to check block proposals with
# If none provided, and selected source supports proposals, it alone will also
# be used for checking
# NOTE: Any servers listed here MUST support BIP 23 Block Proposals
# NOTE: Mainline bitcoind (as of 0.8) does NOT support this (though the 0.8.0.eligius branch does)
#TemplateChecks = (
# {
# 'name': 'primary',
# 'uri': 'http://user:pass@localhost:8332',
#
# # If 'unanimous' is true, no template will be used if this node
# # rejects it
# 'unanimous': False,
#
# # If check servers disagree on all templates, they will be scored and
# # the highest score will be used; 'weight' can be used to control the
# # scoring per-server
# 'weight': 1.1,
# },
# {
# 'name': 'secondary',
# 'uri': 'http://user:pass@localhost:18332',
# 'unanimous': False,
# 'weight': 1,
# },
#)

# JSON-RPC servers to submit found blocks to (when they meet the full target)
# The specific TemplateSource that the block was based on will always be sent
# the block first.
# If setting is not specified, or None, full TemplateSources list will be used.
# If an empty list, no extra submissions will be attempted.
# If an empty list, and the block was found on a "clear" merkle root (not based
# on any TemplateSource), the full TemplateSources list will be used.
#BlockSubmissions = (
# {
# 'name': 'primary',
# 'uri': 'http://user:pass@localhost:8332',
# },
# {
# 'name': 'secondary',
# 'uri': 'http://user:pass@localhost:18332',
# }
#)

# Templates will not be used unless they have an acceptance ratio above this
# Range: 0.00 - 1.00
MinimumTemplateAcceptanceRatio = 0

# No template with a combined total score below this will be used
MinimumTemplateScore = 1

# Set to True if you want shares meeting the upstream target to wait for a
# response from an upstream server before logging them. Otherwise, for such
# shares, upstreamResult will always be True and upstreamRejectReason will
# always be None. Note that enabling this may cause shares to be logged out of
# order, or with the wrong timestamp (if your share logger uses the log-time
# rather than share-time).
DelayLogForUpstream = False

# Bitcoin p2p server for announcing blocks found
UpstreamBitcoindNode = ('127.0.0.1', 8333)

# Network ID for the primary blockchain
# Other known network IDs can be found at:
#     https://en.bitcoin.it/wiki/Protocol_specification#Message_structure
#UpstreamNetworkId = b'\x0b\x11\x09\x07'  # testnet3
UpstreamNetworkId = b'\xF9\xBE\xB4\xD9'

# Secret username allowed to use setworkaux
#SecretUser = ""

# URI to send gotwork with info for every share submission
#GotWorkURI = ''

# Share hashes must be below this to be submitted to gotwork
GotWorkTarget = 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff

# Aim to produce blocks with transaction counts that are a power of two
# This helps avoid any chance of someone abusing CVE-2012-2459 with them
# 1 = cut out feeless transactions; 2 = cut out even fee-included transactions (if possible)
#POT = 0

# Avoid mining feeless transactions except to satisfy POT
# Note this only works if POT is in fact enabled in the first place
Greedy = False

### Settings relating to network services
# Note that Eloipool only supports IPv6 sockets, and if you want to bind to an
# IPv4 address you will need to prepend it with ::ffff: eg ::ffff:192.168.1.2

# Addresses to listen on for JSON-RPC GBT/getwork server
JSONRPCAddresses = (
('', 8888),
)

# Addresses to listen on for Stratum mining server
StratumAddresses = (
('', 3334),
)

# Addresses to listen on for Bitcoin node
# Note this will only be used to distribute blocks the pool finds, nothing else
BitcoinNodeAddresses = (
('', 8338),
)

# Addresses that are allowed to "spoof" from address with the X-Forwarded-For header
TrustedForwarders = ('::ffff:127.0.0.1',)


# Logging of shares:
ShareLogging = (
{
'type': 'logfile',
'filename': 'share-logfile',
'format': "{time} {Q(remoteHost)} {username} {YN(not(rejectReason))} {dash(YN(upstreamResult))} {dash(rejectReason)} {solution}\n",
},
# {
# 'type': 'sql',
# 'engine': 'postgres',
# 'dbopts': {
# 'host': 'localhost',
# 'database': 'pooldb',
# 'user': 'eloipool',
# 'password': 'somethingsecret',
# },
# 'statement': "insert into shares (rem_host, username, our_result, upstream_result, reason, solution) values ({Q(remoteHost)}, {username}, {YN(not(rejectReason))}, {YN(upstreamResult)}, {rejectReason}, decode({solution}, 'hex'))",
# },
# {
# 'type': 'sql',
# 'engine': 'mysql',
# 'dbopts': {
# 'host': 'localhost',
# 'db': 'pooldb',
# 'user': 'eloipool',
# 'password': 'somethingsecret',
# },
# 'statement': "insert into shares (rem_host, username, our_result, upstream_result, reason, solution) values ({Q(remoteHost)}, {username}, {YN(not(rejectReason))}, {YN(upstreamResult)}, {rejectReason}, unhex({solution}))",
# },
{
'type': 'sql',
'engine': 'sqlite',
'dbopts': {
'database': 'share.db',
},
'statement': "insert into shares (remoteHost, username, rejectReason, upstreamResult, solution) values ({remoteHost}, {username}, {rejectReason}, {upstreamResult}, {solution})",
},
)

# Authentication
# There currently are 2 modules.
# - allowall will allow every username/password combination
# - simplefile will use the username/passwords from a file, which contains usernamepassword\n with no \n on the last line.
Authentication =  (
{
'module': 'allowall',
},
# {
# 'module': 'simplefile',
# 'filename': 'userdatabase',
# },
)

### Settings related to poolserver logging

# By default, significant events will be printed to the interactive console
# You can customize your logging using either simple parameters, or Python's advanced logging framework
# Note that using Python's logging framework will override the default console logging!

# To simply log everything to the system log (syslog) as well:
# LogToSysLog = True

# To make a log file:
# LogFile = 'filename.log'

# For a rotating log file:
LogFile = {
'filename': 'eloipool.log',
'when': 'midnight',
'backupCount': 7,
}
# For details, see:
# http://docs.python.org/3/library/logging.handlers.html#logging.handlers.TimedRotatingFileHandler
legendary
Activity: 1357
Merit: 1004
I'm trying to run the application but I get the error
Code:
kamrenov@pool:~/bin$ ./eloipool.py 
2013-08-01 13:39:43,954 jsonrpc_getwork WARNING Error importing 'midstate' module; work will not provide midstates

>>> Traceback (most recent call last):
  File "./eloipool.py", line 862, in
    BitcoinLink(bcnode, dest=config.UpstreamBitcoindNode)
  File "/home/kamrenov/bin/bitcoin/node.py", line 50, in __init__
    sock.connect(dest)
socket.error: [Errno 111] Connection refused

my config.py
Code:
# Please note that config files are Python source code!
# A common mistake is to put an option list (such as TemplateChecks,
# JSONRPCAddresses, etc) excluding the final comma.
# For example (this is WRONG):
#     JSONRPCAddresses = (
#         ('', 8337)  # <-- there must be a comma after EVERY item, even last
#     )
# Without the final comma, should the option list ever have only one item in
# it, Python would interpret the "main" parenthesis as a mere sub-expression
# instead of a list of values. If that occurs, you might get crazy errors, or
# things might just not work correctly. Be careful to not miss the commas.

### Settings relating to server identity

# Name of the server
ServerName = 'My Pool'

### Settings relating to server scaling/load

# Share hashes must be below this to be valid shares
# If dynamic targetting is enabled, this is a minimum
ShareTarget = 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff

# Automatically adjust targets per username
# 0 = disabled
# 1 = arbitrary targets
# 2 = power of two difficulties (zero bit counts)
DynamicTargetting = 2

# How many shares per minute to try to achieve on average
DynamicTargetGoal = 8

# Number of seconds hashrate is measured over
DynamicTargetWindow = 120

# Minimum and maximum of merkle roots to keep queued
WorkQueueSizeRegular = (0x100, 0x1000)

# Minimum and maximum of BLANK merkle roots to keep queued
# (used if we run out of populated ones)
WorkQueueSizeClear = (0x1000, 0x2000)

# Minimum and maximum of BLANK merkle roots to keep queued, one height up
# (used for longpolls)
WorkQueueSizeLongpoll = (0x1000, 0x2000)

# How long to wait between getmemorypool updates normally
MinimumTxnUpdateWait = 5

# How long to wait between retries if getmemorypool fails
TxnUpdateRetryWait = 1
# How long to sleep in idle loops (temporary!)
IdleSleepTime = 0.1

### Settings relating to reward generation

# Address to generate rewards to
TrackerAddr = '1P5YMGAzSypskCy1kMr7otjH5bSeD1nP9X'

# Coinbaser command to control reward delegation
# NOTE: This example donates 1% of block rewards to Luke-Jr for Eloipool development
# CoinbaserCmd = 'echo -e "1\\n$((%d / 100))\\n1579aXhdwvKZEMrAKoCZhzGuqMa8EonuXU"'

### Settings relating to upstream data providers

# JSON-RPC servers to get block templates from
# See https://en.bitcoin.it/wiki/BIP_0023#Logical_Services for key details
TemplateSources = (
{
'name': 'primary',
'uri': 'http://ruxAbDxUFs6Y:CZoLZwPxBVp5y5jFBUxVsGWrGefX6F@localhost:8332',
'priority': 0,
'weight': 1,
},
)

# JSON-RPC servers to check block proposals with
# If none provided, and selected source supports proposals, it alone will also
# be used for checking
# NOTE: Any servers listed here MUST support BIP 23 Block Proposals
# NOTE: Mainline bitcoind (as of 0.8) does NOT support this (though the 0.8.0.eligius branch does)
TemplateChecks = (
)

# JSON-RPC servers to submit found blocks to (when they meet the full target)
# The specific TemplateSource that the block was based on will always be sent
# the block first.
# If setting is not specified, or None, full TemplateSources list will be used.
# If an empty list, no extra submissions will be attempted.
# If an empty list, and the block was found on a "clear" merkle root (not based
# on any TemplateSource), the full TemplateSources list will be used.
BlockSubmissions = (
{
'name': 'primary',
'uri': 'http://ruxAbDxUFs6Y:CZoLZwPxBVp5y5jFBUxVsGWrGefX6F@localhost:8332',
},
)

# Templates will not be used unless they have an acceptance ratio above this
# Range: 0.00 - 1.00
MinimumTemplateAcceptanceRatio = 0

# No template with a combined total score below this will be used
MinimumTemplateScore = 1

# Set to True if you want shares meeting the upstream target to wait for a
# response from an upstream server before logging them. Otherwise, for such
# shares, upstreamResult will always be True and upstreamRejectReason will
# always be None. Note that enabling this may cause shares to be logged out of
# order, or with the wrong timestamp (if your share logger uses the log-time
# rather than share-time).
DelayLogForUpstream = True

# Bitcoin p2p server for announcing blocks found
UpstreamBitcoindNode = ('127.0.0.1', 8333)  # testnet

# Network ID for the primary blockchain
# Other known network IDs can be found at:
#     https://en.bitcoin.it/wiki/Protocol_specification#Message_structure
UpstreamNetworkId = b'\xF9\xBE\xB4\xD9'  # testnet

# Secret username allowed to use setworkaux
#SecretUser = ""

# URI to send gotwork with info for every share submission
#GotWorkURI = ''

# Share hashes must be below this to be submitted to gotwork
GotWorkTarget = 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff

# Aim to produce blocks with transaction counts that are a power of two
# This helps avoid any chance of someone abusing CVE-2012-2459 with them
# 1 = cut out feeless transactions; 2 = cut out even fee-included transactions (if possible)
# POT = 2

# Avoid mining feeless transactions except to satisfy POT
# Note this only works if POT is in fact enabled in the first place
Greedy = False

### Settings relating to network services
# Note that Eloipool only supports IPv6 sockets, and if you want to bind to an
# IPv4 address you will need to prepend it with ::ffff: eg ::ffff:192.168.1.2

# Addresses to listen on for JSON-RPC GBT/getwork server
JSONRPCAddresses = (
('', 8337),
)

# Addresses to listen on for Stratum mining server
StratumAddresses = (
('', 3334),
)

# Addresses to listen on for Bitcoin node
# Note this will only be used to distribute blocks the pool finds, nothing else
BitcoinNodeAddresses = (
('', 8338),
)

# Addresses that are allowed to "spoof" from address with the X-Forwarded-For header
TrustedForwarders = ('::ffff:127.0.0.1',)


# Logging of shares:
ShareLogging = (
        {
                'type': 'sql',
                'engine': 'postgres',
                'dbopts': {
                        'host': 'localhost',
                        'database': 'pool_stats',
                        'user': 'root',
                        'password': 'eloipool',
                },
                'statement': "insert into shares (rem_host, username, our_result, upstream_result, reason, solution) values ({Q(remoteHost)},
 {username}, {YN(not(rejectReason))}, {YN(upstreamResult)}, {rejectReason}, decode({solution}, 'hex'))",
        },
)

### Settings related to poolserver logging

# By default, significant events will be printed to the interactive console
# You can customize your logging using either simple parameters, or Python's advanced logging framework
# Note that using Python's logging framework will override the default console logging!

# To simply log everything to the system log (syslog) as well:
# LogToSysLog = True

# To make a log file:
LogFile = '/home/eloipool/web_dir/error_log.log'

# For a rotating log file:
LogFile = {
'filename': 'error_log.log',
'when': 'midnight',
'backupCount': 7,
}
# For details, see:
# http://docs.python.org/3/library/logging.handlers.html#logging.handlers.TimedRotatingFileHandler
legendary
Activity: 2576
Merit: 1186
Hi Luke,

how do I get the block height into the coinbase? Let's say, CoinbaserCmd is not really "well" documented ;-)
It's always in the coinbase. CoinbaserCmd controls payouts.
full member
Activity: 158
Merit: 100
Hi Luke,

how do I get the block height into the coinbase? Let's say, CoinbaserCmd is not really "well" documented ;-)
newbie
Activity: 4
Merit: 0
Code:
2013-06-27 23:02:34,173 merkleMaker     CRITICAL        Traceback (most recent call last):
  File "/home/mixa/ttt/eloipool/merklemaker.py", line 692, in run
    self.merkleMaker_I()
  File "/home/mixa/ttt/eloipool/merklemaker.py", line 682, in merkleMaker_I
    self.merkleMaker_II()
  File "/home/mixa/ttt/eloipool/merklemaker.py", line 648, in merkleMaker_II
    return self._updateMerkleTree()
  File "/home/mixa/ttt/eloipool/merklemaker.py", line 548, in _updateMerkleTree
    self._updateMerkleTree_I()
  File "/home/mixa/ttt/eloipool/merklemaker.py", line 512, in _updateMerkleTree_I
    r = self._updateMerkleTree_fromTS(TS)
  File "/home/mixa/ttt/eloipool/merklemaker.py", line 477, in _updateMerkleTree_fromTS
    MP = self._CallGBT(TS)
  File "/home/mixa/ttt/eloipool/merklemaker.py", line 327, in _CallGBT
    MP = access.getblocktemplate(self.GBTReq)
  File "/home/mixa/ttt/eloipool/bitcoinrpc/authproxy.py", line 104, in __call__
    'Content-type': 'application/json'})
  File "/usr/lib/python3.2/http/client.py", line 967, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.2/http/client.py", line 995, in _send_request
    self.putrequest(method, url, **skips)
  File "/usr/lib/python3.2/http/client.py", line 850, in putrequest
    raise CannotSendRequest(self.__state)
http.client.CannotSendRequest: Request-sent

Who knows what the problem is?
sr. member
Activity: 263
Merit: 250
Pool operator of Triplemining.com
I have Eloipool up and running on Testnet.

When I find a block I receive this message in the log file:

Code:
2013-05-20 17:21:33,131	blockSubmission	DEBUG	Upstream 'primary' accepted block
2013-05-20 17:21:33,241 redflag CRITICAL Upstream 'primary' block submission failed: rejected

However, it appears the network has accepted the block.

Any ideas why I'm getting the "redflag" message?



Eloipool tries to submit the block at least three times.  So you *should* get this error.  it is indeed a bit confusing, but that is how it works.
Pages:
Jump to: