-
Notifications
You must be signed in to change notification settings - Fork 189
Tutorial: how to run Hydro scaffold on a $5 linode Server
The first part is to get a relayer running on the local machine. Once we get the scaffold running, we'll setup a react development environment and make some simple UI changes. Then we'll commit our UI modifications and deploy it to a production server.
- Fork the https://github.com/HydroProtocol/hydro-box-dex repository. (You need a github account for this part)
- Once you fork the repository, clone it to your local development computer
- Follow the README instruction to spin up a running hydro relayer via docker-compose
Setup React
- The hydro-box-dex immediately works, and there are options to rebuild from source. However, docker is not the best way to make UI changes. We will 1) take the web component out of the docker-compose, and 2) setup a local react dev instance:
docker-compose down
- open
docker-compose.yml
and comment out theweb:
section- web: image: hydroprotocolio/hydro-box-dex-web:latest container_name: hydro-box-dex-web ports: - 3000:8043
docker-compose up
- now go into the /web directory via:
cd web
- follow the “How to develop” instruction in the web/README.me file or just type:
npm install
npm run start
- Open localhost:3000 and you should see the relayer UI again, except now it's no longer running via docker, but just react
- Now let's make an obvious change, open web/src/index.scss and change the font-size in the body from 14px to 34px. The change should immediately live-update in your browser.
-
Register an account at https://www.linode.com/, you need to link a credit card for $5 payment
-
Create a Linode. I used Ubuntu 18.04 LTS, but feel free to choose your favorite linux flavor
-
Choose a region closest to you
-
The smallest and cheapest server is Nanode 1GB($5/month)
- [Image: Screen Shot 2019-05-02 at 9.41.27 AM.png]
-
Choose a password, which is needed for SSH remote login and installation
-
For more info refer to the first part of this guide: https://www.linode.com/docs/getting-started
- Create the server and wait a few minutes. Once it's setup, you can login via SSH:
- https://www.linode.com/docs/getting-started/#connect-to-your-linode-via-ssh
- Follow this guide all the way to the end
- After finishing the getting-started guide, setup a non-root user account and authentication key by following this guide:
- Login to your linode account
- Follow this guide https://docs.docker.com/install/linux/docker-ce/ubuntu/ to install docker
- Install docker compose: https://docs.docker.com/compose/install/
-
Login to your linode account via ssh
-
go to the home directory
-
open docker-compose.yaml
- Under
web:
and the nestedenvironment:
section, change the IP address from localhost to the IP of your linode server
- Under
-
Follow the instruction as you did on localhost, by running
- ``docker-compose pull && docker-compose up -d`
-
visit http://{your-ip}:3000 and you should see a running
- Setup a domain name (TODO)
- buy a domain
- change the DNS to point to your server
- Setup nginx: one way to host your Hydro relay on port 80 instead of 3000
- Setup ssl via cloudflare
- Now your server is running, you can add some markets(listing pairs) via the command line admin tool