Author Topic: 250 PTS - BOUNTY - Import wallet.dat Private Keys via API call (2 PTS Referral)  (Read 20724 times)

0 Members and 1 Guest are viewing this topic.

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
Bitshares/CMakeLists.txt

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fc8870a..d3724e7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,8 +49,8 @@ ELSE(WIN32)
   add_subdirectory( vendor/leveldb-1.12.0 )
 
   MESSAGE(status "Compiling on UNIX")
-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wno-unused-local-typedefs -fmax-errors=3 -msse4.2" )
-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wno-unused-local-typedefs -fmax-errors=3 -msse4.2" )
+  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wno-unused-local-typedefs -fmax-errors=3" )
+  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wno-unused-local-typedefs -fmax-errors=3" )
   #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wno-unused-local-typedefs" )
   #SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wno-unused-local-typedefs" )
   SET(Boost_USE_STATIC_LIBS ON)


Almost... compiled.
Got 3 errors. Any idea on how to fix this?

Code: [Select]
compilation terminated due to -fmax-errors=3.
make[2]: ** [fc/CMakeFiles/fc.dir/src/crypto/city.cpp.o] Erro 1
make[1]: ** [fc/CMakeFiles/fc.dir/all] Erro 2
make: ** [all] Erro 2

Offline arcke

  • Full Member
  • ***
  • Posts: 115
    • View Profile
    • Diaspora
Almost... compiled.
Got 3 errors. Any idea on how to fix this?

Code: [Select]
compilation terminated due to -fmax-errors=3.
make[2]: ** [fc/CMakeFiles/fc.dir/src/crypto/city.cpp.o] Erro 1
make[1]: ** [fc/CMakeFiles/fc.dir/all] Erro 2
make: ** [all] Erro 2
Can you post the error. I believe GCC should have printed an error before what you post.

Edit: Can we try to keep this thread about new development, maybe you can ask questions about compiling in another thread or create a new one somewhere other than the bounty discussion.
« Last Edit: January 01, 2014, 08:55:44 pm by arcke »
OpenPGP: 0x22d7e9cc35375665
PTS - PawnbhoiXhmkrKJEPAsCiwkpP81nRXJGTD
Diaspora profile - https://pod.orkz.net/u/arcke

Offline pvaladares

  • Full Member
  • ***
  • Posts: 100
    • View Profile
Almost... compiled.
Got 3 errors. Any idea on how to fix this?

Code: [Select]
compilation terminated due to -fmax-errors=3.
make[2]: ** [fc/CMakeFiles/fc.dir/src/crypto/city.cpp.o] Erro 1
make[1]: ** [fc/CMakeFiles/fc.dir/all] Erro 2
make: ** [all] Erro 2
PTS : PkbJAm9uxuGgC9n2NVwWYs8bvX3Mj8uAg3 | MMC : M91vp33SSVBG7N3X9CbrgMcwSBxTDQeDAb
BTC : 1CrAkkYZrVCnwDKSBw3bcnMSYMakEhfB6N
Trade BTC/PTS @ cryptsy.com

Offline arcke

  • Full Member
  • ***
  • Posts: 115
    • View Profile
    • Diaspora

