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