> For the complete documentation index, see [llms.txt](https://tantalum666.gitbook.io/namada-docs-chinese/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tantalum666.gitbook.io/namada-docs-chinese/yun-ying-zhi-nan-operators-guide/yi-tai-fang-qiao-ethereum-bridge/zhong-ji-relaying.md).

# 中继 (Relaying)

中继器命令位于 `namadar` 二进制文件中，目前只能从源代码安装。

***

## 中继验证器集更新 (Relaying validator set updates)

为了将任何交易中继到以太坊智能合约，需要在以太坊方面保持验证器集的更新。可以通过以下方式设置中继器来完成此更新：

```
namadar validator-set relay --daemon --confirmations 1 --retry-sleep 0 --success-sleep 0 --safe-mode
```

`--safe-mode` 标志是可选的，但建议使用。它将阻止中继器被 `^C` 关闭，而是等待当前批次的交易被中继后再关闭。

还有更多可选的标志，可以通过运行 `namadar validator-set relay --help` 找到。值得注意的是，`--eth-gas` 和 `--eth-gas-price` 选项将允许您分别设置中继器在中继交易到以太坊智能合约时使用的最大 gas-limit 和 gas-price。

***

## 中继交易 (Relaying transactions)

交易是分批中继的。中继器将等待，直到它有一批要中继的交易，然后再将它们发送到以太坊智能合约。这样做是为了减少需要发送到以太坊智能合约的交易数量，从而减少 gas 成本。

中继器可以通过运行以下命令获取一组“推荐的”已签名交易以进行中继：

```
namadar ethereum-bridge-pool recommend-batch
```

如果这对中继器有利，它可以通过运行以下命令构建证明，并将其中继到以太坊智能合约：

```
namadar ethereum-bridge-pool relay-proof --hash-list $HASH_LIST
```

{% hint style="info" %}
由于这涉及到一个以太坊交易，`--eth-gas` 和 `--eth-gas-price` 标志也在这里可用。
{% endhint %}

或者，中继器可以运行命令：

```
namadar ethereum-bridge-pool construct-proof --hash-list $HASH_LIST
```

仅构造证明而不进行中继。然后，中继器可以手动中继证明。
