Skip to main content
Version: 1.0.0

Getting Started

Prerequisites

Before you begin, ensure you have installed:

Basic Setup

  1. Clone the Storage Service repository
  2. Copy .env.example to .env
  3. Configure your environment variables (see Configuration section)
  4. Install dependencies:
yarn install

Configuration

The service can be configured through environment variables. If not specified, the following default values will be used:

Server Configuration

VariableDescriptionDefault
PROTOCOLHTTP protocol to usehttp
DOMAINServer domainlocalhost
PORTServer port number3333

Authentication Configuration

VariableDescriptionDefaultRequired
API_KEYAPI key for authenticating upload requestsNoneYes

Storage Configuration

VariableDescriptionDefault
STORAGE_TYPEStorage provider (local, gcp, digital_ocean or aws)local
LOCAL_DIRECTORYDirectory for local file storageuploads
REGIONAWS, DO or GCP regionap-southeast-2

Bucket Configuration

VariableDescriptionDefault
DEFAULT_BUCKETDefault storage bucket nameverifiable-credentials
AVAILABLE_BUCKETSComma-separated list of allowed storage bucketsverifiable-credentials

Example .env file for local development:

# Server
PROTOCOL=http
DOMAIN=localhost
PORT=3333

# Authentication (Required)
API_KEY=your-secure-api-key-here

# Storage
STORAGE_TYPE=local
LOCAL_DIRECTORY=uploads

# Buckets
DEFAULT_BUCKET=verifiable-credentials
AVAILABLE_BUCKETS=verifiable-credentials,private-verifiable-credentials

Basic Usage

Start the service in development mode:

yarn dev

For production:

yarn build
yarn start

Quick Test

You can test the service using curl. Note that all upload endpoints require authentication via the X-API-Key header:

curl -X POST http://localhost:3333/api/1.0.0/credentials \
-H "Content-Type: application/json" \
-H "X-API-Key: your-secure-api-key-here" \
-d '{
"bucket": "verifiable-credentials",
"data": {
"field1": "value1"
}
}'

The service will respond similarly to the data below:

{
"uri": "http://localhost:3333/api/1.0.0/verifiable-credentials/e8b32169-582c-421a-a03f-5d1a7ac62d51.json",
"hash": "d6bb7b579925baa4fe1cec41152b6577003e6a9fde6850321e36ad4ac9b3f30a",
"key": "f3bee3dc18343aaab66d28fd70a03015d2ddbd5fd3b9ad38fff332c09014598d"
}