Position: Home page » Bitcoin » Bitcoin client compiled by windows

Bitcoin client compiled by windows

Publish: 2021-05-14 01:07:05
1. 很多朋友都知道如何在linux平台如何编译比特币程序,但是,到了windows平台,
就会感觉到无从下手. 其实, 比特币程序是跨平台的.
你要编译windows版的比特币程序,基本上有两种方法,一种是在linux平台
(推荐ubuntu 13.10)通过交叉编译的方法来编译.另外一种,就是直接在windows平台编译.
我想,你既然要在windows平台使用,我就详细介绍一下如何在windwows平台编译比特币程序.
我的平台:windows7

第一步:安装变编译环境QT和MINGW,msys
1、msys是一个在windows平台模拟shell的程序
下载安装程序之后,通过安装管理程序,按安装以下内容:
From MinGW installation manager -> All packages -> MSYS
选中以下安装包
msys-base-bin
msys-autoconf-bin
msys-automake-bin
msys-libtool-bin
点 apply changes开始安装他会自动下载安装好
需要注意的是,确保不要安装msys-gcc和msys-w32api ,因为这两个包和我们的编译系统发生冲突
很多人出现一些莫名其妙的问题,就是因为这两个包
2、安装 MinGW-builds
下载并解压缩 i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z 到C盘根目录 C:\
注意我的目录结构你尽量和我一样
3、设置PATH环境变量,将C:\mingw32\bin;添加到第一个
4、在命令行模式下输入 gc -v 会得到以下内容
c:\gcc -v
Using built-in specs.
COLLECT_GCC=c:\mingw32\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/mingw32/bin/../libexec/gcc/i686-w64-mingw32/4.8.2/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../../../src/gcc-4.8.2/configure --host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 --prefix=/mingw32 --with-sysroot=/c/mingw482/i686-482-posix-dwarf-rt_v3-rev3/mingw32 --with-gxx-include-dir=/mingw32/i686-w64-mingw32/include/c++ --enable-shared --enable-static --disable-multilib --enable-languages=ada,c,c++,fortran,objc,obj-c++,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-sjlj-exceptions --with-dwarf2 --disable-isl-version-check --disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=i686 --with-tune=generic --with-libiconv --with-system-zlib --with-gmp=/c/mingw482/prerequisites/i686-w64-mingw32-static --with-mpfr=/c/mingw482/prerequisites/i686-w64-mingw32-static --with-mpc=/c/mingw482/prerequisites/i686-w64-mingw32-static --with-isl=/c/mingw482/prerequisites/i686-w64-mingw32-static --with-cloog=/c/mingw482/prerequisites/i686-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion='i686-posix-dwarf-rev3, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/c/mingw482/i686-482-posix-dwarf-rt_v3-rev3/mingw32/opt/include -I/c/mingw482/prerequisites/i686-zlib-static/include -I/c/mingw482/prerequisites/i686-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/c/mingw482/i686-482-posix-dwarf-rt_v3-rev3/mingw32/opt/include -I/c/mingw482/prerequisites/i686-zlib-static/include -I/c/mingw482/prerequisites/i686-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/c/mingw482/i686-482-posix-dwarf-rt_v3-rev3/mingw32/opt/lib -L/c/mingw482/prerequisites/i686-zlib-static/lib -L/c/mingw482/prerequisites/i686-w64-mingw32-static/lib -Wl,--large-address-aware'
Thread model: posix
gcc version 4.8.2 (i686-posix-dwarf-rev3, Built by MinGW-W64 project)
至此,你的开发环境已经搭建好了,很简单吧

第二部分:下载bitcoin引用的外部库
我们把它们全部放在 C:\deps目录下

2.1 安装OpenSSL
进入启动 MinGw shell 比如目录:(C:\MinGW\msys\1.0\msys.bat)运行这个msys.bat,就会启动一个shell环境,提示符是$
输入命令
cd /c/deps/
tar xvfz openssl-1.0.1g.tar.gz
cd openssl-1.0.1g
Configure no-shared no-dso mingw
make
等待几分钟后,就把openssl编译好了

2.2 下载Berkeley DB
我们推荐使用 4.8版本
同样在msys shell环境下输入以下命令
cd /c/deps/
tar xvfz db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix
../dist/configure --enable-mingw --enable-cxx --disable-shared --disable-replication
make
等待编译

