Deploy HECO master synchronization node using HECO binary in Ubuntu system

  • heco official website: https://www.hecochain.com/zh-cn/
  • heco chain GitHub address: https://github.com/HuobiGroup/huobi-eco-chain/releases
  • Main network blockchain browser: https://hecoinfo.com/
  • Official deployment document of main network chain: https://docs.hecochain.com/#/dev/install
  • Related information of heco main network: https://docs.hecochain.com/#/mainnet
  • Service charge (gasplice): https://tc.hecochain.com/price/prediction
  • Introduction to Genesis documents: https://docs.hecochain.com/#/genesis
  • Developer documentation: https://docs.hecochain.com/#/

Note: due to regulatory problems, the web pages related to the domain name of hecochain.com cannot be viewed.

Before starting this document, briefly describe the HECO synchronization:

  • Server environment
Server: alicloud server
CPU: 8 nucleus
 Memory: 32 GB
 Data disk: 1 T SSD Data disk
 Bandwidth: exclusive 30 M
  • software environment
Ubuntu 20.04.3

1, Download HECO binaries

  • Download HECO binaries
cd /data/heco
wget https://github.com/HuobiGroup/huobi-eco-chain/releases/download/v1.2.0/geth-linux-amd64
  • Grant executable rights
chmod +x geth-linux-amd64 

2, Edit heco master profile

  • Edit the heco main network configuration file. For the main network configuration file, please refer to: https://docs.hecochain.com/#/dev/deploy
cd /data/heco
cat config.toml

[Eth]
SyncMode = "fast"
TrieCleanCacheRejournal= 300000000000

[Eth.Miner]
GasFloor = 8000000
GasCeil = 8000000
GasPrice = 0
Recommit = 3000000000
Noverify = false

[Eth.Ethash]
CacheDir = "ethash"
CachesInMem = 2
CachesOnDisk = 3
CachesLockMmap = false
DatasetDir = "/data/heco/data/.ethash"
DatasetsInMem = 1
DatasetsOnDisk = 2
DatasetsLockMmap = false
PowMode = 0

[Eth.TxPool]
Locals = []
NoLocals = false
Journal = "transactions.rlp"
Rejournal = 3600000000000
PriceLimit = 1
PriceBump = 10
AccountSlots = 16
GlobalSlots = 4096
AccountQueue = 64
GlobalQueue = 1024
Lifetime = 10800000000000

[Node]
DataDir = "/data/heco/data"
InsecureUnlockAllowed = true
NoUSB = true
IPCPath = "geth.ipc"
HTTPHost = "0.0.0.0"
HTTPPort = 8545
HTTPCors = ["*"]
HTTPVirtualHosts = ["*"]
HTTPModules = ['eth', 'net', 'web3']

WSHost = "0.0.0.0"
WSPort = 8546
WSModules = ['eth', 'net', 'web3']

GraphQLVirtualHosts = ["localhost"]


[Node.P2P]
MaxPeers = 50
NoDiscovery = false

ListenAddr = ":32668"
EnableMsgEvents = false

[Node.HTTPTimeouts]
ReadTimeout = 30000000000
WriteTimeout = 30000000000
IdleTimeout = 120000000000
  • Modify HECO main network configuration file

HTTPHost: HTTP-RPC service connection whitelist. The default value of this parameter is "localhost". Only local access is allowed. It can be set to: "0.0.0.0"

HTTPVirtualHosts: HTTP-RPC service listening interface. The default value of this parameter is ["localhost"] and can be set to: HTTPVirtualHosts = ["*"]

3, Binary startup HECO main network

3.1 download bsc master network snapshot data

  • Install the window manager tool under linux: screen
apt-get install screen -y

3.2 start HECO main network node

screen -S heco /data/heco/geth-linux-amd64 --config /data/heco/config.toml --logpath /data/heco/logs

Parameter Description:

– config: Specifies the HECO node configuration file
– logpath: Specifies the HECO node log directory

  • View node log startup status
