Skip to main content

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

  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

Storage Configuration

VariableDescriptionDefault
STORAGE_TYPEStorage provider (local, gcp, or aws)local
LOCAL_DIRECTORYDirectory for local file storageuploads
REGIONAWS/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:

PROTOCOL=http
DOMAIN=localhost
PORT=3333
STORAGE_TYPE=local
LOCAL_DIRECTORY=uploads
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:

curl -X POST http://localhost:3333/api/1.0.0/credentials \
-H "Content-Type: application/json" \
-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"
}