2.3 安装Boost
msys命令:
cd C:\deps\boost_1_55_0\
bootstrap.bat mingw
b2 --build-type=complete --with-chrono --with-filesystem --with-program_options --with-system --with-thread toolset=gcc variant=release link=static threading=multi runtime-link=static stage

2.4 安装Miniupnpc
cd C:\deps\miniupnpc
mingw32-make -f Makefile.mingw init upnpc-static
msys shell命令
cd /c/deps/protobuf-2.5.0
configure --disable-shared
make

2.6 qrencode:
命令
cd /c/deps/libpng-1.6.10
configure --disable-shared
make
LIBS="../libpng-1.6.10/.libs/libpng16.a ../../mingw32/i686-w64-mingw32/lib/libz.a" \
png_CFLAGS="-I../libpng-1.6.10" \
png_LIBS="-L../libpng-1.6.10/.libs" \
configure --enable-static --disable-shared --without-tools
make

2.7 安装 Qt 5 库
下载和解压缩
在 windows命令行输入:
set INCLUDE=C:\deps\libpng-1.6.10;C:\deps\openssl-1.0.1g\include
set LIB=C:\deps\libpng-1.6.10\.libs;C:\deps\openssl-1.0.1g
cd C:\Qt\5.2.1
configure.bat -release -opensource -confirm-license -static -make libs -no-sql-sqlite -no-opengl -system-zlib -qt-pcre -no-icu -no-gif -system-libpng -no-libjpeg -no-freetype -no-angle -no-vcproj -openssl-linked -no-dbus -no-audio-backend -no-wmf-backend -no-qml-debug
mingw32-make
set PATH=%PATH%;C:\Qt\5.2.1\bin
cd C:\Qt\qttools-opensource-src-5.2.1
qmake qttools.pro
mingw32-make

3. 下载Bitcoin 0.9.1
在msys shell下输入以下命令行:
cp /c/deps/libpng-1.6.10/.libs/libpng16.a /c/deps/libpng-1.6.10/.libs/libpng.a
cd /c/bitcoin-0.9.1
./autogen.sh
CPPFLAGS="-I/c/deps/boost_1_55_0 \
-I/c/deps/db-4.8.30.NC/build_unix \
-I/c/deps/openssl-1.0.1g/include \
-I/c/deps \
-I/c/deps/protobuf-2.5.0/src \
-I/c/deps/libpng-1.6.10 \
-I/c/deps/qrencode-3.4.3" \
LDFLAGS="-L/c/deps/boost_1_55_0/stage/lib \
-L/c/deps/db-4.8.30.NC/build_unix \
-L/c/deps/openssl-1.0.1g \
-L/c/deps/miniupnpc \
-L/c/deps/protobuf-2.5.0/src/.libs \
-L/c/deps/libpng-1.6.10/.libs \
-L/c/deps/qrencode-3.4.3/.libs" \
./configure \
--disable-upnp-default \
--disable-tests \
--with-qt-incdir=/c/Qt/5.2.1/include \
--with-qt-libdir=/c/Qt/5.2.1/lib \
--with-qt-bindir=/c/Qt/5.2.1/bin \
--with-qt-plugindir=/c/Qt/5.2.1/plugins \
--with-boost-system=mgw48-mt-s-1_55 \
--with-boost-filesystem=mgw48-mt-s-1_55 \
--with-boost-program-options=mgw48-mt-s-1_55 \
--with-boost-thread=mgw48-mt-s-1_55 \
--with-boost-chrono=mgw48-mt-s-1_55 \
--with-protoc-bindir=/c/deps/protobuf-2.5.0/src
make
strip src/bitcoin-cli.exe
strip src/bitcoind.exe
strip src/qt/bitcoin-qt.exe

