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