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
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:
- Chromia CLI
- Git
- Docker
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
orlocalhost
, defaults tolocalhost
)-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:
- Environment detection: Identifies the appropriate environment for deployment (local or production).
- Reset and clean up: Cleans up folders and Docker containers to reset the environment to a fresh state.
- Repository cloning: Clones the necessary repositories required for Filehub and Filechain.
- Directory chain preparation: Extracts and installs the necessary packages, then builds the Directory Chain.
- Database setup: Starts a PostgreSQL container to handle the database requirements.
- Directory chain launch: Starts the Directory chain, which manages directory services.
- Filehub deployment: Installs, builds, and deploys the Filehub, which acts as the control hub.
- Filechain deployment: Installs, builds, and deploys the Filechain, which handles the actual file storage.
- Gateway API Setup: Configures and starts the Gateway API container, allowing easy file access via HTTP.