Initial setup
This page contains information about initial setup that you need to do in order to run applications locally.
Dependencies installation
First you need to install all dependencies for the monorepo:
yarn installApplications in monorepo rely on HUMAN Protocol SDKs from the monorepo, so after dependencies installation they should be built:
yarn build:libsNormally it's done once, but in case of yarn.lock file changes - you might need to repeat these steps to get latest changes.
Setting up environment variables
All applications have .env.example with a minimum set of environment variables to run the application locally. In order to run some app you will need to copy an example file
cp .env.example .env.localand for variable that have replace_me values you will need to replace that value with you own.
Spinning up infrastructure
Almost all services depend on some infrastructure components, such as database and/or other external storage. In order to easily spin them up and get ready to use out of the box we have a default setup of such components via Docker. In order to get it up and running just run next command from the project root:
yarn docker:infra-upDB migrations
For services that rely on the DB, you will also need to run the initial DB migration. It can be easily done from the project root for all necessary services:
# Fortune Exchange Oracle
NODE_ENV=local yarn workspace @human-protocol/fortune-exchange-oracle-server migration:run
# Job Launcher
NODE_ENV=local yarn workspace @human-protocol/job-launcher-server migration:run
# Reputation Oracle
NODE_ENV=local yarn workspace @human-protocol/reputation-oracle migration:runCreating network mappings
In order to easily access some links from the applications in your browser, you should create network mappings in your /etc/hosts file:
127.0.0.1 minio127.0.0.1 cvat-lb
After you save the changes - flush the DNS cache if needed (FAQ #How to clear the DNS cache on my PC?)
Once you are done with all the above - you are ready to run specific service from its folder. In case you want to run "oracle" - please keep in mind that it needs some extra steps described onSetting up Oracles page.
Last updated
Was this helpful?