2021-11-23 08:38:01 -08:00
2021-11-23 08:38:01 -08:00
2021-11-23 08:38:01 -08:00
2021-11-23 08:38:01 -08:00
2021-11-23 08:38:01 -08:00
2021-11-23 08:38:01 -08:00
2021-11-23 10:20:17 -08:00

ipfs-bch-wallet-consumer

js-standard-style semantic-release

This is a REST API server based on Koa. It's essentially a mirror image of ipfs-bch-wallet-service. Where ipfs-bch-wallet-service is intended to be coupled to bch-api to provide blockchain service, ipfs-bch-wallet-consumer provides a localized REST API for consuming that blockchain service.

When started, this web server starts an IPFS node and connects to an ipfs-bch-wallet-service server over the IPFS network. It then pipes that connection over its own localized REST API.

Requirements

  • node ^14.17.0
  • npm ^7.13.0

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 is recommended for running this code base as an IPFS Circuit Relay.

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
./ipfs-service-provider.sh

Production Environment

The docker directory contains a Dockerfile for building a production deployment. However, there is currently a bug 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.

Usage

  • npm start Start server on live mode
  • npm run docs Generate API documentation
  • npm test Run mocha tests
  • docker-compose build Build a 'production' Docker container
  • docker-compose up Run the docker container

Documentation

API documentation is written inline and generated by apidoc.

Visit http://localhost:5000/docs/ to view docs

Dependencies

IPFS

Snapshots pinned to IPFS will be listed here.

License

MIT

test

Languages
JavaScript 98.2%
Shell 0.7%
HTML 0.7%
Dockerfile 0.4%