forked from ckolivas/ckpool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathckproxy.conf
More file actions
131 lines (115 loc) · 6.21 KB
/
Copy pathckproxy.conf
File metadata and controls
131 lines (115 loc) · 6.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
{
"proxy" : [
{
"url" : "pool.example.org:3336/9anrRNhBh7869XtNnFcCuGBRZP51E635qGbu457J5kHdszhfRc3",
"auth" : "user",
"pass" : "pass"
},
{
"url" : "ckpool.org:3333",
"auth" : "user",
"pass" : "pass"
}
],
"update_interval" : 30,
"serverurl" : [
"192.168.1.100:3334",
"127.0.0.1:3334"
],
"mindiff" : 1,
"startdiff" : 10000,
"maxdiff" : 0,
"logdir" : "logs"
}
Comments from here on are ignored.
proxy: array of upstream pools, tried in order with automatic failover.
url: the upstream pool address. SV1 and SV2 upstreams may be mixed freely in
the same array. An upstream is treated as Stratum V2 (Noise-encrypted)
when its path carries the pool's base58check authority public key --
the presence of that key is what selects SV2; the stratum2+tcp:// scheme
prefix is accepted but not required:
host:port Stratum V1 upstream.
stratum+tcp://host:port Stratum V1 upstream (explicit scheme).
host:port/KEY Stratum V2 upstream (key present).
stratum2+tcp://host:port/KEY Stratum V2 upstream (explicit + key).
KEY is the pool's authority public key, published by the pool (e.g. on
its website / in its connect URL). The connection is refused if the key
is invalid or the server certificate does not verify against it -- an
SV2 upstream is never connected unauthenticated. A plain "host:port"
(no path), or a path that is not a valid authority key, is Stratum V1.
auth: username. For an SV2 upstream this is sent as the channel user_identity
(e.g. a payout address for a solo pool).
pass: password. Unused by SV2 upstreams.
jds: optional. The pool's Job Declaration server, which turns this entry into
a job declaring proxy: block templates come from your own bitcoind
instead of the pool's. See "Job Declaration" below.
Passthrough, node, userproxy and redirector modes are not supported over SV2.
Without a "jds" an SV2 entry uses the Mining Protocol only, mining whatever
templates the pool sends.
Job Declaration (choose your own transactions, upstream still pays you):
With a "jds" entry, ckproxy builds block templates from your own bitcoind over
the Bitcoin Core mining IPC, declares each one to the pool's job declaration
server, and -- once the pool accepts it -- mines that template as a custom job.
You pick the transactions; the pool still validates, credits and pays the
hashrate exactly as it does for its own work. Nothing about the downstream
miners changes: they stay plain SV1.
{
"proxy" : [
{
"url" : "pool.example.org:3336/9anrRNhBh7869XtNnFcCuGBRZP51E635qGbu457J5kHdszhfRc3",
"jds" : "pool.example.org:3337/9anrRNhBh7869XtNnFcCuGBRZP51E635qGbu457J5kHdszhfRc3",
"auth" : "bc1qexampleaddress.worker",
"pass" : "x"
},
{
"url" : "ckpool.org:3333",
"auth" : "user",
"pass" : "pass"
}
],
"ipcmining" : "/home/bitcoin/.bitcoin/node.sock",
"serverurl" : [ "0.0.0.0:3334" ],
"startdiff" : 10000,
"logdir" : "logs"
}
Requirements, all checked at startup rather than left to fail at runtime:
- the same entry must have an SV2 "url": job declaration is negotiated
on the mining connection, so it cannot attach to an SV1 upstream;
- "ipcmining" must be set (see below);
- the binary must have been built with mining IPC support (configure
finds capnp-rpc). ckproxy refuses to start otherwise.
The "jds" URL has the same shape as an SV2 "url" and needs its own authority
key -- pools may terminate the two services separately, so the key is allowed
to differ from the mining one. Give the port explicitly (3337 by convention).
"auth" doubles as the job declaration identity, so with a solo pool upstream
it must be the payout address you want the coinbase to pay: the pool matches
it against the mining channel's user_identity.
Job declaration binds to the first entry that has a "jds", and to that entry's
channel only. Other entries in the failover list stay mining-only.
There is nothing to tune and no way for it to cost you work. Whenever a
template cannot be declared -- your node is behind the pool's tip or ahead of
it, the declaration session is down, bitcoind is unreachable, the pool rejects
the template -- ckproxy mines the pool's own work for that window and returns
to declared work as soon as it can. "work source" lines in the log say which
of the two is live at any moment (POOL, LOCAL_JD, or POOL_BRIDGE while your
node catches up to a tip the pool announced first).
ipcmining: path to the Bitcoin Core mining IPC socket, required by "jds" and
unused without it. Needs a multiprocess Core build started with
-ipcbind=unix, which creates <datadir>/node.sock; point this at that
path. The node does not have to be the one any pool uses, and needs no
RPC credentials here -- ckproxy only asks it for templates and submits
any block it finds to it directly as well as upstream. If the socket is
not there yet ckproxy keeps retrying, so start order does not matter.
update_interval: seconds between work updates pushed to downstream miners
(default 30).
serverurl: array of local addresses:ports to listen on for downstream SV1
miners (default 0.0.0.0:3333, or :3334 shown here to avoid clashes).
mindiff / startdiff / maxdiff: downstream miner difficulty floor / initial /
ceiling (0 = no ceiling). Vardiff adjusts within these bounds.
nonce2length: optional. Downstream extranonce2 (miner-rolled) size in bytes.
Leave unset in proxy mode (the default) to auto-split the upstream
extranonce space, reserving per-client id bytes so one upstream channel
aggregates many downstream miners. For an SV2 extended-channel upstream
this splits the pool-granted extranonce_size into per-client id bytes +
this many miner-rolling bytes; set it (2-8) only to tune that split.
logdir: directory for log files (default "logs").