# head -100 chain.log 
INFO [10-18|18:27:38.096] Starting Geth on Ethereum mainnet... 
INFO [10-18|18:27:38.096] Bumping default cache on mainnet         provided=1024 updated=4096
INFO [10-18|18:27:38.097] Maximum peer count                       ETH=50 LES=0 total=50
INFO [10-18|18:27:38.097] Smartcard socket not found, disabling    err="stat /run/pcscd/pcscd.comm: no such file or directory"
WARN [10-18|18:27:38.097] Option nousb is deprecated and USB is deactivated by default. Use --usb to enable 
WARN [10-18|18:27:38.098] Sanitizing cache to Go's GC limits       provided=4096 updated=2606
INFO [10-18|18:27:38.098] Set global gas cap                       cap=25,000,000
WARN [10-18|18:27:38.098] Sanitizing invalid miner gas price       provided=0    updated=1,000,000,000
INFO [10-18|18:27:38.098] Allocated trie memory caches             clean=390.00MiB dirty=651.00MiB
INFO [10-18|18:27:38.098] Allocated cache and file handles         database=/data/heco/data/geth/chaindata cache=1.27GiB handles=32767
INFO [10-18|18:27:38.114] Opened ancient database                  database=/data/heco/data/geth/chaindata/ancient readonly=false
INFO [10-18|18:27:38.115] Writing default main-net genesis block 
INFO [10-18|18:27:38.115] Persisted trie from memory database      nodes=5 size=742.00B time="37.858µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [10-18|18:27:38.115] Initialised chain configuration          config="{ChainID: 128 Homestead: 0 DAO: <nil> DAOSupport: true EIP150: 0 EIP155: 0 EIP158: 0 Byzantium: 0 Constantinople: 0 Petersburg: 0 Istanbul: 0, Muir Glacier: <nil>, RedCoastBlock: 6618800, Berlin: 8577000, London: 8577000, Engine: congress}"
INFO [10-18|18:27:38.115] Initialising Ethereum protocol           network=128 dbversion=<nil>
INFO [10-18|18:27:38.116] Loaded most recent local header          number=0 hash=5751d1..4cb144 td=1 age=10mo3w10h
INFO [10-18|18:27:38.116] Loaded most recent local full block      number=0 hash=5751d1..4cb144 td=1 age=10mo3w10h
INFO [10-18|18:27:38.116] Loaded most recent local fast block      number=0 hash=5751d1..4cb144 td=1 age=10mo3w10h
WARN [10-18|18:27:38.117] Failed to load snapshot, regenerating    err="missing or corrupted snapshot"
INFO [10-18|18:27:38.117] Rebuilding state snapshot 
INFO [10-18|18:27:38.117] JamConfig sanity PeriodsSecs             old=0 new=3
INFO [10-18|18:27:38.117] JamConfig sanity JamSecs                 old=0 new=15
INFO [10-18|18:27:38.117] JamConfig sanity UnderPricedFactor       old=0 new=3
INFO [10-18|18:27:38.117] JamConfig sanity PendingFactor           old=0 new=1
INFO [10-18|18:27:38.117] JamConfig sanity MaxValidPendingSecs     old=0 new=300
INFO [10-18|18:27:38.117] Resuming state snapshot generation       root=51729b..61d32f accounts=0 slots=0 storage=0.00B elapsed="544.689µs"
INFO [10-18|18:27:38.117] Generated state snapshot                 accounts=4 slots=0 storage=259.00B elapsed="780.136µs"
INFO [10-18|18:27:38.117] Regenerated local transaction journal    transactions=0 accounts=0
INFO [10-18|18:27:38.132] Allocated fast sync bloom                size=1.27GiB
INFO [10-18|18:27:38.132] Gasprice oracle is ignoring threshold set threshold=2
INFO [10-18|18:27:38.132] Prediction started                       checkBlocks=20 Interval=3 ff=2 mf=5 lf=8 minMi=500 minLi=1000 fp=75 mp=90 minCnt=100
WARN [10-18|18:27:38.132] Error reading unclean shutdown markers   error="leveldb: not found"
INFO [10-18|18:27:38.133] Starting peer-to-peer node               instance=Geth/v1.2.0-stable-f7849a80/linux-amd64/go1.13.4
INFO [10-18|18:27:38.139] Stored checkpoint snapshot to disk       number=0 hash=5751d1..4cb144
INFO [10-18|18:27:38.145] New local node record                    seq=1 id=ef7e229d842043a6 ip=127.0.0.1 udp=32668 tcp=32668
INFO [10-18|18:27:38.149] Started P2P networking                   self=enode://e1f394741c1e2e77797d04e42da63b9f52f3717d89a33f7317ef70f3b87511869508114d5a522ba5c543d961d9ed3426a6457cbe33a550ecfc01fc36145564d1@127.0.0.1:32668
INFO [10-18|18:27:38.149] IPC endpoint opened                      url=/data/heco/data/geth.ipc
INFO [10-18|18:27:38.150] HTTP server started                      endpoint=[::]:8545 prefix= cors=* vhosts=*
INFO [10-18|18:27:38.150] WebSocket enabled                        url=ws://[::]:8546
INFO [10-18|18:27:38.151] Initialized state bloom                  items=9 errorrate=0.000 elapsed=18.155ms
ERROR[10-18|18:27:39.440] Snapshot extension registration failed   peer=98998f1a err="peer connected on snap without compatible eth support"
INFO [10-18|18:27:39.630] New local node record                    seq=2 id=ef7e229d842043a6 ip=47.242.166.213 udp=32668 tcp=32668
INFO [10-18|18:27:48.150] Block synchronisation started 
INFO [10-18|18:27:50.076] Looking for peers                        peercount=2 tried=139 static=0
INFO [10-18|18:28:01.226] Looking for peers                        peercount=2 tried=98  static=0
INFO [10-18|18:31:58.461] Imported new state entries               count=273 elapsed="3.638µs"   processed=273 pending=4369 trieretry=0 coderetry=0 duplicate=0 unexpected=0
......
INFO [10-18|18:35:19.310] Imported new block receipts              count=2048 elapsed=381.770ms   number=875,712 hash=8f1f86..3a8931 age=9mo2w5d    size=5.63MiB

4, Query whether synchronization is completed

  • View the current latest block
# curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' http://127.0.0.1:8545
{"jsonrpc":"2.0","id":1,"result":"0xa352a4"}
  • View current synchronization status
# curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' http://127.0.0.1:8545
{"jsonrpc":"2.0","id":1,"result":false}

Note: if the result is false, the synchronization is completed

The above is all the content shared today.

I hope you can solve your actual needs and problems through the above methods.

If you have any questions during the deployment process, you can scan the following QR code and add my personal wechat. Note: Region - career direction - nickname. Welcome to join the blockchain technology exchange group to learn and communicate with more blockchain technology leaders.

Original is not easy, codeword is not easy. If you think this article is a little useful to you, please like this article, leave a message or forward it, because this will be the driving force for me to output more high-quality articles. Thank you!

Tags: Linux Blockchain Ubuntu

Posted on Mon, 18 Oct 2021 20:14:16 -0400 by ragear