koa API server implementing a Consolidating CoinJoin described here: https://gist.github.com/christroutner/457b99b8033fdea5ae565687e6360323
MIT License
This is an API server forked from this koa boilerplate. It implements the Consolidating CoinJoin described here. It works with this BCH command-line wallet.
Version 1.1.1 is a proof-of-concept prototype. This version will be refactored, tests will be added, and functionality iterated upon.
Future improvements to be made:
Installation is different depending on if you want to create a development server for developing the code, or a production server for setting up your own Consolidating CoinJoin service.
npm install
to install npm dependencies../install-mongo
to install and setup mongodb.npm test
to run tests and ensure everything is working correctly.npm start
to run a development server.This server requires a Mongo database, so it uses Docker Compose to run in production. This tutorial shows how to setup Docker. This tutorial shows how to setup Docker Compose. Here are some commands to build and run this application with Docker Compose:
docker-compose build --no-cache
will build the Docker container from scratch.
If previously used, this will fail without first deleting the database
folder,
which is created with root privileges by Docker, so it must be deleted with the
command sudo rm -rf database
.
docker-compose up -d
will run the server in the background (daemon mode).
The server attaches to port 5000 on the host by default.
It is assumed that a production server will have nginx sitting in front of the docker containers. Nginx will serve static content, handle SSL, and proxy API calls to the docker container on port 5000.
bin
server.js # Bootstrapping and entry point
config # Server configuration settings
env # Environment specific config
common.js
development.js
production.js
test.js
index.js # Config entrypoint - exports config according to envionrment and commons
passport.js # Passportjs config of strategies
src # Source code
modules
controller.js # Module-specific controllers
router.js # Router definitions for module
models # Mongoose models
middleware # Custom middleware
validators # Validation middleware
test # Unit tests
npm start
Start server on live modenpm run dev
Start server on dev mode with nodemonnpm run docs
Generate API documentationnpm test
Run mocha testsMIT