Skip to content

Commit

Permalink
docs(relay-node): Improve style and reference the official docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
zah committed Jun 27, 2023
1 parent 843b9f7 commit b5e4d59
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.relay
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ COPY ./scripts ./scripts
ENV INFURA_API_KEY=asd ETHERSCAN_API_KEY=asd
RUN cd beacon-light-client/solidity && yarn hardhat compile

VOLUME relayvolume DendrETH/build
VOLUME relayvolume DendrETH/data

ENTRYPOINT ["./relay/run-relay.sh"]
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ yarn-check:
echo "Please run yarn install"; exit 1; \
}

.PHONY: build-relay-image
build-relay-image:
.PHONY: dendreth-relay-node
dendreth-relay-node:
nix run '.#docker-image-yarn.copyToDockerDaemon'
nix run '.?submodules=1#docker-image-all.copyToDockerDaemon'

docker build -t relayimage -f Dockerfile.relay .
docker build -t metacraft/dendeth-relay-node -f Dockerfile.relay .

publish-dendreth-relay-node: dendreth-relay-node
docker push metacraft/dendeth-relay-node

evm-simulation: yarn-check
cd beacon-light-client/solidity && \
Expand Down
40 changes: 27 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,47 +119,58 @@ You should see a [Hardhat simulation](https://hardhat.org/hardhat-runner/docs/ge
sequentially processing all available updates. At the time of this writing, each
update costs around 330K in gas.

### Run relayer
### Running the DendrETH relay node

To run the relayer you can execute
The DendrETH relay node efficiently generates proofs and publishes updates for
all blockchains supported by the DendrETH project. To simplify the process of
running a relay, we provide up-to-date Docker images.

```bash
make build-relay-image
```
> You can also build a custom image yourself by executing the
> `make dendreth-relay-node` command within the development environment
> provided by this repository.
To run the relay node, please follow these steps:

Which will build the relayimage for you. To run it
1. Ensure that you have Docker installed on your system.
2. Open a terminal or command prompt.
3. Execute the following command:

```bash
docker run -it --env-file .env -v relayvolume:/DendrETH/build relayimage
docker run --env-file .env -v relay-node-data:/DendrETH/data metacraft/dendreth-relay-node
```

Passing the .env file with needed configurations.
This command assumes that you want to store all runtime data in a local directory
called `relay-node-data`. If you prefer to use a different directory, please modify
the command accordingly.

The .env file must contain the following things
The provided `.env` file must supply the following variables:

For accessing the networks and signing transactions:
#### For accessing the networks and signing transactions:

```bash
USER_PRIVATE_KEY=private_key
ALCHEMY_API_KEY=api_key
```

To configure from which slot should the relayer start generating updates. And what step it should use
#### To configure the starting point and frequency of updates:

```bash
INITIAL_SLOT=5355991
SLOTS_JUMP=64
```

To configure relayer what network it should follow. Currently the script only supports following one network. You can mannually run the tasks for publishing and updating on a second network.
#### To configure which networks should be followed:

```bash
PRATTER=TRUE
MAINNET=FALSE
FOLLOW_NETWORK=pratter
```

You can also provide for addresses on different networks if you skip a network transactions won't be broadcasted to it
Currently the scripts within the container support following a single network.
You can manually run the tasks for publishing updates on a second network.

#### To specify the deployed instances of the DendrETH smart contracts:

```bash
LC_GOERLI=0xf65B59bc947865490eF92D8461e8B5D0eA87c343
Expand All @@ -174,6 +185,9 @@ LC_CHIADO=0xAa5eeb05D0B080b366CB6feA00d16216B24FB9bE
LC_EVMOS=0x8E4D36CD13015EA6F384cab3342156b3dC5d0a53
```

If you skip some of these variables, the relay node won't publish updates for
the particular network.

### How does the relayer work?

We utilize BullMQ for our system.
Expand Down

0 comments on commit b5e4d59

Please sign in to comment.