The method of enabling Staking has been introduced in the previous tutorial: Ethereum 2.0 POS Mining (ETH2 Staking) Tutorial (I) Topaz Test Network Since Staking requires validators to stay online 24/7 to continue to earn income, if a validator is offline for a short period of time, there will be a small penalty; if it is offline for a long time, the penalty amount will increase significantly over time. For a brief introduction to this mechanism, see the "Validator Incentives" section of this article. Therefore, it is necessary to monitor Staking in real time so that when problems occur, alarms can be received and handled in a timely manner to avoid further losses. This article will introduce several monitoring methods from simple to complex. Preparation - Get the certifier public key1. Obtained from deposit transactionOpen metamask, find the deposit transaction of 32ETH, and click "Browse via etherscan". You can see the validator public key corresponding to that transaction. 2. View from the validator key directoryAfter entering the key directory, check the validatorprivate**** file and find the "publickey" part. # Enter the directory cd ~/.eth2validators # Open the file starting with validatorprivate vim validatorprivatekey***** # Open it and find the "publickey" part Blockchain browser to view the validator statusThe easiest way is to monitor the validator status by visiting the blockchain browser website: https://beaconcha.in or https://beacon.etherscan.io, and enter the Public Key to view the current status and historical earnings. Validator status — beaconcha.in example Use the cloud hosting provider’s monitoring dashboardMost cloud hosting service providers provide host performance monitoring and alarm functions. If you are staking on a cloud host, you can use the resource monitoring and alarm functions provided by the cloud service. The beacon chain client occupies approximately 2.5GB-3.5GB of memory. If the process is terminated, the memory will drop sharply. You can monitor it from the side through abnormal memory usage/usage. At the same time, you can set up more dimensional monitoring of network traffic and whether the machine is running normally. Monitoring via prometheusPrometheus is a popular real-time monitoring tool. After developing the service and setting the listening port as required, you can obtain data through the prometheus access port for monitoring. prysm has built-in listening services for prometheus, so you only need to configure prometheus to monitor the beacon chain and validator clients. If you want to study it yourself, you can refer to the official tutorial. Here are the brief steps:
tar xvfz prometheus-*.tar.gz cd prometheus-*
# Create a new session screen -S prometheusETH2 # Start prometheus ./prometheus --config.file=prometheus.yml # After the startup is complete, press CTRL+A+D to exit the session
scrape_configs: # The job name is added as a label `job=` to any timeseries scraped from this config. - job_name: 'prometheus'# metrics_path defaults to '/metrics' # scheme defaults to 'http'.static_configs: - targets: ['localhost:9090']# Add the following targets to monitor the beacon chain and validators - job_name: 'beacon-chain' static_configs: - targets: ['localhost:8080'] - job_name: 'validator' static_configs: - targets: ['localhost:8081'] After the modification is complete, use promtool to check the correctness of the configuration file: ./promtool check config prometheus.yml After verification, you can see the following information: Checking prometheus.yml SUCCESS: 0 rule files found
kill -HUP PID
Pros and ConsThe above different monitoring methods have their own advantages and disadvantages. The comparison is as follows:
In summary, the safer approach is to monitor host performance indicators + prometheus. In addition, prometheus can be deployed on another machine, so that abnormal indicators can be observed when the host is down or the network is disconnected. We have monitoring, but what about alarms?Having said so much, does it mean that a person needs to do nothing but stare at the indicators all day? Of course not. The next article will introduce how to alert for abnormalities. Don't miss it. Link to this article: https://www.8btc.com/media/594563 |
<<: Bitcoin price key indicator shows: investor panic has decreased after halving
Various marks will appear on the palm lines. This...
Marriage is very important for women. It can be s...
Peach blossom luck is not always good. Some peach...
The length of a person's fingers can reveal h...
1. Dragon eyebrows and phoenix eyes Generally, pe...
On June 27, the 21st meeting of the Standing Comm...
The overall shape of a man's palm Round Hands...
From the perspective of physiognomy, people with ...
Suitable for people with 5 machines or less 1. Wh...
Source: China Business News Author: Zheng Yu and ...
Career line in palmistry, palmistry can tell when...
Dear readers, you should all know that moles on t...
A person often has a lot of responsibilities, inc...
Zhuge Shensuan, also known as Zhuge Divine Number...
Text | Zheng Yi Editor | Bi Tongtong Source | PAN...