ethminer: remove

This commit is contained in:
Babbaj 2022-11-09 09:37:35 -05:00
parent 969c3ccf30
commit 9a7c359a35
No known key found for this signature in database
GPG key ID: F044309848A07CAC
5 changed files with 0 additions and 241 deletions

View file

@ -570,7 +570,6 @@
./services/misc/etcd.nix
./services/misc/etebase-server.nix
./services/misc/etesync-dav.nix
./services/misc/ethminer.nix
./services/misc/exhibitor.nix
./services/misc/felix.nix
./services/misc/freeswitch.nix

View file

@ -1,117 +0,0 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.ethminer;
poolUrl = escapeShellArg "stratum1+tcp://${cfg.wallet}@${cfg.pool}:${toString cfg.stratumPort}/${cfg.rig}/${cfg.registerMail}";
in
{
###### interface
options = {
services.ethminer = {
enable = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc "Enable ethminer ether mining.";
};
recheckInterval = mkOption {
type = types.ints.unsigned;
default = 2000;
description = lib.mdDoc "Interval in milliseconds between farm rechecks.";
};
toolkit = mkOption {
type = types.enum [ "cuda" "opencl" ];
default = "cuda";
description = lib.mdDoc "Cuda or opencl toolkit.";
};
apiPort = mkOption {
type = types.int;
default = -3333;
description = lib.mdDoc "Ethminer api port. minus sign puts api in read-only mode.";
};
wallet = mkOption {
type = types.str;
example = "0x0123456789abcdef0123456789abcdef01234567";
description = lib.mdDoc "Ethereum wallet address.";
};
pool = mkOption {
type = types.str;
example = "eth-us-east1.nanopool.org";
description = lib.mdDoc "Mining pool address.";
};
stratumPort = mkOption {
type = types.port;
default = 9999;
description = lib.mdDoc "Stratum protocol tcp port.";
};
rig = mkOption {
type = types.str;
default = "mining-rig-name";
description = lib.mdDoc "Mining rig name.";
};
registerMail = mkOption {
type = types.str;
example = "email%40example.org";
description = lib.mdDoc "Url encoded email address to register with pool.";
};
maxPower = mkOption {
type = types.ints.unsigned;
default = 113;
description = lib.mdDoc "Miner max watt usage.";
};
};
};
###### implementation
config = mkIf cfg.enable {
systemd.services.ethminer = {
path = optionals (cfg.toolkit == "cuda") [ pkgs.cudaPackages.cudatoolkit ];
description = "ethminer ethereum mining service";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
DynamicUser = true;
ExecStartPre = "${pkgs.ethminer}/bin/.ethminer-wrapped --list-devices";
ExecStartPost = optional (cfg.toolkit == "cuda") "+${getBin config.boot.kernelPackages.nvidia_x11}/bin/nvidia-smi -pl ${toString cfg.maxPower}";
Restart = "always";
};
environment = mkIf (cfg.toolkit == "cuda") {
LD_LIBRARY_PATH = "${config.boot.kernelPackages.nvidia_x11}/lib";
};
script = ''
${pkgs.ethminer}/bin/.ethminer-wrapped \
--farm-recheck ${toString cfg.recheckInterval} \
--report-hashrate \
--${cfg.toolkit} \
--api-port ${toString cfg.apiPort} \
--pool ${poolUrl}
'';
};
};
}

View file

@ -1,25 +0,0 @@
diff --git a/libethcore/CMakeLists.txt b/libethcore/CMakeLists.txt
index 1a53de8..832e926 100644
--- a/libethcore/CMakeLists.txt
+++ b/libethcore/CMakeLists.txt
@@ -7,7 +7,7 @@ set(SOURCES
include_directories(BEFORE ..)
add_library(ethcore ${SOURCES})
-target_link_libraries(ethcore PUBLIC devcore ethash::ethash PRIVATE hwmon)
+target_link_libraries(ethcore PUBLIC devcore ethash::ethash ethash-global-context PRIVATE hwmon)
if(ETHASHCL)
target_link_libraries(ethcore PRIVATE ethash-cl)
diff --git a/libethcore/EthashAux.h b/libethcore/EthashAux.h
index d9aadc7..fe5c6cf 100644
--- a/libethcore/EthashAux.h
+++ b/libethcore/EthashAux.h
@@ -22,6 +22,7 @@
#include <libdevcore/Worker.h>
#include <ethash/ethash.hpp>
+#include <ethash/global_context.hpp>
namespace dev
{

View file

@ -1,94 +0,0 @@
{
lib,
stdenv,
fetchpatch,
fetchFromGitHub,
opencl-headers,
cmake,
jsoncpp,
boost16x,
makeWrapper,
cudatoolkit,
cudaSupport,
mesa,
ethash,
opencl-info,
ocl-icd,
openssl,
pkg-config,
cli11
}:
stdenv.mkDerivation rec {
pname = "ethminer";
version = "0.19.0";
src =
fetchFromGitHub {
owner = "ethereum-mining";
repo = "ethminer";
rev = "v${version}";
sha256 = "1kyff3vx2r4hjpqah9qk99z6dwz7nsnbnhhl6a76mdhjmgp1q646";
fetchSubmodules = true;
};
patches = [
# global context library is separated from libethash
./add-global-context.patch
# CUDA 11 no longer support SM30
(fetchpatch {
url = "https://github.com/ethereum-mining/ethminer/commit/dae359dff28f376d4ce7ddfbd651dcd34d6dad8f.patch";
hash = "sha256-CJGKc0rXOcKDX1u5VBzc8gyBi1Me9CNATfQzKViqtAA=";
})
];
postPatch = ''
sed -i 's/_lib_static//' libpoolprotocols/CMakeLists.txt
'';
# NOTE: dbus is broken
cmakeFlags = [
"-DHUNTER_ENABLED=OFF"
"-DETHASHCUDA=ON"
"-DAPICORE=ON"
"-DETHDBUS=OFF"
"-DCMAKE_BUILD_TYPE=Release"
] ++ (if cudaSupport then [
"-DCUDA_PROPAGATE_HOST_FLAGS=off"
] else [
"-DETHASHCUDA=OFF" # on by default
]);
nativeBuildInputs = [
cmake
pkg-config
makeWrapper
];
buildInputs = [
cli11
boost16x # 1.7x support is broken, see https://github.com/ethereum-mining/ethminer/issues/2393
opencl-headers
mesa
ethash
opencl-info
ocl-icd
openssl
jsoncpp
] ++ lib.optionals cudaSupport [
cudatoolkit
];
postInstall = ''
wrapProgram $out/bin/ethminer --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib
'';
meta = with lib; {
description = "Ethereum miner with OpenCL${lib.optionalString cudaSupport ", CUDA"} and stratum support";
homepage = "https://github.com/ethereum-mining/ethminer";
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ atemu ];
license = licenses.gpl3Only;
};
}

View file

@ -5319,10 +5319,6 @@ with pkgs;
ethash = callPackage ../development/libraries/ethash { };
ethminer = callPackage ../tools/misc/ethminer { cudaSupport = config.cudaSupport or true; };
ethminer-cuda = ethminer.override { cudaSupport = true; };
ethminer-free = ethminer.override { cudaSupport = false; };
cuetools = callPackage ../tools/cd-dvd/cuetools { };
u3-tool = callPackage ../tools/filesystems/u3-tool { };