美文网首页区块链
[EOS]单机部署测试网络(两个节点)

[EOS]单机部署测试网络(两个节点)

作者: ytxing | 来源:发表于2018-06-04 10:23 被阅读127次

[EOS]单机部署测试网络(两个节点)

参考

https://github.com/EOSIO/eos/wiki/Testnet-Single-Host-Multinode

单机部署两个节点的测试网络

启动第一个节点

$ nohup ./nodeos -e -p eosio --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin  --plugin eosio::wallet_api_plugin &

加载bios合约

$ cleos set contract eosio build/contracts/eosio.bios
Reading WAST/WASM from build/contracts/eosio.bios/eosio.bios.wasm...
Using already assembled WASM...
Publishing contract...
executed transaction: 964d6e27d35e3a94e8c1ff33012c34d2d407c05312f5a10baad64dfba445e6ac  3712 bytes  748 us
#         eosio <= eosio::setcode               {"account":"eosio","vmtype":0,"vmversion":0,"code":"0061736d0100000001621260037f7e7f0060057f7e7e7e7e...
#         eosio <= eosio::setabi                {"account":"eosio","abi":"0e656f73696f3a3a6162692f312e30050c6163636f756e745f6e616d65046e616d650f7065...
warning: transaction executed locally, but may not be confirmed by the network yet

创建producernde1账户

作为第二个节点的生产者账户

$ cleos create account eosio producernde1 EOS8UCi6r82EvzxKd5KFv3um3fnfaczqZ5aWT6L4zb9ZkHGQUkVkV EOS5Kth7yY94SHU54X7dvpUnthrfnRwgWSDBsdbuYPyEAbczdxRss

executed transaction: 1333aca9491e214740e89cc4cefcf26a64a38b38177f693900a779712090c1cb  200 bytes  253 us
#         eosio <= eosio::newaccount            {"creator":"eosio","name":"producernde1","owner":{"threshold":1,"keys":[{"key":"EOS8UCi6r82EvzxKd5KF...
warning: transaction executed locally, but may not be confirmed by the network yet

启动第二个节点

