Links

Run Dev Mode

Dev mode is for development purposes to allow easier debugging and testing. If you have built your exchange using CLI commands running on your machine, you need to stop and start the process fresh with the following instructions.
Clone the HollaEx Kit Github repo: https://github.com/hollaex/hollaex-kit
git clone https://github.com/hollaex/hollaex-kit.git
  • HollaEx Kit /web is the front-end project built in ReactJS that connects to the HollaEx Kit server which is accessible in the /server folder.

Web

/web folder in HollaEx Kit is a ReactJS project that contains all the front-end code.
To run it locally in development mode, you need to run: npm start which installs all the dependencies and starts the browser on http://localhost:3000 .
Changes are applied and updated live on the site.
By default, it connects to the default HollaEx Kit which is HollaEx Sandbox https://api.sandbox.hollaex.com
You can change this value in /web/src/config/index.js
Change DEVELOPMENT_ENDPOINT to your custom HollaEx Kit server API.

Server

In order to start the server in dev mode you need to run the following:
You need to download a new Kit in order to follow the guide. Following the guide below with the existing Kit exchange could cause unexpected issues. Please make sure to proceed with a new fresh HollaEx Kit.
  1. 1.
    cd server/
  2. 2.
    make an env mv tools/hollaex-kit.env.local.example tools/hollaex-kit.env.local
  3. 3.
    Run docker-compose up
  4. 4.
    Once docker is all set check docker ps and there should be 4 containers for nginx redis postgresql and the kit server
  5. 5.
    Go inside the Docker container, by running docker exec -it server_hollaex-kit-server_1 /bin/bash
  6. 6.
    Once you are successfully inside the docker container you should run the following commands:
    • Run database migrations: sequelize db:migrate
    • Set the exchange keys based on HollaEx Network exchange keys. It can be found on dash.hollaex.com (Production HollaEx Network) or dash.testnet.hollaex.com (Testnet HollaEx Network). This key is very important to connect the HollaEx Kit to HollaEx Network
      • (the following is an example of an exchange called hiww on HollaEx Network Testnet) export API_KEY=<your key> API_SECRET=<your secret> ACTIVATION_CODE=<your activation code>
    • Run database seed: sequelize db:seed:all
    • Run database triggers: node tools/dbs/runTriggers.js
    • Run activation to activate the exchange: node tools/dbs/setActivationCode.js

Accessing Dev Mode After Initial Setup

Once you have completed all the above, and either come out of dev mode or rebooted your machine, fortunatley to get back in to dev mode the only command to run is docker-compose up. Easy peasy.

Dev Mode Quick Checking Example

A good way to quickly see the live code updates of dev mode, is by opening localhost/v2/health in your browser. Make a mental note of the version that is displayed. Then will dev mode is active, go into your IDE and alter the file found at hollaex-kit/server/api/controllers/public.js.
By changing the version to any string on line 13, saving and then refreshing your browser, you will see that the version disaplyed on the health page will have changed to whatever you wrote. Remember to put it back to packageJson.version though to make sure its up to date!
By default, the env uses NETWORK=testnet which would connect your HollaEx Kit to the Testnet HollaEx Network. If you want to change that you can set NETWORK_URL to your custom HollaEx Network endpoint.

Troubleshooting Dev Mode