https://hub.docker.com/r/eosio/eos-dev/
https://developers.eos.io/eosio-nodeos/docs/docker-quickstart # EOS官方开发文档
https://eos.io/ https://github.com/EOSIO/
https://eosflare.io/ # EOS区块链浏览器
https://block.cc/coin/eos # 查看区块链信息
EOS是Block.One公司开发的一款超高性能的类操作系统区块链,其设计目标是:
- 支持大量用户,可能是上亿级别的用户
- 消除手续费(可以免费使用)
- 超高性能(支持百万级TPS)
- 具备横向和纵向性能扩展能力
EOS代币:
市面上流通的EOS代币最初是基于以太坊发行的ERC20代币,代号为EOS,目前通过将以太坊token映射到EOS主网,可以兑换成主网的真正EOS Token。
EOS代币如何增值:
跟其他Token不同,EOS代币代表的是是EOS主网资源的拥有权,也就是说只要你持有部分EOS,那么EOS主网的部分资源理论上就永远属于你,这也是为什么EOS区块链能做到免费给用户提供服务的原因。EOS是一个为DApp而生的超高性能公链,越往后发展上面的应用也就会越多,当EOS网络上的应用越多时,EOS的主网资源就会越宝贵,这时候EOS代币就会越值钱。
docker部署
应用: bigdata -> 添加服务: eosio
镜像: eosio/eos-dev:latest
命令:
/bin/bash -c "nodeos -e -p eosio --plugin eosio::wallet_api_plugin --plugin eosio::wallet_plugin --plugin eosio::producer_plugin --plugin eosio::history_plugin --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --plugin eosio::http_plugin -d /mnt/dev/data --config-dir /mnt/dev/config --http-server-address=0.0.0.0:8888 --access-control-allow-origin=* --contracts-console"
卷:
/etc/localtime:/etc/localtime:ro
/data/file:/data/file
/data/docker/bigdata/eosio/work:/work
/data/docker/bigdata/eosio/data:/mnt/dev/data
/data/docker/bigdata/eosio/config:/mnt/dev/config:ro
端口:8092(http)-8888
保存ip: 升级或替换 不变
主机名: 使用容器名称
=======说明========
#1.验证节点通信
docker logs --tail 10 eosio
正常情况下输出的内容应该类似于这样:
212500ms thread-0 producer_plugin.cpp:1087 produce_block ] Produced block 000000ac1a243dd1... #172 @ 2018-07-05T04:03:32.500 signed by eosio [trxs: 0, lib: 171, confirmed: 0]
#2.在浏览器中查看节点信息
在浏览器地址栏访问 http://localhost:8888/v1/chain/get_info,检查RPC接口是否正常工作,正常情况下会显示:
{
"server_version": "5875549c",
"chain_id": "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f",
"head_block_num": 2233,
"last_irreversible_block_num": 2232,
"last_irreversible_block_id": "000008b872290cc75b8cb68b836a82ff87a1cc39b75f88341765f68bc925a623",
"head_block_id": "000008b9c9c9c11ee3e4c95613c971861788f7e80a82e20bcad0c2ef622aa7be",
"head_block_time": "2018-07-05T04:20:43.000",
"head_block_producer": "eosio",
"virtual_block_cpu_limit": 1861596,
"virtual_block_net_limit": 9777935,
"block_cpu_limit": 199900,
"block_net_limit": 1048576
}
以上信息我们还可以通过cleos get info命令查看到。
至此,我们就在Docker容器中成功地运行了一个EOS节点区块链!
#3客户端配置
在docker下使用cleos客户端,我们需要以Docker的命令方式来运行,且需要带命令的完整路径,如/opt/eosio/bin/cleos,为了后续操作方便,我们给cleos命令配置一下别名:
alias cleos='docker exec eosio /opt/eosio/bin/cleos --wallet-url http://localhost:8888'
我们试着在终端测试一下是否生效:
$ cleos --help
看到命令的相关参数信息就说明已经可以运行生效了。
关闭节点运行
$ docker stop eosio
之前使用eosio_build.sh脚本的安装方式时,只能粗暴的按Ctrl+C中断节点,有了Docker后,就能优雅地关闭节点了。
#源码部署
镜像:ubuntu:latest
apt update
apt upgrade
apt dist-upgrade
apt autoremove
apt-get install -y wget vim net-tools curl git cron axel
apt clean
cd /data/file/work
git clone https://github.com/EOSIO/eos --recursive # --recursive参数,子模块的代码一同下载
cd eos
git checkout-b dawn-v4.0.0 # 下载完成后,切换到tag dawn-v4.0.0
https://github.com/mongodb/mongo-c-driver/releases
apt-get install pkg-config libssl-dev libsasl2-dev
wget https://github.com/mongodb/mongo-c-driver/releases/download/1.10.2/mongo-c-driver-1.10.2.tar.gz
tar -xzvf mongo-c-driver-1.10.2.tar.gz && rm -rf mongo-c-driver-1.10.2.tar.gz
cd mongo-c-driver-1.10.2
./configure --disable-automatic-init-and-cleanup
cd ../
vi scripts/eosio_build_ubuntu.sh # 去掉sudo
./eosio_build.sh
vim /etc/profile
export PATH=${HOME}/opt/mongodb/bin:$PATH
source /etc/profile
cd /data/file/work/eos/build && make test
make install
/usr/local/eosio/bin/nodeos # 运行
vi ~/.local/share/eosio/nodeos/config/config.ini
enable-stale-production = true
producer-name = eosio
plugin = eosio::producer_plugin
plugin = eosio::wallet_api_plugin
plugin = eosio::chain_api_plugin
plugin = eosio::http_plugin
plugin = eosio::history_api_plugin
/usr/local/eosio/bin/nodeos # 再次运行
如果报错Failed to start a pending block, will try again later,则按如下处理:
rm -rf ~/.local/share/eosio/nodeos/data/shared_mem
参考网址:
https://www.linuxidc.com/Linux/2018-09/154498.htm
https://blog.csdn.net/lys07962000/article/details/80371944