Apollo WebOS 2 Backend
Go to file
2023-05-04 08:41:58 +02:00
apolloui@cea25568ad Added git safe.directory to update 2022-07-21 17:22:14 +02:00
backend Fix first boot issues 2022-07-25 18:46:08 -04: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 [WIP] Node user config 2022-07-03 10:40:07 +02:00
src Fix wifi disconnect 2023-05-04 08:41:58 +02:00
.dockerignore Docker compose changes 2022-07-14 07:28:15 +02:00
.gitignore Fix possible problem with bitcoin.conf overwritten 2022-07-20 17:37:32 +02:00
.gitmodules Update .gitmodules 2020-03-10 18:02:24 -04:00
.nvmrc Multiple boards 2021-04-18 19:36:10 +02:00
btc-miner-test-server.js Timezone hack 2021-08-12 15:11:23 +02:00
docker-compose.dev.yml Fix change system password, fix bitcoin.conf 2022-07-20 12:24:40 +02:00
docker-compose.yml Multiple boards 2021-04-18 19:36:10 +02:00
Dockerfile Fix change system password, fix bitcoin.conf 2022-07-20 12:24:40 +02:00
get-token.js Docker compose [WIP], Node version update [WIP], UI Settings update, misc 2021-04-11 11:46:40 +02:00
knexfile.js knexfile update 2018-11-05 11:37:13 +01:00
LICENSE Create LICENSE 2021-05-06 15:53:43 -04: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.json [WIP] Node settings, Node TOR, misc 2022-06-30 17:50:44 +02:00
README.md Update README.md 2018-11-09 08:31:19 +01:00
yarn.lock [WIP] Node settings, Node TOR, misc 2022-06-30 17:50:44 +02: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