eos bp节点 超级节点搭建

2023-10-27

https://github.com/nebulaprotocol,这个网址里面有一个 fake-terminal-website 比较有意思,可以看看示例: https://bp.nebulaprotocol.com/

 


 
  • 搭建eos BP节点
 
环境搭建与配置
安装最新版本
$ wget https://github.com/eosio/eos/releases/download/v1.8.1/eosio-1.8.1-1.el7.x86_64.rpm $ sudo yum install ./eosio-1.8.1-1.el7.x86_64.rpm
 
设置一个合约目录(目前没有用到)
mkdir contracts cd contracts
 
启动keosd
keosd &
 
启动nodeos
执行以下命令 nodeos -e -p eosio \ --plugin eosio::producer_plugin \ --plugin eosio::chain_api_plugin \ --plugin eosio::http_plugin \ --plugin eosio::history_plugin \ --plugin eosio::history_api_plugin \ --access-control-allow-origin='*' \ --contracts-console \ --http-validate-host=false \ --verbose-http-errors >> nodeos.log 2>&1 &
 
tail -f nodeos.log查看启动日志:
1929001ms thread-0   producer_plugin.cpp:585       block_production_loo ] Produced block 0000366974ce4e2a... #13929 @ 2018-05-23T16:32:09.000 signed by eosio [trxs: 0, lib: 13928, confirmed: 0]
1929502ms thread-0   producer_plugin.cpp:585       block_production_loo ] Produced block 0000366aea085023... #13930 @ 2018-05-23T16:32:09.500 signed by eosio [trxs: 0, lib: 13929, confirmed: 0]
1930002ms thread-0   producer_plugin.cpp:585       block_production_loo ] Produced block 0000366b7f074fdd... #13931 @ 2018-05-23T16:32:10.000 signed by eosio [trxs: 0, lib: 13930, confirmed: 0]
1930501ms thread-0   producer_plugin.cpp:585       block_production_loo ] Produced block 0000366cd8222adb... #13932 @ 2018-05-23T16:32:10.500 signed by eosio [trxs: 0, lib: 13931, confirmed: 0]
1931002ms thread-0   producer_plugin.cpp:585       block_production_loo ] Produced block 0000366d5c1ec38d... #13933 @ 2018-05-23T16:32:11.000 signed by eosio [trxs: 0, lib: 13932, confirmed: 0]
1931501ms thread-0   producer_plugin.cpp:585       block_production_loo ] Produced block 0000366e45c1f235... #13934 @ 2018-05-23T16:32:11.500 signed by eosio [trxs: 0, lib: 13933, confirmed: 0]
1932001ms thread-0   producer_plugin.cpp:585       block_production_loo ] Produced block 0000366f98adb324... #13935 @ 2018-05-23T16:32:12.000 signed by eosio [trxs: 0, lib: 13934, confirmed: 0]
1932501ms thread-0   producer_plugin.cpp:585       block_production_loo ] Produced block 00003670a0f01daa... #13936 @ 2018-05-23T16:32:12.500 signed by eosio [trxs: 0, lib: 13935, confirmed: 0]
1933001ms thread-0   producer_plugin.cpp:585       block_production_loo ] Produced block 00003671e8b36e1e... #13937 @ 2018-05-23T16:32:13.000 signed by eosio [trxs: 0, lib: 13936, confirmed: 0]
1933501ms thread-0   producer_plugin.cpp:585       block_production_loo ] Produced block 0000367257fe1623... #13938 @ 2018-05-23T16:32:13.500 signed by eosio [trxs: 0, lib: 13937, confirmed: 0]

 

 
校验钱包
cleos wallet list
控制台返回
Wallets: []
 
查看chain信息
 
 
  • 创建钱包
生成default钱包的密钥到指定文件
cleos wallet create --file wallet-file
 
 
导入私钥
cleos wallet import(输入私钥 )
private key: warn 2019-08-12T12:00:24.677 thread-0 wallet.cpp:223 save_wallet_file ] saving wallet to file /home/ec2-user/eosio-wallet/./default.wallet
imported private key for: xxxxxxxxx
 
导入成功后可使用cleos wallet keys命令查看
 
 
 
