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