-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
12,250 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
group: | ||
title: 🔹 Relayer | ||
order: 5 | ||
order: 2 | ||
title: Client | ||
--- | ||
|
||
Helix has open-sourced a JavaScript client, and you can find more information about it on their [GitHub](https://github.com/helix-bridge/relayer) repository. For specific configuration and deployment instructions, please refer to the README file in the repository. The README typically contains detailed guidelines on how to set up and use the client effectively. | ||
|
||
Make sure to carefully follow the instructions provided in the README for a successful setup and deployment of the Helix JavaScript client. | ||
|
||
Here's a brief overview of the steps for deploying a Relayer: | ||
|
||
- **Deploy Indexer Service (You can skip this step if using Helix's public service)**: If not using Helix's public service, you need to deploy your own Indexer service. This might involve setting up and configuring an Indexer to index and provide on-chain data. | ||
|
||
- **Download Relayer Source Code and Compile**: Download the Relayer's source code and compile it following the instructions provided in the project's documentation. Typically, this involves installing build tools, dependencies, and running compilation commands. | ||
|
||
- **Configure Bridge Information for Providing Relay Services**: In the Relayer's configuration file, specify information about the bridges you want to interact with. This includes details about the source and target chains, such as chain types, connection details, contract addresses, etc. | ||
|
||
- **Start the Relayer Client and Keep It Online**: Run the Relayer client and ensure it stays online, ready to handle forwarding transaction requests. Usually, Relayers listen on specific ports, awaiting requests from users. | ||
|
||
- **Register the Relayer, Stake a Bond, and Set Fees**: Depending on the bridge's requirements, you may need to register the Relayer's identity on-chain, stake a certain amount as a bond, and set the fee structure. This ensures the credibility and availability of the Relayer. | ||
|
||
Absolutely, it's crucial to ensure that the Relayer client is running smoothly and remains online before attempting to register as a Relayer. Failing to do so could result in penalties or other consequences, as reliability and uptime are typically important criteria for becoming and remaining a Relayer in most bridge ecosystems. | ||
|
||
Relayers play a critical role in maintaining the smooth operation of cross-chain transactions, so they are expected to provide a high level of availability and responsiveness. Therefore, it's essential to thoroughly test and monitor your Relayer setup to ensure it meets the required standards before registering and actively participating in the bridge network. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
--- | ||
group: | ||
title: 🔹 Relayer | ||
order: 5 | ||
order: 1 | ||
title: Indexer | ||
--- | ||
|
||
Before we can understand and try to run a relay, we should first understand the index of the helix. Because relayer relies heavily on and trusts the indexed data, the index is very important to the proper functioning and security of relayer. | ||
|
||
## Structure | ||
|
||
Helix indexing consists of a two-tier index structure, the first tier indexes the data directly on the chain, often using mature solutions such as thegraph. the second tier aggregates and correlates the data from the first tier. | ||
|
||
``` | ||
+------------------------------+ +------------------------------+ | ||
| blockchain(contract) | | blockchain(contract) | | ||
+----------------+-------------+ +----------------+-------------+ | ||
| | | ||
|event | event | ||
| | | ||
+----------------v--------------+ +-------------v-------------+ | ||
| indexer(level1) | | indexer(level1) | | ||
| thegraph | | thegraph | | ||
+----------------+--------------+ +--------------+------------+ | ||
| | | ||
| | | ||
+-v------------------------------------------------v--+ | ||
| indexer(level2) | | ||
+--^----------------------^-----------------------^---+ | ||
| | | | ||
+--------------+ | +------------+ | +-----------+ | | ||
| relayer +---+ | relayer +-+ | relayer +-+ | ||
+--------------+ +------------+ +-----------+ | ||
``` | ||
|
||
Each indexer on the first layer is responsible for indexing and storing data from a single chain. The second layer's service is unique; it connects to the first layer's services, requests data from them sequentially, and associates data from different chains while performing global sorting. The Relayer only requests data from the second-layer indexer and trusts the data from that indexer. | ||
|
||
## Deploy | ||
|
||
Relayers have the option to deploy their own indexer services. All Helix-related services are already open source on [GitHub](https://github.com/helix-bridge/indexer). Deploying the indexer service is also a two-step process, first deploying the first-layer indexing service, and then deploying the second layer. | ||
|
||
- For the first-layer service, navigate to the "subgraph" directory. Relayers can choose either the "default" or "opposite" subgraph directory based on their specific needs. Taking "arbitrum -> linea" as an example, before deploying, the relayer should first start the "graph-node" service. For detailed instructions, refer to the "graph-node" [documentation](https://thegraph.com/docs/en/deploying/hosted-service/). | ||
|
||
```shell | ||
// deploy subgraph to graph-node | ||
>> cd subgraph/ln-default-bridge | ||
>> yarn build-arbitrum | ||
>> npx graph create --node http://graph-node:8020/ lndefault/arbitrum | ||
>> npx graph deploy --node http://graph-node:8020/ --ipfs http://ipfs:5001 lndefault/arbitrum | ||
>> yarn build-linea | ||
>> npx graph create --node http://graph-node:8020/ lndefault/linea | ||
>> npx graph deploy --node http://graph-node:8020/ --ipfs http://ipfs:5001 lndefault/linea | ||
``` | ||
|
||
- For the second-layer service, go into the "apollo" directory, and modify the .env.test file. Set the URL for "ENDPOINT" to your own deployed subgraph URL. Before starting the Apollo service, you should first launch a PostgreSQL service. You can follow the example below to start it using Docker Compose: | ||
|
||
```yaml | ||
version: '3' | ||
|
||
services: | ||
postgres: | ||
container_name: subql-postgres | ||
ports: | ||
- 5432:5432 | ||
image: postgres:12-alpine | ||
restart: always | ||
volumes: | ||
- ./data:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_USER: 'admin' | ||
POSTGRES_PASSWORD: 'admin' | ||
POSTGRES_DB: 'apollo_graph' | ||
``` | ||
Make sure to customize the environment variables (POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD) to suit your needs, and then use docker-compose up to start the PostgreSQL service before launching the Apollo service. | ||
Once you've completed the setup and configuration, you can proceed to compile and start the Apollo service. The default port for the service is 4002. Here are the general steps: | ||
1. Make sure you are in the "apollo" directory where you have your configuration files, including the modified .env.test file. | ||
2. Compile the Apollo service if required. Typically, this can be done by running the necessary build or compile commands. | ||
3. After compiling (if needed), you can start the Apollo service by running a command like `yarn start:test` from the "apollo" directory. you need to initialize the database for the first-time startup using the command `yarn init:db`. | ||
|
||
4. The Apollo service should now be running on port 4002 as the default. You can access it by navigating to http://localhost:4002 in your web browser or by making API requests to that endpoint. | ||
|
||
```bash | ||
// deploy indexer | ||
>> cd apollo | ||
// update ENDPOINT url in the file .env.test | ||
// start a local postgres service (user:admin, password: admin, db: apollo_graph, port: 5432) | ||
>> yarn generate:prisma | ||
>> yarn build:test | ||
>> yarn init:db | ||
>> yarn start:test | ||
``` | ||
|
||
## Helix Indexer Service | ||
|
||
Helix provides a public indexing service at the address https://apollo.helix.app. Relayers have the option to directly connect to this service. However, it's important to note that Helix does not guarantee the security of indexed data. Relayers should be aware that they are responsible for any data-related risks when using this service. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
group: | ||
title: 🔹 User Guide | ||
order: 4 | ||
order: 1 | ||
--- | ||
|
||
## LnBridge | ||
|
||
### Testnet | ||
|
||
<table style="width:80%"> | ||
<tr> | ||
<th style="width:20%">From Chain</th><th>ToChain</th><th>BridgeType</th><th>Generical Message Protocol</th> | ||
</tr> | ||
<tr> | ||
<td rowspan="3">Ethereum Goerli</td><td>Arbitrum Goerli</td><td>Default</td><td>Arbitrum L1 To L2</td> | ||
</tr> | ||
<tr> | ||
<td>Linea Goerli</td><td>Default</td><td>Linea L1 To L2</td> | ||
</tr> | ||
<tr> | ||
<td>Mantle Goerli</td><td>Default</td><td>LayerZero</td> | ||
</tr> | ||
<tr> | ||
<td rowspan="3">Arbitrum Goerli</td><td>Ethereum Goerli</td><td>Opposite</td><td>Arbitrum L1 To L2</td> | ||
</tr> | ||
<tr> | ||
<td>Linea Goerli</td><td>Default</td><td>LayerZero</td> | ||
</tr> | ||
<tr> | ||
<td>Mantle Goerli</td><td>Default</td><td>LayerZero</td> | ||
</tr> | ||
<tr> | ||
<td rowspan="3">Linea Goerli</td><td>Ethereum Goerli</td><td>Opposite</td><td>Linea L1 To L2</td> | ||
</tr> | ||
<tr> | ||
<td>Arbitrum Goerli</td><td>Default</td><td>LayerZero</td> | ||
</tr> | ||
<tr> | ||
<td>Mantle Goerli</td><td>Default</td><td>LayerZero</td> | ||
</tr> | ||
<td rowspan="3">Mantle Goerli</td><td>Ethereum Goerli</td><td>Default</td><td>LayerZero</td> | ||
</tr> | ||
<tr> | ||
<td>Arbitrum Goerli</td><td>Default</td><td>LayerZero</td> | ||
</tr> | ||
<tr> | ||
<td>Linea Goerli</td><td>Default</td><td>LayerZero</td> | ||
</tr> | ||
</table> |
Oops, something went wrong.