创世节点相关配置和脚本
cd ~
mkdir biosboot
cd biosboot
mkdir genesis
cd genesis
cd ~/biosboot
touch genesis.json
vi genesis.json
将下面的文本复制到genesis.json(注意,不需要做任何更改)
{ "initial_timestamp": "2018-06-08T08:08:08.888", "initial_key": "xxxxxx", "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 } }
 
 
cd ~/biosboot/genesis touch genesis_start.sh
genesis_start.sh内容如下:
#!/bin/bash DATADIR="./blockchain" if [ ! -d $DATADIR ]; then mkdir -p $DATADIR; fi nodeos \ --genesis-json $DATADIR"/../../genesis.json" \ --data-dir $DATADIR"/data" \ --blocks-dir $DATADIR"/blocks" \ --config-dir $DATADIR"/config" \ --access-control-allow-origin=* \ --contracts-console \ --http-validate-host=false \ --verbose-http-errors \ --enable-stale-production \ >> $DATADIR"/nodeos.log" 2>&1 & \ echo $! > $DATADIR"/eosd.pid"
 
chmod 755 genesis_start.sh ./genesis_start.sh
执行后可通过日志查看启动情况 tail -fn300 ./blockchain/nodeos.log
 
停止nodeos
vi stop.sh
 
#!/bin/bash DATADIR="./blockchain/" if [ -f $DATADIR"/eosd.pid" ]; then pid=`cat $DATADIR"/eosd.pid"` echo $pid kill $pid rm -r $DATADIR"/eosd.pid" echo -ne "Stoping Node" while true; do [ ! -d "/proc/$pid/fd" ] && break echo -ne "." sleep 1 done echo -ne "\rNode Stopped. \n" fi
chmod 755 stop.sh
./stop.sh
 
 
修改配置文件(重要)
配置文件中设置了公私钥、producer-name、主网节点等重要信息
/home/ec2-user/biosboot/genesis/blockchain/config/config.ini
signature-provider = EOSxxxxx=KEY:xxxxxx
producer-name = xxxxx

# checkpoint = 
# wasm-runtime = 
chain-state-db-size-mb = 128000
reversible-blocks-db-size-mb = 2048
contracts-console = false
# actor-whitelist = 
# actor-blacklist = 
# contract-whitelist = 
# contract-blacklist = 

# Track actions which match receiver:action:actor. Actor may be blank to include all. Receiver and Action may not be blank. (eosio::history_plugin)
# filter-on = 
# https-client-root-cert = 
# false: ignore cert errors (eosio::http_client_plugin)
http-validate-host = false

verbose-http-errors = false
#在http返回中加入错误日志

https-client-validate-peers = 1
http-server-address = 0.0.0.0:8888
abi-serializer-max-time-ms = 2000
# https-server-address = 
# https-certificate-chain-file = 
# https-private-key-file = 

access-control-allow-origin = *
access-control-allow-headers = Origin, X-Requested-With, Content-Type, Accept
# access-control-max-age = 
access-control-allow-credentials = false
#p2p-server-address = p2p.eoshenzhen.io:9876
#p2p-listen-endpoint = p2p.eoshenzhen.io:9876

p2p-server-address = 0.0.0.0:9876
#p2p-server-address = 120.197.130.119:9876
p2p-listen-endpoint = 0.0.0.0:9876
#read-mode=read-only
p2p-max-nodes-per-host = 70
agent-name = "eszbp"
allowed-connection = any
# peer-key = 

# peer-private-key = 
max-clients = 25
connection-cleanup-period = 30
network-version-match = 0
sync-fetch-span = 100
#max-implicit-request = 1500
enable-stale-production = false
# Start this node in a state where production is paused (eosio::producer_plugin)
pause-on-startup = false
max-transaction-time = 30
max-irreversible-block-age = -1
keosd-provider-timeout = 5
txn-reference-block-lag = 0
#wallet-dir = "."


#unlock-timeout = 900
# Plugin(s) to enable, may be specified multiple times
plugin = eosio::chain_plugin
plugin = eosio::chain_api_plugin
plugin = eosio::producer_plugin
plugin = eosio::producer_api_plugin
plugin = eosio::http_plugin
#plugin = eosio::producer_heartbeat_plugin
##heartbeat-period = 1500
#heartbeat-signature-provider = EOS7QW6YN5zXmKRBLVJ7zFCAPU6zggdHuqHW4wB4aVqu8ykRUwXL1=KEY:5JJtzsScTpHE8fNV84tJpv8w5DkqHm12k72dL5PZdoEutneNHN9
#heartbeat-contract = eosheartbeat
#heartbeat-permission = heartbeat
#heartbeat-oncall = telegram:sheldonpp
#
## localnet
#p2p-peer-address = 192.168.5.12:9876
#p2p-peer-address = 192.168.5.13:9877


#1 eoshuobipool
p2p-peer-address = peer2.eoshuobipool.com:18181
p2p-peer-address = 54.65.62.40:18181
#2 starteosiobp
p2p-peer-address = node1.starteos.io:9876
#p2p-peer-address = node2.starteos.io:9876
#3 eoslaomaocom
#p2p-peer-address = fullnode.eoslaomao.com:443
p2p-peer-address = mainnet.eoslaomao.com:443
#4 zbeosbp11111
p2p-peer-address = node1.zbeos.com:9876
p2p-peer-address = node2.zbeos.com:9876
#5 eosliquideos
p2p-peer-address = node2.liquideos.com:9876
#6 eosflytomars
p2p-peer-address = p2p.bitmars.one:8080
#7 eosiosg11111
p2p-peer-address = peer.eosio.sg:80
#8 bitfinexeos1
#p2p-peer-address = eos-bp.bitfinex.com:9876
#9 atticlabeosb
p2p-peer-address = 62.149.9.136:9876
#10 eosnewyorkio
p2p-peer-address = node1.eosnewyork.io:6987
#11 cochainworld
#p2p-peer-address = peer1.eoscochain.io:9877
#p2p-peer-address = peer2.eoscochain.io:9877
#12 jedaaaaaaaaa
p2p-peer-address = m.jeda.one:3322
#13 eoscannonchn
#p2p-peer-address = node1.eoscannon.io:59876
#14 eos42freedom
p2p-peer-address = seed1.eos42.io:9876
p2p-peer-address = seed2.eos42.io:9876
#15 eosbixinboot
p2p-peer-address = mars.fnp2p.eosbixin.com:443
#16 eoscanadacom
p2p-peer-address = peering.mainnet.eoscanada.com:9876
#17 eosbeijingbp
#p2p-peer-address = bp.eosbeijing.one:8080
p2p-peer-address = 18.182.194.107:8080
#18 eoshenzhenio
p2p-peer-address = p2p.eoshenzhen.io:9876
#19 eosauthority
p2p-peer-address = node869-mainnet.eosauthority.com:9393
#20 eosriobrazil
p2p-peer-address = br.eosrio.io:9876
#21 eosnationftw
p2p-peer-address = peer.eosn.io:9876
#22 eosswedenorg
p2p-peer-address = p2p.eossweden.se:9876
#23 eosdacserver
#p2p-peer-address = ro1.eosdac.io:49876
#24 teamgreymass
p2p-peer-address = seed.greymass.com:9876
#25 cypherglasss
p2p-peer-address = publicnode.cypherglass.com:9876
#26 eospaceioeos
#p2p-peer-address = p2p.mainnet.eospacex.com:88


# Stolen accounts blacklist
actor-blacklist = blacklistmee
actor-blacklist = ge2dmmrqgene
actor-blacklist = gu2timbsguge
actor-blacklist = ge4tsmzvgege
actor-blacklist = gezdonzygage
actor-blacklist = ha4tkobrgqge
# 18 - remove below entry from blacklist
#actor-blacklist = ha4tamjtguge
actor-blacklist = gq4dkmzzhege

# 2
actor-blacklist = gu2teobyg4ge
actor-blacklist = gq4demryhage
actor-blacklist = q4dfv32fxfkx
actor-blacklist = ktl2qk5h4bor
actor-blacklist = haydqnbtgene
actor-blacklist = g44dsojygyge
actor-blacklist = guzdonzugmge
actor-blacklist = ha4doojzgyge
actor-blacklist = gu4damztgyge
actor-blacklist = haytanjtgige
actor-blacklist = exchangegdax
actor-blacklist = cmod44jlp14k
actor-blacklist = 2fxfvlvkil4e
actor-blacklist = yxbdknr3hcxt
actor-blacklist = yqjltendhyjp
actor-blacklist = pm241porzybu
actor-blacklist = xkc2gnxfiswe
actor-blacklist = ic433gs42nky
actor-blacklist = fueaji11lhzg
actor-blacklist = w1ewnn4xufob
actor-blacklist = ugunxsrux2a3
actor-blacklist = gz3q24tq3r21
actor-blacklist = u5rlltjtjoeo
actor-blacklist = k5thoceysinj
actor-blacklist = ebhck31fnxbi
actor-blacklist = pvxbvdkces1x
actor-blacklist = oucjrjjvkrom

# 3
actor-blacklist = neverlandwal
actor-blacklist = tseol5n52kmo
actor-blacklist = potus1111111

# 4
actor-blacklist = craigspys211

# 5
actor-blacklist = eosfomoplay1

# 6
actor-blacklist = wangfuhuahua

# 7
# Order 10 remove blacklist for this
#actor-blacklist = ha4timrzguge
actor-blacklist = guytqmbuhege

# 8
actor-blacklist = huobldeposit

# Ram lockers
#actor-blacklist = eosramfoodie
#actor-blacklist = eosbetfucker

# 11
actor-blacklist = gm3dcnqgenes
actor-blacklist = gm34qnqrepqt
actor-blacklist = gt3ftnqrrpqp
actor-blacklist = gtwvtqptrpqp
actor-blacklist = gm31qndrspqr
actor-blacklist = lxl2atucpyos

# AO-012
actor-blacklist = g4ytenbxgqge
actor-blacklist = jinwen121212
actor-blacklist = ha4tomztgage
actor-blacklist = my1steosobag
actor-blacklist = iloveyouplay
actor-blacklist = eoschinaeos2
actor-blacklist = eosholderkev
actor-blacklist = dreams12true
actor-blacklist = imarichman55

# AO-013
actor-blacklist = gizdcnjyg4ge

# A0-014
actor-blacklist = gyzdmmjsgige

# A0-015
actor-blacklist = guzdanrugene
actor-blacklist = earthsop1sys

#A0-016 - missing?

# A0-017
actor-blacklist = refundwallet
actor-blacklist = jhonnywalker
actor-blacklist = alibabaioeos
actor-blacklist = whitegroupes
actor-blacklist = 24cryptoshop
actor-blacklist = minedtradeos

# A0-018
actor-blacklist = gizdkmjvhege

# Feb 22
actor-blacklist = newdexmobapp
actor-blacklist = ftsqfgjoscma 
actor-blacklist = hpbcc4k42nxy 
actor-blacklist = 3qyty1khhkhv 
actor-blacklist = xzr2fbvxwtgt
actor-blacklist = myqdqdj4qbge
actor-blacklist = shprzailrazt
actor-blacklist = qkwrmqowelyu 
actor-blacklist = lhjuy3gdkpq4
actor-blacklist = lmfsopxpr324
actor-blacklist = lcxunh51a1gt
actor-blacklist = geydddsfkk5e
actor-blacklist = pnsdiia1pcuy
actor-blacklist = kwmvzswquqpb
actor-blacklist = guagddoefdqu

 

 
设置完成后启动nodeos
vi start.sh
#!/bin/bash DATADIR="./blockchain" if [ ! -d $DATADIR ]; then mkdir -p $DATADIR; fi nodeos \ --data-dir $DATADIR"/data" \ --blocks-dir $DATADIR"/blocks" \ --config-dir $DATADIR"/config" \ --access-control-allow-origin=* \ --contracts-console \ --http-validate-host=false \ --verbose-http-errors \ --enable-stale-production \ >> $DATADIR"/nodeos.log" 2>&1 & \ echo $! > $DATADIR"/eosd.pid"
chmod 755 start.sh
./start.sh
 
查看节点信息
cleos get info
{ "server_version": "14185431", "chain_id": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906", "head_block_num": 9631012, "last_irreversible_block_num": 9630681, "last_irreversible_block_id": "0092f3d9e4dd07d48d30da36b28127a6ee2e7c0ae9e0dce4dcf66b2e562448ae", "head_block_id": "0092f5246cf421886a4e08945fa445598323a37cd6e586e41d6c6645215f37da", "head_block_time": "2018-08-05T22:16:39.000", "head_block_producer": "eosauthority", "virtual_block_cpu_limit": 200000000, "virtual_block_net_limit": 1048576000, "block_cpu_limit": 200000, "block_net_limit": 1048576, "server_version_string": "v1.8.1", "fork_db_head_block_num": 9631012, "fork_db_head_block_id": "0092f5246cf421886a4e08945fa445598323a37cd6e586e41d6c6645215f37da" }
 
校验
chain_id是否为aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906,必须为这个值才说明同步到了主网
server_version_string 版本号为v1.8.1
多执行几次命令查看head_block_num是否一直在增长,增长说明是在不断同步主网区块(现在高度为7000多万)
 
 
 
  • 注册EOS BP(EOS Block Producer)
cleos -u https://mainnet.eoscannon.io system regproducer xxx EOSxxx https://www.xxx.com 702
注意702表示地区编码,必须为数字
 
注册完成可在 https://eospark.com/上搜索xxxx,相关信息如下:
 
设置相关信息:
将bp.json放在官网
https://www.xxxx.com/bp.json
{ "producer_account_name": "xxxxx", "producer_public_key": "EOSxxxxx", "org": { "candidate_name": "xxxx", "website": "https://www.xxxx.com", "code_of_conduct":"", "email":"contact@mail.xxxx.com", "branding":{ "logo_256":"https://www.xxxx.com/beekuaibao-256*256.png", "logo_1024":"https://www.xxxx.com/beekuaibao-1024*1024.png", "logo_svg":"https://www.xxxx.com/beekuaibao-300*300.svg" }, "location": { "name": "Singapore", "country": "SG", "latitude": 1.369004, "longitude": 103.851561 }, "social": { "twitter": "https://twitter.com/xxxx", "facebook": "https://www.facebook.com/xxx" } }, "nodes": [ { "location": { "name": "Singapore", "country": "SG", "latitude": 1.369004, "longitude": 103.851561 }, "node_type": "full", "api_endpoint": "", "ssl_endpoint": "" } ] }
 
参考
 
投票
cleos -u https://mainnet.eoscannon.io system voteproducer prods xxxx xxxxx
 
 
  • EOS节点奖励
奖励规则
eos有21个出块节点和n个候选节点,每年增发eos比例为5%,其中20%用于节点奖励,80%用于基金池。
20%的节点奖励中有25%用于21个出块节点奖励,75%由所有节点按照投票权重占比来分配的。
如果某个备用节点的得票奖励不足100个EOS,则无法得到奖励。
 
认领奖励
查询余额
cleos -u https://mainnet.eoscannon.io get account xxxx
 
申领奖励
 
先新建一对公私钥,然后自定义claim权限
cleos -u https://mainnet.eoscannon.io set account permission xxxxx claim EOSxxxxxx active -p xxxxx@active
 
cleos -u https://mainnet.eoscannon.io set action permission xxxx eosio claimrewards claim -p xxxxx@active
 
使用claim权限申领
cleos -u https://mainnet.eoscannon.io system claimrewards xxxx -p xxxxx@claim
 
 
 
定时任务申领奖励
1、编写脚本(使用go编写,相对于执行执行命令,多了重试机制并提供了多个endpoint)
 
 
2、build脚本,在mac上build的二进制文件在aws的服务器上无法执行,于是在aws上配置了go、git环境。
环境配置好后执行go build main.go 生成二进制可执行文件main;
vi reward_clain.sh执行main文件并输出日志到log中
#!/bin/sh cd /home/ec2-user/biosboot/genesis/claim_reward ./main >> claim_reward.log &
 
3、将脚本放入crontab中
crontab -e
00 02 * * * nohup sh /home/ec2-user/biosboot/genesis/claim_reward/claim_reward.sh
设置UTC时间每日凌晨2点(北京时间10点)执行
 
 
 
  • 出块节点
如果投票进入前21名成为超级节点,则要负责出块,出块的前提是追平最新区块。
如果从第一个区块开始同步会非常慢,现在最新区块为7000多万,我们的机器同步了半个月才4000多万。
 
那么快捷方式呢?有!可以通过snapshot快速同步。关键步骤如下:
 
1、前往snapshots提供网站下载
网址1:
这里有个坑:2019年8月30日前后下载的snapshot版本是V1.7.1,而我本机安装的是最新版V1.8.1,
node启动起来后chain_id一直不对,head_block_num始终为1。
 
网址2
这个上面是最新的1.8版本
 
下载后解压放入snapshots目录
tar -zxvf snapshot-76607475.bin.tar.gz
 
2、停掉node节点
ps -ef | grep nodeos
杀掉对进程
 
3、删除data目录下的blocks、state
 
4、以snapshot的方式启动nodeos,脚本如下,执行即可
#!/bin/bash EOSBP_DIR="/home/ec2-user/eosnode" if [ ! -d $EOSBP_DIR ]; then mkdir -p $EOSBP_DIR; fi nodeos \ --snapshot $EOSBP_DIR"/data/snapshots/snapshot-76607475.bin" \ --data-dir $EOSBP_DIR"/data" \ --config-dir $EOSBP_DIR"/config" \ >> $EOSBP_DIR"/nodeos.log" 2>&1 & \ echo $! > $EOSBP_DIR"/eosd.pid"
 
5、验证
可以看到nodeos.log中的日志如下,可以看到nodeos在初始化snapshot并从第76607475个区块开始同步
info  2019-08-30T05:48:19.449 nodeos    main.cpp:93                   main                 ] nodeos version v1.8.1
info  2019-08-30T05:48:19.449 nodeos    main.cpp:94                   main                 ] nodeos using configuration file /home/ec2-user/eosnode/config/config.ini
info  2019-08-30T05:48:19.449 nodeos    main.cpp:95                   main                 ] nodeos data directory is /home/ec2-user/eosnode/data
info  2019-08-30T05:48:19.449 nodeos    controller.cpp:2255           startup              ] Starting initialization from snapshot, this may take a significant amount of time
info  2019-08-30T05:49:58.578 nodeos    controller.cpp:685            init                 ] database initialized with hash: f6068f08c2a9cc0a6df3da868c9855110b7c4c34c40704323edf21c507a486e4
info  2019-08-30T05:49:58.579 nodeos    controller.cpp:2265           startup              ] Finished initialization from snapshot
info  2019-08-30T05:49:58.579 nodeos    chain_plugin.cpp:982          plugin_startup       ] starting chain in read/write mode
info  2019-08-30T05:49:58.579 nodeos    chain_plugin.cpp:986          plugin_startup       ] Blockchain started; head block is #76607475, genesis timestamp is 2018-06-08T08:08:08.888
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:538           plugin_startup       ] start listening for http requests
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/node/get_supported_apis
info  2019-08-30T05:49:58.579 nodeos    chain_api_plugin.cpp:77       plugin_startup       ] starting chain_api_plugin
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/abi_bin_to_json
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/abi_json_to_bin
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/get_abi
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/get_account
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/get_activated_protocol_features
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/get_block
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/get_block_header_state
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/get_code
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/get_code_hash
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/get_currency_balance
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/get_currency_stats
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/get_info
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/get_producer_schedule
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/get_producers
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/get_raw_abi
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/get_raw_code_and_abi
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/get_required_keys
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/get_scheduled_transactions
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/get_table_by_scope
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/get_table_rows
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/get_transaction_id
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/push_block
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/push_transaction
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/push_transactions
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/chain/send_transaction
info  2019-08-30T05:49:58.579 nodeos    producer_plugin.cpp:820       plugin_startup       ] producer plugin:  plugin_startup() begin
info  2019-08-30T05:49:58.579 nodeos    producer_plugin.cpp:842       plugin_startup       ] Launching block production for 1 producers at 2019-08-30T05:49:58.579.
info  2019-08-30T05:49:58.579 nodeos    producer_plugin.cpp:854       plugin_startup       ] producer plugin:  plugin_startup() end
info  2019-08-30T05:49:58.579 nodeos    producer_api_plugin.cp:93     plugin_startup       ] starting producer_api_plugin
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/producer/add_greylist_accounts
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/producer/create_snapshot
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/producer/get_account_ram_corrections
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/producer/get_greylist
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/producer/get_integrity_hash
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/producer/get_runtime_options
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/producer/get_scheduled_protocol_feature_activations
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/producer/get_supported_protocol_features
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/producer/get_whitelist_blacklist
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/producer/pause
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/producer/paused
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/producer/remove_greylist_accounts
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/producer/resume
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/producer/schedule_protocol_feature_activations
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/producer/set_whitelist_blacklist
info  2019-08-30T05:49:58.579 nodeos    http_plugin.cpp:625           add_handler          ] add api url: /v1/producer/update_runtime_options
info  2019-08-30T05:49:58.579 nodeos    net_plugin.cpp:1851           connect              ] host: peer2.eoshuobipool.com port: 18181 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: 54.65.62.40 port: 18181 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: node1.starteos.io port: 9876 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: mainnet.eoslaomao.com port: 443 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: node1.zbeos.com port: 9876 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: node2.zbeos.com port: 9876 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: node2.liquideos.com port: 9876 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: p2p.bitmars.one port: 8080 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: peer.eosio.sg port: 80 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: 62.149.9.136 port: 9876 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: node1.eosnewyork.io port: 6987 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: m.jeda.one port: 3322 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: seed1.eos42.io port: 9876 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: seed2.eos42.io port: 9876 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: mars.fnp2p.eosbixin.com port: 443 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: peering.mainnet.eoscanada.com port: 9876 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: 18.182.194.107 port: 8080 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: p2p.eoshenzhen.io port: 9876 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: node869-mainnet.eosauthority.com port: 9393 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: br.eosrio.io port: 9876 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: peer.eosn.io port: 9876 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: p2p.eossweden.se port: 9876 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: seed.greymass.com port: 9876 
info  2019-08-30T05:49:58.580 nodeos    net_plugin.cpp:1851           connect              ] host: publicnode.cypherglass.com port: 9876 
info  2019-08-30T05:49:58.800 nodeos    transaction_context.cp:103    deadline_timer       ] Using 11us deadline timer for checktime: min:3us max:13us mean:6us stddev:2us
info  2019-08-30T05:50:15.264 nodeos    producer_plugin.cpp:421       on_incoming_block    ] Received block c65aec441fcb5448... #76608000 @ 2019-08-29T18:04:26.500 signed by zbeosbp11111 [trxs: 44, lib: 76607674, conf: 0, latency: 42348764 ms]
info  2019-08-30T05:50:28.579 nodeos    net_plugin.cpp:1851           connect              ] host: node2.liquideos.com port: 9876 
info  2019-08-30T05:50:28.580 nodeos    net_plugin.cpp:1851           connect              ] host: peer.eosio.sg port: 80 
info  2019-08-30T05:50:28.580 nodeos    net_plugin.cpp:1851           connect              ] host: node1.eosnewyork.io port: 6987 
info  2019-08-30T05:50:28.580 nodeos    net_plugin.cpp:1851           connect              ] host: seed2.eos42.io port: 9876 
info  2019-08-30T05:50:28.580 nodeos    net_plugin.cpp:1851           connect              ] host: node869-mainnet.eosauthority.com port: 9393 
info  2019-08-30T05:50:28.580 nodeos    net_plugin.cpp:1851           connect              ] host: br.eosrio.io port: 9876 
info  2019-08-30T05:50:28.580 nodeos    net_plugin.cpp:1851           connect              ] host: peer.eosn.io port: 9876 
info  2019-08-30T05:50:28.580 nodeos    net_plugin.cpp:1851           connect              ] host: publicnode.cypherglass.com port: 9876 

 

 
执行cleos get info
确认chain_id为aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906,且head_block_num在不断增加并渐渐追平最新区块。
 
