ragnaroek / mithril Goto Github PK
View Code? Open in Web Editor NEWPure Rust Monero Miner
License: GNU General Public License v3.0
Pure Rust Monero Miner
License: GNU General Public License v3.0
fi-0.0.1/src/lib.rs:2:1
|
2 | #![feature(libc)]
| ^^^^^^^^^^^^^^^^^
error[E0554]: #![feature] may not be used on the stable release channel
error: aborting due to previous error
For more information about this error, try rustc --explain E0554
.
error: aborting due to previous error
For more information about this error, try rustc --explain E0554
.
error: Could not compile skein-ffi
.
warning: build failed, waiting for other jobs to finish...
error: Could not compile jh-ffi
.
To learn more, run the command again with --verbose.
Hi Ragnaroek,
I've implemented the sse.rs
and most of the m128d and m128i for aarch64, unfortunately the Raspberry Pi 4B doesn't have the crypto extension.
Therefore I was unable to verify if the AESE instruction works, although it does compile when using RUSTFLAGS='-C target_feature=+aes'.
I was wondering what your preferred way of seperating the different architectures would be.
Currently, mithril uses a depricated function which is the Select in:
use std::sync::mpsc::{channel, Sender, Receiver, RecvTimeoutError, Select};
error[E0432]: unresolved import
std::sync::mpsc::Select--> src\metric\mod.rs:3:68 | 3 | use std::sync::mpsc::{channel, Sender, Receiver, RecvTimeoutError, Select}; | ^^^^^^ no
Selectin
sync::mpsc
Is there a plan of when this is going to be redone? I imagine it's quite a lot of work to redo it but I still feel like it should be pointed out that the usage of this Select function is not in the library anymore.
needs to be updated, currently I cannot work a lot on this
default_config.txt
talks about logging to a file. I was sure what would be logged, but since there isn't a way to see the hash rate, that it would output a hashrate. Now I'm seeing a log file that looks like:
1514864820053;4729
1514864880053;5055
1514864940053;5489
1514865000054;5349
1514865060054;5835
I see the first one is a timestamp, but what's the second number? It'd be great if the logging was better documented.
thread 'metric sample thread' panicked at 'overflow when adding duration to time', libcore\option.rs:989:5
note: Run with RUST_BACKTRACE=1
for a backtrace.
mithril won't start on Windows 10, throws this error
Hi, again i installed gcc but i think i'm still missing something
C:\Users\GasGeverij\Documents\Mining\mithril-master>cargo build --release
Compiling blake v2.0.0
Compiling jh-ffi v0.0.2
Compiling skein-ffi v0.0.1
Compiling thread_local v0.2.7
Compiling groestl v0.3.0
Compiling bandit v0.11.1
error: failed to run custom build command for jh-ffi v0.0.2
process didn't exit successfully: C:\Users\GasGeverij\Documents\Mining\mithril-master\target\release\build\jh-ffi-71c4f16816cc3dda\build-script-build
(exit code: 101)
--- stdout
TARGET = Some("x86_64-pc-windows-gnu")
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
TARGET = Some("x86_64-pc-windows-gnu")
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
CC_x86_64-pc-windows-gnu = None
CC_x86_64_pc_windows_gnu = None
HOST_CC = None
CC = None
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
CFLAGS_x86_64-pc-windows-gnu = None
CFLAGS_x86_64_pc_windows_gnu = None
HOST_CFLAGS = None
CFLAGS = None
DEBUG = Some("false")
running: "gcc.exe" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-Wall" "-Wextra" "-o" "C:\Users\GasGeverij\Documents\Mining\mithril-master\target\release\build\jh-ffi-93b7ffe38715e165\out\
ext/jh\c_jh.o" "-c" "ext/jh/c_jh.c"
cargo:warning=ext/jh/c_jh.c:1:0: sorry, unimplemented: 64-bit mode not compiled in
cargo:warning= /*This program gives the 64-bit optimized bitslice implementation of JH using ANSI C
cargo:warning=
exit code: 1
--- stderr
thread 'main' panicked at '
Internal error occurred: Command "gcc.exe" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-Wall" "-Wextra" "-o" "C:\Users\GasGeverij\Documents\Mining\mithril-master\target\release\build\jh-ffi
-93b7ffe38715e165\out\ext/jh\c_jh.o" "-c" "ext/jh/c_jh.c" with args "gcc.exe" did not execute successfully (status code exit code: 1).
', C:\Users\GasGeverij.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.54\src\lib.rs:1670:5
note: Run with RUST_BACKTRACE=1
for a backtrace.
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for skein-ffi v0.0.1
process didn't exit successfully: C:\Users\GasGeverij\Documents\Mining\mithril-master\target\release\build\skein-ffi-fb62bf4d353dbb57\build-script-build
(exit code: 101)
--- stdout
TARGET = Some("x86_64-pc-windows-gnu")
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
TARGET = Some("x86_64-pc-windows-gnu")
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
CC_x86_64-pc-windows-gnu = None
CC_x86_64_pc_windows_gnu = None
HOST_CC = None
CC = None
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
CFLAGS_x86_64-pc-windows-gnu = None
CFLAGS_x86_64_pc_windows_gnu = None
HOST_CFLAGS = None
CFLAGS = None
DEBUG = Some("false")
running: "gcc.exe" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-Wall" "-Wextra" "-o" "C:\Users\GasGeverij\Documents\Mining\mithril-master\target\release\build\skein-ffi-4397f3446073ef62\ou
t\ext/skein\c_skein.o" "-c" "ext/skein/c_skein.c"
cargo:warning=ext/skein/c_skein.c:1:0: sorry, unimplemented: 64-bit mode not compiled in
cargo:warning= /***********************************************************************
cargo:warning=
exit code: 1
--- stderr
thread 'main' panicked at '
Internal error occurred: Command "gcc.exe" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-Wall" "-Wextra" "-o" "C:\Users\GasGeverij\Documents\Mining\mithril-master\target\release\build\skein-
ffi-4397f3446073ef62\out\ext/skein\c_skein.o" "-c" "ext/skein/c_skein.c" with args "gcc.exe" did not execute successfully (status code exit code: 1).
', C:\Users\GasGeverij.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.54\src\lib.rs:1670:5
note: Run with RUST_BACKTRACE=1
for a backtrace.
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for blake v2.0.0
process didn't exit successfully: C:\Users\GasGeverij\Documents\Mining\mithril-master\target\release\build\blake-a6e7c5891afef641\build-script-build
(exit code: 101)
--- stdout
TARGET = Some("x86_64-pc-windows-gnu")
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
TARGET = Some("x86_64-pc-windows-gnu")
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
CC_x86_64-pc-windows-gnu = None
CC_x86_64_pc_windows_gnu = None
HOST_CC = None
CC = None
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
CFLAGS_x86_64-pc-windows-gnu = None
CFLAGS_x86_64_pc_windows_gnu = None
HOST_CFLAGS = None
CFLAGS = None
DEBUG = Some("false")
running: "gcc.exe" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-Wall" "-Wextra" "-o" "C:\Users\GasGeverij\Documents\Mining\mithril-master\target\release\build\blake-d7c992cdce3efa2c\out\e
xt/blake\blake_ref.o" "-c" "ext/blake/blake_ref.c"
cargo:warning=ext/blake/blake_ref.c:1:0: sorry, unimplemented: 64-bit mode not compiled in
cargo:warning= #include <string.h>
cargo:warning=
exit code: 1
--- stderr
thread 'main' panicked at '
Internal error occurred: Command "gcc.exe" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-Wall" "-Wextra" "-o" "C:\Users\GasGeverij\Documents\Mining\mithril-master\target\release\build\blake-
d7c992cdce3efa2c\out\ext/blake\blake_ref.o" "-c" "ext/blake/blake_ref.c" with args "gcc.exe" did not execute successfully (status code exit code: 1).
', C:\Users\GasGeverij.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.54\src\lib.rs:1670:5
note: Run with RUST_BACKTRACE=1
for a backtrace.
warning: build failed, waiting for other jobs to finish...
error: build failed
Hi @Ragnaroek,
I'm trying to understand your work_job function and what all the values mean (primarily nonce & the loops, as well as num_target). What information did you use to implement it? It's really difficult to find anything at all about this, since documentation for Stratum is basically non-existent.
Thanks!
Mithril sets group_par_is_source to true for IMULH_R & ISMULH_R and does not set can_reuses to true
mithril/src/randomx/superscalar.rs
Lines 303 to 323 in 104ee0f
This is different to the reference implementation:
Really excited that you're building a miner in Rust. I'm interested in helping test and develop. I'm currently just trying to build it and run it on my local machine on the CPU, but ran into a problem compiling as it appears this requires a nightly. It would be helpful to have this (and any other needs) documented in the README.
Mithril missed the v8 fork, that needs to be updated.
build failed with command: cargo build --release
on macos, the version of rust is:
$ rustup show *[master]
Default host: x86_64-apple-darwin
installed toolchains
--------------------
stable-x86_64-apple-darwin
nightly-x86_64-apple-darwin (default)
active toolchain
----------------
nightly-x86_64-apple-darwin (default)
rustc 1.25.0-nightly (ee220daca 2018-01-07)
Compiling config v0.8.0
Compiling bandit v0.11.1
Compiling mithril v0.7.0 (file:///Users/yuanlinfeng/Work/Monero/mithril)
error: 128-bit type is unstable (see issue #35118)
--> src/byte_string.rs:61:26
|
61 | pub fn u128_to_string(u: u128) -> String {
| ^^^^
|
= help: add #![feature(i128_type)] to the crate attributes to enable
error: 128-bit type is unstable (see issue #35118)
--> src/cryptonight/hash.rs:134:14
|
134 | let r0 = u128::from(a.0);
| ^^^^^^^^^^
|
= help: add #![feature(i128_type)] to the crate attributes to enable
error: 128-bit type is unstable (see issue #35118)
--> src/cryptonight/hash.rs:135:14
|
135 | let r1 = u128::from(b.0);
| ^^^^^^^^^^
|
= help: add #![feature(i128_type)] to the crate attributes to enable
error: 128-bit type is unstable (see issue #35118)
--> src/u64x2.rs:65:29
|
65 | pub fn to_u128(self) -> u128 {
| ^^^^
|
= help: add #![feature(i128_type)] to the crate attributes to enable
error: 128-bit type is unstable (see issue #35118)
--> src/u64x2.rs:66:21
|
66 | let mut r = u128::from(self.1);
| ^^^^^^^^^^
|
= help: add #![feature(i128_type)] to the crate attributes to enable
error: 128-bit type is unstable (see issue #35118)
--> src/u64x2.rs:68:14
|
68 | r |= u128::from(self.0);
| ^^^^^^^^^^
|
= help: add #![feature(i128_type)] to the crate attributes to enable
error: aborting due to 6 previous errors
error: Could not compile `mithril`.
To learn more, run the command again with --verbose.
Strangely i installed with rust-up the nighly but i see stable channel..any ideas why not compile?
Compiling skein-ffi v0.0.1
Compiling jh-ffi v0.0.2
Compiling serde_derive v1.0.27
Compiling env_logger v0.4.3
error[E0554]: #![feature] may not be used on the stable release channel
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/skein-ffi-0.0.1/src/lib.rs:2:1
|
2 | #![feature(libc)]
| ^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error[E0554]: #![feature] may not be used on the stable release channel
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/jh-ffi-0.0.2/src/lib.rs:2:1
|
2 | #![feature(libc)]
| ^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error: Could not compile jh-ffi
.
warning: build failed, waiting for other jobs to finish...
The following warnings were emitted during compilation:
warning: ext/skein/c_skein.c: In function ‘Skein_256_Final’:
warning: ext/skein/c_skein.c:1360:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
warning: ext/skein/c_skein.c: In function ‘Skein_512_Final’:
warning: ext/skein/c_skein.c:1560:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
warning: ext/skein/c_skein.c: In function ‘Skein1024_Final’:
warning: ext/skein/c_skein.c:1758:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
error: Could not compile skein-ffi
.
warning: build failed, waiting for other jobs to finish...
It'd be helpful to be able to specify in the config if the threads should be assigned to only some subset of cores, either explicitely pinning to cores A, B...N in tandem with the num_threads
option, or as predefined "slots" for the bandit optimisation.
For instance, if I have 8 cores available on a home machine, and I want to mine while keeping cores 1 & 2 free for day to day things.
Does that sound doable here or would that mean rewriting a lot of things?
Hi I have some questions regarding this project:
I heard there is an anonymous coin named mithril which is based on mimblewimble.
I found your lib and would be happy to contribute the Skein and JH hash.
The reason I'm looking into it is for a side-project which is closed source. Specifically compiling a Monero miner to WebAssembly (more stuff needs to change e.g. asm is not supported for the wasm target. I would prefer to use Rust, but the overall side-project project is closed source. Here is my question: Would you consider a different license or do you want keep GPL3?
Hi Ragnaroek,
I have implemented the JH hash function in rust, with the same method interface as the jh-ffi crate.
https://github.com/DaanA32/jh-rs
In the Mithril dir I copied the default_config.toml file and renamed it to config.toml. I also made the required changes to the config.toml file (e.g. address). I then run "cargo build --release" and navigate to /target/release and run the "mithril" executable. I get the following output:
thread 'main' panicked at 'called Result::unwrap()
on an Err
value: config file not found', libcore/result.rs:945:5
note: Run with RUST_BACKTRACE=1
for a backtrace.
Hi @Ragnaroek! I was testing mithril today with x86_64-pc-windows-gnu/x86_64-pc-windows-gnu toolchains , and it seems its way too (~50 times) slower than xmrig on RandomX; maybe I'm doing something wrong? :) My expectation was that its 2-3 times slower than xmrig
Hi I have a question, am I able to use this as a crate and use all the high level cryptomining features? That way I can integrate it into my Rust GUI Software which can then allow the user to control the options with a GUI interface?
mithril-master>cargo build --release
Updating registry https://github.com/rust-lang/crates.io-index
Downloading serde_derive v1.0.27
Downloading blake v2.0.0
Downloading env_logger v0.4.3
Downloading config v0.7.1
Downloading skein-ffi v0.0.1
Downloading jh-ffi v0.0.2
Downloading bandit v0.11.1
Downloading groestl v0.3.0
Downloading syn v0.11.11
Downloading quote v0.3.15
Downloading serde_derive_internals v0.19.0
Downloading unicode-xid v0.0.4
Downloading synom v0.11.3
Downloading gcc v0.3.54
Downloading serde-hjson v0.8.1
Downloading yaml-rust v0.3.5
Downloading nom v3.2.1
Downloading toml v0.4.5
Downloading serde v0.8.23
Downloading regex v0.1.80
Downloading linked-hash-map v0.3.0
Downloading num-traits v0.1.43
Downloading aho-corasick v0.5.3
Downloading thread_local v0.2.7
Downloading utf8-ranges v0.1.3
Downloading regex-syntax v0.3.9
Downloading memchr v0.1.11
Downloading thread-id v2.0.0
Downloading serde_test v0.8.23
Downloading memchr v1.0.2
Downloading block-buffer v0.2.0
Downloading generic-array v0.8.3
Downloading byte-tools v0.2.0
Downloading digest v0.6.2
Downloading typenum v1.9.0
Downloading winapi-x86_64-pc-windows-gnu v0.4.0
Compiling winapi-build v0.1.1
Compiling winapi v0.2.8
Compiling winapi-x86_64-pc-windows-gnu v0.4.0
Compiling libc v0.2.39
Compiling unicode-xid v0.0.4
Compiling typenum v1.9.0
Compiling void v1.0.2
Compiling winapi v0.3.4
Compiling serde v0.8.23
Compiling quote v0.3.15
Compiling nodrop v0.1.12
Compiling gcc v0.3.54
Compiling lazy_static v1.0.0
Compiling utf8-ranges v0.1.3
Compiling num-traits v0.2.1
Compiling ucd-util v0.1.1
Compiling regex-syntax v0.3.9
Compiling cfg-if v0.1.2
Compiling serde v1.0.27
Compiling byte-tools v0.2.0
Compiling lazy_static v0.2.11
Compiling dtoa v0.4.2
Compiling utf8-ranges v1.0.0
Compiling itoa v0.3.4
Compiling yaml-rust v0.3.5
Compiling unreachable v1.0.0
Compiling memchr v0.1.11
Compiling memchr v2.0.1
Compiling memchr v1.0.2
Compiling num_cpus v1.8.0
Compiling synom v0.11.3
Compiling kernel32-sys v0.2.2
Compiling regex-syntax v0.5.0
Compiling log v0.4.1
Compiling num-traits v0.1.43
Compiling blake v2.0.0
Compiling jh-ffi v0.0.2
Compiling skein-ffi v0.0.1
Compiling thread_local v0.3.5
Compiling serde_test v0.8.23
Compiling aho-corasick v0.5.3
Compiling nom v3.2.1
Compiling aho-corasick v0.6.4
Compiling syn v0.11.11
Compiling log v0.3.9
error: failed to run custom build command for blake v2.0.0
process didn't exit successfully: C:\Users\GasGeverij\Documents\Mining\mithril-master\target\release\build\blake-a6e7c5891afef641\build-scr ipt-build
(exit code: 101)
--- stdout
TARGET = Some("x86_64-pc-windows-gnu")
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
TARGET = Some("x86_64-pc-windows-gnu")
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
CC_x86_64-pc-windows-gnu = None
CC_x86_64_pc_windows_gnu = None
HOST_CC = None
CC = None
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
CFLAGS_x86_64-pc-windows-gnu = None
CFLAGS_x86_64_pc_windows_gnu = None
HOST_CFLAGS = None
CFLAGS = None
DEBUG = Some("false")
running: "gcc.exe" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-Wall" "-Wextra" "-o" "C:\Users\GasGeverij\Documents\Mining\mit
hril-master\target\release\build\blake-d7c992cdce3efa2c\out\ext/blake\blake_ref.o" "-c" "ext/blake/blake_ref.c"
--- stderr
thread 'main' panicked at '
Internal error occurred: Failed to find tool. Is gcc.exe
installed? (see https://github.com/alexcrichton/gcc-rs#compile-time-requirements f
or help)
', C:\Users\GasGeverij.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.54\src\lib.rs:1670:5
note: Run with RUST_BACKTRACE=1
for a backtrace.
warning: build failed, waiting for other jobs to finish...
error: build failed
rustc --version
rustc 1.26.0-nightly (75af15ee6 2018-03-20)
Is there going to be a pure/Rust-only (no embedded assembly) option for AES?
This is currently handled very poorly by stopping the whole miner.
If connection is lost, reconnect should be tried.
It would be most helpful if the hashrate was output at regular intervals. I'm not certain how you ran your hashing tests and got a number, but it'd be useful if one could be output by this tool, even if it was only exposed when setting RUST_LOG=mithril=info
sample_config.toml
to config.toml
and modifyRUST_LOG=mithril=debug rustup run nightly cargo run
Can any one send the command for Linux
C:\Users\server\Downloads\mithril-master\mithril-master\target\release>mithril.exe
thread 'main' panicked at 'called Result::unwrap()
on an Err
value: config file not found', src\libcore\result.rs:916:5
note: Run with RUST_BACKTRACE=1
for a backtrace.
config.toml is in the directory
I tried compiling this for aarch64-unknown-android cause I was just curious how well it'd run on my phone, and it failed. I then looked through the readme and didn't see a list of approved platforms. It would be helpful if a list was added. And even better if those platforms were tested in CI so they can be reliably guaranteed to at least compile.
Hello, I wonder is it possible to split your project into different modules, so that we can reuse more code.
I wanna adder SHA256d, X11 etc algorithms.
And also as for the algorithm backend, I also wanna implement some protocol and use it for ASIC miner.
This crate does not define a rust edition and uses older syntax. Is there a reason for this or it is not important?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.