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 install

Applications in monorepo rely on HUMAN Protocol SDKs from the monorepo, so after dependencies installation they should be built:

yarn build:libs

Normally 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.local

and for variable that have replace_me values you will need to replace that value with you own.

For web3 testnet private keys and addresses it's recommended to have your own set of valid values that you don't share, so you can be sure your dev env is not broken accidentally by anybody else.

For web3 localhost private keys use defaults provided by local hardhat node FAQ

If you are not sure on where/how to obtain value for some variable - please check FAQ


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-up

All .env.example files by default already preset to point on that pre-defined docker infra


DB 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:run

For CVAT services migrations automatically run as part of start script


Creating 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 minio

  • 127.0.0.1 cvat-lb

After you save the changes - flush the DNS cache if needed (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?