Codename for MVP Order Generation / Filling / Dashboard DApp
- Docker CE installed for ubuntu or windows
- Docker compose
You should install MetaMask chrome extension to approve all blockchain transactions.
- Open MetaMask extension.
- If this is the first run, agree with terms.
- Click by update cycle icon at the right left corner.
- Select
Import account
- Paste your private key.
- Install dependencies
$ yarn install
- Create
.env
file with the following variables:
SERVER_PORT=8080
MONGO_HOST=mongo
FRONT_HOST=http://localhost:3000
- Switch working directory to
react-ui
. - Install dependencies
$ yarn install
- Start ngrok tunnel to your localhost in a separate terminal window (optional)
$ yarn ngrok:start
- Create
.env.local
file with the following variables:
REACT_APP_HTTPS=false
REACT_APP_SERVER_HOST=localhost
REACT_APP_SERVER_PORT=8080
-
In case you ran ngrok: copy the ngrok forwarding route (it should look something like
https://00434830.ngrok.io
) withouthttp://
orhttps://
at the beginning to.env.local
file asREACT_APP_NGROK_HOSTNAME=<your_ngrok_hostname>
. -
Run local test chain in a separate terminal window:
$ yarn chain
- Copy the first private key from the list and import it into MetaMask (see above).
- Migrate contracts on to the local chain:
$ yarn contracts:migrate
If you run
yarn contracts:migrate
afteryarn start
, make sure to re-runyarn start
again in order to pick up the latestnetworkId
- Pre-populate the app with some test loans data (optional):
$ yarn migrations:loans
- Switch MetaMask network to
Localhost 8545
- Run docker from the root directory:
$ docker-compose up -d
If this is the first time you run docker, it may take some time to download required containers.
- Run server:
$ docker exec -ti orbit-net-server yarn start-dev
- In separate terminal window run front (from
react-ui
folder):
$ yarn start
- To completely stop docker from root directory run:
$ docker-compose down
- Follow instructions described in Server part above.
- Set
MONGO_HOST=localhost
in.env
file. - Ensure you have MongoDB installed and running on your local machine.
Command to run mongo daemon in a background:
$ mongod --fork --logpath /var/log/mongod.log
- Run development server with:
$ yarn start-dev
Whether you have local instance run or deployed it somewhere you can switch to Kovan test network instead of local test chain.
To do this just open MetaMask extension and select Kovan test network
from the list of available networks.
In case you need to apply some changes on production.
- Switch to the project root directory:
$ cd ~/OrbitNet
- Pull changes from git:
$ git pull
- Rebuild docker containers:
$ ./start-prod.sh
Run yarn test:watch
in order to watch test files changes.