Main Menu

Standalone miner

Started by alexxy, December 21, 2013, 01:36:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

FreeTrade

Oh dear. I think I'm going to give up on this. Thanks for your assistance, but I think we're still too far off.

Instead I'm going to work on embedding a pool-compatible miner in the main distribution.
"People should be more sophisticated? How are you gonna get that done?" - Jerry Seinfeld reply to Bill Maher

radiumsoup

[ 57%] Building CXX object CMakeFiles/pool_miner.dir/pool_miner.cpp.o
/memcoin/memorycoin_miner/pool_miner.cpp: In function void start_work(const stcp_socket_ptr&, work_message, int):
/memcoin/memorycoin_miner/pool_miner.cpp:39:54: error: momentum_search was not declared in this scope
       auto pairs = momentum_search( mid,scratchpad,8 );
                                                      ^
/memcoin/memorycoin_miner/pool_miner.cpp:39:54: note: suggested alternative:
In file included from /memcoin/memorycoin_miner/pool_miner.cpp:6:0:
/memcoin/memorycoin_miner/momentum.h:5:46: note:   mc::momentum_search
  std::vector< std::pair<uint32_t,uint32_t> > momentum_search( uint256 midHash, char* scratchpad, int totalThreads );
                                              ^
/memcoin/memorycoin_miner/pool_miner.cpp:51:88: error: no matching function for call to std::basic_string<char>::basic_string(uint256&)
                 std::cout<<std::string(fc::time_point::now())<< " "<<std::string(result)<<"\n";
                                                                                        ^
/memcoin/memorycoin_miner/pool_miner.cpp:51:88: note: candidates are:
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/stdexcept:39,
                 from /usr/include/boost/asio/io_service.hpp:20,
                 from /usr/include/boost/asio/basic_io_object.hpp:19,
                 from /usr/include/boost/asio/basic_socket.hpp:20,
                 from /usr/include/boost/asio/basic_datagram_socket.hpp:20,
                 from /usr/include/boost/asio.hpp:21,
                 from /memcoin/memorycoin_miner/bitcoin.hpp:3,
                 from /memcoin/memorycoin_miner/pool_miner.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:532:9: note: template<class _InputIterator> std::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&)
         basic_string(_InputIterator __beg, _InputIterator __end,
         ^
/usr/include/c++/4.8/bits/basic_string.h:532:9: note:   template argument deduction/substitution failed:
/memcoin/memorycoin_miner/pool_miner.cpp:51:88: note:   candidate expects 3 arguments, 1 provided
                 std::cout<<std::string(fc::time_point::now())<< " "<<std::string(result)<<"\n";
                                                                                        ^
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/stdexcept:39,
                 from /usr/include/boost/asio/io_service.hpp:20,
                 from /usr/include/boost/asio/basic_io_object.hpp:19,
                 from /usr/include/boost/asio/basic_socket.hpp:20,
                 from /usr/include/boost/asio/basic_datagram_socket.hpp:20,
                 from /usr/include/boost/asio.hpp:21,
                 from /memcoin/memorycoin_miner/bitcoin.hpp:3,
                 from /memcoin/memorycoin_miner/pool_miner.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:522:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc());
       ^
/usr/include/c++/4.8/bits/basic_string.h:522:7: note:   no known conversion for argument 1 from uint256 to std::initializer_list<char>
/usr/include/c++/4.8/bits/basic_string.h:507:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       basic_string(basic_string&& __str) noexcept
       ^
/usr/include/c++/4.8/bits/basic_string.h:507:7: note:   no known conversion for argument 1 from uint256 to std::basic_string<char>&&
/usr/include/c++/4.8/bits/basic_string.h:497:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::basic_string<_CharT, _Traits, _Alloc>::size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
       basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc());
       ^
/usr/include/c++/4.8/bits/basic_string.h:497:7: note:   candidate expects 3 arguments, 1 provided
/usr/include/c++/4.8/bits/basic_string.h:490:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       basic_string(const _CharT* __s, const _Alloc& __a = _Alloc());
       ^
