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:
- upstreams: vector of upstreams (likely pools). An upstream is composed by:
- 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: LikeExtendedbut 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. - adress: ip address of the upstream
- port: upstream's port
- pub_key: is the public key that upstream will use to sign the upstream cert needed for the noise handshake.
- jd_values: optional value only needed when
channel_kindisExtendedWithDeclaratoris composed by:- address: ip of the JD that we want to use with this upstream
- port: port of the JD that we want to use with this upstream
- pub_key: pub_key of the JD that we want to use with this upstream
- tp_address: optional value only needed when at least one
upstreaminupstreamshas the kindExtendedWithDeclarator. Is the address in the form[ip:port]of the TP. - listen_address: the address at which the
mining-proxywill accept downstream connection. - listen_mining_port: the port at which the
mining-proxywill accept downstream connection. - max_supported_version: the
mining-proxywill not connect to upstream the are using an Sv2 version higher that the one specified here (default to 2) - min_supported_version: the
mining-proxywill not connect to upstream the are using an Sv2 version smaller that the one specified here (default to 2) - downstream_share_per_minute: how many share per minute downstream is supposed to produce. The
mining-proxywill use this value and the expected downstream hash rate (communicate viepenStandardMiningChannelto 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