Skip to main content

Deploy Filehub and Filechain bundle

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.

warning

This deployment is primarily intended for local development and testing purposes, utilizing a "mock" directory chain. For deployments on actual networks, refer to the independent deployment instructions for Filehub and Filechain.

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:
./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.