diff --git a/compile-db.sh b/compile-db.sh new file mode 100755 index 0000000..4919652 --- /dev/null +++ b/compile-db.sh @@ -0,0 +1,29 @@ +#!/bin/sh +BITCOIN_ROOT=$(pwd) + +# Pick some path to install BDB to, here we create a directory within the bitcoin directory +BDB_PREFIX="${BITCOIN_ROOT}/db4" +mkdir -p $BDB_PREFIX + +if [ ! -d "db-4.8.30.NC" ]; then + # Fetch the source and verify that it is not tampered with + wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz' + echo '12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz' | sha256sum -c + # -> db-4.8.30.NC.tar.gz: OK + tar -xzvf db-4.8.30.NC.tar.gz + + # Build the library and install to our prefix + cd db-4.8.30.NC/build_unix/ + # Note: Do a static build so that it can be embedded into the exectuable, instead of having to find a .so at runtime + ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$BDB_PREFIX + make install + cd $BITCOIN_ROOT +fi + +# Configure Bitcoin Core to use our own-built instance of BDB +./configure LDFLAGS="-L${BDB_PREFIX}/lib/" CPPFLAGS="-I${BDB_PREFIX}/include/" + +make +strip src/cnote-cli +strip src/cnoted +strip src/qt/cnote-qt diff --git a/configure.ac b/configure.ac index b0952fc..9c47aac 100644 --- a/configure.ac +++ b/configure.ac @@ -1,9 +1,9 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N) AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 2) -define(_CLIENT_VERSION_MINOR, 0) +define(_CLIENT_VERSION_MINOR, 1) define(_CLIENT_VERSION_REVISION, 0) -define(_CLIENT_VERSION_BUILD, 0) +define(_CLIENT_VERSION_BUILD, 3) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2017) AC_INIT([C-Note],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@fastbit.com],[c-note]) @@ -603,7 +603,7 @@ else AC_MSG_RESULT($use_upnp_default) AC_DEFINE_UNQUOTED([USE_UPNP],[$upnp_setting],[UPnP support not compiled if undefined, otherwise value (0 or 1) determines default state]) if test x$TARGET_OS = xwindows; then - CPPFLAGS="$CPPFLAGS -DSTATICLIB" + CPPFLAGS="$CPPFLAGS -DMINIUPNP_STATICLIB" fi else AC_MSG_RESULT(no) diff --git a/contrib/bitcoin-qt.pro b/contrib/bitcoin-qt.pro index 3a72d10..0600eed 100644 --- a/contrib/bitcoin-qt.pro +++ b/contrib/bitcoin-qt.pro @@ -1,21 +1,421 @@ -FORMS += \ - ../src/qt/forms/aboutdialog.ui \ - ../src/qt/forms/addressbookpage.ui \ - ../src/qt/forms/askpassphrasedialog.ui \ - ../src/qt/forms/coincontroldialog.ui \ - ../src/qt/forms/editaddressdialog.ui \ - ../src/qt/forms/helpmessagedialog.ui \ - ../src/qt/forms/intro.ui \ - ../src/qt/forms/openuridialog.ui \ - ../src/qt/forms/optionsdialog.ui \ - ../src/qt/forms/overviewpage.ui \ - ../src/qt/forms/receivecoinsdialog.ui \ - ../src/qt/forms/receiverequestdialog.ui \ - ../src/qt/forms/rpcconsole.ui \ - ../src/qt/forms/sendcoinsdialog.ui \ - ../src/qt/forms/sendcoinsentry.ui \ - ../src/qt/forms/signverifymessagedialog.ui \ - ../src/qt/forms/transactiondescdialog.ui \ +TEMPLATE = app +TARGET = cnote-qt +VERSION = 2.0.0.0 +INCLUDEPATH += src src/json src/qt +QT += network +DEFINES += ENABLE_WALLET +DEFINES += BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE +CONFIG += no_include_pwd +CONFIG += thread + +greaterThan(QT_MAJOR_VERSION, 4) { + QT += widgets + DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 +} + +# for boost 1.37, add -mt to the boost libraries +# use: qmake BOOST_LIB_SUFFIX=-mt +# for boost thread win32 with _win32 sufix +# use: BOOST_THREAD_LIB_SUFFIX=_win32-... +# or when linking against a specific BerkelyDB version: BDB_LIB_SUFFIX=-4.8 + +# Dependency library locations can be customized with: +# BOOST_INCLUDE_PATH, BOOST_LIB_PATH, BDB_INCLUDE_PATH, +# BDB_LIB_PATH, OPENSSL_INCLUDE_PATH and OPENSSL_LIB_PATH respectively + +OBJECTS_DIR = build +MOC_DIR = build +UI_DIR = build + +# use: qmake "RELEASE=1" +contains(RELEASE, 1) { + # Mac: compile for maximum compatibility (10.5, 32-bit) + macx:QMAKE_CXXFLAGS += -mmacosx-version-min=10.5 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk + + !windows:!macx { + # Linux: static link + LIBS += -Wl,-Bstatic + } +} + +!win32 { +# for extra security against potential buffer overflows: enable GCCs Stack Smashing Protection +QMAKE_CXXFLAGS *= -fstack-protector-all --param ssp-buffer-size=1 +QMAKE_LFLAGS *= -fstack-protector-all --param ssp-buffer-size=1 +# We need to exclude this for Windows cross compile with MinGW 4.2.x, as it will result in a non-working executable! +# This can be enabled for Windows, when we switch to MinGW >= 4.4.x. +} +# for extra security on Windows: enable ASLR and DEP via GCC linker flags +win32:QMAKE_LFLAGS *= -Wl,--dynamicbase -Wl,--nxcompat +win32:QMAKE_LFLAGS += -static-libgcc -static-libstdc++ + +# use: qmake "USE_QRCODE=1" +# libqrencode (http://fukuchi.org/works/qrencode/index.en.html) must be installed for support +contains(USE_QRCODE, 1) { + message(Building with QRCode support) + DEFINES += USE_QRCODE + LIBS += -lqrencode +} + +# use: qmake "USE_UPNP=1" ( enabled by default; default) +# or: qmake "USE_UPNP=0" (disabled by default) +# or: qmake "USE_UPNP=-" (not supported) +# miniupnpc (http://miniupnp.free.fr/files/) must be installed for support +contains(USE_UPNP, -) { + message(Building without UPNP support) +} else { + message(Building with UPNP support) + count(USE_UPNP, 0) { + USE_UPNP=1 + } + DEFINES += USE_UPNP=$$USE_UPNP MINIUPNP_STATICLIB STATICLIB + INCLUDEPATH += $$MINIUPNPC_INCLUDE_PATH + LIBS += $$join(MINIUPNPC_LIB_PATH,,-L,) -lminiupnpc + win32:LIBS += -liphlpapi +} + +# use: qmake "USE_DBUS=1" or qmake "USE_DBUS=0" +linux:count(USE_DBUS, 0) { + USE_DBUS=1 +} +contains(USE_DBUS, 1) { + message(Building with DBUS (Freedesktop notifications) support) + DEFINES += USE_DBUS + QT += dbus +} + +contains(BITCOIN_NEED_QT_PLUGINS, 1) { + DEFINES += BITCOIN_NEED_QT_PLUGINS + QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets +} + +INCLUDEPATH += src/leveldb/include src/leveldb/helpers +LIBS += $$PWD/src/leveldb/libleveldb.a $$PWD/src/leveldb/libmemenv.a +# SOURCES += src/txdb-leveldb.cpp +SOURCES += src/leveldbwrapper.cpp +!win32 { + # we use QMAKE_CXXFLAGS_RELEASE even without RELEASE=1 because we use RELEASE to indicate linking preferences not -O preferences + genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a +} else { + # make an educated guess about what the ranlib command is called + isEmpty(QMAKE_RANLIB) { + QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib) + } + LIBS += -lshlwapi + genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a +} +genleveldb.target = $$PWD/src/leveldb/libleveldb.a +genleveldb.depends = FORCE +PRE_TARGETDEPS += $$PWD/src/leveldb/libleveldb.a +QMAKE_EXTRA_TARGETS += genleveldb +# Gross ugly hack that depends on qmake internals, unfortunately there is no other way to do it. +QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb ; $(MAKE) clean + +# regenerate src/build.h +!windows|contains(USE_BUILD_INFO, 1) { + genbuild.depends = FORCE + genbuild.commands = cd $$PWD; /bin/sh share/genbuild.sh $$OUT_PWD/build/build.h + genbuild.target = $$OUT_PWD/build/build.h + PRE_TARGETDEPS += $$OUT_PWD/build/build.h + QMAKE_EXTRA_TARGETS += genbuild + DEFINES += HAVE_BUILD_INFO +} + +contains(USE_O3, 1) { + message(Building O3 optimization flag) + QMAKE_CXXFLAGS_RELEASE -= -O2 + QMAKE_CFLAGS_RELEASE -= -O2 + QMAKE_CXXFLAGS += -O3 + QMAKE_CFLAGS += -O3 +} + +*-g++-32 { + message("32 platform, adding -msse2 flag") + + QMAKE_CXXFLAGS += -msse2 + QMAKE_CFLAGS += -msse2 +} + +QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wextra -Wno-ignored-qualifiers -Wformat -Wformat-security -Wno-unused-parameter -Wstack-protector + +# Input +DEPENDPATH += src src/json src/qt +HEADERS += \ + src/qt/bitcoingui.h \ + src/qt/transactiontablemodel.h \ + src/qt/addresstablemodel.h \ + src/qt/optionsdialog.h \ + src/qt/coincontroldialog.h \ + src/qt/coincontroltreewidget.h \ + src/qt/sendcoinsdialog.h \ + src/qt/addressbookpage.h \ + src/qt/signverifymessagedialog.h \ + src/qt/editaddressdialog.h \ + src/qt/bitcoinaddressvalidator.h \ + src/alert.h \ + src/addrman.h \ + src/base58.h \ + src/bignum.h \ + src/chainparams.h \ + src/checkpoints.h \ + src/compat.h \ + src/coincontrol.h \ + src/sync.h \ + src/util.h \ + src/hash.h \ + src/uint256.h \ + src/serialize.h \ + src/core.h \ + src/main.h \ + src/miner.h \ + src/net.h \ + src/key.h \ + src/db.h \ + src/txdb.h \ + src/txmempool.h \ + src/walletdb.h \ + src/script.h \ + src/init.h \ + src/mruset.h \ + src/json/json_spirit_writer_template.h \ + src/json/json_spirit_writer.h \ + src/json/json_spirit_value.h \ + src/json/json_spirit_utils.h \ + src/json/json_spirit_stream_reader.h \ + src/json/json_spirit_reader_template.h \ + src/json/json_spirit_reader.h \ + src/json/json_spirit_error_position.h \ + src/json/json_spirit.h \ + src/qt/clientmodel.h \ + src/qt/guiutil.h \ + src/qt/transactionrecord.h \ + src/qt/guiconstants.h \ + src/qt/optionsmodel.h \ + src/qt/monitoreddatamapper.h \ + src/qt/trafficgraphwidget.h \ + src/qt/transactiondesc.h \ + src/qt/transactiondescdialog.h \ + src/qt/bitcoinamountfield.h \ + src/wallet.h \ + src/keystore.h \ + src/qt/transactionfilterproxy.h \ + src/qt/transactionview.h \ + src/qt/walletmodel.h \ + src/rpcclient.h \ + src/rpcprotocol.h \ + src/rpcserver.h \ + src/qt/overviewpage.h \ + src/qt/csvmodelwriter.h \ + src/crypter.h \ + src/qt/sendcoinsentry.h \ + src/qt/qvalidatedlineedit.h \ + src/qt/bitcoinunits.h \ + src/qt/qvaluecombobox.h \ + src/qt/askpassphrasedialog.h \ + src/protocol.h \ + src/qt/notificator.h \ + src/qt/paymentserver.h \ + src/allocators.h \ + src/ui_interface.h \ + src/qt/rpcconsole.h \ + src/version.h \ + src/netbase.h \ + src/clientversion.h \ + src/threadsafety.h \ + src/tinyformat.h + +SOURCES += \ + src/qt/bitcoin.cpp \ + src/qt/bitcoingui.cpp \ + src/qt/transactiontablemodel.cpp \ + src/qt/addresstablemodel.cpp \ + src/qt/optionsdialog.cpp \ + src/qt/sendcoinsdialog.cpp \ + src/qt/coincontroldialog.cpp \ + src/qt/coincontroltreewidget.cpp \ + src/qt/addressbookpage.cpp \ + src/qt/signverifymessagedialog.cpp \ + src/qt/editaddressdialog.cpp \ + src/qt/bitcoinaddressvalidator.cpp \ + src/alert.cpp \ + src/chainparams.cpp \ + src/version.cpp \ + src/sync.cpp \ + src/txmempool.cpp \ + src/util.cpp \ + src/hash.cpp \ + src/netbase.cpp \ + src/key.cpp \ + src/script.cpp \ + src/core.cpp \ + src/main.cpp \ + src/miner.cpp \ + src/init.cpp \ + src/net.cpp \ + src/checkpoints.cpp \ + src/addrman.cpp \ + src/db.cpp \ + src/walletdb.cpp \ + src/qt/clientmodel.cpp \ + src/qt/guiutil.cpp \ + src/qt/transactionrecord.cpp \ + src/qt/optionsmodel.cpp \ + src/qt/monitoreddatamapper.cpp \ + src/qt/trafficgraphwidget.cpp \ + src/qt/transactiondesc.cpp \ + src/qt/transactiondescdialog.cpp \ + src/qt/bitcoinstrings.cpp \ + src/qt/bitcoinamountfield.cpp \ + src/wallet.cpp \ + src/keystore.cpp \ + src/qt/transactionfilterproxy.cpp \ + src/qt/transactionview.cpp \ + src/qt/walletmodel.cpp \ + src/rpcclient.cpp \ + src/rpcprotocol.cpp \ + src/rpcserver.cpp \ + src/rpcdump.cpp \ + src/rpcmisc.cpp \ + src/rpcnet.cpp \ + src/rpcmining.cpp \ + src/rpcwallet.cpp \ + src/rpcblockchain.cpp \ + src/rpcrawtransaction.cpp \ + src/qt/overviewpage.cpp \ + src/qt/csvmodelwriter.cpp \ + src/crypter.cpp \ + src/qt/sendcoinsentry.cpp \ + src/qt/qvalidatedlineedit.cpp \ + src/qt/bitcoinunits.cpp \ + src/qt/qvaluecombobox.cpp \ + src/qt/askpassphrasedialog.cpp \ + src/protocol.cpp \ + src/qt/notificator.cpp \ + src/qt/paymentserver.cpp \ + src/qt/rpcconsole.cpp \ + src/noui.cpp RESOURCES += \ - ../src/qt/bitcoin.qrc + src/qt/bitcoin.qrc + +FORMS += \ + src/qt/forms/coincontroldialog.ui \ + src/qt/forms/sendcoinsdialog.ui \ + src/qt/forms/addressbookpage.ui \ + src/qt/forms/signverifymessagedialog.ui \ + src/qt/forms/aboutdialog.ui \ + src/qt/forms/editaddressdialog.ui \ + src/qt/forms/transactiondescdialog.ui \ + src/qt/forms/overviewpage.ui \ + src/qt/forms/sendcoinsentry.ui \ + src/qt/forms/askpassphrasedialog.ui \ + src/qt/forms/rpcconsole.ui \ + src/qt/forms/optionsdialog.ui + +contains(USE_QRCODE, 1) { +HEADERS += src/qt/qrcodedialog.h +SOURCES += src/qt/qrcodedialog.cpp +FORMS += src/qt/forms/qrcodedialog.ui +} + +CODECFORTR = UTF-8 + +# for lrelease/lupdate +# also add new translations to src/qt/bitcoin.qrc under translations/ +TRANSLATIONS = $$files(src/qt/locale/bitcoin_*.ts) + +isEmpty(QMAKE_LRELEASE) { + win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe + else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease +} +isEmpty(QM_DIR):QM_DIR = $$PWD/src/qt/locale +# automatically build translations, so they can be included in resource file +TSQM.name = lrelease ${QMAKE_FILE_IN} +TSQM.input = TRANSLATIONS +TSQM.output = $$QM_DIR/${QMAKE_FILE_BASE}.qm +TSQM.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT} +TSQM.CONFIG = no_link +QMAKE_EXTRA_COMPILERS += TSQM + +# "Other files" to show in Qt Creator +OTHER_FILES += \ + doc/*.rst doc/*.txt doc/README README.md res/bitcoin-qt-res.rc + +# platform specific defaults, if not overridden on command line +isEmpty(BOOST_LIB_SUFFIX) { + macx:BOOST_LIB_SUFFIX = -mt + windows:BOOST_LIB_SUFFIX = -mt +} + +isEmpty(BOOST_THREAD_LIB_SUFFIX) { + win32:BOOST_THREAD_LIB_SUFFIX = _win32$$BOOST_LIB_SUFFIX + else:BOOST_THREAD_LIB_SUFFIX = $$BOOST_LIB_SUFFIX +} + +isEmpty(BDB_LIB_PATH) { + macx:BDB_LIB_PATH = /opt/local/lib/db48 +} + +isEmpty(BDB_LIB_SUFFIX) { + macx:BDB_LIB_SUFFIX = -4.8 +} + +isEmpty(BDB_INCLUDE_PATH) { + macx:BDB_INCLUDE_PATH = /opt/local/include/db48 +} + +isEmpty(BOOST_LIB_PATH) { + macx:BOOST_LIB_PATH = /opt/local/lib +} + +isEmpty(BOOST_INCLUDE_PATH) { + macx:BOOST_INCLUDE_PATH = /opt/local/include +} + +windows:DEFINES += WIN32 +windows:RC_FILE = src/qt/res/bitcoin-qt-res.rc + +windows:!contains(MINGW_THREAD_BUGFIX, 0) { + # At least qmake's win32-g++-cross profile is missing the -lmingwthrd + # thread-safety flag. GCC has -mthreads to enable this, but it doesn't + # work with static linking. -lmingwthrd must come BEFORE -lmingw, so + # it is prepended to QMAKE_LIBS_QT_ENTRY. + # It can be turned off with MINGW_THREAD_BUGFIX=0, just in case it causes + # any problems on some untested qmake profile now or in the future. + DEFINES += _MT BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN + QMAKE_LIBS_QT_ENTRY = -lmingwthrd $$QMAKE_LIBS_QT_ENTRY +} + +macx:HEADERS += src/qt/macdockiconhandler.h +macx:OBJECTIVE_SOURCES += src/qt/macdockiconhandler.mm +macx:LIBS += -framework Foundation -framework ApplicationServices -framework AppKit +macx:DEFINES += MAC_OSX MSG_NOSIGNAL=0 +macx:ICON = src/qt/res/icons/bitcoin.icns +macx:TARGET = "CNote-Qt" +macx:QMAKE_CFLAGS_THREAD += -pthread +macx:QMAKE_LFLAGS_THREAD += -pthread +macx:QMAKE_CXXFLAGS_THREAD += -pthread +macx:QMAKE_INFO_PLIST = share/qt/Info.plist + +# Set libraries and includes at end, to use platform-defined defaults if not overridden +INCLUDEPATH += $$BOOST_INCLUDE_PATH $$BDB_INCLUDE_PATH $$OPENSSL_INCLUDE_PATH $$QRENCODE_INCLUDE_PATH +LIBS += $$join(BOOST_LIB_PATH,,-L,) $$join(BDB_LIB_PATH,,-L,) $$join(OPENSSL_LIB_PATH,,-L,) $$join(QRENCODE_LIB_PATH,,-L,) +LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX +# -lgdi32 has to happen after -lcrypto (see #681) +windows:LIBS += -lws2_32 -lshlwapi -lmswsock -lole32 -loleaut32 -luuid -lgdi32 +LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX +windows:LIBS += -lboost_chrono$$BOOST_LIB_SUFFIX + +contains(RELEASE, 1) { + !windows:!macx { + # Linux: turn dynamic linking back on for c/c++ runtime libraries + LIBS += -Wl,-Bdynamic + } +} + +!windows:!macx { + DEFINES += LINUX + LIBS += -lrt -ldl +} + +system($$QMAKE_LRELEASE -silent $$_PRO_FILE_) \ No newline at end of file diff --git a/doc/build-unix.md b/doc/build-unix.md index ab5fbad..48eea83 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -1,15 +1,7 @@ UNIX BUILD NOTES ==================== -Some notes on how to build Bitcoin in Unix. +Some notes on how to build C-Note in Unix. -To Build ---------------------- - - ./autogen.sh - ./configure - make - -This will build bitcoin-qt as well if the dependencies are met. Dependencies --------------------- @@ -33,13 +25,13 @@ turned off by default. See the configure options for upnp behavior desired: --enable-upnp-default UPnP support turned on by default at runtime Licenses of statically linked libraries: - Berkeley DB New BSD license with additional requirement that linked - software must be free open source + Berkeley DB New BSD license with additional requirement that linked software must be free open source Boost MIT-like license miniupnpc New (3-clause) BSD license - For the versions used in the release, see doc/release-process.md under *Fetch and build inputs*. + System requirements -------------------- @@ -47,6 +39,7 @@ C++ compilers are memory-hungry. It is recommended to have at least 1 GB of memory available when compiling Bitcoin Core. With 512MB of memory or less compilation will take much longer due to swap thrashing. + Dependency Build Instructions: Ubuntu & Debian ---------------------------------------------- Build requirements: @@ -59,12 +52,6 @@ for Ubuntu 12.04 and later: sudo apt-get install libboost-all-dev - db4.8 packages are available [here](https://launchpad.net/~bitcoin/+archive/bitcoin). - You can add the repository using the following command: - - sudo add-apt-repository ppa:bitcoin/bitcoin - sudo apt-get update - Ubuntu 12.04 and later have packages for libdb5.1-dev and libdb5.1++-dev, but using these will break binary wallet compatibility, and is not recommended. @@ -83,15 +70,11 @@ To enable the change run sudo apt-get update -for other Ubuntu & Debian: - - sudo apt-get install libdb4.8-dev - sudo apt-get install libdb4.8++-dev - Optional: sudo apt-get install libminiupnpc-dev (see --with-miniupnpc and --enable-upnp-default) + Dependencies for the GUI: Ubuntu & Debian ----------------------------------------- @@ -106,68 +89,52 @@ To build with Qt 4 you need the following: For Qt 5 you need the following: - sudo apt-get install libqt5gui5 libqt5core5 libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev + sudo apt-get install libqt5core5 (<--This wasn't required for 14.04 and 16.04) + sudo apt-get install libqt5gui5 libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler libqrencode (optional) can be installed with: sudo apt-get install libqrencode-dev -Once these are installed, they will be found by configure and a bitcoin-qt executable will be +Once these are installed, they will be found by configure and a cnote-qt executable will be built by default. -Notes ------ -The release is built with GCC and then "strip bitcoind" to strip the debug -symbols, which reduces the executable size by about 90%. - - -miniupnpc ---------- - tar -xzvf miniupnpc-1.6.tar.gz - cd miniupnpc-1.6 - make - sudo su - make install - Berkeley DB ----------- It is recommended to use Berkeley DB 4.8. If you have to build it yourself: -```bash -BITCOIN_ROOT=$(pwd) - -# Pick some path to install BDB to, here we create a directory within the bitcoin directory -BDB_PREFIX="${BITCOIN_ROOT}/db4" -mkdir -p $BDB_PREFIX - -# Fetch the source and verify that it is not tampered with -wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz' -echo '12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz' | sha256sum -c -# -> db-4.8.30.NC.tar.gz: OK -tar -xzvf db-4.8.30.NC.tar.gz + -- Contents of compile-db.sh which is located in the repository root ---------- + #!/bin/sh + BITCOIN_ROOT=$(pwd) + + # Pick some path to install BDB to, here we create a directory within the bitcoin directory + BDB_PREFIX="${BITCOIN_ROOT}/db4" + mkdir -p $BDB_PREFIX + + if [ ! -d "db-4.8.30.NC" ]; then + # Fetch the source and verify that it is not tampered with + wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz' + echo '12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz' | sha256sum -c + # -> db-4.8.30.NC.tar.gz: OK + tar -xzvf db-4.8.30.NC.tar.gz + # Build the library and install to our prefix + cd db-4.8.30.NC/build_unix/ + # Note: Do a static build so that it can be embedded into the exectuable, instead of having to find a .so at runtime + ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$BDB_PREFIX + make install + cd $BITCOIN_ROOT + fi + + # Configure Bitcoin Core to use our own-built instance of BDB + ./configure LDFLAGS="-L${BDB_PREFIX}/lib/" CPPFLAGS="-I${BDB_PREFIX}/include/" -# Build the library and install to our prefix -cd db-4.8.30.NC/build_unix/ -# Note: Do a static build so that it can be embedded into the exectuable, instead of having to find a .so at runtime -../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$BDB_PREFIX -make install + make + ------------------------------------------------------------------------------- -# Configure Bitcoin Core to use our own-built instance of BDB -cd $BITCOIN_ROOT -./configure (other args...) LDFLAGS="-L${BDB_PREFIX}/lib/" CPPFLAGS="-I${BDB_PREFIX}/include/" -``` **Note**: You only need Berkeley DB if the wallet is enabled (see the section *Disable-Wallet mode* below). -Boost ------ -If you need to build Boost yourself: - - sudo su - ./bootstrap.sh - ./bjam install - Security -------- @@ -180,7 +147,6 @@ Hardening Flags: ./configure --enable-hardening ./configure --disable-hardening - Hardening enables the following features: * Position Independent Executable @@ -217,6 +183,7 @@ Hardening enables the following features: The STK RW- means that the stack is readable and writeable but not executable. + Disable-wallet mode -------------------- When the intention is to run only a P2P node without a wallet, bitcoin may be compiled in @@ -229,3 +196,17 @@ In this case there is no dependency on Berkeley DB 4.8. Mining is also possible in disable-wallet mode, but only using the `getblocktemplate` RPC call not `getwork`. + +Notes +----- +The release is built with GCC and then "strip bitcoind" to strip the debug +symbols, which reduces the executable size by about 90%. + +To Build +--------------------- + + ./autogen.sh + ./compile-db.sh + ./src/qt/cnote-qt + +This will build cnote-qt as well if the dependencies are met. diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 7b7a527..dd17a9e 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -71,11 +71,11 @@ class CMainParams : public CChainParams { vSeeds.push_back(CDNSSeedData("96.67.25.134", "96.67.25.134")); - base58Prefixes[PUBKEY_ADDRESS] = list_of(28); - base58Prefixes[SCRIPT_ADDRESS] = list_of(6); - base58Prefixes[SECRET_KEY] = list_of(186); - base58Prefixes[EXT_PUBLIC_KEY] = list_of(0x04)(0x88)(0xB2)(0x1E); - base58Prefixes[EXT_SECRET_KEY] = list_of(0x04)(0x88)(0xAD)(0xE4); + base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,28); + base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,6); + base58Prefixes[SECRET_KEY] = std::vector(1,186); + base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x04)(0x88)(0xB2)(0x1E).convert_to_container >(); + base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x04)(0x88)(0xAD)(0xE4).convert_to_container >(); // Convert the pnSeeds array into usable address objects. for (unsigned int i = 0; i < ARRAYLEN(pnSeed); i++) @@ -133,11 +133,11 @@ class CTestNetParams : public CMainParams { vFixedSeeds.clear(); vSeeds.clear(); - base58Prefixes[PUBKEY_ADDRESS] = list_of(119); - base58Prefixes[SCRIPT_ADDRESS] = list_of(199); - base58Prefixes[SECRET_KEY] = list_of(247); - base58Prefixes[EXT_PUBLIC_KEY] = list_of(0x04)(0x35)(0x87)(0xCF); - base58Prefixes[EXT_SECRET_KEY] = list_of(0x04)(0x35)(0x83)(0x94); + base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,119); + base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,199); + base58Prefixes[SECRET_KEY] = std::vector(1,247); + base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x04)(0x35)(0x87)(0xCF).convert_to_container >(); + base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x04)(0x35)(0x83)(0x94).convert_to_container >(); } virtual Network NetworkID() const { return CChainParams::TESTNET; } }; diff --git a/src/clientversion.h b/src/clientversion.h index cf108c0..cc2af17 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -10,9 +10,9 @@ // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 2 -#define CLIENT_VERSION_MINOR 0 +#define CLIENT_VERSION_MINOR 1 #define CLIENT_VERSION_REVISION 0 -#define CLIENT_VERSION_BUILD 0 +#define CLIENT_VERSION_BUILD 3 // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true diff --git a/src/leveldbwrapper.cpp b/src/leveldbwrapper.cpp index fdae0b4..cedf63c 100644 --- a/src/leveldbwrapper.cpp +++ b/src/leveldbwrapper.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include void HandleError(const leveldb::Status &status) throw(leveldb_error) { if (status.ok()) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 23184cd..a4e9b4a 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -304,7 +304,7 @@ void BitcoinGUI::createActions(bool fIsTestnet) usedReceivingAddressesAction = new QAction(QIcon(":/icons/address-book"), tr("&Receiving addresses..."), this); usedReceivingAddressesAction->setStatusTip(tr("Show the list of used receiving addresses and labels")); - openAction = new QAction(QApplication::style()->standardIcon(QStyle::SP_FileIcon), tr("Open &URI..."), this); + openAction = new QAction(QApplication::style()->standardIcon(QStyle::SP_DesktopIcon), tr("Open &URI..."), this); openAction->setStatusTip(tr("Open a c-note: URI or payment request")); showHelpMessageAction = new QAction(QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation), tr("&Command-line options"), this); diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index ffbb66c..e3d2dc6 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -296,7 +296,7 @@ Value listunspent(const Array& params, bool fHelp) CTxDestination address; if (ExtractDestination(pk, address)) { - const CScriptID& hash = boost::get(address); + const CScriptID& hash = boost::get(address); CScript redeemScript; if (pwalletMain->GetCScript(hash, redeemScript)) entry.push_back(Pair("redeemScript", HexStr(redeemScript.begin(), redeemScript.end()))); diff --git a/src/util.h b/src/util.h index 62e6df5..afd0e85 100644 --- a/src/util.h +++ b/src/util.h @@ -30,6 +30,7 @@ #endif #include +#include #include class CNetAddr;