Run Dev Mode
Clone the HollaEx Kit Github repo: https://github.com/hollaex/hollaex-kit
git clone https://github.com/hollaex/hollaex-kit.gitServer
In order to start the server in dev mode you need to run the following:
Before you proceed, please set up a new exchange on the HollaEx Dashboard. Please visit dash.hollaex.com for the mainnet connection or dash.testnet.hollaex.com for the testnet connection.
You need to get 2 things here.
Exchange Keys (API Key and API Secret)
Mainnet - https://dash.hollaex.com/mypage/apikey
Activation Code
Mainnet - https://dash.hollaex.com/general
Testnet - https://dash.testnet.hollaex.com/general
Please save them somewhere safe. You'll need those very soon.
Enter the HollaEx Kit folder with
cd hollaex-kit/cd server/make a new env file
mv tools/hollaex-kit.env.local.example tools/hollaex-kit.env.localOpen the new
tools/hollaex-kit.env.localfile with a text editor/ IDE.Fill up
API_KEY,API_SECRET, andACTIVATION_CODEvalues you got from the HollaEx Dashboard.API_KEYandAPI_SECRETare for the exchange keys.ACTIVATION_CODEis for the activation code.
Run
docker-compose upto start the server.Once docker is all set, open a new terminal window, and check the status of the containers with
docker ps. There should be 4 containers fornginxredispostgresqland the kitserverGo inside the Docker container, by running
docker exec -it server_hollaex-kit-server_1 /bin/bash
Once you are successfully inside the docker container you should run the following commands:
Run database migrations:
sequelize db:migrateRun database seed:
sequelize db:seed:allRun database triggers:
node tools/dbs/runTriggers.jsRun activation to activate the exchange:
node tools/dbs/setActivationCode.js

On the terminal that you ran
docker-compose up, press ctrl + c to stop the process, then rundocker-compose upagain to apply the new settings.
Checking Dev Mode is working
One thing we can do to see dev mode in action is run the pre-existing 'hello-exchange' plugin. This will have been downloaded as part of the cloning process above and can be found at:
hollaex-kit/plugins/src/plugins/hello-exchange

Whilst docker-compose up is running in one terminal, in another terminal, enter the hollaex-kit_server docker container with:
docker exec -it server_hollaex-kit-server_1 /bin/bash (just as in step 7 above).
Once in the container run:
node plugins/dev.js --plugin=hello-exchange
Give it a little time (until 'info: HELLO-EXCHANGE PLUGIN initializing...' is printed) and from your browser access:
http://localhost:10013/plugins/hello-exchange/info
You should see the output in the image below.


Editing a File While in Dev Mode
Now let's edit the hello-exchange plugin, access the following file (I will be in my IDE):
hollaex-kit/plugins/src/plugins/hello-exchange/server/script.js

Edit the returned JSON object highlighted in the image above. Here the message has been altered from retrieving values from the config file, and elsewhere, to the string "Something new!"

Now go back to the terminal where we built the plugin (where the node command was run) and stop the process, and rerun it (node plugins/dev.js --plugin=hello-exchange). Refresh the localhost browser page, and we will see that a new message is now displayed.

From this very quick example, you can see the benefit of dev mode, rather than needing to completely rebuild the codebase, we have been able to quickly make a change, rebuild it in seconds and see that change reflected.
Accessing Dev Mode After Initial Setup
Once you have completed all the above, and either come out of dev mode or rebooted your machine, fortunately, to get back into dev mode the only command required to run is docker-compose up in the /server directory. Easy peasy.
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.
Last updated