Skip to content

Commit

Permalink
docs: relayer readme
Browse files Browse the repository at this point in the history
  • Loading branch information
adamewozniak committed Sep 4, 2024
1 parent 17e698e commit c1f38d2
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ Ojo-evm is a set of contracts which use Axelar's GMP to request data from the Oj
## Table of Contents

- [Table of Contents](#table-of-contents)
- [Push Oracle](#push-oracle)
- [Flow](#flow)
- [Gas](#gas)
- [Integration](#integration)
- [Example](#example)
- [Alternate Example](#alternate-example)
- [Deployments](#deployments)

## Push Oracle

Ojo's smart contracts also support push oracles. These are smart contracts which are chainlink interface compatible and can be used to push price data from Ojo to any receiving EVM blockchain. Our existing push oracles are documented [here](https://docs.ojo.network/integrate/evm/push-oracle).

The chainlink interface is a wrapper around our base contract which allows existing DeFi applications to integrate Ojo without the need to modify their source code. This contract can be found [here](./contracts/pricefeed/PriceFeed.sol).

## Flow

Expand Down
Binary file modified assets/ojo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added contracts/pricefeed/readme.md
Empty file.
114 changes: 114 additions & 0 deletions relayer/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Ojo Relayer

Ojo Relayer is a service that anyone can run to periodically push price feeds from the Ojo blockchain to an Ojo contract deployed to an EVM chain. This service is normally run by the Ojo core team, but anyone can run it.

## Installation

Use the `make install` command to install the Ojo Relayer.

Alternatively, you can see our recent [releases](https://github.com/ojo-network/ojo-evm/releases) to see if there is a binary.

## Compatibility

| Ojo Relayer Version | Ojo Version |
|---------------------|-------------|
| v0.1.x | v0.3.x |

## Configuration

The Ojo relayer uses a toml file for configuration. You can find an example [here](./relayer.example.toml).

### `gas`

The `gas` field is the amount of gas to use for the transaction.
The `gas_prices` field is the amount of gas to use for the transaction.

### `account`

The `account` section is used to specify the account that will be used to sign transactions on the Ojo blockchain. The chain-id should always be `agamotto`.

For example:
```toml
[account]
address = "ojo1kjqcup59v5jtlykewz90em6v0cz7tqpd7u7nyr"
chain_id = "agamotto"
```

### `keyring`

The `keyring` field is the keyring to use for the transaction.

Our keyring must be set up to sign transactions before running the relayer.
Additional info on the different keyring modes is available [here](https://docs.cosmos.network/v0.46/run-node/keyring.html).
**Please note that the `test` and `memory` modes are only for testing purposes.**
**Do not use these modes for running the relayer against mainnet.**

The keyring `dir` and `backend` are defined in the config file.
You may use the `KEYRING_PASS` environment variable to set up the keyring password.

Ex :
`export KEYRING_PASS=keyringPassword`

If this environment variable is not set, the relayer will prompt the user for input.

### `rpc`

The `rpc` section is used to specify the RPC endpoints for the Ojo blockchain. We generally suggest using a local Ojo node for development purposes. Please see [these docs](https://docs.ojo.network/networks/agamotto#start-a-full-node) for running a node on the Ojo blockchain.

For example:
```toml
[rpc]
grpc_endpoint = "localhost:9090"
rpc_timeout = "100ms"
tmrpc_endpoint = "http://localhost:26657"
```

### `relayer`

These config values are used to specify how often the relayer pushed prices, and to where.

```toml
[relayer]
interval = "24h"
deviation = "0.05"
destination = "Arbitrum"
contract = "0x001"
```

The `interval` field will determine how often to send a heartbeat, if the price doesn't deviate by more than `deviation` percentage in a given period.
The `deviation` field is the percentage of deviation allowed before a new price update is sent.
The `destination` field is the name of the EVM chain that you want to push the price feeds to. This directory is managed by Axelar and can be found [here](https://docs.axelar.dev/resources/contract-addresses/mainnet/).

The `contract` field is the address of the Ojo contract on the EVM chain.

Here are the publicly supported contract addresses:

| Chain | Contract Address |
|----------|------------------|
| Ethereum | [0x5BB3E85f91D08fe92a3D123EE35050b763D6E6A7](https://etherscan.io/address/0x5BB3E85f91D08fe92a3D123EE35050b763D6E6A7) |
| Arbitrum | [0x5BB3E85f91D08fe92a3D123EE35050b763D6E6A7](https://arbiscan.io/address/0x5BB3E85f91D08fe92a3D123EE35050b763D6E6A7) |

### `assets`

The assets array specifies which assets you want to push. You can have one relayer instance per asset or have it handle multiple assets.

```toml
[[assets]]
denom = "BTC"
[[assets]]
denom = "ETH"
```

### `axelar_gas`

This section determines how much gas to pay the Axelar relayer for the transaction. The relayer will use axelar's gas estimator to determine how much AXL gas is used for each transaction.

This is an example with the IBC representation of the AXL token on agamotto:
```toml
[axelar_gas]
denom = "ibc/0E1517E2771CA7C03F2ED3F9BAECCAEADF0BFD79B89679E834933BC0F179AD98"
multiplier = "1.2"
default = "1000000"
```

How much each transaction will cost in AXL is different for each chain, and will vary with the usage of each chain (for example, pushing prices to Ethereum is more expensive than Arbitrum).

0 comments on commit c1f38d2

Please sign in to comment.