Apollo WebOS 2 Backend
Go to file
Michele Marcucci b472756df8 Build
2019-01-28 18:21:57 +01:00
apolloui@acf14df9c1 Build 2019-01-28 18:21:57 +01:00
build Build 2019-01-28 18:21:57 +01:00
config Added UI as submodule and as static in production, changed endpoint to /api/graphql 2018-11-06 10:19:49 +01:00
migrations Fixed default voltage 2018-12-17 08:22:53 +01:00
scripts Added bfgminer log 2019-01-28 17:52:48 +01:00
src Added bfgminer log 2019-01-28 17:52:48 +01:00
.dockerignore compressed binaries 2018-10-25 14:18:50 +02:00
.gitignore Added build 2018-11-20 16:23:24 +01:00
.gitmodules Added UI as submodule and as static in production, changed endpoint to /api/graphql 2018-11-06 10:19:49 +01:00
.nvmrc Added miner & Setting list API 2018-11-02 11:11:08 +01:00
Dockerfile Added latest configs 2018-11-20 11:21:01 +01:00
knexfile.js knexfile update 2018-11-05 11:37:13 +01:00
Makefile build scripts 2018-10-25 15:09:41 +02:00
miner-test-server.js Fix install 2018-11-26 09:55:27 +01:00
package-lock.json Frontend inside build folder 2018-11-27 12:51:57 +01:00
package.json Allow-api to LAN network 2019-01-28 15:39:10 +01:00
README.md Update README.md 2018-11-09 08:31:19 +01:00
yarn.lock Allow-api to LAN network 2019-01-28 15:39:10 +01:00

apolloapi

Install

$ yarn

Run dev

$ yarn dev

It will:

  1. Create .env file in app directory with following variables
  • DATABASE_URL=
  • APP_SECRET
  1. Create sqlite database futurebit.sqlite in app directory and run pending migrations
  2. Start GraphQL API on http://localhost:5000/graphql

Production build

You can't build this on a low-resources MCU (<= 512MB ram), so there is a script to run the builder in a docker that simulates an OrangePI with Armbian and create a file with all the node_modules compiled.

$ ./scripts/build

It will generate the file build//futurebit.tar.gz

Next step required:

  • scp futurebit.tar.gz to the MCU
  • extract it in a tmp directory
  • copy (overwrite) node_modules to /opt/apolloapi directory
  • pull changes
  • restart apollo service

Production usage

In the system MCU there are several commands built-in:

Apollo API manager:

$ sudo systemctl start|stop|restart|status|... apollo

Miner manager:

$ sudo systemctl start|stop|restart|status|... bfgminer

Wifi manager:

$ nmcli help