可对比此网站查看是否追平最新区块
 
{ "server_version": "14185431", "chain_id": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906", "head_block_num": 76697940, "last_irreversible_block_num": 76697605, "last_irreversible_block_id": "04925005805fd1c7e7df5ceb72a880dcaa4ea765295f608eae30e75bae25a2ee", "head_block_id": "049251543734211cce2619bc5a23a5e102bd964645b1244582572f601c5e5a1b", "head_block_time": "2019-08-30T06:35:59.000", "head_block_producer": "okcapitalbp1", "virtual_block_cpu_limit": 200000000, "virtual_block_net_limit": 1048576000, "block_cpu_limit": 199553, "block_net_limit": 1048136, "server_version_string": "v1.8.1", "fork_db_head_block_num": 76697940, "fork_db_head_block_id": "049251543734211cce2619bc5a23a5e102bd964645b1244582572f601c5e5a1b" }
 
 
Done!
 
 

 
 
  • 相关文档
 
 
白皮书
 
github
 
eos数据服务查询
 
eos现有区块快照
 
搭建一个私有的EOS集群
 
EOS多节点环境配置(搭建自己的EOS主网)
 
eos节点列表
 
通过cleos 进行注册BP
 
快速搭建 EOS 主网见证人节点(BP)

 

 

 

 

EOS建立节点与主网进行同步

本文介绍在本地建立一个EOS节点并与EOS主网进行数据同步。

首先新建一个文件夹,在里面新建一个genesis.json创世文件,文件内容:


{
"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
}
}


