Skip to main content

Deploy

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

caution

For production deployments consider using more sofisticated tools, e.g. Kubernetes.

Requirements

  • Reliable Internet connection
  • 2CPU, 2GB RAM
  • At least 30 GB of storage (mainly for logs)
  • Docker and Docker Compose
tip

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.

Docker Compose Example

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.

services:
redstone-oracle-node:
image: public.ecr.aws/y7v2w8b2/redstone-oracle-node:957ca2a1
restart: always
depends_on:
- redstone-kms
networks:
- public_network
- private_network
volumes:
- redstone-oracle-node:/oracle-node-level-db
environment:
OVERRIDE_DIRECT_CACHE_SERVICE_URLS: '["https://httpbin.org/anything"]'
OVERRIDE_MANIFEST_USING_FILE: ./manifests/dev/dev.json
LEVEL_DB_LOCATION: /oracle-node-level-db
REMOTE_SIGNER_URL: http://redstone-kms:4499
ENABLE_REMOTE_SIGNER: true

redstone-kms:
restart: always
image: public.ecr.aws/y7v2w8b2/kms@sha256:d5df0ad389c329e541b26b09b3ad18b453342f1fee3837c1bd05f23c4a4264da
networks:
- private_network
expose:
- "4499"
environment:
KMS_PRIVATE_KEY_FILE: /run/secrets/private_key
secrets:
- private_key

secrets:
private_key:
file: private_key.txt

volumes:
redstone-oracle-node:

networks:
public_network:
driver: bridge
private_network:
internal: true # This ensures the network is private

Services

RedsStone KMS (Key Management Service)

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 Docker image.

ParamDescriptionExample value
KMS_PRIVATE_KEY_FILEPath 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
KMS_PRIVATE_KEYHex encoded key. Alternative way of passing the keyKMS_PRIVATE_KEY=0xYOUR_PRIVATE_KEY
KMS_ADDRESSBind addressKMS_ADDRESS=0.0.0.0:4499

RedStone Node

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). It should be configured using environment variables.

ParamDescriptionExample value
ENABLE_REMOTE_SIGNERDelegate signing to a remote signer. Only this image has access to your ECDSA private keyENABLE_REMOTE_SIGNER=true
REMOTE_SIGNER_URLThis 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.keyREMOTE_SIGNER_URL=http://localhost:4499
OVERRIDE_DIRECT_CACHE_SERVICE_URLSYour 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 from the RedStone team.OVERRIDE_DIRECT_CACHE_SERVICE_URLS=["https://xxx.yyy.secret-url-1.com","https://zzz.aaa.secret-url-2.com"]
OVERRIDE_MANIFEST_USING_FILEPath 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.OVERRIDE_MANIFEST_USING_FILE=./manifests/dev/dev.json
LEVEL_DB_LOCATIONPath 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.

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
ENABLE_REMOTE_SIGNERSwitch on signing with RedStone KMSENABLE_REMOTE_SIGNER=true
Custom local manifest

If you want to run oracle-node from Docker with your custom manifest you should mount the manifest file from your local system to the docker container and update the OVERRIDE_MANIFEST_USING_FILE env variable.