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 Subgraph
  • First time setup
  • Subsequent launches
  • Playing around with local web3

Was this helpful?

  1. HUMAN Tech Docs
  2. Developer

Run web3 in Docker

On this page you will find steps to run blockchain and subgraph nodes in Docker locally

Running blockchain and subgraph nodes locally in Docker might be useful in order to test changes in smart contracts or/and SDKs.

In order to run necessary infra for local web3 - run next command from the project root:

yarn docker:web3-up

This will run hardhat node with HUMAN Protocol smart contracts deployed on it and empty subgraph node w/ its dependencies.

Setting up Subgraph

First time setup

Running web3 docker containers for the first time provides you with empty subgraph node. In order to deploy our subgraphs to it you will need to follow next steps:

# Generate subgraph manifest
NETWORK=localhost yarn workspace @human-protocol/subgraph generate
# Create subgraph
yarn workspace @human-protocol/subgraph create-local
# Deploy subgraph
yarn workspace @human-protocol/subgraph deploy-local

After that subgraph is ready for use.

Subsequent launches

Subgraph containers have Docker volumes attached to it, so every time you stop/start containers - data in subgraph persists, so you don't have to deploy graph again.

In case you make some changes to the subgraph - you might want to either re-deploy it and run re-indexing or have a clean setup. For the latter - remove all existing containers and their volumes:

yarn docker:web3-down

After that run clean web3 services and deploy updated subgraph.

Playing around with local web3

Our TypeScript SDK has examples folder, where you can find local-node.ts script and use it to play around with your local web3 setup in order to verify that it works as expected:

yarn ts-node example/local-node.ts

Run it multiple times and see if values in KV store are updated.

PreviousInitial setupNextRun services in Docker

Last updated 4 days ago

Was this helpful?