1 源码下载

github上初始版本是bitcoin-0.1.5,可以从https://github.com/bitcoin/bitcoin下载,但是从网上可以找到更老版本bitcoin-0.1.0,例如可以从如下地址下载:

https://github.com/Dan-McG/bitcoin-0.1.0

网上可以搜到一封关于这个版本的说明邮件,内容如下

Announcing the first release of Bitcoin, a new electronic cash

system that uses a peer-to-peer network to prevent double-spending.

It's completely decentralized with no server or central authority.

See bitcoin.org for screenshots.

Download link:

http://downloads.sourceforge.net/bitcoin/bitcoin-0.1.0.rar

Windows only for now. Open source C++ code is included.

- Unpack the files into a directory

- Run BITCOIN.EXE

- It automatically connects to other nodes

If you can keep a node running that accepts incoming connections,

you'll really be helping the network a lot. Port 8333 on your

firewall needs to be open to receive incoming connections.

The software is still alpha and experimental. There's no guarantee

the system's state won't have to be restarted at some point if it

becomes necessary, although I've done everything I can to build in

extensibility and versioning.

You can get coins by getting someone to send you some, or turn on

Options->Generate Coins to run a node and generate blocks. I made

the proof-of-work difficulty ridiculously easy to start with, so

for a little while in the beginning a typical PC will be able to

generate coins in just a few hours. It'll get a lot harder when

competition makes the automatic adjustment drive up the difficulty.

Generated coins must wait 120 blocks to mature before they can be

spent.

There are two ways to send money. If the recipient is online, you

can enter their IP address and it will connect, get a new public

key and send the transaction with comments. If the recipient is

not online, it is possible to send to their Bitcoin address, which

is a hash of their public key that they give you. They'll receive

the transaction the next time they connect and get the block it's

in. This method has the disadvantage that no comment information

is sent, and a bit of privacy may be lost if the address is used

multiple times, but it is a useful alternative if both users can't

be online at the same time or the recipient can't receive incoming

connections.

Total circulation will be 21,000,000 coins. It'll be distributed

to network nodes when they make blocks, with the amount cut in half

every 4 years.

first 4 years: 10,500,000 coins

next 4 years: 5,250,000 coins

next 4 years: 2,625,000 coins

next 4 years: 1,312,500 coins

etc...

When that runs out, the system can support transaction fees if

needed. It's based on open market competition, and there will

probably always be nodes willing to process transactions for free.

Satoshi Nakamoto

该版本是用VC6.0进行编译的,结合源码中的说明文档可知,完成编译还需如下依赖库

wxWidgets http://www.wxwidgets.org/downloads/

OpenSSL http://www.openssl.org/source/

Berkeley DB http://www.oracle.com/technology/software/products/berkeley-db/index.html

Boost http://www.boost.org/users/download/

2 编译依赖库

2.1 编译wxWidgets

初始版本中界面库用的是wxWidgets,这里选用版本wxWidgets-2.8.10,编译时尽量使用和该文中相同的版本,否则可能会有问题,该库编译过程很简单,直接用VC6.0打开图中静态工程wx.dsw,并编译相应的Debug和Release版本即可,如图

2.2 编译OpenSSL

OpenSSL 是一个安全套接字层密码库,囊括主要的加密算法,比特币源码直接使用了该库中的相关加密算法。这里选用的是源码说明文件readme.txt中的版本openssl-0.9.8h.tar.gz,编译OpenSSL需要安装nasm和ActivePerl可参考如下网址

https://www.cnblogs.com/passedbylove/p/5977777.htmlhttps://blog.csdn.net/liangyuannao/article/details/7788004

打开命令行并进入到源码目录,执行如下命令即可完成编译

perl Configure VC-WIN32
ms\do_ms.bat
nmake -f ms\ntdll.mak

2.3 编译Berkeley DB

Berkeley DB是一个开源的文件数据库,比特币借助该库实现文件存取,这里选用的版本是db-4.7.25.tar.gz,直接用VC6.0打开图中工程,并编译其中Win32 Debug x86和Win32 Release x86版本

2.4 编译Boost

这里选用版本boost_1_34_1.tar.gz,更新的版本用VC6.0编译会有很多编译错误。
(1)生成bjam.exe,打开cmd命令行,进入到boost_1_34_1\tools\jam\src目录下,运行build.bat,build.bat会运行VCVARS32.BAT,设置环境变量,并编译生成bjam,如图

如果系统安装多个VS版本,可以通过注释其他版本来选择VC6.0版本生成bjam.exe

最终会在目录下生成一个名为bin.ntx86的文件夹里面包含一个bjam.exe可执行文件,将其拷贝到boost_1_34_1目录下。

(2)有了bjam之后,运行 bjam --toolset=msvc-6.0进行编译,bjam --toolset=msvc-6.0 install 生成相应的头文件(include)和 库文件(lib),默认生成在C:\boost下面。

3 新建VC工程并编译

3.1 新建工程

新建Win32应用工程bitcoin

3.2 添加源码文件

将源码中的头文件源文件及资源文件添加到新建的工程中

3.3 修改编译选项

将第2节编译好的库文件及相关头文件拷贝到工程目录下(如果不拷贝到工程目录,则添加头文件目录时请填写相应的文件路径),添加相应库头文件路径到附加头文件目录,添加宏定义D__WXMSW__,__WXDEBUG__到预定义中;添加相应的库文件目录到附加文件目录,添加相应的依赖库文件,libeay32.lib libdb47sd.lib wxmsw28d_richtext.lib wxmsw28d_html.lib wxmsw28d_core.lib wxbase28d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib ws2_32.lib,改Code Generation中Use run-time library为Debug Multithreaded DLL,在编译选项中添加/Zm300,否则编译时会有“compiler limit : internal heap limit reached; use /Zm to specify a higher limit”错误提示,在Resources设置下添加附件包含路径include,主要编译设置如下图

