Hub
HUMAN Website
  • HUMAN Protocol Document Hub
  • HUMAN Tech Docs
    • Architecture
      • Components
        • Smart Contracts
          • Escrow.sol
          • EscrowFactory.sol
          • Contract Addresses
        • Dashboard
        • Job Launcher
          • Standard
          • HUMAN Job Launcher
        • Exchange Oracle
          • Standard
        • Recording Oracle
          • Standard
        • Reputation Oracle
          • Standard
          • HUMAN Reputation Oracle
        • HUMAN App
        • Annotation Tools
          • CVAT
          • hCaptcha
          • Fortune (test)
      • Protocol Features
        • Routing Protocol
        • Abuse System
        • Qualifications System
        • Governance
    • SDK
    • Tutorials
      • Job Requesters
        • Signup
        • Launch Jobs
          • Fortune
      • Workers
        • Sign Up
        • KYC Verification
        • Wallet address registration
      • Operators
        • Sign Up
      • HMToken
        • Bridge
          • Ethereum <--> Polygon
          • Ethereum <--> Binance Smart Chain
    • Developer
      • Prerequisites
      • Initial setup
      • Run web3 in Docker
      • Run services in Docker
      • Setting up Oracles
      • Running HUMAN Protocol with CVAT
        • Running CVAT
        • Setting up Worker user
        • Launch simple CVAT job
      • FAQ
  • Routing Protocol Tokenomics
    • Status
    • Premise
    • Token design
    • Proposition for a governance minimization model
    • Liquidity provision /market making
    • Alternate Conviction voting model
    • Voting model
    • The HUMAN-RP Magistrate
    • Voting process
    • Security
    • Policies
    • Slashing and Soft-freezing
    • Staking for tool vendors
  • Grants Program
    • Introduction and Program Overview
    • Application Process
      • Application Process of the HUMAN Grants Program
    • Funded Projects
    • Community
    • Help & FAQs
    • Terms and condition
  • Guide to the HUMAN Protocol SDK's
Powered by GitBook
LogoLogo

© 2023 HPF. HUMAN Protocol® is a registered trademark

On this page
  • Setting up environment variables
  • Spinning up infrastructure
  • DB migrations
  • Creating network mappings

Was this helpful?

  1. HUMAN Tech Docs
  2. Developer

Initial setup

This page contains information about initial setup that you need to do in order to run applications locally.

PreviousPrerequisitesNextRun web3 in Docker

Last updated 7 days ago

Was this helpful?

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

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


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.

After you save the changes - flush the DNS cache if needed ()

#what-are-hardhat-local-node-default-accounts
How to clear the DNS cache on my PC?