Multy-tenant RESTful HTTP API server for encrypted data storing and retrieval in IPFS and web3 storages with per-user workload accounting.
There are two layers of storage here: one with an instant access and an archive storages. Instant access storage backend is IPFS caching node. Archive storage is an external service that can replicate and restore content from the IPFS caching node.
Assuming we are in the repository root directory.
-
Load environment variables
... export $(cat .env.local | xargs)
-
Run local database and IPFS node
docker compose up postgres kubo
-
Launch service instance
./start.sh
-
Create a tenant and an API key
$ python -m storage --tenant-create dev && python -m storage --create-api-key-for-tenant dev 2022-11-28 17:47:08.555 | INFO | __main__:<module>:75 - tenant created, tenant.name='dev', tenant.schema='dev', tenant.host='dev' 0dOzYgisKiKBJFM5Y60J7p96U48IdmsuV_GOan0c15fTNQuxee6sPSgMMNGDDeCwtKK6BzScI7ORJ9dqfQOThw
Assuming we are in the repository root directory and cluster leader Docker context is available locally by merklebot
name.
-
Load environment variables
... export $(cat .env.prod | xargs)
-
Connect to swam leader
docker context use merklebot
-
Remove an old version
docker stack rm $DOCKER_SWARM_STACK_NAME
-
Run a new version
docker stack deploy -c docker-compose.yml -c docker-compose.prod.yml $DOCKER_SWARM_STACK_NAME
-
Check services are ok (at least 1 replica is running)
$ docker service ls ID NAME MODE REPLICAS IMAGE PORTS 6zw0odgoqjuf storage_postgres replicated 1/1 postgres:15 met55xby5gmf storage_storage replicated 1/1 ghcr.io/merklebot/storage:main