然后再创建一个文件config.ini,文件内容:


genesis-json = genesis.json
block-log-dir = blocks
readonly = 0
send-whole-blocks = true
shared-file-dir = blockchain
shared-file-size = 8192
unlock-timeout = 90000
bnet-endpoint = 0.0.0.0:4321
http-server-address = 0.0.0.0:8888
p2p-listen-endpoint = 0.0.0.0:9876
p2p-server-address = localhost:9876
allowed-connection = any
#p2p-peer-address = localhost:9877
required-participation = true
signature-provider = EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV=KEY:5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
producer-name = eosio
plugin = eosio::chain_plugin
plugin = eosio::chain_api_plugin
plugin = eosio::net_plugin
plugin = eosio::net_api_plugin
plugin = eosio::history_plugin
plugin = eosio::history_api_plugin
plugin = eosio::http_plugin
plugin = eosio::http_client_plugin
plugin = eosio::wallet_api_plugin

p2p-peer-address = 185.253.188.1:19876
p2p-peer-address = 807534da.eosnodeone.io:19872
p2p-peer-address = api-full1.eoseoul.io:9876
p2p-peer-address = api-full2.eoseoul.io:9876
p2p-peer-address = api.eosuk.io:12000
p2p-peer-address = boot.eostitan.com:9876
p2p-peer-address = bp.antpool.com:443
p2p-peer-address = bp.cryptolions.io:9876
p2p-peer-address = bp.eos.miami:13975
p2p-peer-address = bp.eosbeijing.one:8080
p2p-peer-address = bp.libertyblock.io:9800
p2p-peer-address = br.eosrio.io:9876
p2p-peer-address = eos-seed-de.privex.io:9876
p2p-peer-address = eos.nodepacific.com:9876
p2p-peer-address = eos.staked.us:9870
p2p-peer-address = eosapi.blockmatrix.network:13546
p2p-peer-address = eu-west-nl.eosamsterdam.net:9876
p2p-peer-address = eu1.eosdac.io:49876
p2p-peer-address = fn001.eossv.org:443
p2p-peer-address = fullnode.eoslaomao.com:443
p2p-peer-address = m.eosvibes.io:9876
p2p-peer-address = mainnet.eosarabia.org:3571
p2p-peer-address = mainnet.eoscalgary.io:5222
p2p-peer-address = mainnet.eospay.host:19876
p2p-peer-address = mars.fnp2p.eosbixin.com:443
p2p-peer-address = node.eosflare.io:1883
p2p-peer-address = node1.eoscannon.io:59876
p2p-peer-address = node1.eosnewyork.io:6987
p2p-peer-address = node2.eosnewyork.io:6987
p2p-peer-address = p.jeda.one:3322
p2p-peer-address = p2p.eos.bitspace.no:9876
p2p-peer-address = p2p.eosio.cr:1976
p2p-peer-address = p2p.eosio.cr:5418
p2p-peer-address = p2p.meet.one:9876
p2p-peer-address = p2p.one.eosdublin.io:9876
p2p-peer-address = p2p.two.eosdublin.io:9876
p2p-peer-address = p2p.unlimitedeos.com:15555
p2p-peer-address = peer.eosjrr.io:9876
p2p-peer-address = peer.eosn.io:9876
p2p-peer-address = peer.main.alohaeos.com:9876
p2p-peer-address = peer1.mainnet.helloeos.com.cn:80
p2p-peer-address = peer2.mainnet.helloeos.com.cn:80
p2p-peer-address = peering.mainnet.eoscanada.com:9876
p2p-peer-address = peering1.mainnet.eosasia.one:80
p2p-peer-address = peering2.mainnet.eosasia.one:80
p2p-peer-address = pub0.eosys.io:6637
p2p-peer-address = pub1.eosys.io:6637
p2p-peer-address = publicnode.cypherglass.com:9876
p2p-peer-address = seed1.greymass.com:9876
p2p-peer-address = seed2.greymass.com:9876

