This is a 'boilerplate' repository. It's intended to be forked to start new projects. Some code projects that are forks of this repository and regularly pull in changes:
In addition to being forked as a boilerplate, it can also be run as a stand-alone application to create a Circuit Relay, which can support the PSF IPFS network. It can also be used for experimenting with helia-coord and the psf-bch-wallet command-line wallet.
A video demo shows you how to quickly setup ipfs-service-provider and start interacting with its IPFS node using the psf-bch-wallet command-line app.
This repository has been forked from the koa-api-boilerplate. It has all the same features as that boilerplate:
- Koa framework for REST APIs
- User management
- Access and rate-limit control (authentication and authorization) using JWT tokens
- Logging system with API access
- Email contact integration
This boilerplate extends that code to provide the basic features required to be a 'service provider' on the IPFS network. This is a core concept in the web3 Cash Stack. These basic features include:
- helia-coord for coordinating service providers and consumers across the IPFS network.
- JSON RPC for creating an API between providers and consumers.
If you are interested in creating your own service provider on the IPFS network, fork this repository and start building. This repository is used in serveral PSF projects:
- P2WDB - the pay-to-write database is a censorship-resistent, p2p database for storing data and pinning files to the IPFS network.
- ipfs-bch-wallet-consumer and ipfs-bch-wallet-service creates a web3, censorship-resistent API for apps to communicate with a blockchain. This software is documented in the Cash Stack.
- colab-coinjoin-api is part of the Collaborative CoinJoin framework to allow wallets to easily integrate CoinJoin transaction forming, to create financial privacy.
This web server spins up an embedded IPFS (Helia) node. This node can be controlled and interrogated via the REST API. psf-bch-wallet is a command-line app (CLI) that can easily tap into this REST API in order to interact with the embedded IPFS node.
- Video link will be added here
- node ^20.16.0
- npm ^10.8.1
- Docker ^24.0.7
- Docker Compose ^1.27.4
The docker directory contains a Dockerfile for building a production deployment.
docker-compose pull
docker-compose up -d
- You can bring the containers down with
docker-compose down
- You can bring the containers back up with
docker-compose up -d
.
A development environment will allow you modify the code on-the-fly and contribute to the code base of this repository. Ubuntu v20 is the recommended OS for creating a dev environment. Other operating systems may cause issues.
git clone https://github.com/Permissionless-Software-Foundation/ipfs-service-provider
cd ipfs-service-provider
./install-mongo-sh
npm install
npm start
This app is intended to be started via a bash shell script. See the environment variables used to configure this app in the config/env/common.js file.
The file layout of this repository follows the file layout of Clean Architecture. Understaning the principles laid out this article will help developers navigate the code base.
npm start
Start server on live modenpm run docs
Generate API documentationnpm test
Run mocha tests
API documentation is written inline and generated by apidoc. Docs can be generated with this command:
npm run docs
Visit http://localhost:5020/
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.