MiningOS Logo
Install MiningOS

HTTP API Gateway

Use the same working directory for all the workers.

Install the HTTP API Gateway

1. Clone the Repository

Use the same working directory for all the workers.

Inside your working directory, run the following command to clone the (miningos-app-node) repository:

git clone https://github.com/tetherto/miningos-app-node.git

After cloning the repository, move into its directory:

cd miningos-app-node

2. Install Dependencies

Inside the miningos-app-node directory, run the following command to install dependencies using npm:

npm ci

3. Generate Configuration Files

Next, run the following script to scan the config/ directory, copy each .example file into an active configuration file by removing the .example suffix.

sh setup-config.sh

4. Edit the Configuration Files

config/common.json

Open the config/common.json file and update the following properties:

You should use the rpcPublicKey you generated when you started the service orchestrator.

You should set the staticRootPath to the absolute path to the miningos-app-ui/build directory you created when you installed the React Web App UI.

rpcPublicKey : Ork rpcPublicKey generated in step 1.
staticRootPath : absolute path to miningos-app-ui/build dir created in step 2.

config/facs/auth.config.json

Open the config/facs/auth.config.json file and update the following properties:

superAdmin : Super admin user email

config/facs/httpd-oauth2.config.json

Open the config/facs/httpd-oauth2.config.json file and update the following properties:

id: Google oauth CLIENT_ID
secret: Google oauth CLIENT_SECRET
"startRedirectPath": "/oauth/google",
"callbackUri": "http://localhost:3000/oauth/google/callback",
"callbackUriUI": "http://localhost:3000",

4. Enable Debugging and Start the Worker

You can now start the worker by running the following command:

DEBUG="miningos:*" pm2 -s start worker.js --name 'app-node' -- --wtype wrk-node-http --env development --port 3000

Commands, OAuth settings, and configuration use port 3000, but the process can run on any local port. Make sure to use the same port number everywhere.

On this page