> For the complete documentation index, see [llms.txt](https://docs.chaintools.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chaintools.tech/home/readme/install-hermes-relayer.md).

# Install Hermes Relayer

Setup demonstrates how to setup Hermes relayer and configure it to relay assets between LumenX and Osmosis chains.

### Pre-requisites

All steps were executed and tested on:

* Ubuntu 22.04 LTS

#### Create user account

```bash
adduser relayer
```

#### Required packages

```bash
sudo apt install make clang pkg-config libssl-dev build-essential git jq llvm libudev-dev -y
```

#### Rust installation

```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
```

**NOTE:** Install Rust as ***relayer*** user created earlier

### Relayer build & installation

```bash
git clone https://github.com/informalsystems/ibc-rs.git && \
cd ibc-rs && \
git checkout v1.3.0 && \
cargo build --release --bin hermes
```

```bash
mkdir -p ${HOME}/.local/bin ; \
cp ${HOME}/ibc-rs/target/release/hermes ${HOME}/.local/bin
```

### Hermes configuration

Create folder for Hermes configuration

```bash
mkdir -p ${HOME}/.hermes
```

Then populate ***${HOME}/.hermes/config.toml*** with following content:

```toml
[[chains]]
id = 'osmosis-1'
rpc_addr = 'https://rpc.service.for.osmosis:443'
grpc_addr = 'https://grpc.service.for.osmosis:443'
websocket_addr = 'ws://rpc.service.for.osmosis:443/websocket'
rpc_timeout = '10s'
account_prefix = 'osmo'
key_name = 'osmo'
address_type = { derivation = 'cosmos' }
store_prefix = 'ibc'
default_gas = 3000000
max_gas = 10000000
gas_price = { price = 0.25, denom = 'uosmo' }
gas_adjustment = 0.1
max_msg_num = 30
max_tx_size = 180000
clock_drift = '15s'
max_block_time = '10s'
trusting_period = '14days'
memo_prefix = ''
trust_threshold = { numerator = '1', denominator = '3' }
[chains.packet_filter]
policy = 'allow'
list = [
 ['transfer', 'channel-286'], # LumenX
]


[[chains]]
id = 'LumenX'
rpc_addr = 'http://rpc.service.for.lumenx:26727'
grpc_addr = 'http://rpc.service.for.lumenx:9160'
websocket_addr = 'ws://rpc.service.for.lumenx:26727/websocket'
rpc_timeout = '10s'
account_prefix = 'lumen'
key_name = 'lumen'
address_type = { derivation = 'cosmos' }
store_prefix = 'ibc'
default_gas = 3000000
max_gas = 10000000
gas_price = { price = 0.25, denom = 'ulumen' }
gas_adjustment = 0.1
max_msg_num = 30
max_tx_size = 180000
clock_drift = '15s'
max_block_time = '10s'
trusting_period = '14days'
memo_prefix = ''
trust_threshold = { numerator = '1', denominator = '3' }
[chains.packet_filter]
policy = 'allow'
list = [
 ['transfer', 'channel-3'], # osmosis-1
]
```

**NOTE:** Please note that apropriate addresses and ports for RPC, gRPC and WebSocket services must be adjusted accordingly to point to nodes providing those services.

### Add relayer keys

```bash
hermes-keys add --chain LumenX --mnemonic-file lumenx.txt
hermes-keys add --chain osmosis-1 --mnemonic-file osmosis.txt
```

**NOTE:** files *lumenx.txt* and *osmosis.txt* contain mnemonic for wallet which will be used for relayer fees. Wallets for relayer must have some amount of coins prior to starting relayer. Otherwise relayer will not be able to relay any transactions

### Create and start Hermes service

Service file ***/etc/systemd/system/hermes.service*** should have at least following content:

```bash
[Unit]
Description=Hermes IBC Relayer

[Service]
User=relayer
Group=relayer
ExecStart=/home/relayer/.local/bin/hermes start
LimitNOFILE=180000
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target
```

```bash
sudo systemctl daemon-reload && \
sudo systemctl enable hermes && \
sudo systemctl restart hermes
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.chaintools.tech/home/readme/install-hermes-relayer.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
