首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

海派教你区块链第17天-学习以太坊003

选择以太坊客户端,以太坊提供了多种语言、支持mac、Linux、Windows,为的是让更多开发者能够进入生态,这是目前很多区块链项目所不具备的。

我们在使用这些版本时候可以通过以下两种方式

下载客户端源码;部署编译环境并生成目标文件

直接下载最终版;运行;

由于我是一名开发者,从来都是下载源码,通过下载源码的好处是:

可以查看源码、真正了解V神的代码逻辑和实现方式,是提高自己技术和设计模式的最好教程。

通过源码的编译可以避免节点版本错误和未知的潜在风险

会感觉自己很牛

可以结合自己项目,增加或减少定制的内容

然并卵,我现在还没有部署成功,由于一名区块链开发者,使用的是Mac电脑,还要下载CPP的版本,首先就要下载4个G的XCode(在Mac上的C语言开发环境),因此,在CPP的客户端搞定之前,先搞下Go语言版本的,马上进入go-ethereum的教程。

The go-ethereum client is commonly referred to as geth, which is the the command line interface for running a full ethereum node implemented in Go. By installing and running geth, you can take part in the ethereum frontier live network and:

mine real ether

transfer funds between addresses

create contracts and send transactions

explore block history

and much much more

我的翻译:

go版本以太坊客户端通常使用 geth (Go ETH),通过命令行的接口方式来运行使用Go语言实现的完整以太坊节点,(这句翻译的别扭,不过我懂了),安装和运行geth,可以加入以太坊网络,并可以:

挖矿

在多个账户间交易

创建合约以及发起交易

查看区块历史

以及更多

Links:

Website: http://ethereum.github.io/go-ethereum/

GitHub: https://github.com/ethereum/go-ethereum

Wiki: https://github.com/ethereum/go-ethereum/wiki/geth

Gitter: https://gitter.im/ethereum/go-ethereum

以上为以太坊Go语言版本的相关链接,下一步进入Github,

注意往下翻,看怎么在Mac电脑上安装,(其实开源项目在文档中都写的很明白,因此不用到处找不靠谱的教程)

Automated builds are available for stable releases and the unstable master branch. Binary archives are published at

https://geth.ethereum.org/downloads/.

如果需要运行编译好的Geth,可以从以上地址下载,可我是开发者,怎么能下载编译好的呢,一定要自己搞,自己搞,自己搞,

1.Installing with Homebrew

By far the easiest way to install go-ethereum is to use our Homebrew tap. If you don't have Homebrew, install it first.

1.1先安装Homebrew,这是一个包管理工具

Then run the following commands to add the tap and install geth:

1.2运行以下命令,安装Geth

brew tap ethereum/ethereum

brew install ethereum

You can install the develop branch by running --devel:

1.3 如果按照开发者模式安装请加入参数 --devel

brew install ethereum --devel

After installing, run geth account new to create an account on your node.

You should now be able to run geth and connect to the network.

Make sure to check the different options and commands with geth --help

For options and patches, see: https://github.com/ethereum/homebrew-ethereum

2.Building from source

编译源码方式

Building Geth(command line client)

Clone the repository to a directory of your choosing:

git clone https://github.com/ethereum/go-ethereum

1.从github下载Go版本ETH代码

Building geth requires the Go compiler:

brew install go

2.下载 Go编译器

Finally, build the geth program using the following command.

cd go-ethereum

make geth

3.执行以上命令,编译geth

If you see some errors related to header files of Mac OS system library, install XCode Command Line Tools, and try again.

4.如果出错,下载Xcode(这里又要下)

xcode-select --install

You can now run build/bin/geth to start your node.

---------------------------------------------------------------------------------------------------

武林秘籍功法已学,下面开始实践

果然,上来就出错,看来要先升级HomeBrew,再下载Xcode,Go版本也不顺利,睡觉,明天再搞。

2018.4.10日评:【BTC反弹未果,不宜抄底】BTC 早盘延续昨日反弹的走势,其主要围绕7000关口盘展开攻守战,日内一度冲高至7166.99,在18:10出现暴跌行情,最低下探至6639.63,跌幅3.99%,报收6722.95,从技术面来看,日K线收了一个镊子线,均线系统、量能线依然向下。操作建议:激进投资者可适量做空,稳健投资者观望。【币市有风险,入市需谨慎】

  • 发表于:
  • 原文链接http://kuaibao.qq.com/s/20180410G1YSD200?refer=cp_1026
  • 腾讯「腾讯云开发者社区」是腾讯内容开放平台帐号(企鹅号)传播渠道之一,根据《腾讯内容开放平台服务协议》转载发布内容。
  • 如有侵权,请联系 cloudcommunity@tencent.com 删除。

扫码

添加站长 进交流群

领取专属 10元无门槛券

私享最新 技术干货

扫码加入开发者社群
领券