diff options
| author | Adam Soltys <[email protected]> | 2019-02-09 15:40:37 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2019-02-09 15:40:37 -0800 |
| commit | 91a5c761a5b57243c252a0cf666201d5b93e6ed7 (patch) | |
| tree | 64d1247106097353b860693788dbfbcdfb72dc43 | |
| parent | 334df545276ea9bb1a60dd1561df70a221c5dfa7 (diff) | |
| download | coinos-server-91a5c761a5b57243c252a0cf666201d5b93e6ed7.tar.gz coinos-server-91a5c761a5b57243c252a0cf666201d5b93e6ed7.zip | |
README
| -rw-r--r-- | README.md | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 00000000..f48bd05b --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +This is the backend API server for https://coinos.io/ + +It's built on NodeJS and Express and uses Sequelize to communicate with a MariaDB database server. There are a couple GraphQL endpoints I was experimenting with but most of the communication is done with REST endpoints and persistent per-user websocket connections using socket.io. + +The server expects you to be running a full bitcoind node and two separate lnd instances, referred to in the code as lna and lnb. The reason for running two nodes is so that they can invoice and pay each other in the case that one CoinOS user wants to pay another CoinOS user since lnd nodes cannot pay themselves (or at least that was the case when I started, that may have changed). + +lnb takes care of generating invoices and receiving payments and lna takes deposits and sends payments. As soon as lna sends a payment, it generates an invoice for lnb to pay it back right away so that they don't become unbalanced. + +We use ZMQ to communicate with bitcoind in addition to the JSON RPC so make sure your bitcoind is compiled with ZMQ enabled. This should be done automatically if you have the prerequisite libzmq dependency installed at compile time. + +There are also integrations with Facebook's API for single sign-in and contacts, Stripe for taking credit card payments, Mailgun for email notifications, Twilio for SMS notifications, and Authy for two-factor authentication. Pricing info is fetched from Kraken at the time of writing and only in CAD but that's soon to change. + +## Configuration + +You can configure the connection info and API keys for all the external services in config/index.js + +There's a sample config at config/index.sample.js + +## Database + +There's a sample of the MariaDB database schema at schema.sql + +For a while I was writing Sequelize migrations to keep it in sync with the codebase but right now there are a handful of columns that aren't captured in any migration. + +## Installation + +git clone https://github.com/asoltys/coinos-server +yarn +yarn start + |
