Workaround for bug in Python's math.log function
[bitcoin:eloipool.git] / config.py.example
1 ### Settings relating to server identity
2
3 # Name of the server
4 ServerName = 'Private Eloipool'
5
6 ### Settings relating to server scaling/load
7
8 # Share hashes must be below this to be valid shares
9 # If dynamic targetting is enabled, this is a minimum
10 ShareTarget = 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff
11
12 # Automatically adjust targets per username
13 # 0 = disabled
14 # 1 = arbitrary targets
15 # 2 = power of two difficulties (zero bit counts)
16 DynamicTargetting = 0
17
18 # How many shares per minute to try to achieve on average
19 DynamicTargetGoal = 8
20
21 # Minimum and maximum of merkle roots to keep queued
22 WorkQueueSizeRegular = (0x100, 0x1000)
23
24 # Minimum and maximum of BLANK merkle roots to keep queued
25 # (used if we run out of populated ones)
26 WorkQueueSizeClear = (0x1000, 0x2000)
27
28 # Minimum and maximum of BLANK merkle roots to keep queued, one height up
29 # (used for longpolls)
30 WorkQueueSizeLongpoll = (0x1000, 0x2000)
31
32 # How long to wait between getmemorypool updates normally
33 MinimumTxnUpdateWait = 5
34
35 # How long to wait between retries if getmemorypool fails
36 TxnUpdateRetryWait = 1
37
38 # How long to sleep in idle loops (temporary!)
39 IdleSleepTime = 0.1
40
41 ### Settings relating to reward generation
42
43 # Address to generate rewards to
44 TrackerAddr = 'mrsP7M31efGkQHXb7nRiWLDjfV2M8oakf2'  # testnet
45
46 # Coinbaser command to control reward delegation
47 # NOTE: This example donates 1% of block rewards to Luke-Jr for Eloipool development
48 CoinbaserCmd = 'echo -e "1\\n$((%d / 100))\\n1579aXhdwvKZEMrAKoCZhzGuqMa8EonuXU"'
49
50 ### Settings relating to upstream data providers
51
52 # JSON-RPC server for getmemorypool
53 UpstreamURI = 'http://user:pass@localhost:18332'
54
55 # Bitcoin p2p server for announcing blocks found
56 UpstreamBitcoindNode = ('127.0.0.1', 18333)  # testnet
57
58 # Network ID for the primary blockchain
59 UpstreamNetworkId = b'\xFA\xBF\xB5\xDA'  # testnet
60
61 # Secret username allowed to use setworkaux
62 #SecretUser = ""
63
64 # URI to send gotwork with info for every share submission
65 #GotWorkURI = ''
66
67 # Share hashes must be below this to be submitted to gotwork
68 GotWorkTarget = 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff
69
70 # Aim to produce blocks with transaction counts that are a power of two
71 # This helps avoid any chance of someone abusing CVE-2012-2459 with them
72 # 1 = cut out feeless transactions; 2 = cut out even fee-included transactions (if possible)
73 POT = 2
74
75 # Avoid mining feeless transactions except to satisfy POT
76 # Note this only works if POT is in fact enabled in the first place
77 Greedy = False
78
79 ### Settings relating to network services
80
81 # Addresses to listen on for JSON-RPC getwork server
82 # Note that Eloipool only supports IPv6 sockets, and if you want to bind to an
83 # IPv4 address you will need to prepend it with ::ffff: eg ::ffff:192.168.1.2
84 JSONRPCAddresses = (
85         ('', 8337),
86 )
87
88 # Addresses to listen on for Bitcoin node
89 # Note that Eloipool only supports IPv6 sockets, and if you want to bind to an
90 # IPv4 address you will need to prepend it with ::ffff: eg ::ffff:192.168.1.2
91 BitcoinNodeAddresses = (
92         ('', 8338),
93 )
94
95 # Addresses that are allowed to "spoof" from address with the X-Forwarded-For header
96 TrustedForwarders = ('::ffff:127.0.0.1',)
97
98
99 # Logging of shares:
100 ShareLogging = (
101         {
102                 'type': 'logfile',
103                 'filename': 'share-logfile',
104                 'format': "{time} {Q(remoteHost)} {username} {YN(not(rejectReason))} {dash(YN(upstreamResult))} {dash(rejectReason)} {solution}\n",
105         },
106         {
107                 'type': 'sql',
108                 'engine': 'postgres',
109                 'dbopts': {
110                         'host': 'localhost',
111                         'database': 'pooldb',
112                         'user': 'eloipool',
113                         'password': 'somethingsecret',
114                 },
115                 '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'))",
116         },
117         {
118                 'type': 'sql',
119                 'engine': 'mysql',
120                 'dbopts': {
121                         'host': 'localhost',
122                         'db': 'pooldb',
123                         'user': 'eloipool',
124                         'password': 'somethingsecret',
125                 },
126                 '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}))",
127         },
128         {
129                 'type': 'sql',
130                 'engine': 'sqlite',
131                 'dbopts': {
132                         'database': 'share.db',
133                 },
134                 'statement': "insert into shares (remoteHost, username, rejectReason, upstreamResult, solution) values ({remoteHost}, {username}, {rejectReason}, {upstreamResult}, {solution})",
135         },
136 )
137