什么是验证者?
验证者负责通过自动化投票流程将新区块提交到区块链中。如果验证者离线,或在同一高度签署区块,其质押可能会被罚没。由于存在被罚没的风险,我们建议你阅读关于哨兵节点架构的内容,以保护你的节点免受 DDOS 攻击并确保高可用性。 以下说明假设你已经设置好全节点,并且已同步到最新区块高度。创建你的验证者
你的cosmosvalconspub 可通过质押代币用于创建新的验证者。你可以运行以下命令查看验证者公钥:
编辑验证者描述
你可以编辑验证者的公开描述。这些信息用于标识你的验证者,委托人会依赖这些信息决定将质押委托给哪个验证者。请确保为下方每个标志都提供输入。如果命令中未包含某个标志,则当该字段从未设置过时会默认为空(--moniker 默认为机器名);如果过去设置过,则会保持原值。
key_name 用于指定你要编辑的验证者。如果你选择不包含下方某些标志,请记住必须包含 —from 标志,以标识要更新的验证者。
--identity 可用于通过 Keybase 或 UPort 等系统验证身份。使用 Keybase 时,--identity 应填写一个 16 位字符串,该字符串由 keybase.io 账户生成。这是一种可在多个在线网络中验证你身份的加密安全方法。Keybase API 允许我们获取你的 Keybase 头像。这也是你为验证者资料添加 logo 的方式。
commission-rate 的值必须遵循以下规则:
- 必须在 0 和验证者的
commission-max-rate之间 - 不得超过验证者的
commission-max-change-rate,该值表示每天允许的最大百分点变动率。换句话说,验证者每天只能修改一次佣金,且变动幅度必须在commission-max-change-rate的限制范围内。
查看验证者描述
使用以下命令查看验证者信息:跟踪验证者签名信息
为了跟踪验证者过去的签名情况,你可以使用signing-info 命令:
解除验证者监禁状态
当验证者因宕机而被“监禁”时,你必须使用操作员账户提交一笔Unjail 交易,才能再次获得区块提议奖励(取决于该 zone 的手续费分配机制)。
确认你的验证者正在运行
如果以下命令有任何返回结果,则说明你的验证者处于活跃状态:~/.gaia/config/priv_validator.json 文件中的 bech32 编码 address。
停止你的验证者
当你要执行例行维护,或为即将到来的协调升级做准备时,让验证者以系统化且平滑的方式停止会很有用。你可以通过设置halt-height 为希望节点关闭的区块高度,或在启动 gaiad 时传入 --halt-height 标志来实现。在提交该高度的区块后,节点会以零退出码关闭。
高级配置
关于运行节点或验证者的更多高级信息,请参阅 CometBFT Core 文档。常见问题
问题 #1:我的验证者 voting_power: 0
你的验证者已被监禁。如果验证者没有对最近 10,000 个区块中的至少 500 个进行投票,或者发生双签,就会被监禁,也就是从活跃验证者集合中移除。
如果你是因宕机而被监禁,可以恢复验证者的投票权。首先,如果你没有使用 Cosmovisor 且 gaiad 当前未运行,请先重新启动:
问题 #2:我的 gaiad 因 too many open files 崩溃
Linux 默认允许单个进程打开的文件数是 1024。已知 gaiad 打开的文件数会超过 1024,这会导致进程崩溃。一个快速修复方法是运行 ulimit -n 4096(提高允许打开的文件数量),然后使用 gaiad start 重启进程。如果你使用 systemd 或其他进程管理器来启动 gaiad(例如 Cosmovisor),则可能需要在对应层面进行配置。下面给出一个用于修复此问题的 systemd 示例文件:
Before setting up a validator node, make sure to have completed the Joining Mainnet guide. If you plan to use a KMS (key management system), you should go through these steps first: Using a KMS.
What is a Validator?
Validators are responsible for committing new blocks to the blockchain through an automated voting process. A validator’s stake is slashed if they become unavailable or sign blocks at the same height. Because there is a chance of slashing, we suggest you read about Sentry Node Architecture to protect your node from DDOS attacks and to ensure high-availability. The following instructions assume you have already set up a full-node and are synchronised to the latest blockheight.Create Your Validator
Yourcosmosvalconspub can be used to create a new validator by staking tokens. You can find your validator pubkey by running:
Edit Validator Description
You can edit your validator’s public description. This info is to identify your validator, and will be relied on by delegators to decide which validators to stake to. Make sure to provide input for every flag below. If a flag is not included in the command the field will default to empty (--moniker defaults to the machine name) if the field has never been set or remain the same if it has been set in the past.
The key_name specifies which validator you are editing. If you choose to not include some of the flags below, remember that the —from flag must be included to identify the validator to update.
The --identity can be used as to verify identity with systems like Keybase or UPort. When using Keybase, --identity should be populated with a 16-digit string that is generated with a keybase.io account. It’s a cryptographically secure method of verifying your identity across multiple online networks. The Keybase API allows us to retrieve your Keybase avatar. This is how you can add a logo to your validator profile.
commission-rate value must adhere to the following rules:
- Must be between 0 and the validator’s
commission-max-rate - Must not exceed the validator’s
commission-max-change-ratewhich is maximum % point change rate per day. In other words, a validator can only change its commission once per day and withincommission-max-change-ratebounds.
View Validator Description
View the validator’s information with this command:Track Validator Signing Information
In order to keep track of a validator’s signatures in the past you can do so by using thesigning-info command:
Unjail Validator
When a validator is “jailed” for downtime, you must submit anUnjail transaction from the operator account in order to be able to get block proposer rewards again (depends on the zone fee distribution).
Confirm Your Validator is Running
Your validator is active if the following command returns anything:bech32 encoded address in the ~/.gaia/config/priv_validator.json file.
Halting Your Validator
When attempting to perform routine maintenance or planning for an upcoming coordinated upgrade, it can be useful to have your validator systematically and gracefully halt. You can achieve this by either setting thehalt-height to the height at which you want your node to shutdown or by passing the --halt-height flag to gaiad. The node will shutdown with a zero exit code at that given height after committing
the block.
Advanced configuration
You can find more advanced information about running a node or a validator on the CometBFT Core documentation.Common Problems
Problem #1: My validator has voting_power: 0
Your validator has become jailed. Validators get jailed, i.e. get removed from the active validator set, if they do not vote on at least 500 of the last 10,000 blocks, or if they double sign.
If you got jailed for downtime, you can get your voting power back to your validator. First, if you’re not using Cosmovisor and gaiad is not running, start it up again:
Problem #2: My gaiad crashes because of too many open files
The default number of files Linux can open (per-process) is 1024. gaiad is known to open more than 1024 files. This causes the process to crash. A quick fix is to run ulimit -n 4096 (increase the number of open files allowed) and then restarting the process with gaiad start. If you are using systemd or another process manager to launch gaiad (such as Cosmovisor) this may require some configuration at that level. A sample systemd file to fix this issue is below: