This fork of ipfs-bch-wallet-consumer is used to power free-bch.fullstack.cash REST API.
This master
branch is left unchanged, to pull in changes from the parent repository. The production branch is what is deployed to production for free-bch.fullstack.cash.
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.
- node ^14.18.2
- npm ^8.3.0
- Docker ^20.10.8
- Docker Compose ^1.27.4
Note: This software now uses an external go-ipfs IPFS node. The instructions below have not been updated to reflect this.
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
The docker directory contains a Dockerfile for building a production deployment.
docker-compose pull
docker-compose up -d
You can bring the containers back up with docker-compose up -d
.
-
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.
-
The PSF network operates as a private network. It does not connect or interact with the wider PSF network, relying instead on gateways to bridge the two networks, when they need to share content. This improves the performance and experience for everyone in the PSF network. To join the network, you'll need to add the swarm.key file to the IPFS data folder.
-
For external installations, the swarm.key file will typically go in
~/.ipfs/swarm.key
-
For production Docker containers, the key would go in
ipfs-service-provider/production/data/go-ipfs/data/swarm.key
The file layout of this repository differs from the koa-api-boilerplate. Instead, it follows the file layout of Clean Architecture.
npm start
Start server on live modenpm run docs
Generate API documentationnpm test
Run mocha testsdocker-compose build
Build a 'production' Docker containerdocker-compose up
Run the docker container
API documentation is written inline and generated by apidoc.
Visit http://localhost:5000/docs/
to view docs
There is additional developer documentation in the dev-docs directory.
- koa2
- koa-router
- koa-bodyparser
- koa-generic-session
- koa-logger
- MongoDB
- Mongoose
- Passport
- Nodemon
- Mocha
- apidoc
- ESLint
- ipfs-coord
Snapshots pinned to IPFS will be listed here.