Skip to content

Conversation

@dnechay
Copy link
Collaborator

@dnechay dnechay commented May 27, 2025

Issue tracking

Part of #3053
Follow up to #3360

Context behind the change

Here we removed scripts folder in favor of common docker setup. Now when developing smart contracts, sdk or subgraph engineer either can keep writing unit tests or writing all the infra locally by yarn docker:web3-up from the project root (docs updated with some hints).

To distinguish between local environment and testnet - there are now two different env files:

  • .env is expected to be used for running services in docker and pointing to testnet
  • .env.local is expected to be used for running services locally (i.e. in terminal) and pointing to localhost web3
    The above expectation is reflected in "setup scripts", i.e. setup-kv-store.ts and setup-staking.ts for oracles.

Also updated yarn setup:local command for convenience. If env files are correctly filled and web3 is running - it will perform staking for oracle and fill its KV store.

Note

.env.local takes precedence over .env for both backend and frontend apps, so if you have both - running from terminal will rely on .env.local, but in docker context we ignore these files so keep relying only on .env inside of docker containers.

How has this been tested?

  • run yarn docker:web3-up from project root and check that blockchain node and subgraph run correctly
  • follow steps from e2e test using local node section of human-protocol/subgraph README; make sure graph is deployed and works correctly by running local-node script from human-protocol/sdk multiple times
  • run yarn setup-local for oracles, check KV store values via local Subgraph UI
  • run ./scripts/fortune-all-local.sh, make sure everything is started and operational; press Ctrl+C and ensure processes properly shut down

Important

When press Ctrl+C multiple times - only kill commands will ignore it, when for yarn ... commands that shutdown docker it propagates, so take this into account and not press it mindlessly, otherwise you will have to manually cleanup containers and volumes.

Release plan

Just merge.

Potential risks; What to monitor; Rollback plan

No

@vercel
Copy link

vercel bot commented May 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

5 Skipped Deployments
Name Status Preview Comments Updated (UTC)
faucet-frontend ⬜️ Ignored (Inspect) Visit Preview Jun 2, 2025 0:17am
faucet-server ⬜️ Ignored (Inspect) Visit Preview Jun 2, 2025 0:17am
human-app ⬜️ Skipped (Inspect) Jun 2, 2025 0:17am
human-dashboard-frontend ⬜️ Skipped (Inspect) Jun 2, 2025 0:17am
staking-dashboard ⬜️ Skipped (Inspect) Jun 2, 2025 0:17am

@dnechay dnechay marked this pull request as draft May 28, 2025 08:41
@vercel vercel bot temporarily deployed to Preview – staking-dashboard May 28, 2025 09:03 Inactive
@vercel vercel bot temporarily deployed to Preview – human-dashboard-frontend May 28, 2025 09:04 Inactive
@vercel vercel bot temporarily deployed to Preview – human-app May 28, 2025 09:04 Inactive
@dnechay dnechay marked this pull request as ready for review May 28, 2025 09:12
@dnechay dnechay changed the title Dnechay/3053 web3 refactor: docker setup for local web3; dev env with local web3 May 28, 2025
Copy link
Contributor

@flopez7 flopez7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@vercel vercel bot temporarily deployed to Preview – staking-dashboard May 30, 2025 16:17 Inactive
@vercel vercel bot temporarily deployed to Preview – human-dashboard-frontend May 30, 2025 16:17 Inactive
@vercel vercel bot temporarily deployed to Preview – human-app May 30, 2025 16:17 Inactive
@vercel vercel bot temporarily deployed to Preview – human-app June 2, 2025 12:16 Inactive
@vercel vercel bot temporarily deployed to Preview – human-dashboard-frontend June 2, 2025 12:16 Inactive
@vercel vercel bot temporarily deployed to Preview – staking-dashboard June 2, 2025 12:16 Inactive
@dnechay dnechay merged commit 9fa7dd1 into develop Jun 2, 2025
17 checks passed
@dnechay dnechay deleted the dnechay/3053-web3 branch June 2, 2025 13:12
@dnechay dnechay mentioned this pull request Jun 2, 2025
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants