Docs
chromia.com

Deploy Filehub and Filechain bundle

On this page

A Filechain is inherently dependent on a Filehub, meaning that each Filechain must be deployed in conjunction with a Filehub. This project simplifies the process by packaging both Filehub and Filechain as a cohesive unit for deployment.

You can set up the Filehub and Filechain either as standalone systems or in a multi-node setup, enhancing redundancy and ensuring higher availability.

Prerequisites

Before starting, ensure you have the following tools and resources:

Step 1: Run the deploy bundle

The deployment script simplifies setting up your local development environment. It accepts three main input parameters:

  • -r => Enable rate limiter for Filehub (1 = enabled, 0 = disabled)
  • -e => Specify which endpoint to use for nodes (e.g., docker or localhost, defaults to localhost)
  • -a => Enable the Gateway API (1 = enabled, 0 = disabled)

Example commands:

Terminal
./start.sh          # Starts the deploy bundle with default settings
./start.sh -r 0     # Rate limiter disabled
./start.sh -e docker  # Node URLs configured for Docker
./start.sh -a 0     # Gateway API disabled
./start.sh -r 0 -a 0 # Both rate limiter and Gateway API disabled
./start.sh -r 0 -e docker -a 0  # Disabled rate limiter & Gateway API, with Docker endpoint

The script executes several steps to configure the development environment:

  1. Environment detection: Identifies the appropriate environment for deployment (local or production).
  2. Reset and clean up: Cleans up folders and Docker containers to reset the environment to a fresh state.
  3. Repository cloning: Clones the necessary repositories required for Filehub and Filechain.
  4. Directory Chain preparation: Extracts and installs the necessary packages, then builds the Directory Chain.
  5. Database setup: Starts a PostgreSQL container to handle the database requirements.
  6. Directory Chain launch: Starts the Directory Chain, which manages directory services.
  7. Filehub deployment: Installs, builds, and deploys the Filehub, which acts as the control hub.
  8. Filechain deployment: Installs, builds, and deploys the Filechain, which handles the actual file storage.
  9. Gateway API Setup: Configures and starts the Gateway API container, allowing easy file access via HTTP.