Skip to content

Commit

Permalink
from source instructions
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Balaji <[email protected]>
  • Loading branch information
paulbalaji committed Jan 16, 2024
1 parent 86cdb78 commit bb12493
Showing 1 changed file with 86 additions and 3 deletions.
89 changes: 86 additions & 3 deletions docs/guides/deploy-hyperlane-local-agents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Make sure the validator key corresponds to the address provided when setting up

**Update agent config**

Unless you are running on Linux, you will also need to update the agent configuration for your network. This is because Docker does not support the [`host` network mode](https://docs.docker.com/network/drivers/host/) on Mac, Windows or Windows Server.
Unless you are running Docker on Linux, you will also need to update the agent configuration for your network. This is because Docker does not support the [`host` network mode](https://docs.docker.com/network/drivers/host/) on Mac, Windows or Windows Server.

To do this, navigate to the agent-configuration at `$CONFIG_FILES` and replace all instances of "localhost" or "127.0.0.1" in to `host.docker.internal`. For example:

Expand Down Expand Up @@ -157,7 +157,25 @@ Hardcoding these paths deduplucates the configuration, making it easier to pass

</TabItem>
<TabItem value="from-source" label="Building from source">
****

**Clone and setup**

First, clone the Hyperlane monorepo:

```sh
git clone [email protected]:hyperlane-xyz/hyperlane-monorepo.git
```

Then follow the [setup instructions](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/README.md) in the `rust` directory. This should setup `rustup` as well as Rosetta 2 if you are on Apple Silicon.

```sh
# install rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# (apple silicon only) install rosetta 2
softwareupdate --install-rosetta --agree-to-license
```

</TabItem>
</Tabs>

Expand All @@ -171,7 +189,7 @@ Now that you understand more about configuring validator arguments, pull the lat
docker pull gcr.io/abacus-labs-dev/hyperlane-agent:main
```

Finally, run the container:
Finally, run the validator:

```sh
docker run \
Expand All @@ -193,6 +211,8 @@ docker run \

<TabItem value="from-source" label="Building from source">

After following the setup instructions, you should now be able to use `cargo` to run the Validator:

```sh
cargo run --bin validator -- \
--db ./hyperlane_db_validator_<your_chain_name> \
Expand All @@ -202,6 +222,27 @@ cargo run --bin validator -- \
--validator.key <your_validator_key>
```

:::note (optional) Run the binary directly

You can alternatively build out the agent:

```sh
cargo build --release bin validator
```

And run the binary directly:

```sh
./target/release/validator \
--db ./hyperlane_db_validator_<your_chain_name> \
--originChainName <your_chain_name> \
--checkpointSyncer.type localStorage \
--checkpointSyncer.path $VALIDATOR_SIGNATURES_DIR \
--validator.key <your_validator_key>
```

:::

</TabItem>
</Tabs>

Expand All @@ -227,6 +268,7 @@ There are numerous parameters that validators can be configured with. For this g
| `--relayChains` | Comma separates names of the origin chain and destination chains to relay messages between. E.g. `ethereum,polygon,avalanche`. |
| `--allowLocalCheckpointSyncers` | Allows the relayer to look for validator signatures on the local filesystem. |
| `--defaultSigner.key` | A hexadecimal private key used to sign transactions for all chains. |
| `--metrics-port` | Optional. The port to expose prometheus metrics on, defaults to `9090`. |

<Tabs groupId="docker">
<TabItem value="docker" label="Using Docker">
Expand All @@ -253,6 +295,22 @@ Hardcoding these paths deduplucates the configuration, making it easier to pass

</TabItem>
<TabItem value="from-source" label="Building from source">

**Clone and setup**

If you haven't already done so when setting up the validator, clone the Hyperlane monorepo and follow the [setup instructions](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/README.md) in the `rust` directory.

```sh
# clone hyperlane monorepo
git clone [email protected]:hyperlane-xyz/hyperlane-monorepo.git

# install rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# (apple silicon only) install rosetta 2
softwareupdate --install-rosetta --agree-to-license
```

</TabItem>
</Tabs>

Expand Down Expand Up @@ -291,6 +349,8 @@ docker run \
</TabItem>
<TabItem value="from-source" label="Building from source">

After following the setup instructions, you should now be able to use `cargo` to run the Relayer:

```sh
cargo run --bin relayer -- \
--db ./hyperlane_db_relayer \
Expand All @@ -300,6 +360,29 @@ cargo run --bin relayer -- \
--metrics-port 9091
```

The metrics port is overriden to avoid clashing with the validator.

:::note (optional) Run the binary directly

You can alternatively build out the agent:

```sh
cargo build --release bin relayer
```

And run the binary directly:

```sh
./target/release/relayer \
--db ./hyperlane_db_relayer \
--relayChains <your_chain_name>,<remote_chain_name> \
--allowLocalCheckpointSyncers true \
--defaultSigner.key <your_validator_key> \
--metrics-port 9091
```

:::

</TabItem>
</Tabs>

Expand Down

0 comments on commit bb12493

Please sign in to comment.