关闭

【QTUM】MacOS部署量子链环境

标签: qtum量子链智能合约区块链技术
2507人阅读 评论(0) 收藏 举报
分类:

什么是量子链

量子链是一个基于比特币核心和集成Ethereum的智能合约的新的区块链。他实现了一种可扩展的设计,能添加更多的虚拟机,允许账户的虚拟机在UTXO的区块链上执行。

安装

需要有OS X的命令行工具

xcode-select --install

需要环境安装Homebrew.

安装依赖

brew install cmake automake berkeley-db4 libtool boost --c++11 --without-single --without-static miniupnpc openssl pkg-config protobuf qt5 libevent imagemagick --with-librsvg

安装核心


xiaoyu@LIXIAOYUdeMacBook-Pro.com➤ git clone --recursive https://github.com/qtumproject/qtum.git
Cloning into 'qtum'...
remote: Counting objects: 82732, done.
remote: Compressing objects: 100% (172/172), done.
remote: Total 82732 (delta 147), reused 148 (delta 84), pack-reused 82476
Receiving objects: 100% (82732/82732), 70.07 MiB | 91.00 KiB/s, done.
Resolving deltas: 100% (61844/61844), done.
Submodule 'src/cpp-ethereum' (https://github.com/qtumproject/cpp-eth-qtum.git) registered for path 'src/cpp-ethereum'
Cloning into '/Users/xiaoyu/qtum/qtum/src/cpp-ethereum'...
remote: Counting objects: 114829, done.        
remote: Total 114829 (delta 0), reused 0 (delta 0), pack-reused 114829        
Receiving objects: 100% (114829/114829), 49.26 MiB | 851.00 KiB/s, done.
Resolving deltas: 100% (73868/73868), done.
Submodule path 'src/cpp-ethereum': checked out '488ccdc7cef0a0b4fa54c88b7e44e43ed8316ea7'
Submodule 'evmjit' (https://github.com/ethereum/evmjit) registered for path 'src/cpp-ethereum/evmjit'
Cloning into '/Users/xiaoyu/qtum/qtum/src/cpp-ethereum/evmjit'...
remote: Counting objects: 6600, done.        
remote: Total 6600 (delta 0), reused 0 (delta 0), pack-reused 6600        
Receiving objects: 100% (6600/6600), 1.91 MiB | 306.00 KiB/s, done.
Resolving deltas: 100% (4282/4282), done.
Submodule path 'src/cpp-ethereum/evmjit': checked out '81fc5be25987020f498ea0100a7fb9055c08b84f'

遇到的问题

configure: WARNING: libprotobuf not found; bitcoin-qt frontend will not be buil

解决问题

//更新了cmake,更新后的版本为3.9.2
brew upgrade cmake
//再次执行以下命令
brew install cmake automake berkeley-db4 libtool boost --c++11 --without-single --without-static miniupnpc openssl pkg-config protobuf qt5 libevent imagemagick --with-librsvg

xiaoyu@LIXIAOYUdeMacBook-Pro.com➤ brew install cmake automake berkeley-db4 libtool boost --c++11 --without-single --without-static miniupnpc openssl pkg-config protobuf qt5 libevent imagemagick --with-librsvg
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
anjuta                                         baobab                                         gdl

Warning: cmake 3.9.2 is already installed
Warning: automake 1.15.1 is already installed
Warning: berkeley-db@4 4.8.30 is already installed
Warning: libtool 2.4.6_1 is already installed
Warning: boost 1.65.1 is already installed
Warning: miniupnpc 2.0.20170509 is already installed
Warning: openssl 1.0.2l is already installed
Warning: pkg-config 0.29.2 is already installed
Warning: protobuf 3.4.0 is already installed, it's just not linked.
You can use `brew link protobuf` to link this version.
Warning: qt 5.9.1 is already installed
Warning: libevent 2.1.8 is already installed, it's just not linked.
You can use `brew link libevent` to link this version.
Warning: imagemagick 7.0.7-1 is already installed, it's just not linked.
You can use `brew link imagemagick` to link this version.


//提示需要执行link操作,下面执行了link操作,提示权限不足

xiaoyu@LIXIAOYUdeMacBook-Pro.com➤ brew link protobuf
Linking /usr/local/Cellar/protobuf/3.4.0... 
Error: Could not symlink lib/pkgconfig/protobuf-lite.pc
/usr/local/lib/pkgconfig is not writable.

//但是不支持root用户执行
xiaoyu@LIXIAOYUdeMacBook-Pro.com➤ sudo brew link protobuf
Password:
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.

//解决方式,unlnk后再执行link就行了,protobuf  libevent imagemagick 一样处理

~/qtum/qtum git:(master) [15:28:23]
xiaoyu@LIXIAOYUdeMacBook-Pro.com➤ brew unlink protobuf     
Unlinking /usr/local/Cellar/protobuf/3.4.0... 0 symlinks removed
❖  ~/qtum/qtum git:(master) [15:28:54]
xiaoyu@LIXIAOYUdeMacBook-Pro.com➤ brew link protobuf 
Linking /usr/local/Cellar/protobuf/3.4.0... 15 symlinks created

❖  ~/qtum/qtum git:(master) [15:31:51]
xiaoyu@LIXIAOYUdeMacBook-Pro.com➤ brew unlink libevent
Unlinking /usr/local/Cellar/libevent/2.1.8... 0 symlinks removed
❖  ~/qtum/qtum git:(master) [15:32:11]
xiaoyu@LIXIAOYUdeMacBook-Pro.com➤ brew link libevent 
Linking /usr/local/Cellar/libevent/2.1.8... 817 symlinks created

~/qtum/qtum git:(master) [15:32:17]
xiaoyu@LIXIAOYUdeMacBook-Pro.com➤ brew unlink imagemagick
Unlinking /usr/local/Cellar/imagemagick/7.0.7-1... 0 symlinks removed
~/qtum/qtum git:(master) [15:32:34]
xiaoyu@LIXIAOYUdeMacBook-Pro.com➤ brew link imagemagick 
Linking /usr/local/Cellar/imagemagick/7.0.7-1... 71 symlinks created

//再次执行,证明全部环境安装完毕,没有报错
❖  ~/qtum/qtum git:(master) [15:32:41]
xiaoyu@LIXIAOYUdeMacBook-Pro.com➤ brew install cmake automake berkeley-db4 libtool boost --c++11 --without-single --without-static miniupnpc openssl pkg-config protobuf qt5 libevent imagemagick --with-librsvg
Updating Homebrew...
Warning: cmake 3.9.2 is already installed
Warning: automake 1.15.1 is already installed
Warning: berkeley-db@4 4.8.30 is already installed
Warning: libtool 2.4.6_1 is already installed
Warning: boost 1.65.1 is already installed
Warning: miniupnpc 2.0.20170509 is already installed
Warning: openssl 1.0.2l is already installed
Warning: pkg-config 0.29.2 is already installed
Warning: protobuf 3.4.0 is already installed
Warning: qt 5.9.1 is already installed
Warning: libevent 2.1.8 is already installed
Warning: imagemagick 7.0.7-1 is already installed

再次执行

❖  ~/qtum/qtum git:(master) [15:34:51]
xiaoyu@LIXIAOYUdeMacBook-Pro.com➤ ./configure   
(.....)
Options used to compile and link:
  with wallet   = yes
  with gui / qt = yes
    qt version  = 5
    with qr     = auto
  with zmq      = no
  with test     = yes
  with bench    = yes
  with upnp     = yes
  debug enabled = no
  werror        = no

  target os     = darwin
  build os      = darwin

  CC            = gcc
  CFLAGS        = -g -O2
  CPPFLAGS      =  -DQTUM_BUILD -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -I/usr/local/opt/berkeley-db@4/include -DMAC_OSX
  CXX           = g++ -std=c++11
  CXXFLAGS      = -g -O2 -Wall -Wextra -Wformat -Wvla -Wformat-security -Wno-unused-parameter -Wno-self-assign -Wno-unused-local-typedef -Wno-deprecated-register -Wno-unknown-pragmas
  LDFLAGS       =  -Wl,-headerpad_max_install_names -Wl,-dead_strip

下面进行编译

make

经过漫长的等待,编译成功。

Making all in doc/man
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all-am'.

启动

执行src/qtumd或者src/qtum-cli

启动UI界面的话,执行src/qt/qtum-qt

注意目前的是主干网络

领取测试网络的币

访问 http://qtum.me/#!/ ,领取测试币的发放。

http://skynet.qtum.me/#!/

在钱包界面,找到receive,在界面中,点击请求付款,就会得到一个地址,将地址复制到网页中,就能收到测试代币。

一直没收到,失败~

切换到测试网络

拉取测试网络的代码
git checkout testnet-2

然后再次执行

./autogen.sh
./configure 
make

注意的是,切换网络后,需要删除之前用的数据文件,所在的位置是~/Library/Application Support/Qtum

到此,量子链的正式环境和测试环境部署完成。

参考资料

https://github.com/qtumproject/qtum

0
0
查看评论

如何通过Qtum量子链账户抽象层打通比特币和以太坊生态?

Qtum账户抽象层(AAL)实现简析 Qtum设计上以比特币UTXO为基础账户模型,并实现了支持EVM规范的智能合约,这是通过账户抽象层(Account Abstract Layer, AAL)来完成的。AAL对UTXO账户和EVM合约账户之间进行了适配,这样通过AAL可以使用UTXO交易输出...
  • taifei
  • taifei
  • 2017-06-28 09:04
  • 1095

【区块链】量子链命令行qtum-cli全命令详解

量子链命令行qtum-cli全命令详解== Blockchain ==callcontract “address” “data” ( address )调用智能合约getaccountinfo “address”获取账户信息getbestblockhash获取最长链的hashgetblock “bl...
  • diandianxiyu
  • diandianxiyu
  • 2017-10-11 09:53
  • 5816

量子链Qtum ERC20 兑换为主网络币的公告

量子链(Qtum)主干网络已经于2017年9月13日发布,到目前为止,运行稳定。目前持有基于ETH网络的QTUM ERC20代币的用户需要按照以下方法1:1兑换为Qtum的主网络币。gate.io平台用户的QTUM已经自动转换为Qtum主网络币。gate.io对场外用户支持量子链两种币的兑换。兑换方...
  • sinat_34070003
  • sinat_34070003
  • 2018-01-19 14:55
  • 163

【区块链】DOCKER部署量子链私有网络环境以及部署智能合约实践

DOCKER部署量子链私有网络环境以及部署智能合约实践安装环境安装Dockerhttps://store.docker.com/editions/community/docker-ce-desktop-mac这里安装的是CE的稳定版xiaoyu@LIXIAOYUdeMacBook-Pro.com➤ ...
  • diandianxiyu
  • diandianxiyu
  • 2017-10-16 16:33
  • 4529

帅初:我为什么要做量子链?

硅谷Live / 实地探访 / 热点探秘 / 深度探讨帅初(Patrick Dai),2017年《福布斯》中国 30 under 30、中国科学院博士辍学、Qtum量子链创始人兼CEO,过去5年一直致力于区块链技术的发展和创新,使区块链技术早日走向主流商业社会,并通过技术创新引领...
  • kXYOnA63Ag9zqtXx0
  • kXYOnA63Ag9zqtXx0
  • 2018-02-05 00:00
  • 266

5、macos环境部署——mysql部署

从官网下载:https://dev.mysql.com/downloads/file/?id=467574  双击打开,启动安装。 启动mysql 然后在偏好设置中出现了mysql程序。 点击后,再点击Start MySQL Server,即可启动mysql程序。 也可以右键偏好...
  • notbaron
  • notbaron
  • 2017-04-02 17:09
  • 30419

macOS上搭建python环境

今天刚接触python,查看了一些环境建立的文章,可能是年代久远很多都不适用,现在mac搭建python环境变得更简单。大神勿喷。首先去python官网下载anaconda,我下载的是Python3.6,64位的。 下载后直接安装。 安装完成后 将anaconda的bin目录加入PATH ech...
  • cafeshadow
  • cafeshadow
  • 2017-09-08 17:56
  • 452

Qtum量子链创始人帅初:95%的项目在3年后,应该都不在

“币圈一天,人间一年”每天的凌晨都是新的一年的开始。春节?不存在的。在这个全国人民都在休假的日子,区块链社区“三点钟无眠区块链”一直保持7*24*365全时段活跃,就在今天著名区块链技术专家、Qtum量子链创始人帅初,在群内给大家分享解答,打开区块链更深层的大门。帅初简介:著名区块链技术专家、Qtu...
  • q1ZG4Sw
  • q1ZG4Sw
  • 2018-02-17 00:00
  • 28

浅谈增量部署的svn和全量部署的git

1、增量部署 增量部署一般指在每次部署过程中,首先提取当前版本和即将部署版本之间的增量(包括代码、可执行文件或配置等),并在部署过程中仅更新增量部分。 (1)增量部署的部署流程: 利用代码管理工具(SVN等)提取两个版本之间的增量,并结合其他方面的增量变化。按照增量部分制定具体的部署方...
  • zhouziyu2011
  • zhouziyu2011
  • 2017-03-12 18:59
  • 1538

macOS下搭建Node.js环境

macOS下搭建Node.js环境
  • feng2qing
  • feng2qing
  • 2017-02-14 21:08
  • 545
    个人资料
    • 访问:649620次
    • 积分:9118
    • 等级:
    • 排名:第2456名
    • 原创:298篇
    • 转载:13篇
    • 译文:4篇
    • 评论:82条
    博客专栏
    微信订阅号
    欢迎加入QQ群
    玩家老黄历(微信小程序)
    谢谢支持~
    最新评论