Merge pull request #41 from Permissionless-Software-Foundation/ct-unstable

fix(startup script): Added startup script
This commit is contained in:
Chris Troutner
2021-09-17 11:20:39 -07:00
committed by GitHub
3 changed files with 37 additions and 2 deletions
-1
View File
@@ -65,6 +65,5 @@ system-user-*.json
orbitdb
ipfsdata
.ipfsdata
ipfs-service-provider.sh
!README.md
+19 -1
View File
@@ -36,14 +36,32 @@ This project covers basic necessities of most APIs.
## Installation
### Development Environment
A development environment will allow you modify the code on-the-fly and contribute to the code base of this repository. [PM2](https://www.npmjs.com/package/pm2) is recommended for running this code base as an IPFS Circuit Relay.
```bash
git clone https://github.com/Permissionless-Software-Foundation/ipfs-service-provider
cd ipfs-service-provider
./install-mongo-sh
sudo npm install -g node-pre-gyp
npm install
npm start
./ipfs-service-provider.sh
```
### Production Environment
The [docker](./production/docker) directory contains a Dockerfile for building a production deployment. However, there is currently [a bug](https://github.com/Permissionless-Software-Foundation/ipfs-service-provider/issues/38) preventing the Docker container from being used as a Circuit Relay.
```
docker-compose build --no-cache
docker-compose up -d
```
### Operation Notes
- There is a memory leak in the version of js-ipfs. The app is currently configured to shut down every 8 hours to flush memory. It relies on a process manager like pm2, Docker, or systemd to restart the app after it shuts down, in order to ensure continuous operation.
## Structure
The file layout of this repository differs from the koa-api-boilerplate. Instead, it follows the file layout of [Clean Architecture](troutsblog.com/blog/clean-architecture).
+18
View File
@@ -0,0 +1,18 @@
#!/bin/bash
# Ports
export PORT=5001 # REST API port
export IPFS_TCP_PORT=5268
export IPFS_WS_PORT=5269
#export ENABLE_CIRCUIT_RELAY=1
# Production database connection string.
#export DBURL=mongodb://localhost:27017/bch-service-dev
export COORD_NAME=ipfs-serive-provider-generic
export MNEMONIC="churn aisle shield silver ladder swear hunt slim pen demand spoil veteran"
export DEBUG_LEVEL=1
npm start