美文网首页EOS技术爱好者EOS开发系列EOS学习资料
EOS开发(1) -- 安装及常用工具介绍

EOS开发(1) -- 安装及常用工具介绍

作者: freelands | 来源:发表于2018-03-14 22:29 被阅读1401次
tools.png

目录

EOS开发(1) -- 安装及常用工具介绍
EOS开发(2) -- 发布智能合约
EOS开发(3) -- currency合约分析

介绍

eos致力于打造一个企业级的去中心化操作系统,可以理解成一个Saas平台,很多人可以在上面构建dapp或者Pass,今天我们来一起探索下如何在本地启动eos节点(mac or ubuntu)

eos文档

安装

  • 拉取代码并切换分支
git clone https://github.com/eosio/eos --recursive //注意这里要递归的下载子模块
git checkout dawn-2.x //切换到2.x稳定版本
  • 本地代码build
./build.sh 
709
Usage: bash build.sh TARGET [full|build]
Targets: ubuntu darwin
可以看到用法不对 要指定操作系统

如果你是mac 执行(官方推荐Ubuntu16.10)
./build.sh  darwin
如果你是ubuntu 执行
./build.sh  ubuntu
 ps : 在build的过程中可能要输入几次电脑root密码,build过程可能要个10-20分钟
  • 启动eos 后台进程
cd eos/build/programs/eosd
./eosd
执行上述命令后会报错 不过没有关系,这是会在eosd文件夹下生成一个data-dir目录
进入这个目录会看到`config.ini`文件,这个是eos 区块生产者以及需要加载模块的配置
在编辑这个文件前我们先去备份一份,后面我们会用到里面的数据
cp config.ini config.ini.back
  • 把下面的配置copy到config.ini里,注意genesis-json是创世区块的配置,默认就是在eos目录下,这个需要替换掉
# Load the testnet genesis state, which creates some initial block producers with the default key
genesis-json = /path/to/eos/source/genesis.json #这个要配置成创世区块的路径
 # Enable production on a stale chain, since a single-node test chain is pretty much always stale
enable-stale-production = true
# Enable block production with the testnet producers
producer-name = inita
producer-name = initb
producer-name = initc
producer-name = initd
producer-name = inite
producer-name = initf
producer-name = initg
producer-name = inith
producer-name = initi
producer-name = initj
producer-name = initk
producer-name = initl
producer-name = initm
producer-name = initn
producer-name = inito
producer-name = initp
producer-name = initq
producer-name = initr
producer-name = inits
producer-name = initt
producer-name = initu
# Load the block producer plugin, so you can produce blocks
plugin = eosio::producer_plugin
# Wallet plugin
plugin = eosio::wallet_api_plugin
# As well as API and HTTP plugins
plugin = eosio::chain_api_plugin
plugin = eosio::http_plugin
  • 再次启动eos,可以看到已经在生产区块了,测试链默认1s中一个区块,主链好像是3s中一个区块,是21个区块默认协作生产,采用的是dpos共识算法,感兴趣的可以去了解下

  • eos start.png

区块链技术交流

image.png

相关文章

网友评论

    本文标题:EOS开发(1) -- 安装及常用工具介绍

    本文链接:https://www.haomeiwen.com/subject/hafqqftx.html