EOS主网部署

从2018年10月份左右,开始接触EOS,搭建了单机或集群环境,也写了一些文档。最近整理电脑时发现,在这里分享出来。。。。

系统: linux ubuntu 16.04

下载主网源码

git clone https://github.com/EOS-Mainnet/eos

cd eos

git submodule update --init --recursive

查看版本

git tag

EOS主网部署_第1张图片

 

切换最新分支

git checkout mainnet-1.1.6

git branch

 

执行脚本

sudo ./eosio_build.sh

EOS主网部署_第2张图片

 

sudo ./eosio_install.sh

EOS主网部署_第3张图片

 

配置文件

修改config.ini

~/.local/share/eosio/nodeos/config

# fullnode sample config

blocks-dir = "blocks"

chain-state-db-size-mb = 1024

reversible-blocks-db-size-mb = 340

contracts-console = false

https-client-validate-peers = 1

http-server-address = 0.0.0.0:8888

access-control-allow-credentials = false

p2p-listen-endpoint = 0.0.0.0:9876

p2p-server-address = 0.0.0.0:9876

# List of peers

p2p-peer-address = p2p.one.eosdublin.io:9876

p2p-peer-address = eu-west-nl.eosamsterdam.net:9876

p2p-peer-address = p2p.mainnet.eosgermany.online:9876

p2p-peer-address = 35.197.190.234:19878

p2p-peer-address = p2p.genereos.io:9876

p2p-peer-address = fullnode.eoslaomao.com:443

p2p-peer-address = new.eoshenzhen.io:10034

p2p-peer-address = node1.eosphere.io:9876

p2p-peer-address = p2p.meet.one:9876

p2p-peer-address = bp.eosbeijing.one:8080

p2p-peer-address = peer1.mainnet.helloeos.com.cn:80

p2p-peer-address = p2p-public.hkeos.com:19875

p2p-peer-address = pub1.eostheworld.io:9876

p2p-peer-address = eu1.eosdac.io:49876

p2p-peer-address = peer.eosio.sg:9876

p2p-max-nodes-per-host = 10

agent-name = "kevincaokun1"

# allowed-connection can be set to "specified" to use whitelisting with the "peer-key" option

allowed-connection = any

# peer-private-key is needed if you are whitelisting specific peers with the "peer-key" option

peer-private-key = ["EOS6qTvpRYx35aLonqUkWAMwAf3mFVugYfQCbjV67zw2aoe7Vx7qd", "5JroNC1B4pz9gJzNZeU7tkU6YMtoeWRCr4CJJwKsVXnJhRbKXSC"]

max-clients = 250

connection-cleanup-period = 30

network-version-match = 1

sync-fetch-span = 100

max-implicit-request = 1500

enable-stale-production = false

pause-on-startup = false

max-transaction-time = 10000

max-irreversible-block-age = -1

txn-reference-block-lag = 0

# Plugins used for full nodes

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

 

 

创建genesis.json

/www/eos-mainnet/eos/build/programs/nodeos

{

  "initial_timestamp": "2018-06-08T08:08:08.888",

  "initial_key": "EOS7EarnUhcyYqmdnPon8rm7mBCTnBoot6o7fE2WzjvEX2TdggbL3",

  "initial_configuration": {

    "max_block_net_usage": 1048576,

    "target_block_net_usage_pct": 1000,

    "max_transaction_net_usage": 524288,

    "base_per_transaction_net_usage": 12,

    "net_usage_leeway": 500,

    "context_free_discount_net_usage_num": 20,

    "context_free_discount_net_usage_den": 100,

    "max_block_cpu_usage": 200000,

    "target_block_cpu_usage_pct": 1000,

    "max_transaction_cpu_usage": 150000,

    "min_transaction_cpu_usage": 100,

    "max_transaction_lifetime": 3600,

    "deferred_trx_expiration_window": 600,

    "max_transaction_delay": 3888000,

    "max_inline_action_size": 4096,

    "max_inline_action_depth": 4,

    "max_authority_depth": 6

  }

}

 

启动nodeos

/www/eos-mainnet/eos/build/programs/nodeos

vim start.sh

#!/bin/bash



nohup ./nodeos --genesis-json genesis.json &

chmod 777 start.sh

./start.sh

 

nodeos启动后使用 cleos get info 命令查看链的chain_id 是否下面这行代码

aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906

EOS主网部署_第4张图片

 

区块数据正常同步以后,可以使用cleos命令行对链条进行一些操作,比如:查看191块的数据

cleos get block 191

EOS主网部署_第5张图片

 

在线查看EOS网络信息

如果仅是想查看EOS主网和测试网络上的部分信息,区块浏览器直接可用

主网:

Jungle Mainnet:http://eosnetworkmonitor.io/#home

EOSTEA : https://eosmonitor.io/

EOSpark: https://eospark.com/

测试网:

Jungle Testnet:http://jungle.cryptolions.io/

EOSTEA:https://party.eosmonitor.io/

 

通过在线api查询blocknumber为191的blockinfo

EOS主网部署_第6张图片

 

EOS主网部署_第7张图片

EOS主网部署_第8张图片

 

参考资料

https://blog.csdn.net/caokun_8341/article/details/80656765

https://blog.csdn.net/w7849516230/article/details/80809329

https://github.com/CryptoLions/EOS-MainNet

你可能感兴趣的:(eos,eos,区块链)