这样,你就得到了变异好的 bitcoin-cli.exe和bitcoind.exe ,bitcoin-qt.exewindows QT图形界面的钱包软件
2.
  1. the concept of bitcoin was first proposed by Nakamoto in 2009. According to Nakamoto's idea, open source software was designed and released, and P2P network was built on it. Bitcoin is a kind of P2P digital currency. Point to point transmission means a decentralized payment system

    Unlike most currencies, bitcoin does not rely on specific currency institutions to issue. It is generated by a large number of calculations based on specific algorithms. Bitcoin economy uses a distributed database composed of many nodes in the whole P2P network to confirm and record all transactions, and uses cryptography design to ensure the security of all aspects of currency circulation. The decentralized nature and algorithm of P2P can ensure that it is impossible to artificially manipulate the value of bitcoin through mass proction. The design based on cryptography can make bitcoin only be transferred or paid by the real owner. This also ensures the anonymity of money ownership and circulation transactions. The biggest difference between bitcoin and other virtual currencies is that the total amount of bitcoin is very limited and it has a strong scarcity

3. The concept of bitcoin was first proposed by Nakamoto in 2009. According to Nakamoto's idea, open source software was designed and released, and P2P network was built on it. Bitcoin is a kind of P2P digital currency. Point to point transmission means a decentralized payment system
unlike most currencies, bitcoin does not rely on specific currency institutions. It is generated by a large number of calculations based on specific algorithms. Bitcoin economy uses a distributed database composed of many nodes in the whole P2P network to confirm and record all transactions, and uses cryptography design to ensure the security of all aspects of currency circulation. The decentralized nature and algorithm of P2P can ensure that it is impossible to artificially manipulate the value of bitcoin through mass proction. The design based on cryptography can make bitcoin only be transferred or paid by the real owner. This also ensures the anonymity of money ownership and circulation transactions. The biggest difference between bitcoin and other virtual currencies is that the total amount of bitcoin is very limited and it has a strong scarcity.
4. < UL >
  • the core problem of blockchain solution is not "digital currency", but how to establish a "trust" ecosystem to meet the occurrence and development of economic activities under the environment of information asymmetry and uncertainty. This problem is called "Byzantine general problem", or "Byzantine fault tolerance" or "two armed forces problem". It is a difficult problem in the process of information machine interaction in a distributed system, that is, when any node in the whole network can't trust its counterpart, How to create a consensus basis for secure information interaction without worrying about data tampering

  • < / UL >


    < UL >
  • blockchain uses algorithmic proof mechanism to ensure the security of the whole network. With it, all nodes in the whole system can exchange data automatically and safely in a de trusted environment. For details of Byzantine Generals, please refer to relevant papers


  • the second meaning of blockchain is to realize transnational value transfer. At the beginning of the birth of the Internet, the core problem to be solved is information manufacturing and transmission. We can quickly generate and information to every corner of the world with network through the Internet, but it still can not solve the value transfer and credit transfer. The so-called value transfer here means that everyone in the network can recognize and confirm the way to transfer a certain part of the value accurately from one address to another, and it must be ensured that after the value transfer, the original address reces the transferred part, while the new address increases the transferred value. The value mentioned here can be monetary assets, some physical assets or virtual assets (including securities, financial derivatives, etc.). And the results of this operation must be recognized by all parties, and the results can not be manipulated by any party

  • < / UL >


    < UL >
  • in the current Internet, there are various financial systems, and there are many payment systems provided by banks or third parties, but it still relies on centralized solutions. The so-called centralized solution is to place all the value transfer calculations in a central server (cluster) through a certain company as endorsement. Although all the calculations are automatically completed by the program, the centralized person or organization must be trusted. In fact, to solve this problem through centralized credit endorsement can only limit credit to certain institutions, regions or countries. From this we can see that the fundamental problem that must be solved is credit. Therefore, the core issue of value transfer is transnational credit consensus. In such a complex global system, it is very difficult to establish a global credit consensus system out of thin air. Due to the different political, economic and cultural situations of each country, it is almost impossible to achieve complete mutual trust between enterprises and governments of the two countries, which means that whether the endorsement is made with the credit of indivials or enterprises or governments, Even if the value exchange between countries can be completed, it also has huge time and economic costs. But in the long history of mankind, no matter how different the religion, politics and culture of each country is, the only thing that can reach a consensus is mathematics (Basic Science). Therefore, it is no exaggeration to say that mathematics (algorithm) is the greatest common divisor of global civilization, and it is also the basis for human beings to obtain the most consensus. If we take the mathematical algorithm (program) as an endorsement, all the rules are built on an open and transparent mathematical algorithm (program), so that all people with different political and cultural backgrounds can reach a consensus


  • future development? The Internet will make the global interaction more and more close, accompanied by a huge trust gap. At present, the existing mainstream database technology architecture is private and centralized, which can never solve the problem of value transfer and mutual trust. Therefore, blockchain technology is likely to become the next generation of database architecture. Through decentralization technology, we will be able to complete the great progress of mathematical (algorithm) endorsement and global mutual trust on the basis of big data

    As a specific distributed data access technology, blockchain technology participates in data calculation and recording through multiple nodes in the network, and verifies the validity of their information (anti-counterfeiting). From this point, blockchain technology is also a specific database technology. The Internet has just entered the era of big data, but at present, big data is still in a very basic stage. But when we enter the stage of blockchain database, we will enter the era of real big data with strong trust endorsement. All the data in this is of indestructible quality, and no one has the ability or need to question it. Perhaps we are now at a major turning point - the early stage of a major turning point that is almost the same as the profound changes brought about by the instrial revolution. It's not just the exponential, digital and combinatorial progress and change of new technologies, but more surprises may be ahead of us. In the next 24 months, the planet will grow more computing power and record more data than all stages of history combined. In the past 24 months, this value-added may have exceeded 1000 times. These digital data information is still growing faster than Moore's law

  • < / UL >


    < UL >
  • blockchain technology will not only be applied in the field of financial payment, but will be extended to all the current applications, such as decentralized microblog, wechat, search, rental, and even taxi software. Because blockchain will allow human beings to conct large-scale cooperation in a way of no geographical restrictions and no trust


  • Bubi blockchain uses cryptography provable algorithm to build multi center network trust, which is open, transparent, tamper proof and revocable; Multi party participation in information transparent sharing, the establishment of authentic traceability chain path, direct to consumers

  • < / UL >


    < UL >
  • our generation is likely to be lucky to experience two of the most amazing events in human history. All people and all machines on the earth have launched unprecedented large-scale collaboration with unprecedented mutual trust through blockchain technology. Secondly, based on this, real artificial intelligence will be created. These two times will profoundly change the economic development mode of the world. Entrepreneurs, entrepreneurs, scientists and all kinds of geeks will use this abundant world to create something that can shock and delight us

  • 5. Bitcoin, lightcoin and all kinds of counterfeit coins are stored on the computer, so you need to keep your wallet
    back up your wallet
    the first thing you need to do is back up your wallet. It is recommended that you do so immediately after installing the client. In this way, in the case of your computer failure and data loss, you can recover your wallet at any time, so that you can use it.
    6. The client of bitcoin wallet is a very small file. Bitcoin is just a string
    it doesn't need any configuration. A computer can open 386, just like opening a text file
    7. 你要编译windows版的比特币程序,基本上有两种方法,一种是在linux平台
    (推荐ubuntu 13.10)通过交叉编译的方法来编译.另外一种,就是直接在windows平台编译.
    我想,你既然要在windows平台使用,我就详细介绍一下如何在windwows平台编译比特币程序.
    我的平台:windows7
    第一步:安装变编译环境QT和MINGW,msys
    1、msys是一个在windows平台模拟shell的程序

    下载安装程序之后,通过安装管理程序,按安装以下内容:
    From MinGW installation manager -> All packages -> MSYS
    选中以下安装包
    msys-base-bin
    msys-autoconf-bin
    msys-automake-bin
    msys-libtool-bin
    点 apply changes开始安装他会自动下载安装好
    需要注意的是,确保不要安装msys-gcc和msys-w32api ,因为这两个包和我们的编译系统发生冲突
    很多人出现一些莫名其妙的问题,就是因为这两个包
    2、安装 MinGW-builds
    下载并解压缩 i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z 到C盘根目录 C:\
    注意我的目录结构你尽量和我一样
    3、设置PATH环境变量,将C:\mingw32\bin;添加到第一个
    4、在命令行模式下输入 gc -v 会得到以下内容
    c:\gcc -v
    Using built-in specs.
    COLLECT_GCC=c:\mingw32\bin\gcc.exe
    COLLECT_LTO_WRAPPER=c:/mingw32/bin/../libexec/gcc/i686-w64-mingw32/4.8.2/lto-wrapper.exe
    Target: i686-w64-mingw32
    Configured with: ../../../src/gcc-4.8.2/configure --host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 --prefix=/mingw32 --with-sysroot=/c/mingw482/i686-482-posix-dwarf-rt_v3-rev3/mingw32 --with-gxx-include-dir=/mingw32/i686-w64-mingw32/include/c++ --enable-shared --enable-static --disable-multilib --enable-languages=ada,c,c++,fortran,objc,obj-c++,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-sjlj-exceptions --with-dwarf2 --disable-isl-version-check --disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=i686 --with-tune=generic --with-libiconv --with-system-zlib --with-gmp=/c/mingw482/prerequisites/i686-w64-mingw32-static --with-mpfr=/c/mingw482/prerequisites/i686-w64-mingw32-static --with-mpc=/c/mingw482/prerequisites/i686-w64-mingw32-static --with-isl=/c/mingw482/prerequisites/i686-w64-mingw32-static --with-cloog=/c/mingw482/prerequisites/i686-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion='i686-posix-dwarf-rev3, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/c/mingw482/i686-482-posix-dwarf-rt_v3-rev3/mingw32/opt/include -I/c/mingw482/prerequisites/i686-zlib-static/include -I/c/mingw482/prerequisites/i686-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/c/mingw482/i686-482-posix-dwarf-rt_v3-rev3/mingw32/opt/include -I/c/mingw482/prerequisites/i686-zlib-static/include -I/c/mingw482/prerequisites/i686-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/c/mingw482/i686-482-posix-dwarf-rt_v3-rev3/mingw32/opt/lib -L/c/mingw482/prerequisites/i686-zlib-static/lib -L/c/mingw482/prerequisites/i686-w64-mingw32-static/lib -Wl,--large-address-aware'
    Thread model: posix
    gcc version 4.8.2 (i686-posix-dwarf-rev3, Built by MinGW-W64 project)
    至此,你的开发环境已经搭建好了,很简单吧
    8. As a matter of fact, bitcoin programs are cross platform.
    there are basically two ways to compile bitcoin programs for windows. One is to compile bitcoin programs on Linux platform by cross compiling. The other is to compile bitcoin programs directly on Windows platform.
    I think that since you want to use bitcoin programs on Windows platform, I will introce how to compile bitcoin program on Windows platform in detail.
    My platform: windows7
    Step 1: install QT and MinGW, msys

    in this way, you will get bitcoin-cli.exe and bitcoin.exe, bitcoin-qt.exe (Windows QT graphical interface software)
    9. The concept of bitcoin was first proposed by Nakamoto in 2009. According to Nakamoto's idea, open source software was designed and released, and P2P network was built on it. Bitcoin is a kind of P2P digital currency. Point to point transmission means a decentralized payment system
    unlike most currencies, bitcoin does not rely on specific currency institutions. It is generated by a large number of calculations based on specific algorithms. Bitcoin economy uses a distributed database composed of many nodes in the whole P2P network to confirm and record all transactions, and uses cryptography design to ensure the security of all aspects of currency circulation. The decentralized nature and algorithm of P2P can ensure that it is impossible to artificially manipulate the value of bitcoin through mass proction. The design based on cryptography can make bitcoin only be transferred or paid by the real owner. This also ensures the anonymity of money ownership and circulation transactions. The biggest difference between bitcoin and other virtual currencies is that the total amount of bitcoin is very limited and it has a strong scarcity
    Hot content
    Inn digger Publish: 2021-05-29 20:04:36 Views: 341
    Purchase of virtual currency in trust contract dispute Publish: 2021-05-29 20:04:33 Views: 942
    Blockchain trust machine Publish: 2021-05-29 20:04:26 Views: 720
    Brief introduction of ant mine Publish: 2021-05-29 20:04:25 Views: 848
    Will digital currency open in November Publish: 2021-05-29 19:56:16 Views: 861
    Global digital currency asset exchange Publish: 2021-05-29 19:54:29 Views: 603
    Mining chip machine S11 Publish: 2021-05-29 19:54:26 Views: 945
    Ethereum algorithm Sha3 Publish: 2021-05-29 19:52:40 Views: 643
    Talking about blockchain is not reliable Publish: 2021-05-29 19:52:26 Views: 754
    Mining machine node query Publish: 2021-05-29 19:36:37 Views: 750