Support for MySQL and Sqlite share logging
[bitcoin:eloipool.git] / config.py.example
1 ### Settings relating to server scaling/load
2
3 # Minimum and maximum of merkle roots to keep queued
4 WorkQueueSizeRegular = (0x100, 0x1000)
5
6 # Minimum and maximum of BLANK merkle roots to keep queued
7 # (used if we run out of populated ones, usually after a block is found)
8 WorkQueueSizeLongpoll = (0x1000, 0x2000)
9
10 # How long to wait between getmemorypool updates normally
11 MinimumTxnUpdateWait = 5
12
13 # How long to wait between retries if getmemorypool fails
14 TxnUpdateRetryWait = 1
15
16 # How long to sleep in idle loops (temporary!)
17 IdleSleepTime = 0.1
18
19 ### Settings relating to reward generation
20
21 # Address to generate rewards to
22 TrackerAddr = 'mrsP7M31efGkQHXb7nRiWLDjfV2M8oakf2'  # testnet
23
24 # Coinbaser command to control reward delegation
25 CoinbaserCmd = 'let x=%d-1; echo -e "1\\n$x\\n1GEJfZRPrK2BLSSx3r6gwtuFxCUvq3QytN\\n"'
26
27 ### Settings relating to upstream data providers
28
29 # JSON-RPC server for getmemorypool
30 UpstreamURI = 'http://user:pass@localhost:18332'
31
32 # Bitcoin p2p server for announcing blocks found
33 UpstreamBitcoindNode = ('127.0.0.1', 18333)  # testnet
34
35 # Network ID for the primary blockchain
36 UpstreamNetworkId = b'\xFA\xBF\xB5\xDA'  # testnet
37
38 # Secret username allowed to use setworkaux
39 #SecretUser = ""
40
41 # URI to send gotwork with info for every share submission
42 #GotWorkURI = ''
43
44 # Share hashes must be below this to be submitted to gotwork
45 GotWorkTarget = 0x000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
46
47 ### Settings relating to network services
48
49 # Addresses to listen on for JSON-RPC getwork server
50 # Note that Eloipool only supports IPv6 sockets, and if you want to bind to an
51 # IPv4 address you will need to prepend it with ::ffff: eg ::ffff:192.168.1.2
52 JSONRPCAddresses = (
53         ('', 8337),
54 )
55
56 # Addresses to listen on for Bitcoin node
57 # Note that Eloipool only supports IPv6 sockets, and if you want to bind to an
58 # IPv4 address you will need to prepend it with ::ffff: eg ::ffff:192.168.1.2
59 BitcoinNodeAddresses = (
60         ('', 8338),
61 )
62
63 # Logging of shares:
64 ShareLogging = (
65         {
66                 'type': 'logfile',
67                 'filename': 'share-logfile',
68                 'format': "{time} {Q(remoteHost)} {username} {YN(not(rejectReason))} {dash(YN(upstreamResult))} {dash(rejectReason)} {solution}\n",
69         },
70         {
71                 'type': 'sql',
72                 'engine': 'postgres',
73                 'dbopts': {
74                         'host': 'localhost',
75                         'database': 'pooldb',
76                         'user': 'eloipool',
77                         'password': 'somethingsecret',
78                 },
79                 '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'))",
80         },
81         {
82                 'type': 'sql',
83                 'engine': 'mysql',
84                 'dbopts': {
85                         'host': 'localhost',
86                         'db': 'pooldb',
87                         'user': 'eloipool',
88                         'password': 'somethingsecret',
89                 },
90                 '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'))",
91         },
92         {
93                 'type': 'sql',
94                 'engine': 'sqlite',
95                 'dbopts': {
96                         'database': 'share.db',
97                 },
98                 'statement': "insert into shares (remoteHost, username, rejectReason, upstreamResult, solution) values ({remoteHost}, {username}, {rejectReason}, {upstreamResult}, {solution})",
99         },
100 )
101