p2p-peer-address加入了主网的节点列表,主网节点可以在这个网址获取:https://eosnodes.privex.io/?config=1

然后启动节点:


~/eos_mainnet$ sudo nodeos --data-dir ./ --config-dir ./ --genesis-json genesis.json 


查询当前区块链信息:


{
"server_version": "40a20769",
"chain_id": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906",
"head_block_num": 8125,
"last_irreversible_block_num": 8124,
"last_irreversible_block_id": "00001fbc139659a3d9a17f990648dcc9161f19781926dfd8267c24db5a49993a",
"head_block_id": "00001fbdeafcf14f29b02de00f0a67038e5f205d86e7e589c611c243f4d7e8a4",
"head_block_time": "2018-06-09T13:06:08.500",
"head_block_producer": "eosio",
"virtual_block_cpu_limit": "100000000000",
"virtual_block_net_limit": 1048576000,
"block_cpu_limit": 100000000,
"block_net_limit": 1048576
}


区块链chain_id为aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906,这正是主网的chain_id,说明我们已经在主网上了。当前区块高度为8125。

继续查询:


{
"server_version": "40a20769",
"chain_id": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906",
"head_block_num": 8137,
"last_irreversible_block_num": 8136,
"last_irreversible_block_id": "00001fc8b7ccfecac12859182c739b40daec5c12c9b742f67875429bce803c23",
"head_block_id": "00001fc95e262b292be00e4abd19fcd8acef7bd76ad8dbfbcc6e9f4959489205",
"head_block_time": "2018-06-09T13:06:14.500",
"head_block_producer": "eosio",
"virtual_block_cpu_limit": "100000000000",
"virtual_block_net_limit": 1048576000,
"block_cpu_limit": 100000000,
"block_net_limit": 1048576
}


区块高度在增加,现在是8137,说明区块链在与主网同步中。 

 
  • 创建钱包
生成default钱包的密钥到指定文件
cleos wallet create --file wallet-file
 
 
导入私钥
cleos wallet import(输入私钥 )
private key: warn 2019-08-12T12:00:24.677 thread-0 wallet.cpp:223 save_wallet_file ] saving wallet to file /home/ec2-user/eosio-wallet/./default.wallet
imported private key for: xxxxxxxxx
 
导入成功后可使用cleos wallet keys命令查看
 
 
 
