Skip to content

Commit 24c6cd0

Browse files
authored
docs: add initial description of lombard integration (#65)
* chore: proper images restored * docs: added lombard details * fix: linter issues resolved * chore: fix after review
1 parent 87dbf0b commit 24c6cd0

File tree

5 files changed

+86
-28
lines changed

5 files changed

+86
-28
lines changed

docs/Introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ RedStone was designed with a modular architecture making it easy to incorporate
4141
- Our code was audited by multiple security experts including [ABDK](https://abdk.consulting/) [Peckshield](https://peckshield.com/) and a co-founder of [L2Beat](https://pl.linkedin.com/company/l2beat#:~:text=Join%20Piotr%20Szlachciak%20Cofounder%20%26%20CEO,insights%20shaping%20the%20%23DeFi%20landscape!).
4242
- RedStone supports leading projects like [Morpho](https://morpho.org/), [Venus](https://venus.io/), and [Pendle Finance](https://www.pendle.finance/).
4343

44-
<a href="https://raw.githubusercontent.com/redstone-finance/redstone-docs/main/static/img/redstone-architecture-simple.png">
45-
<img alt="RedStone Architecure" src="/img/redstone-architecture-simple.png" target="_blank"/>
44+
<a target="_blank" href="https://raw.githubusercontent.com/redstone-finance/redstone-docs/main/static/img/redstone-architecture-simple.png">
45+
<img alt="RedStone Architecure" src="/img/redstone-architecture-simple.png"/>
4646
</a>

docs/data-providers/deploy.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar_label: "Deploy"
55

66
# Deploy
77

8-
In this section you will see how to run a RedStone node using Docker Compose.
8+
In this section you will see how to run a RedStone node using Docker Compose.
99

1010
:::caution
1111
For production deployments consider using more sofisticated tools, e.g. Kubernetes.
@@ -18,11 +18,10 @@ For production deployments consider using more sofisticated tools, e.g. Kubernet
1818
- At least 30 GB of storage (mainly for logs)
1919
- [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/)
2020

21-
:::tip
21+
:::tip
2222
The hardware requirements for running a RedStone node are quite low, but you should reserve a healthy margin. The more resources you spare when provisioning your machine, the better it will perform and the less likely it will be to run into issues.
2323
:::
2424

25-
2625
### Docker Compose Example
2726

2827
Here's a simple example of a `docker-compose.yml` file that you can use to run the RedStone oracle node locally. Copy this configuration and adjust it to your needs.
@@ -38,7 +37,7 @@ services:
3837
- public_network
3938
- private_network
4039
volumes:
41-
- redstone-oracle-node:/oracle-node-level-db
40+
- redstone-oracle-node:/oracle-node-level-db
4241
environment:
4342
OVERRIDE_DIRECT_CACHE_SERVICE_URLS: '["https://httpbin.org/anything"]'
4443
OVERRIDE_MANIFEST_USING_FILE: ./manifests/dev/dev.json
@@ -59,8 +58,8 @@ services:
5958
- private_key
6059

6160
secrets:
62-
private_key:
63-
file: private_key.txt
61+
private_key:
62+
file: private_key.txt
6463

6564
volumes:
6665
redstone-oracle-node:
@@ -69,36 +68,35 @@ networks:
6968
public_network:
7069
driver: bridge
7170
private_network:
72-
internal: true # This ensures the network is private
71+
internal: true # This ensures the network is private
7372
```
7473
7574
### Services
7675
7776
#### RedsStone KMS (Key Management Service)
7877
79-
RedStone KMS' sole purpose is to handle all operations on your private key. It signs the data fetched by the oracle node and returns the evm address. This should be the only service that has access to your private key. Use the [RedStone KMS](https://gallery.ecr.aws/y7v2w8b2/kms) Docker image.
78+
RedStone KMS' sole purpose is to handle all operations on your private key. It signs the data fetched by the oracle node and returns the evm address. This should be the only service that has access to your private key. Use the [RedStone KMS](https://gallery.ecr.aws/y7v2w8b2/kms) Docker image.
8079
8180
| Param | Description | Example value |
8281
| ------------------------ | ---------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
8382
| **KMS_PRIVATE_KEY_FILE** | Path to the file with your private key. The file should contain a single line with your private key. | `KMS_PRIVATE_KEY_FILE=/run/secrets/private_key` |
8483
| **KMS_PRIVATE_KEY** | Hex encoded key. Alternative way of passing the key | `KMS_PRIVATE_KEY=0xYOUR_PRIVATE_KEY` |
8584
| **KMS_ADDRESS** | Bind address | `KMS_ADDRESS=0.0.0.0:4499` |
8685

87-
#### RedStone Node
88-
RedStone oracle node will fetch data from main public APIs, sign them with your private keys and broadcast to the streamr network and redstone Data Distribution Layer (DDL).
89-
It should be configured using environment variables.
86+
#### RedStone Node
9087

88+
RedStone oracle node will fetch data from main public APIs, sign them with your private keys and broadcast to the streamr network and redstone Data Distribution Layer (DDL).
89+
It should be configured using environment variables.
9190

92-
| Param | Description | Example value |
93-
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
94-
| **ENABLE_REMOTE_SIGNER** | Delegate signing to a remote signer. Only this image has access to your ECDSA private key | `ENABLE_REMOTE_SIGNER=true` |
95-
| REMOTE_SIGNER_URL | This is where Redstone's signer is listening. We recommend using a colocation e.g. in Kubernetes oracle-node and signer should be run in the same POD. By default `http://localhost:4499`.key | `REMOTE_SIGNER_URL=http://localhost:4499` |
91+
| Param | Description | Example value |
92+
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
93+
| **ENABLE_REMOTE_SIGNER** | Delegate signing to a remote signer. Only this image has access to your ECDSA private key | `ENABLE_REMOTE_SIGNER=true` |
94+
| REMOTE_SIGNER_URL | This is where Redstone's signer is listening. We recommend using a colocation e.g. in Kubernetes oracle-node and signer should be run in the same POD. By default `http://localhost:4499`.key | `REMOTE_SIGNER_URL=http://localhost:4499` |
9695
| **OVERRIDE_DIRECT_CACHE_SERVICE_URLS** | Your personal private URLs of gateways to the RedStone Data Distribution Layer (DDL). For running a local node you can simply put `OVERRIDE_DIRECT_CACHE_SERVICE_URLS=["https://httpbin.org/anything"]`. But for production node running you should [request them](https://redstone.finance/discord) from the RedStone team. | `OVERRIDE_DIRECT_CACHE_SERVICE_URLS=["https://xxx.yyy.secret-url-1.com","https://zzz.aaa.secret-url-2.com"]` |
9796
| **OVERRIDE_MANIFEST_USING_FILE** | Path to your manifest file. Manifest is a public JSON file that defines the provider's obligation regarding the data that they provide. It sets fetching interval, tokens, sources and other public technical details for the provided data. You can check available manifests [here.](https://github.com/redstone-finance/redstone-oracles-monorepo/tree/main/packages/oracle-node/manifests) | `OVERRIDE_MANIFEST_USING_FILE=./manifests/dev/dev.json` |
98-
| **LEVEL_DB_LOCATION** | Path to the level DB. Each RedStone oracle node relies on a single-level DB. It is used to store recently fetched values from the last 15 minutes. These values are used for checking value deviations, filtering outliers and preventing price manipulation attacks. <br/><br/> You don't need to create a Level DB instance manually, it will be created automatically at the specified path during the first node launch. | `LEVEL_DB_LOCATION=/oracle-node-level-db` |
97+
| **LEVEL_DB_LOCATION** | Path to the level DB. Each RedStone oracle node relies on a single-level DB. It is used to store recently fetched values from the last 15 minutes. These values are used for checking value deviations, filtering outliers and preventing price manipulation attacks. <br/><br/> You don't need to create a Level DB instance manually, it will be created automatically at the specified path during the first node launch. | `LEVEL_DB_LOCATION=/oracle-node-level-db` |
9998
| **ENABLE_REMOTE_SIGNER** | Switch on signing with RedStone KMS | `ENABLE_REMOTE_SIGNER=true` |
10099

101100
:::tip Custom local manifest
102101
If you want to run oracle-node from Docker with your custom manifest you should [mount the manifest file](https://docs.docker.com/storage/bind-mounts/) from your local system to the docker container and update the `OVERRIDE_MANIFEST_USING_FILE` env variable.
103102
:::
104-

docs/data-providers/introduction.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,32 @@
22
sidebar_position: 1
33
sidebar_label: "Introduction"
44
---
5+
56
# Introduction
67

78
RedStone is one of the leading oracle providers on the market, but with great power comes great responsibility. In order to minimize the (already small) risk of price manipulation RedStone is allowing other, verified and trusted companies to send oracle data to its gateways. This way we increase safety, transparency and improve data quality.
89

9-
We call those companies **External Oracle Providers** (EOP).
10-
10+
We call those companies **External Oracle Providers** (EOP).
1111

1212
## Becoming External Oracle Provider
1313

1414
Not every company may become an External Oracle Provider (EOP). Institutions need to meet some legal and technical conditions. The whole process may be divided into 3 steps - legal analysis, joining staging and joining production environments.
1515

16-
### Legal Analysis
16+
### Legal Analysis
17+
1718
At the end of this stage EOP understands what are the legal consequences of malicious manipulation of rates. EOP also knows how the compensation mechanism works.
1819

1920
### Staging
21+
2022
Now that all legal matters are out of the way EOP will start setting up its own Oracle Node. At this point RedStone’s and EOP’s dev ops contact and set it all up.
2123
First EOP connects to staging environment where we monitor in detail how stable is the deployment. We record downtime as well as the provided prices - we do everything we can to catch problems before EOP is moved to production.
2224

2325
This stage lasts for as long as it is needed, at least 30 days. RedStone will be in constant contact with EOP's team to inform about the problems so they may be fixed right away.
2426

2527
### Production
28+
2629
After EOP runs on Staging and both parties agree that it's ok - we move to Production. RedStone continues to monitor EOP, but now data is available in our production gateways.
2730

2831
:::info Data availability
2932
RedStone consumers will be able to use the data published by your node [on all supported chains.](/docs/get-started/supported-chains) You can learn more about the RedStone Oracles architecture [here.](../get-started/selecting-redstone-model.md)
30-
:::
33+
:::

docs/get-started/data-formatting-processing.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
sidebar_position: 3
3-
sidebar_label: "Data Formatting & Processing"
3+
sidebar_label: "💾 Data Formatting & Processing"
44
---
55

66
# How Data Flows to the Blockchain
77

8-
<a href="https://raw.githubusercontent.com/redstone-finance/redstone-docs/main/static/img/architecture.png">
9-
<img src="/img/architecture.png" target="_blank" alt="RedStone Architecture"/>
8+
<a target="_blank" href="https://raw.githubusercontent.com/redstone-finance/redstone-docs/main/static/img/architecture.png">
9+
<img src="/img/architecture.png" alt="RedStone Architecture"/>
1010
</a>
1111

1212
## Overview
@@ -32,13 +32,17 @@ All of the steps are executed automatically by the ContractWrapper and is transp
3232

3333
2. Data is packed into a message based on the structure of the ‘Transaction Payload’ diagram below…
3434

35-
<a href="https://raw.githubusercontent.com/redstone-finance/redstone-docs/main/static/img/redstone-tx-wrapping.png">
36-
<img src="/img/redstone-tx-wrapping.png" target="_blank" alt="Payload Wrapping"/>
35+
<a target="_blank" href="https://raw.githubusercontent.com/redstone-finance/redstone-docs/main/static/img/payload.png">
36+
<img src="/img/payload.png" alt="RedStone Payload"/>
3737
</a>
3838

3939
3. The package is appended to the original transaction message, signed, and submitted to the network.
4040
<br />
4141

42+
<a target="_blank" href="https://raw.githubusercontent.com/redstone-finance/redstone-docs/main/static/img/redstone-tx-wrapping.png">
43+
<img src="/img/redstone-tx-wrapping.png" alt="Payload Wrapping"/>
44+
</a>
45+
4246
### How Data Is Unpacked, Verified and Then Aggregated On-Chain
4347

4448
Firstly, the appended data packages are extracted from the call data. Then, security steps are taken including verifying if the signature was created by a trusted provider and validating the timestamp, confirming the information is correct. Afterward, for each requested data feed RedStone calculates the number of received unique signers, extracts the value for each unique signer, and calculates the aggregated value. The middle value of all the values (median), is the default value that is provided. This logic is executed in the on-chain environment and its execution has been optimized using a low-level assembly code to reduce gas consumption to the absolute minimum. To increase the security of the RedStone Oracle system, we've created the on-chain aggregation mechanism. This mechanism adds an additional requirement of ensuring a minimum number of distinct data feeds are relied on. The values from different providers are then aggregated before returning to a consumer contract. By default, RedStone uses the median value calculation for aggregation. This way, even if a small subset of providers are corrupt (e.g. 2 of 10), it does not significantly affect the aggregated value.

0 commit comments

Comments
 (0)