2 releases

0.1.1 May 7, 2024
0.1.0 Mar 29, 2024

#14 in #sv2

Download history 1/week @ 2024-07-29 9/week @ 2024-09-23

94 downloads per month

MIT/Apache

700KB
13K SLoC

mining-proxy

Run

proxy-config.toml file

When spawned the proxy will look in the current working directory (linux) for a proxy-config.config if the file is not available the proxy will panic. We can specify a different path for the config file with the -c option.

The config need to be a valid toml file with the below values:

  1. upstreams: vector of upstreams (likely pools). An upstream is composed by:
  2. channel_kind: can be either Group, Extended, ExtendedWithDeclarator. * Group: Proxy do not open an extended channel with upstream but just relay request to open standard channel from downstream to upstream, being the proxy non HOM the channels are grouped. * Extended: Proxy open an extended channel with upstream. When downstream ask to open standard channels it just use the open extended channel with upstream to itself open standard channels downstream. * ExtendedWithDeclarator: Like Extended but do not relay on the pool to create new job. It just connect to a TP and communicate to the pool which is the job that it want to work with.
  3. adress: ip address of the upstream
  4. port: upstream's port
  5. pub_key: is the public key that upstream will use to sign the upstream cert needed for the noise handshake.
  6. jd_values: optional value only needed when channel_kind is ExtendedWithDeclarator is composed by:
    1. address: ip of the JD that we want to use with this upstream
    2. port: port of the JD that we want to use with this upstream
    3. pub_key: pub_key of the JD that we want to use with this upstream
  7. tp_address: optional value only needed when at least one upstream in upstreams has the kind ExtendedWithDeclarator. Is the address in the form [ip:port] of the TP.
  8. listen_address: the address at which the mining-proxy will accept downstream connection.
  9. listen_mining_port: the port at which the mining-proxy will accept downstream connection.
  10. max_supported_version: the mining-proxy will not connect to upstream the are using an Sv2 version higher that the one specified here (default to 2)
  11. min_supported_version: the mining-proxy will not connect to upstream the are using an Sv2 version smaller that the one specified here (default to 2)
  12. downstream_share_per_minute: how many share per minute downstream is supposed to produce. The mining-proxy will use this value and the expected downstream hash rate (communicate vie penStandardMiningChannel to calculate the right downstream target.

Test miner <-> proxy <-> pool stack

Terminal 1:

% cd examples/sv2-proxy
% cargo run --bin pool

Terminal 2: Run mining proxy:

% # For help run `cargo run -- --help`
% cd roles/v2/mining-proxy
% cargo run

Terminal 3:

% cd examples/sv2-proxy
% cargo run --bin mining-device

Dependencies

~15–22MB
~263K SLoC