创世节点相关配置和脚本
cd ~
mkdir biosboot
cd biosboot
mkdir genesis
cd genesis
cd ~/biosboot
touch genesis.json
vi genesis.json
将下面的文本复制到genesis.json(注意,不需要做任何更改)
{ "initial_timestamp": "2018-06-08T08:08:08.888", "initial_key": "xxxxxx", "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 } }
 
 
cd ~/biosboot/genesis touch genesis_start.sh
genesis_start.sh内容如下:
#!/bin/bash DATADIR="./blockchain" if [ ! -d $DATADIR ]; then mkdir -p $DATADIR; fi nodeos \ --genesis-json $DATADIR"/../../genesis.json" \ --data-dir $DATADIR"/data" \ --blocks-dir $DATADIR"/blocks" \ --config-dir $DATADIR"/config" \ --access-control-allow-origin=* \ --contracts-console \ --http-validate-host=false \ --verbose-http-errors \ --enable-stale-production \ >> $DATADIR"/nodeos.log" 2>&1 & \ echo $! > $DATADIR"/eosd.pid"
 
chmod 755 genesis_start.sh ./genesis_start.sh
执行后可通过日志查看启动情况 tail -fn300 ./blockchain/nodeos.log
 
停止nodeos
vi stop.sh
 
#!/bin/bash DATADIR="./blockchain/" if [ -f $DATADIR"/eosd.pid" ]; then pid=`cat $DATADIR"/eosd.pid"` echo $pid kill $pid rm -r $DATADIR"/eosd.pid" echo -ne "Stoping Node" while true; do [ ! -d "/proc/$pid/fd" ] && break echo -ne "." sleep 1 done echo -ne "\rNode Stopped. \n" fi
chmod 755 stop.sh
./stop.sh
 
 
修改配置文件(重要)
配置文件中设置了公私钥、producer-name、主网节点等重要信息
/home/ec2-user/biosboot/genesis/blockchain/config/config.ini
signature-provider = EOSxxxxx=KEY:xxxxxx
producer-name = xxxxx

# checkpoint = 
# wasm-runtime = 
chain-state-db-size-mb = 128000
reversible-blocks-db-size-mb = 2048
contracts-console = false
# actor-whitelist = 
# actor-blacklist = 
# contract-whitelist = 
# contract-blacklist = 

# Track actions which match receiver:action:actor. Actor may be blank to include all. Receiver and Action may not be blank. (eosio::history_plugin)
# filter-on = 
# https-client-root-cert = 
# false: ignore cert errors (eosio::http_client_plugin)
http-validate-host = false

verbose-http-errors = false
#在http返回中加入错误日志

https-client-validate-peers = 1
http-server-address = 0.0.0.0:8888
abi-serializer-max-time-ms = 2000
# https-server-address = 
# https-certificate-chain-file = 
# https-private-key-file = 

access-control-allow-origin = *
access-control-allow-headers = Origin, X-Requested-With, Content-Type, Accept
# access-control-max-age = 
access-control-allow-credentials = false
#p2p-server-address = p2p.eoshenzhen.io:9876
#p2p-listen-endpoint = p2p.eoshenzhen.io:9876

p2p-server-address = 0.0.0.0:9876
#p2p-server-address = 120.197.130.119:9876
p2p-listen-endpoint = 0.0.0.0:9876
#read-mode=read-only
p2p-max-nodes-per-host = 70
agent-name = "eszbp"
allowed-connection = any
# peer-key = 

# peer-private-key = 
max-clients = 25
connection-cleanup-period = 30
network-version-match = 0
sync-fetch-span = 100
#max-implicit-request = 1500
enable-stale-production = false
# Start this node in a state where production is paused (eosio::producer_plugin)
pause-on-startup = false
max-transaction-time = 30
max-irreversible-block-age = -1
keosd-provider-timeout = 5
txn-reference-block-lag = 0
#wallet-dir = "."


#unlock-timeout = 900
# Plugin(s) to enable, may be specified multiple times
plugin = eosio::chain_plugin
plugin = eosio::chain_api_plugin
plugin = eosio::producer_plugin
plugin = eosio::producer_api_plugin
plugin = eosio::http_plugin
#plugin = eosio::producer_heartbeat_plugin
##heartbeat-period = 1500
#heartbeat-signature-provider = EOS7QW6YN5zXmKRBLVJ7zFCAPU6zggdHuqHW4wB4aVqu8ykRUwXL1=KEY:5JJtzsScTpHE8fNV84tJpv8w5DkqHm12k72dL5PZdoEutneNHN9
#heartbeat-contract = eosheartbeat
#heartbeat-permission = heartbeat
#heartbeat-oncall = telegram:sheldonpp
#
## localnet
#p2p-peer-address = 192.168.5.12:9876
#p2p-peer-address = 192.168.5.13:9877


#1 eoshuobipool
p2p-peer-address = peer2.eoshuobipool.com:18181
p2p-peer-address = 54.65.62.40:18181
#2 starteosiobp
p2p-peer-address = node1.starteos.io:9876
#p2p-peer-address = node2.starteos.io:9876
#3 eoslaomaocom
#p2p-peer-address = fullnode.eoslaomao.com:443
p2p-peer-address = mainnet.eoslaomao.com:443
#4 zbeosbp11111
p2p-peer-address = node1.zbeos.com:9876
p2p-peer-address = node2.zbeos.com:9876
#5 eosliquideos
p2p-peer-address = node2.liquideos.com:9876
#6 eosflytomars
p2p-peer-address = p2p.bitmars.one:8080
#7 eosiosg11111
p2p-peer-address = peer.eosio.sg:80
#8 bitfinexeos1
#p2p-peer-address = eos-bp.bitfinex.com:9876
#9 atticlabeosb
p2p-peer-address = 62.149.9.136:9876
#10 eosnewyorkio
p2p-peer-address = node1.eosnewyork.io:6987
#11 cochainworld
#p2p-peer-address = peer1.eoscochain.io:9877
#p2p-peer-address = peer2.eoscochain.io:9877
#12 jedaaaaaaaaa
p2p-peer-address = m.jeda.one:3322
#13 eoscannonchn
#p2p-peer-address = node1.eoscannon.io:59876
#14 eos42freedom
p2p-peer-address = seed1.eos42.io:9876
p2p-peer-address = seed2.eos42.io:9876
#15 eosbixinboot
p2p-peer-address = mars.fnp2p.eosbixin.com:443
#16 eoscanadacom
p2p-peer-address = peering.mainnet.eoscanada.com:9876
#17 eosbeijingbp
#p2p-peer-address = bp.eosbeijing.one:8080
p2p-peer-address = 18.182.194.107:8080
#18 eoshenzhenio
p2p-peer-address = p2p.eoshenzhen.io:9876
#19 eosauthority
p2p-peer-address = node869-mainnet.eosauthority.com:9393
#20 eosriobrazil
p2p-peer-address = br.eosrio.io:9876
#21 eosnationftw
p2p-peer-address = peer.eosn.io:9876
#22 eosswedenorg
p2p-peer-address = p2p.eossweden.se:9876
#23 eosdacserver
#p2p-peer-address = ro1.eosdac.io:49876
#24 teamgreymass
p2p-peer-address = seed.greymass.com:9876
#25 cypherglasss
p2p-peer-address = publicnode.cypherglass.com:9876
#26 eospaceioeos
#p2p-peer-address = p2p.mainnet.eospacex.com:88


# Stolen accounts blacklist
actor-blacklist = blacklistmee
actor-blacklist = ge2dmmrqgene
actor-blacklist = gu2timbsguge
actor-blacklist = ge4tsmzvgege
actor-blacklist = gezdonzygage
actor-blacklist = ha4tkobrgqge
# 18 - remove below entry from blacklist
#actor-blacklist = ha4tamjtguge
actor-blacklist = gq4dkmzzhege

# 2
actor-blacklist = gu2teobyg4ge
actor-blacklist = gq4demryhage
actor-blacklist = q4dfv32fxfkx
actor-blacklist = ktl2qk5h4bor
actor-blacklist = haydqnbtgene
actor-blacklist = g44dsojygyge
actor-blacklist = guzdonzugmge
actor-blacklist = ha4doojzgyge
actor-blacklist = gu4damztgyge
actor-blacklist = haytanjtgige
actor-blacklist = exchangegdax
actor-blacklist = cmod44jlp14k
actor-blacklist = 2fxfvlvkil4e
actor-blacklist = yxbdknr3hcxt
actor-blacklist = yqjltendhyjp
actor-blacklist = pm241porzybu
actor-blacklist = xkc2gnxfiswe
actor-blacklist = ic433gs42nky
actor-blacklist = fueaji11lhzg
actor-blacklist = w1ewnn4xufob
actor-blacklist = ugunxsrux2a3
actor-blacklist = gz3q24tq3r21
actor-blacklist = u5rlltjtjoeo
actor-blacklist = k5thoceysinj
actor-blacklist = ebhck31fnxbi
actor-blacklist = pvxbvdkces1x
actor-blacklist = oucjrjjvkrom

# 3
actor-blacklist = neverlandwal
actor-blacklist = tseol5n52kmo
actor-blacklist = potus1111111

# 4
actor-blacklist = craigspys211

# 5
actor-blacklist = eosfomoplay1

# 6
actor-blacklist = wangfuhuahua

# 7
# Order 10 remove blacklist for this
#actor-blacklist = ha4timrzguge
actor-blacklist = guytqmbuhege

# 8
actor-blacklist = huobldeposit

# Ram lockers
#actor-blacklist = eosramfoodie
#actor-blacklist = eosbetfucker

# 11
actor-blacklist = gm3dcnqgenes
actor-blacklist = gm34qnqrepqt
actor-blacklist = gt3ftnqrrpqp
actor-blacklist = gtwvtqptrpqp
actor-blacklist = gm31qndrspqr
actor-blacklist = lxl2atucpyos

# AO-012
actor-blacklist = g4ytenbxgqge
actor-blacklist = jinwen121212
actor-blacklist = ha4tomztgage
actor-blacklist = my1steosobag
actor-blacklist = iloveyouplay
actor-blacklist = eoschinaeos2
actor-blacklist = eosholderkev
actor-blacklist = dreams12true
actor-blacklist = imarichman55

# AO-013
actor-blacklist = gizdcnjyg4ge

# A0-014
actor-blacklist = gyzdmmjsgige

# A0-015
actor-blacklist = guzdanrugene
actor-blacklist = earthsop1sys

#A0-016 - missing?

# A0-017
actor-blacklist = refundwallet
actor-blacklist = jhonnywalker
actor-blacklist = alibabaioeos
actor-blacklist = whitegroupes
actor-blacklist = 24cryptoshop
actor-blacklist = minedtradeos

# A0-018
actor-blacklist = gizdkmjvhege

# Feb 22
actor-blacklist = newdexmobapp
actor-blacklist = ftsqfgjoscma 
actor-blacklist = hpbcc4k42nxy 
actor-blacklist = 3qyty1khhkhv 
actor-blacklist = xzr2fbvxwtgt
actor-blacklist = myqdqdj4qbge
actor-blacklist = shprzailrazt
actor-blacklist = qkwrmqowelyu 
actor-blacklist = lhjuy3gdkpq4
actor-blacklist = lmfsopxpr324
actor-blacklist = lcxunh51a1gt
actor-blacklist = geydddsfkk5e
actor-blacklist = pnsdiia1pcuy
actor-blacklist = kwmvzswquqpb
actor-blacklist = guagddoefdqu

 

 
设置完成后启动nodeos
vi start.sh
#!/bin/bash DATADIR="./blockchain" if [ ! -d $DATADIR ]; then mkdir -p $DATADIR; fi nodeos \ --data-dir $DATADIR"/data" \ --blocks-dir $DATADIR"/blocks" \ --config-dir $DATADIR"/config" \ --access-control-allow-origin=* \ --contracts-console \ --http-validate-host=false \ --verbose-http-errors \ --enable-stale-production \ >> $DATADIR"/nodeos.log" 2>&1 & \ echo $! > $DATADIR"/eosd.pid"
chmod 755 start.sh
./start.sh
 
查看节点信息
cleos get info
{ "server_version": "14185431", "chain_id": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906", "head_block_num": 9631012, "last_irreversible_block_num": 9630681, "last_irreversible_block_id": "0092f3d9e4dd07d48d30da36b28127a6ee2e7c0ae9e0dce4dcf66b2e562448ae", "head_block_id": "0092f5246cf421886a4e08945fa445598323a37cd6e586e41d6c6645215f37da", "head_block_time": "2018-08-05T22:16:39.000", "head_block_producer": "eosauthority", "virtual_block_cpu_limit": 200000000, "virtual_block_net_limit": 1048576000, "block_cpu_limit": 200000, "block_net_limit": 1048576, "server_version_string": "v1.8.1", "fork_db_head_block_num": 9631012, "fork_db_head_block_id": "0092f5246cf421886a4e08945fa445598323a37cd6e586e41d6c6645215f37da" }
 
校验
chain_id是否为aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906,必须为这个值才说明同步到了主网
server_version_string 版本号为v1.8.1
多执行几次命令查看head_block_num是否一直在增长,增长说明是在不断同步主网区块(现在高度为7000多万)
 
 
 
  • 注册EOS BP(EOS Block Producer)
cleos -u https://mainnet.eoscannon.io system regproducer xxx EOSxxx https://www.xxx.com 702
注意702表示地区编码,必须为数字
 
注册完成可在 https://eospark.com/上搜索xxxx,相关信息如下:
 
设置相关信息:
将bp.json放在官网
https://www.xxxx.com/bp.json
{ "producer_account_name": "xxxxx", "producer_public_key": "EOSxxxxx", "org": { "candidate_name": "xxxx", "website": "https://www.xxxx.com", "code_of_conduct":"", "email":"contact@mail.xxxx.com", "branding":{ "logo_256":"https://www.xxxx.com/beekuaibao-256*256.png", "logo_1024":"https://www.xxxx.com/beekuaibao-1024*1024.png", "logo_svg":"https://www.xxxx.com/beekuaibao-300*300.svg" }, "location": { "name": "Singapore", "country": "SG", "latitude": 1.369004, "longitude": 103.851561 }, "social": { "twitter": "https://twitter.com/xxxx", "facebook": "https://www.facebook.com/xxx" } }, "nodes": [ { "location": { "name": "Singapore", "country": "SG", "latitude": 1.369004, "longitude": 103.851561 }, "node_type": "full", "api_endpoint": "", "ssl_endpoint": "" } ] }
 
参考
 
投票
cleos -u https://mainnet.eoscannon.io system voteproducer prods xxxx xxxxx
 
 
  • EOS节点奖励
奖励规则
eos有21个出块节点和n个候选节点,每年增发eos比例为5%,其中20%用于节点奖励,80%用于基金池。
20%的节点奖励中有25%用于21个出块节点奖励,75%由所有节点按照投票权重占比来分配的。
如果某个备用节点的得票奖励不足100个EOS,则无法得到奖励。
 
认领奖励
查询余额
cleos -u https://mainnet.eoscannon.io get account xxxx
 
申领奖励
 
先新建一对公私钥,然后自定义claim权限
cleos -u https://mainnet.eoscannon.io set account permission xxxxx claim EOSxxxxxx active -p xxxxx@active
 
cleos -u https://mainnet.eoscannon.io set action permission xxxx eosio claimrewards claim -p xxxxx@active
 
使用claim权限申领
cleos -u https://mainnet.eoscannon.io system claimrewards xxxx -p xxxxx@claim
 
 
 
定时任务申领奖励
1、编写脚本(使用go编写,相对于执行执行命令,多了重试机制并提供了多个endpoint)
 
 
2、build脚本,在mac上build的二进制文件在aws的服务器上无法执行,于是在aws上配置了go、git环境。
环境配置好后执行go build main.go 生成二进制可执行文件main;
vi reward_clain.sh执行main文件并输出日志到log中
#!/bin/sh cd /home/ec2-user/biosboot/genesis/claim_reward ./main >> claim_reward.log &
 
3、将脚本放入crontab中
crontab -e
00 02 * * * nohup sh /home/ec2-user/biosboot/genesis/claim_reward/claim_reward.sh
设置UTC时间每日凌晨2点(北京时间10点)执行
 
 
 
  • 出块节点
如果投票进入前21名成为超级节点,则要负责出块,出块的前提是追平最新区块。
如果从第一个区块开始同步会非常慢,现在最新区块为7000多万,我们的机器同步了半个月才4000多万。
 
那么快捷方式呢?有!可以通过snapshot快速同步。关键步骤如下:
 
1、前往snapshots提供网站下载
网址1:
这里有个坑:2019年8月30日前后下载的snapshot版本是V1.7.1,而我本机安装的是最新版V1.8.1,
node启动起来后chain_id一直不对,head_block_num始终为1。
 
网址2
这个上面是最新的1.8版本
 
下载后解压放入snapshots目录
tar -zxvf snapshot-76607475.bin.tar.gz
 
2、停掉node节点
ps -ef | grep nodeos
杀掉对进程
 
3、删除data目录下的blocks、state
 
4、以snapshot的方式启动nodeos,脚本如下,执行即可
#!/bin/bash EOSBP_DIR="/home/ec2-user/eosnode" if [ ! -d $EOSBP_DIR ]; then mkdir -p $EOSBP_DIR; fi nodeos \ --snapshot $EOSBP_DIR"/data/snapshots/snapshot-76607475.bin" \ --data-dir $EOSBP_DIR"/data" \ --config-dir $EOSBP_DIR"/config" \ >> $EOSBP_DIR"/nodeos.log" 2>&1 & \ echo $! > $EOSBP_DIR"/eosd.pid"
 
5、验证
可以看到nodeos.log中的日志如下,可以看到nodeos在初始化snapshot并从第76607475个区块开始同步
  View Code

 

 
执行cleos get info
确认chain_id为aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906,且head_block_num在不断增加并渐渐追平最新区块。
 
可对比此网站查看是否追平最新区块
 
{ "server_version": "14185431", "chain_id": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906", "head_block_num": 76697940, "last_irreversible_block_num": 76697605, "last_irreversible_block_id": "04925005805fd1c7e7df5ceb72a880dcaa4ea765295f608eae30e75bae25a2ee", "head_block_id": "049251543734211cce2619bc5a23a5e102bd964645b1244582572f601c5e5a1b", "head_block_time": "2019-08-30T06:35:59.000", "head_block_producer": "okcapitalbp1", "virtual_block_cpu_limit": 200000000, "virtual_block_net_limit": 1048576000, "block_cpu_limit": 199553, "block_net_limit": 1048136, "server_version_string": "v1.8.1", "fork_db_head_block_num": 76697940, "fork_db_head_block_id": "049251543734211cce2619bc5a23a5e102bd964645b1244582572f601c5e5a1b" }
 
 
Done!
 
 

转载于:https://www.cnblogs.com/welhzh/p/11515650.html

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

eos bp节点 超级节点搭建 的相关文章

随机推荐

  • 微信小程序——前端——抵扣券、优惠券样式

    微信小程序 前端 抵扣券 优惠券样式 效果图 实现思路 左边 划线 右边 使用信息 分割线 使用限制 整体底色 wrapper margin 0 auto width 100 display flex background linear g
  • 程序,进程和线程

    注 并发和并行是有区别的 并发是在同一时间段内同时运行 本质上还没有同时 而并行则是在同一时刻同时运行 一 程序 进程和线程之间的关系 1 一个应用程序是由许多个程序段组成 2 进程是由程序段 相关的数据段和PCB 进程控制块 组成 进程是
  • Java中“附近的人”实现方案讨论及代码实现

    在我们平时使用的许多app中有附近的人这一功能 像微信 qq附近的人 哈罗 街兔附近的车辆 这些功能就在我们日常生活中出现 像类似于附近的人这一类业务 在Java中是如何实现的呢 本文就简单介绍下目前的几种解决方案 并提供简单的示例代码 注
  • 46 最佳实践-性能最佳实践-内存大页

    文章目录 46 最佳实践 性能最佳实践 内存大页 46 1 概述 46 2 操作指导 46 最佳实践 性能最佳实践 内存大页 46 1 概述 相比传统的4K内存分页 openEuler也支持2MB 1GB的大内存分页 内存大页可以有效减少T
  • failed with initial frozen solve. Retrying with flexible solve. 什么意思?

    这通常是指一个软件包管理器 如pip conda等 在尝试安装某个软件包时遇到了问题 并且在第一次尝试使用 frozen solve 方法时失败了 Frozen solve 是一种求解器的方法 它会尝试使用已知的软件包版本和其依赖项版本来解
  • AD如何快速更改元件库器件的颜色

    如何你想在原理图库中快速修改元件的颜色 一根根线去点肯定是太慢了 可能第一反应就是查找相似 把颜色不是目标颜色全部选中 然后统一更改 但是在原理图库中 这一做法是行不通的 例如下图 可以在右上方找到筛选器 先选中Lines改成自己想要的颜色
  • 计算机网络思维导图

    计算机网络思维导图 按照计算机网络的TCP IP四层模型构建 物理层对应网络接口层的功能 这个是之前期末考试时做的思维导图 现在复习专业课发现里面还有很多缺漏 希望大家多多提意见 后期有时间我也会查漏补缺的 谢谢支持 目录 计算机网络思维导
  • 集成运算放大电路实验报告_模电总结:第三章、集成运算放大电路

    我的公众号 每日晴天 可关注领取我的笔记pdf版哦 部分英文 d差模 different 差模的d c 共模 common mode 3 1多级放大电路 1 多级放大电路的组成 输入级 输入电阻高 噪声和漂移小 中间级 具有足够大的放大能力
  • android httpClient 支持HTTPS的2种处理方式

    项目中Android https或http请求地址重定向为HTTPS的地址 相信很多人都遇到了这个异常 无终端认证 javax net ssl SSLPeerUnverifiedException No peer certificate 1
  • YoloV4训练自己的数据集

    YoloV4训练自己的数据集 1 建立工作文件夹 2 准备训练数据集 3 修改配置文件 4 Anchor Box先验框聚类分析与修改 5 训练自己的数据集 6 测试训练出来的网络模型 7 性能统计 1 建立工作文件夹 新建一个项目文件夹 用
  • STM32/AMP32F407进入低功耗待机模式后立马被唤醒的解决办法

    最近项目用到低功耗 但是调试发现进入待机就被唤醒的问题 清除WU SB两个唤醒标志位 也依然被立马唤醒一次 进入待机模式 HAL PWR EnterSTANDBYMode 通过极海的数据手册终于发现 我们在使能WAKE UP PA 0唤醒脚
  • 【Linux】进程描述符

    linux进程管理 1 进程描述符 进程描述符 Linux使用进程描述符数据结构记录现场信息 然后给予进程描述符管理进程 包括进程的创建 调度 消亡等操作 进程除了包括运行着的程序 还包括系统资源 当前CPU现场 调度信息 进程间关系等 记
  • One PUNCH Man——激活函数和梯度消失/爆炸

    文章目录 什么是激活函数 激活函数介绍 梯度消失 爆炸 首先推荐一个写公式的网站 https private codecogs com latex eqneditor php 什么是激活函数 如下图 在神经元中 输入的 inputs 通过加
  • FlatBuffers在Java中的使用

    1 去maven仓库下载官网库flatbuffers java 1 7 0 1 jar 地址 点击打开链接 2 编写fbs文件 chat fbs namespace Proto 聊天频道 enum ChatChannel byte SYST
  • 利用Logstash plugins做更多的事情

    1 引言 之前一篇文章 Logstash 介绍及linux下部署 我们实现了logstash的安装以及简单的控制台标准输入输出测试 那么logstash能不能做更多的事情呢 答案是肯定的 logstash就是为了处理日志数据而生的 一个最直
  • mysql下出现Unknown column 'xx' in 'on clause'的完全解决方法

    mysql下出现Unknown column xx in on clause 的完全解决方法 在项目中执行查询无结果 在数据库运行sql报错 Unknown column xx in on clause 百度过后找到这个文章并完全解决了问题
  • 欠拟合和过拟合

    过拟合 定义 具体表现就是最终模型在训练集上效果好 在测试集上效果差 模型泛化能力弱 具体表现就是最终模型在训练集上效果好 在测试集上效果差 模型过于复杂 过拟合的原因 训练数据中噪音干扰过大 使得学习器认为部分噪音是特征从而扰乱学习规则
  • Nginx二级项目配置

    Nginx二级项目服务页面部署 应用场景 比如一个项目需要一个正常的生产服务的地址在根目录 现在需要一个后台管理项目可以部署在 admin 的路径下 需要帮助文档的页面可以部署在 help nginx conf 配置 location ma
  • 【SQL注入-08】二次注入案例—以sqli-labs-less24为例

    目录 1 二次注入概述 1 1 定义 1 2 思路 2 二次注入案例 2 1 实验平台 2 2 实验目标 2 3 具体注入过程 2 3 1 注入前准备 2 3 2 确定目标账户admin 2 3 3 第一次注入 2 3 4 第二次注入 2
  • eos bp节点 超级节点搭建

    https github com nebulaprotocol 这个网址里面有一个 fake terminal website 比较有意思 可以看看示例 https bp nebulaprotocol com 搭建eos BP节点 环境搭建