本篇文章将讲解如何将自己机器部署的节点链接到EOS主网,并同步区块数据。

1.源码编译
2.修改config.ini
  • 修改producer-name为自己的节点名,例如producer-name = eos.dos
  • 修改private-key为自己的公钥私钥(在线生成
  • 添加p2p-peer-address 一些已知稳定访问的公网节点
    三种方式获取可用的p2p-peer-address:
  1. (科学上网访问)
  2. (EOSPark 进入BP节点,查看接入点)
  3. (已测试当前可用节点)
  4. (Block Producer bp.json Validator)
  5. (eosnation)
p2p-peer-address = node1.eosnewyork.io:6987
p2p-peer-address = p2p.eos42.io:9876
p2p-peer-address = peering.mainnet.eoscanada.com:9876
p2p-peer-address = node1.starteos.io:9876
  • 按自己需要添加一些插件支持
    plugin = eosio::chain_api_plugin
    plugin = eosio::history_api_plugin
    plugin = eosio::chain_plugin
    plugin = eosio::history_plugin
    plugin = eosio::net_plugin
    plugin = eosio::net_api_plugin

~/.local/share/eosio/nodeos/config目录下执行 (目录可随意)

wget https://github.com/EOS-Mainnet/eos/raw/mainnet-1.0.5/mainnet-genesis.json

在上面目录下执行nodeos --genesis-json mainnet-genesis.json
出现错误Genesis state can only be set on a fresh blockchain
修改执行命令为

nodeos --genesis-json mainnet-genesis.json --delete-all-blocks

执行cleos get info查看chain_id

已经为EOS主网络。