Getting Started
info
Please note that this content is under development and is not ready for implementation. This status message will be updated as content development progresses.
Prerequisites
Before you begin, ensure you have installed:
Basic Setup
- Clone the Storage Service repository
- Copy
.env.exampleto.env - Configure your environment variables (see Configuration section)
- 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
| Variable | Description | Default |
|---|---|---|
PROTOCOL | HTTP protocol to use | http |
DOMAIN | Server domain | localhost |
PORT | Server port number | 3333 |
Authentication Configuration
| Variable | Description | Default | Required |
|---|---|---|---|
API_KEY | API key for authenticating upload requests | None | Yes |
Storage Configuration
| Variable | Description | Default |
|---|---|---|
STORAGE_TYPE | Storage provider (local, gcp, digital_ocean or aws) | local |
LOCAL_DIRECTORY | Directory for local file storage | uploads |
REGION | AWS, DO or GCP region | ap-southeast-2 |
Bucket Configuration
| Variable | Description | Default |
|---|---|---|
DEFAULT_BUCKET | Default storage bucket name | verifiable-credentials |
AVAILABLE_BUCKETS | Comma-separated list of allowed storage buckets | verifiable-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"
}