This is an API server forked from this koa boilerplate. It implements the Consolidating CoinJoin protocol. It works with this BCH command-line wallet.
Disclaimer: It is the opinion of some educated people that a server running this software on BCH mainnet may be subject to USA money transmission laws. Other educated people disagree with that opinion (source). No effort has been expended to research the legality of the this software, that is the responsibility of the end user. This software is intended to only run on testnet, as a proof-of-concept of how software can be used to protect individual sovereignty and defend against government overreach.
Efforts are currently under way to allow users to run this server as a tor hidden service (with a .onion address). If you'd like to know more, feel free to ask for a status update on this Discord channel
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, and runs over tor by default, 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:
./rebuild-image
will build the Docker container from scratch
docker-compose up -d
will run the server in the background (daemon mode).
The server attaches to port 5000 on the host by default.
By default, the server connects to the tor network and broadcasts its .onion address on the IPFS network.
It is assumed that a production server will have nginx sitting in front of the docker containers when running the server on the regular internet. 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 # Customize YOUR server settings here.
│ │ └── 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 in development modenpm test
Run mocha testsdocker-compose up
Run server in production modeMIT