Skip to content

Instantly share code, notes, and snippets.

@abdelghafour
Last active December 23, 2023 20:54
Show Gist options
  • Save abdelghafour/f793192a6d10ef30fefe82b50f8b47b9 to your computer and use it in GitHub Desktop.
Save abdelghafour/f793192a6d10ef30fefe82b50f8b47b9 to your computer and use it in GitHub Desktop.
Deep Lake Follower Node Setup

Deep Lake Oracle Follower Node Setup

Introduction

Welcome to the Deep Lake Oracle Follower Node documentation. This README will guide you through setting up and running the Oracle Follower Node system, which consists of three main components: the database (Postgres), the follower node app, and the runner app.

The entire system is orchestrated using Docker and Docker Compose, ensuring ease of setup and consistent environments across different setups.

System Architecture

The system is composed of three Docker containers:

  1. Postgres Database: This container runs the PostgreSQL database server, which stores the oracle data. Container name: pg-deeplake

  2. Follower Node App: A Node.js application that connects to the database and stores oracle data. Container name: oracle-follower

  3. Runner App: Essentially a cron job in a container, it collects data from Bitcoin regularly and inputs it into the system. Container name: runner

Prerequisites

Before you begin, ensure you have the following installed:

  • Docker
  • Docker Compose

Setup and Configuration

  1. Environment Variables:

    • Set the any environment variables for PostgreSQL that you would like to modify. Defaults are provided but use of defaults for user and password is the least secure way to run. (POSTGRES_VERSION, PG_SHMSIZE, PG_USER, PG_PASSWORD).
  2. Volume Setup:

    • The db-data volume is used for persistent database storage.
    • The ./sql directory should contain any initialization SQL scripts for the database.
  3. Network Configuration:

    • The services are configured to use a bridge network named deeplake_svcs.

Running the System

  1. Starting the Services:

    • Navigate to the directory containing the follower-node-compose.yml file.
    • Run docker-compose -f follower-node-compose.yml up -d to start all the services in detached mode.
    • The services will start in the following order: Postgres Database, Follower Node App, Runner App.
  2. Monitoring the Services:

    • Use docker logs <container_name> to view the logs for each container.
    • Use docker ps to check the status of the containers.
  3. Stopping the Services:

    • Run docker-compose down to stop and remove the containers and network.

Troubleshooting

  • Ensure all environment variables are set correctly.
  • Check container logs for any error messages or issues.
  • Verify that the PostgreSQL container is fully initialized before the follower and runner apps start.

Updates and Maintenance

  • To update the system, pull the latest Docker images and restart the services.
  • Regularly backup the db-data volume to prevent data loss.
  • Monitor the system regularly for any performance or security issues.

Support

For any issues or inquiries related to the Deep Lake Oracle Follower Node system, please contact our support team or visit our community forums.


This README provides a comprehensive guide for setting up and running the Deep Lake Oracle Follower Node system. If you have any specific requirements or additional information to include, please let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment