Skip to content

Commit 48c3543

Browse files
authored
Release 2025-06-24 (#3364)
2 parents ceb467d + 9f869bd commit 48c3543

File tree

569 files changed

+12728
-11525
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

569 files changed

+12728
-11525
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
.husky
55
audits
66
docs
7+
docker-setup
78
scripts
89
**/node_modules
910
**/build
@@ -22,3 +23,6 @@ scripts
2223
.dockerignore
2324
**/Dockerfile*
2425
**/docker-compose*
26+
27+
# Local .env files
28+
**/.env.local

.github/workflows/cd-subgraph.yaml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: Subgraph deployment
2-
32
on:
43
workflow_dispatch:
54
inputs:
@@ -53,23 +52,21 @@ jobs:
5352
- name: Build core package
5453
if: steps.filter_networks.outputs.continue == 'true'
5554
run: yarn build:core
56-
- name: Install Graph CLI
57-
if: steps.filter_networks.outputs.continue == 'true'
58-
run: yarn global add @graphprotocol/[email protected]
59-
- name: Authenticate Graph CLI
60-
if: steps.filter_networks.outputs.continue == 'true'
61-
run: graph auth --studio ${API_KEY}
62-
env:
63-
API_KEY: ${{ secrets.HP_GRAPH_API_KEY }}
6455
- name: Generate and build Subgraph
6556
if: steps.filter_networks.outputs.continue == 'true'
6657
run: yarn generate && yarn build
6758
working-directory: ./packages/sdk/typescript/subgraph
6859
env:
6960
NETWORK: ${{ matrix.network.name }}
70-
- name: Deploy Subgraph
61+
- name: Authenticate & Deploy
7162
if: steps.filter_networks.outputs.continue == 'true'
72-
run: graph deploy --studio ${NETWORK} -l ${{ github.event.inputs.label }}
73-
working-directory: ./packages/sdk/typescript/subgraph
7463
env:
75-
NETWORK: ${{ matrix.network.name }}
64+
API_KEY: ${{ secrets.HP_GRAPH_API_KEY }}
65+
NETWORK: ${{ matrix.network.name }}
66+
LABEL: ${{ github.event.inputs.label }}
67+
working-directory: ./packages/sdk/typescript/subgraph
68+
run: |
69+
yarn dlx @graphprotocol/[email protected] \
70+
auth --studio "$API_KEY"
71+
yarn dlx @graphprotocol/[email protected] \
72+
deploy --studio ${NETWORK} -l ${LABEL}

.github/workflows/ci-dependency-review.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
steps:
1515
- uses: actions/[email protected]
1616
- name: Dependency Review
17-
uses: actions/[email protected].0
17+
uses: actions/[email protected].1
1818
with:
1919
show-openssf-scorecard: false

.gitignore

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,5 @@ dist
4747
*.tsbuildinfo
4848
hardhat-dependency-compiler
4949

50-
#cache
51-
cache
52-
53-
#docker databases
54-
docker-db
50+
# cache
51+
cache

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
yarn dlx lint-staged
2+
yarn workspaces foreach --all -p run typecheck
23

34
# Format python file changes
45
cd packages/sdk/python/human-protocol-sdk

docker-setup/.env.compose

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MINIO_PORT=9000
2+
3+
# NOTE: Avoid changing this since it impact KV store urls
4+
BACKEND_APPS_INTERNAL_PORT=5000
5+
6+
REPUTATION_ORACLE_EXPOSED_PORT=5001
7+
HUMAN_APP_SERVER_EXPOSED_PORT=5002
8+
JOB_LAUNCHER_EXPOSED_PORT=5003
9+
EXCHANGE_ORACLE_CVAT_EXPOSED_PORT=5004
10+
RECORDING_ORACLE_CVAT_EXPOSED_PORT=5005
11+
EXCHANGE_ORACLE_FORTUNE_EXPOSED_PORT=5006
12+
RECORDING_ORACLE_FORTUNE_EXPOSED_PORT=5007
13+
14+
HUMAN_APP_CLIENT_EXPOSED_PORT=3001
15+
JOB_LAUNCHER_CLIENT_EXPOSED_PORT=3002
16+
FORTUNE_CLIENT_EXPOSED_PORT=3003
17+
18+
RPC_URL_POLYGON_AMOY=https://rpc-amoy.polygon.technology
19+
20+
# Might be empty
21+
SUBGRAPH_API_KEY=

docker-setup/Makefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.PHONY: check-env-file \
2+
infra-up infra-stop \
3+
build-services services-up services-stop
4+
5+
DOCKER_PARALLEL ?= 4
6+
7+
check-env-file:
8+
@if [ ! -f "./.env.compose.local" ]; then \
9+
cp ./.env.compose ./.env.compose.local ; \
10+
fi
11+
12+
infra-up: check-env-file
13+
@docker compose --env-file .env.compose.local up -d postgres redis minio minio-client
14+
15+
infra-stop:
16+
@docker compose --env-file .env.compose.local stop postgres redis minio minio-client
17+
18+
build-services: check-env-file
19+
@docker compose --env-file .env.compose.local --parallel $(DOCKER_PARALLEL) up --no-start
20+
21+
services-up: check-env-file
22+
@service_names="$(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS))"; \
23+
docker compose --env-file .env.compose.local --parallel $(DOCKER_PARALLEL) up -d $$service_names
24+
25+
services-stop:
26+
@service_names="$(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS))"; \
27+
docker compose --env-file .env.compose.local stop $$service_names
28+
29+
# catch-all and noop; to avoid warnings when using MAKECMDGOALS
30+
%:
31+
@:

docker-setup/Makefile.dev

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.PHONY: web3-up web3-down \
2+
infra-up infra-stop infra-down
3+
4+
web3-up:
5+
@docker compose -f docker-compose.dev.yml up -d blockchain-node ipfs graph-node-db graph-node
6+
7+
web3-down:
8+
# also remove volumes to get the clean start after
9+
@docker compose -f docker-compose.dev.yml down -v blockchain-node ipfs graph-node-db graph-node
10+
11+
infra-up:
12+
@docker compose -f docker-compose.dev.yml up -d postgres minio minio-client
13+
14+
infra-stop:
15+
@docker compose -f docker-compose.dev.yml stop postgres minio minio-client
16+
17+
infra-down:
18+
# also remove volumes to get the clean start after
19+
@docker compose -f docker-compose.dev.yml down -v postgres minio minio-client
20+
21+
# catch-all and noop; to avoid warnings when using MAKECMDGOALS
22+
%:
23+
@:
Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
name: human-protocol-local-dev
2+
3+
x-service-default-config:
4+
restart: &default-restart unless-stopped
5+
logging: &default-logging
6+
options:
7+
max-size: 10m
8+
max-file: 3
9+
10+
x-hardcoded-vars:
11+
graph_db_user: &graph_db_user graph-node
12+
graph_db_passwrod: &graph_db_passwrod let-me-in
13+
graph_db_name: &graph_db_name graph-node
14+
15+
x-general-env-variables:
16+
postgres_user: &postgres_user ${POSTGRES_USER:-default}
17+
postgres_password: &postgres_password ${POSTGRES_PASSWORD:-qwerty}
18+
# MINIO VARS
19+
minio_port: &minio_port ${MINIO_PORT:-9000}
20+
minio_console_port: &minio_console_port ${MINIO_CONSOLE_PORT:-9001}
21+
minio_root_user: &minio_root_user ${MINIO_ROOT_USER:-minioadmin}
22+
minio_root_password: &minio_root_password ${MINIO_ROOT_PASSWORD:-minioadmin}
23+
minio_services_access_key: &minio_services_access_key ${MINIO_SERVICES_ACCESS_KEY:-human-oracle}
24+
minio_services_secret_key: &minio_services_secret_key ${MINIO_SERVICES_SECRET_KEY:-human-oracle-s3-secret}
25+
# BUCKET NAMES
26+
bucket_name_manifests: &bucket_name_manifests ${BUCKET_NAME_MANIFESTS:-manifests}
27+
bucket_name_datasets: &bucket_name_datasets ${BUCKET_NAME_DATASETS:-datasets}
28+
bucket_name_rep_o: &bucket_name_rep_o ${BUCKET_NAME_REPUTATION_ORACLE:-reputation-oracle}
29+
bucket_name_fortune: &bucket_name_fortune ${BUCKEN_NAME_FORTUNE:-fortune}
30+
31+
services:
32+
blockchain-node:
33+
container_name: hp-dev-blockchain-node
34+
image: human-protocol/hardhat-blockchain-node
35+
pull_policy: build
36+
restart: *default-restart
37+
logging:
38+
<<: *default-logging
39+
build:
40+
context: ../
41+
dockerfile: packages/core/Dockerfile.local
42+
healthcheck:
43+
test: yarn local:readiness
44+
interval: 15s
45+
timeout: 30s
46+
retries: 0
47+
networks:
48+
- human_protocol_web3
49+
ports:
50+
- name: node-port
51+
target: 8545
52+
published: ${BLOCKCHAIN_NODE_PORT:-8545}
53+
54+
ipfs:
55+
container_name: hp-dev-ipfs
56+
image: ipfs/kubo:v0.14.0
57+
restart: *default-restart
58+
logging:
59+
<<: *default-logging
60+
healthcheck:
61+
test: ["CMD-SHELL", "ipfs id > /dev/null"]
62+
interval: 10s
63+
timeout: 5s
64+
retries: 3
65+
networks:
66+
- human_protocol_web3
67+
ports:
68+
- name: ipfs-port
69+
target: 5001
70+
published: ${IPFS_PORT:-5010}
71+
volumes:
72+
- ipfs-data:/data/ipfs:Z
73+
74+
graph-node-db:
75+
container_name: hp-dev-graph-node-db
76+
image: postgres:latest
77+
restart: *default-restart
78+
logging:
79+
<<: *default-logging
80+
networks:
81+
- human_protocol_web3
82+
command:
83+
[
84+
"postgres",
85+
"-cshared_preload_libraries=pg_stat_statements",
86+
"-cmax_connections=200"
87+
]
88+
healthcheck:
89+
test: ["CMD", "pg_isready"]
90+
interval: 10s
91+
timeout: 5s
92+
retries: 5
93+
volumes:
94+
- graph-node-db-data:/var/lib/postgresql/data:Z
95+
environment:
96+
POSTGRES_USER: *graph_db_user
97+
POSTGRES_PASSWORD: *graph_db_passwrod
98+
POSTGRES_DB: *graph_db_name
99+
POSTGRES_INITDB_ARGS: "-E UTF8 --locale=C"
100+
101+
graph-node:
102+
container_name: hp-dev-graph-node
103+
# In case of issues on Mac M1 rebuild the image for it locally
104+
# https://github.com/graphprotocol/graph-node/blob/master/docker/README.md#running-graph-node-on-an-macbook-m1
105+
image: graphprotocol/graph-node
106+
restart: *default-restart
107+
logging:
108+
<<: *default-logging
109+
networks:
110+
- human_protocol_web3
111+
ports:
112+
- '8000:8000'
113+
- '8001:8001'
114+
- '8020:8020'
115+
- '8030:8030'
116+
- '8040:8040'
117+
depends_on:
118+
- blockchain-node
119+
- ipfs
120+
- graph-node-db
121+
environment:
122+
postgres_host: graph-node-db
123+
postgres_user: *graph_db_user
124+
postgres_pass: *graph_db_passwrod
125+
postgres_db: *graph_db_name
126+
ipfs: ipfs:5001
127+
ethereum: localhost:http://blockchain-node:8545
128+
GRAPH_LOG: info
129+
healthcheck:
130+
test: ["CMD-SHELL", "nc -z localhost 8000 || exit 1"]
131+
interval: 5s
132+
timeout: 5s
133+
retries: 10
134+
start_period: 10s
135+
136+
postgres:
137+
container_name: hp-dev-postgres
138+
image: postgres:16
139+
restart: *default-restart
140+
logging:
141+
<<: *default-logging
142+
ports:
143+
- name: instance_port
144+
target: 5432
145+
# default 5432 is used by CVAT installation
146+
published: ${POSTGRES_PORT:-5433}
147+
volumes:
148+
- ./initdb:/docker-entrypoint-initdb.d
149+
- postgres-data:/var/lib/postgresql/data
150+
environment:
151+
POSTGRES_USER: *postgres_user
152+
POSTGRES_PASSWORD: *postgres_password
153+
healthcheck:
154+
test: ["CMD", "pg_isready"]
155+
interval: 10s
156+
timeout: 5s
157+
retries: 5
158+
159+
minio:
160+
container_name: hp-dev-minio
161+
image: minio/minio:RELEASE.2024-12-18T13-15-44Z
162+
restart: *default-restart
163+
logging:
164+
<<: *default-logging
165+
entrypoint: 'sh'
166+
ports:
167+
- name: instance_port
168+
target: 9000
169+
published: *minio_port
170+
- name: console_port
171+
target: 9001
172+
published: *minio_console_port
173+
volumes:
174+
- minio-data:/data
175+
environment:
176+
MINIO_ROOT_USER: *minio_root_user
177+
MINIO_ROOT_PASSWORD: *minio_root_password
178+
command:
179+
-c "minio server /data --console-address ':9001'"
180+
healthcheck:
181+
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
182+
interval: 5s
183+
timeout: 5s
184+
retries: 3
185+
186+
minio-client:
187+
container_name: hp-dev-minio-client
188+
image: minio/mc:RELEASE.2024-11-21T17-21-54Z
189+
depends_on:
190+
minio:
191+
condition: service_healthy
192+
environment:
193+
MINIO_ROOT_USER: *minio_root_user
194+
MINIO_ROOT_PASSWORD: *minio_root_password
195+
SERVICES_ACCESS_KEY: *minio_services_access_key
196+
SERVICES_SECRET_KEY: *minio_services_secret_key
197+
BUCKET_MANIFESTS: *bucket_name_manifests
198+
BUCKET_DATASETS: *bucket_name_datasets
199+
BUCKET_REPUTATION_ORACLE: *bucket_name_rep_o
200+
BUCKET_FORTUNE: *bucket_name_fortune
201+
entrypoint: >
202+
/bin/sh -c "
203+
mc alias set myminio http://minio:9000 $$MINIO_ROOT_USER $$MINIO_ROOT_PASSWORD
204+
205+
mc admin user add myminio $$SERVICES_ACCESS_KEY $$SERVICES_SECRET_KEY
206+
mc admin policy attach myminio readwrite --user=$$SERVICES_ACCESS_KEY
207+
208+
mc mb myminio/$$BUCKET_MANIFESTS;
209+
mc anonymous set public myminio/$$BUCKET_MANIFESTS;
210+
211+
mc mb myminio/$$BUCKET_DATASETS;
212+
mc anonymous set public myminio/$$BUCKET_DATASETS;
213+
214+
mc mb myminio/$$BUCKET_REPUTATION_ORACLE;
215+
mc anonymous set public myminio/$$BUCKET_REPUTATION_ORACLE;
216+
217+
mc mb myminio/$$BUCKET_FORTUNE;
218+
mc anonymous set public myminio/$$BUCKET_FORTUNE;
219+
"
220+
221+
volumes:
222+
ipfs-data:
223+
graph-node-db-data:
224+
postgres-data:
225+
minio-data:
226+
227+
networks:
228+
human_protocol_web3:
229+
name: human-protocol-web3

0 commit comments

Comments
 (0)