Ubuntu (I assume you're on 13.10) installs boost 1.53 by default, bitshares require 1.54. You can install it with apt-get or you can stay on 1.53 and just downgrade required boost version in CMakeList.txt and also remove boost_coroutine requirement from it. It compiles and runs fine with 1.53, I compiled and ran Keyhotee a few days ago.

Yes, I am running Ubuntu 13.10.

I tried to install Boost 1.55, with this sequence:
Code: [Select]
wget http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.bz2
tar --bzip2 -xf /path/to/boost_1_55_0.tar.bz2
cd boost_1_55_0/
./bootstrap.sh --prefix=/usr/local/
./b2 install
./bjam
sudo ./bjam install

The same error about 1.53 still appears.
Code: [Select]
CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1126 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.53.0

  Boost include path: /usr/include

  The following Boost libraries could not be found:

          boost_coroutine

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.
Call Stack (most recent call first):
  CMakeLists.txt:57 (FIND_PACKAGE)


-- Boost version: 1.53.0
-- Found the following Boost libraries:
--   thread
--   date_time
--   system
--   filesystem
--   program_options
--   signals
--   serialization
--   chrono
--   unit_test_framework
--   context
CMake Warning (dev) at CMakeLists.txt:87 (set):
  Cannot set "BOOST_LIBRARIES": current scope has no parent.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
[/quote]
Your prefix is /usr/local. Your boost include path is /usr/include. Try running cmake like this
Code: [Select]
cmake -DBoost_INCLUDE_DIR:PATH=/usr/local/include -DBoost_LIBRARY_DIR:PATH=/usr/local/lib .
Now it should find the boost libraries during compile.
OpenPGP: 0x22d7e9cc35375665
PTS - PawnbhoiXhmkrKJEPAsCiwkpP81nRXJGTD
Diaspora profile - https://pod.orkz.net/u/arcke

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
I think the --prefix flag doesn't work as you expect.

Just use apt-get, worked for others in this thread
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline pvaladares

  • Full Member
  • ***
  • Posts: 100
    • View Profile

Ubuntu (I assume you're on 13.10) installs boost 1.53 by default, bitshares require 1.54. You can install it with apt-get or you can stay on 1.53 and just downgrade required boost version in CMakeList.txt and also remove boost_coroutine requirement from it. It compiles and runs fine with 1.53, I compiled and ran Keyhotee a few days ago.
[/quote]

Yes, I am running Ubuntu 13.10.

I tried to install Boost 1.55, with this sequence:
Code: [Select]
wget http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.bz2
tar --bzip2 -xf /path/to/boost_1_55_0.tar.bz2
cd boost_1_55_0/
./bootstrap.sh --prefix=/usr/local/
./b2 install
./bjam
sudo ./bjam install

The same error about 1.53 still appears.
Code: [Select]
CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1126 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.53.0

  Boost include path: /usr/include

  The following Boost libraries could not be found:

          boost_coroutine

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.
Call Stack (most recent call first):
  CMakeLists.txt:57 (FIND_PACKAGE)


-- Boost version: 1.53.0
-- Found the following Boost libraries:
--   thread
--   date_time
--   system
--   filesystem
--   program_options
--   signals
--   serialization
--   chrono
--   unit_test_framework
--   context
CMake Warning (dev) at CMakeLists.txt:87 (set):
  Cannot set "BOOST_LIBRARIES": current scope has no parent.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
PTS : PkbJAm9uxuGgC9n2NVwWYs8bvX3Mj8uAg3 | MMC : M91vp33SSVBG7N3X9CbrgMcwSBxTDQeDAb
BTC : 1CrAkkYZrVCnwDKSBw3bcnMSYMakEhfB6N
Trade BTC/PTS @ cryptsy.com

Offline arcke

  • Full Member
  • ***
  • Posts: 115
    • View Profile
    • Diaspora
Yep of course, the idea was to just get it to work *at all* and the prune
If someone comes across specifications for bitcoin/protoshares wallet.dat-files this can help big time. Right now we have been using bitcoin and protoshares as reference implementations for importing wallets.
OpenPGP: 0x22d7e9cc35375665
PTS - PawnbhoiXhmkrKJEPAsCiwkpP81nRXJGTD
Diaspora profile - https://pod.orkz.net/u/arcke

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
Yep of course, the idea was to just get it to work *at all* and the prune
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline bytemaster

Status update: First we tried starting with CBitcoinSecret and pulling out as little as possible to make this work (I think we only need the stuff in fc::ecc and possibly in openssl), then we gave up and tried mass-importing everything from bitcoin it built with CBitcoinSecret but ran into build problems involving boost.

Some points of interest:

https://github.com/bitcoin/bitcoin/blob/086d7ec2b8c6ee352af820fe57908d43ec86f586/src/rpcdump.cpp#L159
https://github.com/bitcoin/bitcoin/blob/f76c122e2eac8ef66f69d142231bd33c88a24c50/src/key.cpp#L150

The repo (note, two branches trying top-down and bottom-up approaches):
https://github.com/nmushegian/BitShares

I would like to import as little code from Bitcoin as possible to minimize future maintenance and dependencies.  If there is more than one solution to this bounty, this will be a major factor in breaking the ties.
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
^^ that's no longer an issue, look at the most recent state in the repo. Would be awesome if anyone could build the base58.h-import branch.
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline enodata

  • Newbie
  • *
  • Posts: 6
    • View Profile
When I try to compile I get the boost error

Code: [Select]
CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1126 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.53.0

  Boost include path: /usr/include

  The following Boost libraries could not be found:

          boost_coroutine

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.
Call Stack (most recent call first):
  CMakeLists.txt:57 (FIND_PACKAGE)


-- Boost version: 1.53.0
-- Found the following Boost libraries:
--   thread
--   date_time
--   system
--   filesystem
--   program_options
--   signals
--   serialization
--   chrono
--   unit_test_framework
--   context
CMake Warning (dev) at CMakeLists.txt:87 (set):
  Cannot set "BOOST_LIBRARIES": current scope has no parent.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!

Is there any guide on how to properly install latest version?

Ubuntu (I assume you're on 13.10) installs boost 1.53 by default, bitshares require 1.54. You can install it with apt-get or you can stay on 1.53 and just downgrade required boost version in CMakeList.txt and also remove boost_coroutine requirement from it. It compiles and runs fine with 1.53, I compiled and ran Keyhotee a few days ago.
Bitmessage: BM-2cTrBQjawt5jrXutgZaXgy2kgsf5V44Rho

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
Status update: First we tried starting with CBitcoinSecret and pulling out as little as possible to make this work (I think we only need the stuff in fc::ecc and possibly in openssl), then we gave up and tried mass-importing everything from bitcoin it built with CBitcoinSecret but ran into build problems involving boost.

Some points of interest:

https://github.com/bitcoin/bitcoin/blob/086d7ec2b8c6ee352af820fe57908d43ec86f586/src/rpcdump.cpp#L159
https://github.com/bitcoin/bitcoin/blob/f76c122e2eac8ef66f69d142231bd33c88a24c50/src/key.cpp#L150

The repo (note, two branches trying top-down and bottom-up approaches):
https://github.com/nmushegian/BitShares
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
Want to sync up and work in my repo? I'm a bit ahead of you I think

gonna hop on IRC (#bitshares on freenode)
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline arcke

  • Full Member
  • ***
  • Posts: 115
    • View Profile
    • Diaspora
I have some code for reading the wallet. How do I execute the unit tests or a specific unit test?

Edit: Nevermind, I just run them directly.

Edit2: Working with code from https://github.com/bitcoin/bitcoin/blob/master/src/rpcdump.cpp#L131
« Last Edit: December 31, 2013, 12:00:40 am by arcke »
OpenPGP: 0x22d7e9cc35375665
PTS - PawnbhoiXhmkrKJEPAsCiwkpP81nRXJGTD
Diaspora profile - https://pod.orkz.net/u/arcke

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
sudo apt-get libboost-all-dev?

not sure, that's just what the first google search gives
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.