Release版本的编译需要类似的设置,这里不在进行重复说明,已在CSDN上上传了编译好的版本,有需要的可自行下载https://download.csdn.net/download/weiwei22844/10642479

比特币初始版本VC6.0编译的更多相关文章

  1. VC6.0编译boost

    今天学习了下VC6.0下boost的编译,只是对regex进行了编译,据说全部编译需要2个多小时,在此记录下学习过程中遇到的问题以便今后查看. 最开始直接从网上(www.boost.org)下载了当前 ...

  2. 让VC6.0编译出来的程序支持XP样式或XP风格

    (1)VC6.0编译出来的win32程序不支持winxp样式的原因:微软WINXP系统更新了Comctl32.dll(ver 6.0)这个“XP风格”的控件.为了保留传统的Windows界面风格,特地 ...

  3. VC6.0编译DLL,使用VS2010调用问题及解决方法

    1.做驱动的时候.做应用程序须要和驱动通信,必须建立一个DLL. 2.由于客户使用版本号太低,须要使用到VC6.0编写DLL 3.在VC6.0上编写DLL的时候,导出的函数名会出现和原函数名不正确,导 ...

  4. Berkeley DB (VC6.0 编译环境配置)

    操作系统:winxp VC环境:VC6.0 必需文件:Berkeley DB安装文件(db-.msi) 下载地址:http://www.oracle.com/technology/software/p ...

  5. pcre7.0在vc6.0编译

    (0)从http://gnuwin32.sourceforge.net/packages/pcre.htm  (pcre windows)下下载最新的windows平台源代码pcre-7.0-src. ...

  6. VC6.0 编译 gdlib 库

    环境  WinXP, MSVC6.0 1 从  https://bitbucket.org/libgd/gd-libgd/downloads 下载最新版本 libgd 2 可以用 nmake 编译 w ...

  7. 使用VC6.0编译C++代码的时候报错:fatal error C1071: unexpected end of file found in comment(Mark ZZ)

    fatal error C1071: unexpected end of file found in comment(Mark ZZ) 今天在一论坛上看到一人发帖: 『最近遇到一个奇怪的问题,代码中的 ...

  8. 校园导游系统(C++实现,VC6.0编译,使用EasyX图形库)

    运行效果: 说明: 由于当年还不会使用多线程,所以很多获取用户点击的地方都是使用循环实现的...CPU占用率会比较高. 代码: //校园导游系统.cpp 1 #include <graphics ...

  9. 贪吃蛇(C++实现,VC6.0编译,使用了EasyX图形库)

    程序效果: 代码: //main.cpp 1 #include <iostream> #include<fstream> #include <graphics.h> ...

随机推荐

  1. JavaBeansDataExchange could not instantiate result class

    当ibatis初始化Bean的时候,会调用无参的构造函数,所以如果Bean中有带参的构造函数,一定得多写个无参的构造函数, 否则ibatis会因找不到构造函数而出错,抛出异常如下:JavaBeansD ...

  2. fedora27安装后的配置工作(持续更新)

    换源 没什么可说的,安装后更换国内软件源是必须做的事,推荐更换阿里的镜像源.换源教程 添加epel源 EPEL (Extra Packages for Enterprise Linux)是基于Fedo ...

  3. 自己动手制作一个本地的yum仓库

    制作本地yum源有两种方式,第一种是使用光盘镜像,然后在本地进行安装.第二种是我们自己创建一个本地yum仓库,然后使用file的形式来向本地提供yum repo(也可以使用http的方式向外部提供,我 ...

  4. X-Pack权限控制之给Kibana加上登录控制以及index_not_found_exception问题解决

    无法查看索引下的日志问题解决 好事多磨,我们还是无法在Kibana下看到数据,究竟是怎么一回事呢? 笔者再次查看了logstash的控制台,又发现了如下错误: logstash outputs ela ...

  5. Docker容器学习与分享09

    Docker容器之间的相互通信 先新建两个不同的网段,就用分享08里的两个网段作为新建的网段. [root@promote ~]# docker network ls NETWORK ID NAME ...

  6. 2019 wannafly winter camp day 3

    2019 wannafly winter camp day 3 J 操作S等价于将S串取反,然后依次遍历取反后的串,每次加入新字符a,当前的串是T,那么这次操作之后的串就是TaT.这是第一次转化. 涉 ...

  7. JS内置对象-String对象、Date日期对象、Array数组对象、Math对象

    一.JavaScript中的所有事物都是对象:字符串.数组.数值.函数... 1.每个对象带有属性和方法 JavaScript允许自定义对象 2.自定义对象 a.定义并创建对象实例 b.使用函数来定义 ...

  8. MySql详解(一)

    MySql详解(一) 作为一名Java开发人员,数据库的地位不用多说了.从大学时期的SqlServer,到现在最流行的MySql和Oracle.前者随着阿里巴巴的去IOE化,在互联网公司中的使用比例是 ...

  9. es6安装babel包

    1.前面下载node.js及安装淘宝镜像可以查看我写的vue.js环境搭建 2.安装完node后,安装babel npm install -g babel-cli 3.检验babel是否安装成功: b ...

  10. JVM各垃圾收集器对比

    本随笔是<深入理解Java虚拟机 JVM高级特性与最佳实践>读书笔记. 1.JDK1.7之后的HotSpot虚拟机所包含的所有收集器如下: 解读: 1. 总共有7种垃圾收集器 2.Seri ...