/usr/include/c++/4.8/bits/basic_string.h:490:7: note:   no known conversion for argument 1 from uint256 to const char*
/usr/include/c++/4.8/bits/basic_string.h:483:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
       basic_string(const _CharT* __s, size_type __n,
       ^
/usr/include/c++/4.8/bits/basic_string.h:483:7: note:   candidate expects 3 arguments, 1 provided
/usr/include/c++/4.8/bits/basic_string.h:471:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&, std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
       basic_string(const basic_string& __str, size_type __pos,
       ^
/usr/include/c++/4.8/bits/basic_string.h:471:7: note:   candidate expects 4 arguments, 1 provided
/usr/include/c++/4.8/bits/basic_string.h:462:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&, std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
       basic_string(const basic_string& __str, size_type __pos,
       ^
/usr/include/c++/4.8/bits/basic_string.h:462:7: note:   candidate expects 3 arguments, 1 provided
/usr/include/c++/4.8/bits/basic_string.h:455:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       basic_string(const basic_string& __str);
       ^
/usr/include/c++/4.8/bits/basic_string.h:455:7: note:   no known conversion for argument 1 from uint256 to const std::basic_string<char>&
/usr/include/c++/4.8/bits/basic_string.h:448:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       basic_string(const _Alloc& __a);
       ^
/usr/include/c++/4.8/bits/basic_string.h:448:7: note:   no known conversion for argument 1 from uint256 to const std::allocator<char>&
/usr/include/c++/4.8/bits/basic_string.h:437:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       basic_string()
       ^
/usr/include/c++/4.8/bits/basic_string.h:437:7: note:   candidate expects 0 arguments, 1 provided
make[2]: *** [CMakeFiles/pool_miner.dir/pool_miner.cpp.o] Error 1
make[1]: *** [CMakeFiles/pool_miner.dir/all] Error 2
make: *** [all] Error 2

FreeTrade

Thanks - hopefully down to the last few errors now - uploaded the changes.
"People should be more sophisticated? How are you gonna get that done?" - Jerry Seinfeld reply to Bill Maher

radiumsoup

Quote from: FreeTrade on December 24, 2013, 10:54:48 AM
Oops - I put those headers in the wrong file.

Changed now - let's give it another whirl.
Much farther now...
-------------------
[ 57%] Building CXX object CMakeFiles/pool_miner.dir/pool_miner.cpp.o
/memcoin/memorycoin_miner/pool_miner.cpp:6:24: fatal error: momentum.hpp: No such file or directory
#include "momentum.hpp"
                        ^
compilation terminated.
make[2]: *** [CMakeFiles/pool_miner.dir/pool_miner.cpp.o] Error 1
make[1]: *** [CMakeFiles/pool_miner.dir/all] Error 2
make: *** [all] Error 2
-------------------
(yes, momentum.hpp is gone - but momentum.h is there; anticipating a rename, I tried copying [not moving] momentum.h to momentum.hpp, which gives the following)
-------------------
[ 57%] Building CXX object CMakeFiles/pool_miner.dir/pool_miner.cpp.o
/memcoin/memorycoin_miner/pool_miner.cpp: In function void start_work(const stcp_socket_ptr&, work_message, int):
/memcoin/memorycoin_miner/pool_miner.cpp:36:41: error: momentum_search was not declared in this scope
       auto pairs = momentum_search( mid );
                                         ^
/memcoin/memorycoin_miner/pool_miner.cpp:36:41: note: suggested alternative:
In file included from /root/memorycoin_miner/pool_miner.cpp:6:0:
/memcoin/memorycoin_miner/momentum.hpp:4:46: note:   mc::momentum_search
  std::vector< std::pair<uint32_t,uint32_t> > momentum_search( uint256 midHash, char* scratchpad, int totalThreads );
                                              ^
/memcoin/memorycoin_miner/pool_miner.cpp: In function int main(int, char**):
/memcoin/memorycoin_miner/pool_miner.cpp:73:51: error: momentum_search was not declared in this scope
               auto pairs = momentum_search( base  );
                                                   ^
/memcoin/memorycoin_miner/pool_miner.cpp:73:51: note: suggested alternative:
In file included from /root/memorycoin_miner/pool_miner.cpp:6:0:
/memcoin/memorycoin_miner/momentum.hpp:4:46: note:   mc::momentum_search
  std::vector< std::pair<uint32_t,uint32_t> > momentum_search( uint256 midHash, char* scratchpad, int totalThreads );
                                              ^
make[2]: *** [CMakeFiles/pool_miner.dir/pool_miner.cpp.o] Error 1
make[1]: *** [CMakeFiles/pool_miner.dir/all] Error 2
make: *** [all] Error 2
-------------------

FreeTrade

Oops - I put those headers in the wrong file.

Changed now - let's give it another whirl.
"People should be more sophisticated? How are you gonna get that done?" - Jerry Seinfeld reply to Bill Maher

balthazr

Quote from: radiumsoup on December 24, 2013, 03:18:45 AM
yeah, I know C about as well as I know Hindi. Which is to say, I do not know it at all but the characters look like something I might have seen on TV once.

For me, I need someone to very explicitly say what needs to be done. I mean, I know what an include is, but I do not understand how C works well enough to determine EXACTLY what needs to be included. :\

I know you're trying to be helpful, but it's quite simply not enough to help me, unfortunately.

so do i, i'm only familiar with windows + visual studio + c#  8)
just trying to get the source and try make build on ubuntu server to see how it going

//btw, just got another block ;D

radiumsoup

yeah, I know C about as well as I know Hindi. Which is to say, I do not know it at all but the characters look like something I might have seen on TV once.

For me, I need someone to very explicitly say what needs to be done. I mean, I know what an include is, but I do not understand how C works well enough to determine EXACTLY what needs to be included. :\

I know you're trying to be helpful, but it's quite simply not enough to help me, unfortunately.

balthazr

momemtum.hpp is missing, only momentum.h is exist, which one i can use?

// just pass the "this_thread" not declare by adding some includes in top of momentum.cpp

radiumsoup

sorry for the length of the interval, I had a client that needed attending to.

I cannot seem to get -fmax-errors to work; it treats "-f" as the flag to specify a makefile. I know very little about compiling with gcc other than copying and pasting instructions, so I don't know how to look any further into this.

I still get the same first two errors; I verified by hand that getwork_miner.cpp added the 3 include lines and that line 190 in momentum.cpp is commented out (those are the two changes in git). The third error is different.
-----------
[ 31%] Building CXX object CMakeFiles/gw_miner.dir/momentum.cpp.o
/memcoin/memorycoin_miner/momentum.cpp: In function void mc::MilliSleep(int64):
/memcoin/memorycoin_miner/momentum.cpp:21:12: error: boost::this_thread has not been declared
     boost::this_thread::sleep(boost::posix_time::milliseconds(n));
            ^
/memcoin/memorycoin_miner/momentum.cpp:21:38: error: boost::posix_time has not been declared
     boost::this_thread::sleep(boost::posix_time::milliseconds(n));
                                      ^
/memcoin/memorycoin_miner/momentum.cpp: In function void mc::aesSearch(char*, int, int, char*, std::vector<std::pair<unsigned int, unsigned int> >*):
/memcoin/memorycoin_miner/momentum.cpp:89:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(uint32_t k=startLoc;k<startLoc+searchNumber;k++){
                                      ^
/memcoin/memorycoin_miner/momentum.cpp: In function std::vector<std::pair<unsigned int, unsigned int> > mc::momentum_search(uint256, char*, int):
/memcoin/memorycoin_miner/momentum.cpp:198:3: error: thread_group is not a member of boost
   boost::thread_group* sha512Threads = new boost::thread_group();
   ^
compilation terminated due to -fmax-errors=3.
make[2]: *** [CMakeFiles/gw_miner.dir/momentum.cpp.o] Error 1
make[1]: *** [CMakeFiles/gw_miner.dir/all] Error 2
make: *** [all] Error 2

FreeTrade

ok - more fixes checked in.

Also if you can set this to a higher number, we might more errors to fix.

-fmax-errors=3
"People should be more sophisticated? How are you gonna get that done?" - Jerry Seinfeld reply to Bill Maher

radiumsoup

(using libboost1.54-all-dev, for the record)
-----------------------
[ 31%] Building CXX object CMakeFiles/gw_miner.dir/momentum.cpp.o
/memcoin/memorycoin_miner/momentum.cpp: In function void mc::MilliSleep(int64):
/memcoin/memorycoin_miner/momentum.cpp:21:12: error: boost::this_thread has not been declared
     boost::this_thread::sleep(boost::posix_time::milliseconds(n));
            ^
/memcoin/memorycoin_miner/momentum.cpp:21:38: error: boost::posix_time has not been declared
     boost::this_thread::sleep(boost::posix_time::milliseconds(n));
                                      ^
/memcoin/memorycoin_miner/momentum.cpp: In function void mc::aesSearch(char*, int, int, char*, std::vector<std::pair<unsigned int, unsigned int> >*):
/memcoin/memorycoin_miner/momentum.cpp:89:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(uint32_t k=startLoc;k<startLoc+searchNumber;k++){
                                      ^
/memcoin/memorycoin_miner/momentum.cpp: In function std::vector<std::pair<unsigned int, unsigned int> > mc::momentum_search(uint256, char*, int):
/memcoin/memorycoin_miner/momentum.cpp:190:3: error: CBlockIndex was not declared in this scope
   CBlockIndex* pindexPrev = pindexBest;
   ^
compilation terminated due to -fmax-errors=3.
make[2]: *** [CMakeFiles/gw_miner.dir/momentum.cpp.o] Error 1
make[1]: *** [CMakeFiles/gw_miner.dir/all] Error 2
make: *** [all] Error 2

FreeTrade

Okay - new code updated - removed some fc refs.
"People should be more sophisticated? How are you gonna get that done?" - Jerry Seinfeld reply to Bill Maher

radiumsoup

Quote from: FreeTrade on December 23, 2013, 05:35:27 PM
Hmm - try clearing out your build folder, and check the momentum.h file that you've got to ensure bignum.h line is changed.
my bad, I must have missed a step somewhere.

new errors, starting from scratch:
------------------------
Scanning dependencies of target gw_miner
[ 30%] Building CXX object CMakeFiles/gw_miner.dir/getwork_miner.cpp.o
/memcoin/memorycoin_miner/getwork_miner.cpp:8:1: error: sha256 in namespace fc does not name a type
fc::sha256 Hash( char* b, size_t len )
^
/memcoin/memorycoin_miner/getwork_miner.cpp: In function int main(int, char**):
/memcoin/memorycoin_miner/getwork_miner.cpp:58:7: error: sha256 is not a member of fc
       fc::sha256 best;
       ^
/memcoin/memorycoin_miner/getwork_miner.cpp:58:18: error: expected ; before best
       fc::sha256 best;
                  ^
compilation terminated due to -fmax-errors=3.
make[2]: *** [CMakeFiles/gw_miner.dir/getwork_miner.cpp.o] Error 1
make[1]: *** [CMakeFiles/gw_miner.dir/all] Error 2
make: *** [all] Error 2

balthazr

getting error when build on ubuntu 13, can anyone help :-\
i also tried guide here http://particlephysicsandcode.wordpress.com/2013/03/11/installing-boost-1-52-ubuntu-12-04-fedora/ to install boost 1.54,  it run succeed.

QuoteBoost version: 1.53.0

  Boost include path: /usr/include

  Detected version of Boost is too old.  Requested version was 1.54 (or
  newer).
Call Stack (most recent call first):
  CMakeLists.txt:31 (FIND_PACKAGE)

FreeTrade

Hmm - try clearing out your build folder, and check the momentum.h file that you've got to ensure bignum.h line is changed.
"People should be more sophisticated? How are you gonna get that done?" - Jerry Seinfeld reply to Bill Maher