$ nohup nodeos --producer-name producernde1 --plugin eosio::chain_api_plugin --plugin eosio::net_api_plugin --http-server-address 127.0.0.1:8889 --p2p-listen-endpoint 127.0.0.1:9877 --p2p-peer-address 127.0.0.1:9876 --config-dir node2 --data-dir node2 --private-key [\"EOS8UCi6r82EvzxKd5KFv3um3fnfaczqZ5aWT6L4zb9ZkHGQUkVkV\",\"${owner-private-key}\"] &

设置产出权限

$ cleos push action eosio setprods "{ \"schedule\": [{\"producer_name\": \"producernde1\",\"block_signing_key\": \"EOS8UCi6r82EvzxKd5KFv3um3fnfaczqZ5aWT6L4zb9ZkHGQUkVkV\"}]}" -p eosio@active
executed transaction: 076cabc41e12ed77665034858dc45eb8ef20b55b221d657377d5a3dedb371b9b  136 bytes  354 us
#         eosio <= eosio::setprods              {"schedule":[{"producer_name":"producernde1","block_signing_key":"EOS8UCi6r82EvzxKd5KFv3um3fnfaczqZ5...
warning: transaction executed locally, but may not be confirmed by the network yet

检查

$ cleos get info
{
  "server_version": "d9df25ac",
  "chain_id": "706a7ddd808de9fc2b8879904f3b392256c83104c1d544b38302cc07d9fca477",
  "head_block_num": 508089,
  "last_irreversible_block_num": 508088,
  "last_irreversible_block_id": "0007c0b865a1adbf4b9d0f4f8d9bb20bebd3531b7841102fb874c9a78a761d00",
  "head_block_id": "0007c0b9f727c1b4d01fd2f0c99f07ef380f4b57b755f1026353efeffebf01df",
  "head_block_time": "2018-06-04T02:16:29",
  "head_block_producer": "producernde1",
  "virtual_block_cpu_limit": 200000000,
  "virtual_block_net_limit": 1048576000,
  "block_cpu_limit": 199900,
  "block_net_limit": 1048576
}
$ cleos -u http://localhost:8889 get info
{
  "server_version": "d9df25ac",
  "chain_id": "706a7ddd808de9fc2b8879904f3b392256c83104c1d544b38302cc07d9fca477",
  "head_block_num": 508125,
  "last_irreversible_block_num": 508124,
  "last_irreversible_block_id": "0007c0dcc2afe567b533dd743a944830f2502ec60dbe1c002ca4b1ec4dd9c132",
  "head_block_id": "0007c0dd1b22286c2b29d732f73627c00de6f1d8ae52fcb68d5d63404009fa9c",
  "head_block_time": "2018-06-04T02:16:47",
  "head_block_producer": "producernde1",
  "virtual_block_cpu_limit": 200000000,
  "virtual_block_net_limit": 1048576000,
  "block_cpu_limit": 199900,
  "block_net_limit": 1048576
}

多个区块生产者

上边的设置,只让其中一个节点产出区块,设置后第一个节点的eosio就不再产生区块,如果想让第一个产生,可以这样设置

cleos push action eosio setprods "{ \"schedule\": [{\"producer_name\": \"eosio\",\"block_signing_key\": \"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV\"}]}" -p eosio@active

或者同时让两个节点都产生区块

cleos push action eosio setprods "{ \"schedule\": [{\"producer_name\": \"eosio\",\"block_signing_key\": \"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV\"},{\"producer_name\": \"producernde1\",\"block_signing_key\": \"EOS8UCi6r82EvzxKd5KFv3um3fnfaczqZ5aWT6L4zb9ZkHGQUkVkV\"}]}" -p eosio@active

相关文章

  • [EOS]单机部署测试网络(两个节点)

    [EOS]单机部署测试网络(两个节点) 参考 https://github.com/EOSIO/eos/wiki/...

  • 2. EOS 测试网络搭建指南

    EOS 测试网络搭建指南 本章节用于指导新手如何搭建 EOS 测试网络。测试网络种类包括:单节点、本地多节点、多主...

  • 【国产】ETL运维批量作业调度管理平台 TASKCTL 8.0

    单机部署 单机部署指的是指我们整个平台只部署一个核心服务节点且没有代理节点。对于后台 TASKCTL 字符界面应用...

  • TASKCTL的单机/分布式部署,启动服务/代理节点监听

    单机部署 单机部署指的是指我们整个平台只部署一个核心服务节点且没有代理节点。对于后台TASKCTL字符界面应用系统...

  • EOS网络

    EOS网络的基础是节点。EOS网络将构建在21个主节点服务器上(及100个备用节点),由节点产生EOS网络的所有区...

  • linux hadoop 伪分布式部署

    单机部署 进程没有 伪分布式部署 进程存在+1节点 开发 集群部署 进程存在+n节点 开发/生产 1、...

  • EOS早期开发者预览版本发布

    虽然EOS正式的测试网络还在准备中,但任何人已经可以在本地节点上创建自己的测试环境了。之后EOS还会有小修改,但不...

  • eos节点部署

    Eos 节点部署 Eos 节点启动命令 相关配置文件 创建默认钱包 生成密钥对 私钥导入钱包(导入私钥后会自动给出...

  • HDFS伪分布部署

    Hadoop的部署有三种: 单机部署:无进程伪分布式部署:进程存在+1个节点,也是我们说的单节点,适合开发集群部署...

  • Nacos系列:Nacos的三种部署模式

    三种部署模式 Nacos支持三种部署模式 1、单机模式:可用于测试和单机使用,生产环境切忌使用单机模式(满足不了高...

网友评论

    本文标题:[EOS]单机部署测试网络(两个节点)

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