progminer zano miner fork https://github.com/hyle-team/progminer
This commit is contained in:
38
zano/progminer/CMakeLists.txt
Normal file
38
zano/progminer/CMakeLists.txt
Normal file
@@ -0,0 +1,38 @@
|
||||
cmake_policy(SET CMP0015 NEW)
|
||||
|
||||
aux_source_directory(. SRC_LIST)
|
||||
|
||||
include_directories(BEFORE ..)
|
||||
|
||||
set(EXECUTABLE progminer)
|
||||
|
||||
file(GLOB HEADERS "*.h")
|
||||
|
||||
add_executable(${EXECUTABLE} ${SRC_LIST} ${HEADERS})
|
||||
if(MSVC)
|
||||
target_sources(${EXECUTABLE} PRIVATE progminer.rc)
|
||||
endif()
|
||||
|
||||
hunter_add_package(CLI11)
|
||||
find_package(CLI11 CONFIG REQUIRED)
|
||||
|
||||
target_link_libraries(progminer PRIVATE ethcore poolprotocols devcore progminer-buildinfo CLI11::CLI11 Boost::filesystem Boost::system Boost::thread)
|
||||
|
||||
if(ETHDBUS)
|
||||
find_package(PkgConfig)
|
||||
set( ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/lib/x86_64-linux-gnu/pkgconfig" )
|
||||
pkg_check_modules(DBUS dbus-1)
|
||||
include_directories(${DBUS_INCLUDE_DIRS})
|
||||
link_directories(${DBUS_LIBRARY_DIRS})
|
||||
target_link_libraries(progminer PRIVATE ${DBUS_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(APICORE)
|
||||
target_link_libraries(progminer PRIVATE apicore)
|
||||
endif()
|
||||
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS progminer DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
if(MSVC)
|
||||
install(FILES $<TARGET_PDB_FILE:progminer> DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)
|
||||
endif()
|
||||
44
zano/progminer/DBusInt.h
Normal file
44
zano/progminer/DBusInt.h
Normal file
@@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
|
||||
#include <dbus/dbus.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class DBusInt
|
||||
{
|
||||
public:
|
||||
DBusInt()
|
||||
{
|
||||
dbus_error_init(&err);
|
||||
conn = dbus_bus_get(DBUS_BUS_SESSION, &err);
|
||||
if (!conn)
|
||||
{
|
||||
minelog << "DBus error " << err.name << ": " << err.message;
|
||||
}
|
||||
dbus_bus_request_name(conn, "eth.miner", DBUS_NAME_FLAG_REPLACE_EXISTING, &err);
|
||||
if (dbus_error_is_set(&err))
|
||||
{
|
||||
minelog << "DBus error " << err.name << ": " << err.message;
|
||||
dbus_connection_close(conn);
|
||||
}
|
||||
minelog << "DBus initialized!";
|
||||
}
|
||||
|
||||
void send(const char* hash)
|
||||
{
|
||||
DBusMessage* msg;
|
||||
msg = dbus_message_new_signal("/eth/miner/hash", "eth.miner.monitor", "Hash");
|
||||
if (msg == nullptr)
|
||||
{
|
||||
minelog << "Message is null!";
|
||||
}
|
||||
dbus_message_append_args(msg, DBUS_TYPE_STRING, &hash, DBUS_TYPE_INVALID);
|
||||
if (!dbus_connection_send(conn, msg, nullptr))
|
||||
cerr << "Error sending message!";
|
||||
dbus_message_unref(msg);
|
||||
}
|
||||
|
||||
private:
|
||||
DBusError err;
|
||||
DBusConnection* conn;
|
||||
};
|
||||
1385
zano/progminer/main.cpp
Normal file
1385
zano/progminer/main.cpp
Normal file
File diff suppressed because it is too large
Load Diff
BIN
zano/progminer/progminer.ico
Normal file
BIN
zano/progminer/progminer.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 117 KiB |
1
zano/progminer/progminer.rc
Normal file
1
zano/progminer/progminer.rc
Normal file
@@ -0,0 +1 @@
|
||||
IDI_ICON1 ICON DISCARDABLE "progminer.ico"
|
||||
Reference in New Issue
Block a user