Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync main with production #954

Merged
merged 99 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
fe22a71
fix events-extrinsics relation in hasura metadata
marcusDesk Nov 8, 2024
deed052
remove array relation between events->extrinsics
marcusDesk Nov 8, 2024
ef49482
add seed schema to init-db.sql
marcusDesk Nov 8, 2024
6468d46
remove migration
marcusDesk Nov 8, 2024
e8d3240
add health condition to depend_on in docker compose
marcusDesk Nov 8, 2024
3d43761
remove table not use by indexers from indexers schema
marcusDesk Nov 8, 2024
f1320a3
use bull js port from env and pass it to hasura for actions
marcusDesk Nov 8, 2024
cca7e57
add updateAccount hasura action
marcusDesk Nov 8, 2024
7ae2fa6
add auto-sdk to taskboard and fix node to 18 for this service
marcusDesk Nov 8, 2024
409e332
add update account task in taskboard
marcusDesk Nov 8, 2024
ab6c67f
add slackNotification task
marcusDesk Nov 9, 2024
9dfa24c
improve main taskboard script
marcusDesk Nov 9, 2024
47df49d
add actions permissions and types
marcusDesk Nov 9, 2024
9bf276a
convert taskboard to typescript
marcusDesk Nov 9, 2024
fb6369d
remove dist
marcusDesk Nov 9, 2024
6fd0b44
add dist to gitignore
marcusDesk Nov 9, 2024
4eb6b5e
cleanup code
marcusDesk Nov 9, 2024
b808eee
improve taskboard docker config
marcusDesk Nov 9, 2024
295f095
add/improve taskboard views
marcusDesk Nov 9, 2024
a139cb4
improve taskboard to run directly in ts and clean code
marcusDesk Nov 9, 2024
d6eafb8
improve hasura <-> taskboard security and infer jobId
marcusDesk Nov 9, 2024
3e900a5
fix some small bugs in task board
marcusDesk Nov 9, 2024
ba86a0d
simplify hasura/task action input types
marcusDesk Nov 9, 2024
ef8b6c9
Merge pull request #933 from autonomys/feat/add-hasura-action-to-upda…
marc-aurele-besner Nov 10, 2024
ada28a2
Merge branch 'main' into feat/improve-taskboard-setup
marc-aurele-besner Nov 10, 2024
8c90428
Merge pull request #934 from autonomys/feat/improve-taskboard-setup
marc-aurele-besner Nov 10, 2024
bff68db
Merge branch 'main' into fix/fix-events-extrinsics-relation
marc-aurele-besner Nov 11, 2024
ae27438
Merge pull request #931 from autonomys/fix/fix-events-extrinsics-rela…
marc-aurele-besner Nov 11, 2024
d8480a8
Merge branch 'main' into feat/seed-dictionary-and-consensus-schema-at…
marc-aurele-besner Nov 11, 2024
8a535b9
Merge pull request #932 from autonomys/feat/seed-dictionary-and-conse…
marc-aurele-besner Nov 11, 2024
c92d0a9
add script to convert genesis allocation to SQL seeds
marcusDesk Nov 11, 2024
e9c5c8b
fix script to generate seeds compatible with Hasura
marcusDesk Nov 11, 2024
2e7f607
add genesis allocation seeds
marcusDesk Nov 11, 2024
46411ea
add script to apply seeds
marcusDesk Nov 11, 2024
f3b6c84
modify script to convert all addresses into the mainnet format
marcusDesk Nov 11, 2024
4bdf44e
update genesis allocations seeds to fix address formatting
marcusDesk Nov 11, 2024
c252b75
Merge pull request #935 from autonomys/feat/convert-genesis-allocatio…
marc-aurele-besner Nov 11, 2024
b9b1b98
remove platform tag for node
marcusDesk Nov 12, 2024
5c07e23
use caddy as private proxy for node
DaMandal0rian Nov 12, 2024
226c205
fix to compose
DaMandal0rian Nov 12, 2024
190a6bb
Merge pull request #937 from autonomys/fix/remove-platform-tag-for-node
marc-aurele-besner Nov 12, 2024
e4b71c7
remove pot external entropy to not cause issue on taurus/mainnet
marcusDesk Nov 12, 2024
00e36f5
Merge pull request #938 from autonomys/hotfix/proxy
DaMandal0rian Nov 12, 2024
ff22928
Merge branch 'main' into fix/remove-pot-external-entropy
marc-aurele-besner Nov 12, 2024
8f88ca0
Merge pull request #939 from autonomys/fix/remove-pot-external-entropy
marc-aurele-besner Nov 12, 2024
cc646d8
fix ports for indexer services
DaMandal0rian Nov 12, 2024
d8c38b3
Merge pull request #940 from autonomys/hotfix/indexer-ports
DaMandal0rian Nov 12, 2024
9cfdf53
improve docker setup for node
marcusDesk Nov 13, 2024
fa015b7
Merge pull request #941 from autonomys/fix/improve-node-settings
marc-aurele-besner Nov 13, 2024
49e78f7
add logging to the node service for indexer stack
DaMandal0rian Nov 13, 2024
33dda03
remove version it's obsolete
DaMandal0rian Nov 13, 2024
0411c4a
change to use PB rather than PiB
marcusDesk Nov 13, 2024
4c1b45f
update codegen
marcusDesk Nov 13, 2024
bd568e6
add postgres tuning config
DaMandal0rian Nov 13, 2024
e6d133c
Merge pull request #945 from autonomys/hotfix/postgres
DaMandal0rian Nov 13, 2024
e8a303c
rename function
marcusDesk Nov 13, 2024
0c13103
Merge branch 'main' into feat/change-storage-pledge-mesurement-from-p…
marc-aurele-besner Nov 13, 2024
d68142e
fix ports collision
marcusDesk Nov 13, 2024
88ac77a
disable dictionary for consensus indexer
marcusDesk Nov 13, 2024
f0b56ef
fix dictionary url
marcusDesk Nov 13, 2024
edc60b9
create leaderboard historical tables
marcusDesk Nov 13, 2024
675f5f9
fix bull board port when call from indexers
marcusDesk Nov 13, 2024
2f5e444
fix indexers db helper to use historical table and not edit
marcusDesk Nov 13, 2024
ce816a3
change leaderboard task logic to work with historical data
marcusDesk Nov 13, 2024
a3a80f3
add finalize leaderboard tables to db init
marcusDesk Nov 13, 2024
ef5dfd5
activate historical and unfinalized block for leaderboard service
marcusDesk Nov 13, 2024
5bf1e60
add apply seeds dev/prod
marcusDesk Nov 13, 2024
801e2ab
add leaderboard historical tables metadata
marcusDesk Nov 13, 2024
dd1be4a
Merge pull request #944 from autonomys/feat/change-storage-pledge-mes…
marc-aurele-besner Nov 14, 2024
10ae5ae
Merge branch 'main' into fix/fix-ports-collision
marc-aurele-besner Nov 14, 2024
d873a96
Merge pull request #946 from autonomys/fix/fix-ports-collision
marc-aurele-besner Nov 14, 2024
5895477
Merge branch 'main' into fix/modify-leaderboard-indexer-to-work-with-…
marc-aurele-besner Nov 14, 2024
21bfcbb
Merge pull request #947 from autonomys/fix/modify-leaderboard-indexer…
marc-aurele-besner Nov 14, 2024
2e8d5b2
Merge pull request #942 from autonomys/feat/logging
DaMandal0rian Nov 14, 2024
3c230a3
add redis store and get utility function
marcusDesk Nov 14, 2024
764cea0
add logic for cron tasks
marcusDesk Nov 14, 2024
9d42c18
improve consensus tasks to be cron and not needing to be called from …
marcusDesk Nov 14, 2024
cbde3ce
remove task calling logic from consensus indexer
marcusDesk Nov 14, 2024
23c5373
change leaderboard task to also use cron
marcusDesk Nov 14, 2024
b2382b4
remove leaderboard task calling from leaderboard indexer
marcusDesk Nov 14, 2024
1506b3a
simplify consensus task logic from unused type
marcusDesk Nov 14, 2024
4260d7a
remove leaderboard unused types and handler
marcusDesk Nov 14, 2024
65971f5
remove the need for unsafe flag in leaderboard (since no api call any…
marcusDesk Nov 14, 2024
a4b8bb8
Merge pull request #949 from autonomys/feat/improve-consensus-tasks-t…
marc-aurele-besner Nov 14, 2024
c2aacca
update postgres init to include leaderboard historical tables
marcusDesk Nov 14, 2024
4397b72
add missing consensus trigger
marcusDesk Nov 14, 2024
30e8cb1
Merge branch 'main' into feat/improve-leaderboard-indexers-and-tasks-…
marc-aurele-besner Nov 14, 2024
8e541eb
Merge pull request #950 from autonomys/feat/improve-leaderboard-index…
marc-aurele-besner Nov 14, 2024
2b1d87c
Merge branch 'main' into feat/improve-postgres-init-with-leaderboard-…
marc-aurele-besner Nov 14, 2024
a1eab5c
Merge pull request #951 from autonomys/feat/improve-postgres-init-wit…
marc-aurele-besner Nov 14, 2024
0e26684
change subscan url
marcusDesk Nov 15, 2024
470b3c3
add polkadot as known words
marcusDesk Nov 15, 2024
8e3619a
improve out of sync logic to give link to proper backup explorer
marcusDesk Nov 15, 2024
d6205bd
fix other component using polkadot link
marcusDesk Nov 15, 2024
2156478
fix port bindings
DaMandal0rian Nov 15, 2024
00dec31
make rpc archival
DaMandal0rian Nov 15, 2024
cd13cf0
bind dictionary graphql to localhost
DaMandal0rian Nov 15, 2024
c306297
Merge pull request #952 from autonomys/feat/change-subscan-url
marc-aurele-besner Nov 15, 2024
98ca591
Merge pull request #953 from autonomys/hotfix/port-bindings
DaMandal0rian Nov 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ NETWORK_ID=mainnet
# Testnet - Taurus
# NETWORK_ID=taurus

LOG_LEVEL=debug

# Mainnet
NODE_DOCKER_TAG="mainnet-2024-nov-05"
NODE_DOCKER_TAG=mainnet-2024-nov-13
# Testnet - Taurus
# NODE_DOCKER_TAG="taurus-candidate"
# NODE_DOCKER_TAG=taurus-2024-nov-05

DB_USER=postgres
DB_DATABASE=postgres
Expand All @@ -17,11 +19,11 @@ DB_PORT=5432
DB_HOST=postgres

# Mainnet
RPC_URLS="ws://caddy:80,wss://rpc-0.mainnet.subspace.network/ws,wss://rpc-1.mainnet.subspace.network/ws,wss://rpc-0.mainnet.autonomys.xyz/ws,wss://rpc-1.mainnet.autonomys.xyz/ws"
RPC_URLS="ws://localhost:8000,wss://rpc-0.mainnet.subspace.network/ws,wss://rpc-1.mainnet.subspace.network/ws,wss://rpc-0.mainnet.autonomys.xyz/ws,wss://rpc-1.mainnet.autonomys.xyz/ws"
CHAIN_ID="0x66455a580aabff303720aa83adbe6c44502922251c03ba73686d5245da9e21bd"

# Testnet - Taurus
# RPC_URLS="ws://caddy:80,wss://rpc-0.taurus.subspace.network/ws"
# RPC_URLS="ws://localhost:8000,wss://rpc-0.taurus.subspace.network/ws"
# CHAIN_ID="0x295aeafca762a304d92ee1505548695091f6082d3f0aa4d092ac3cd6397a6c5e"

HASURA_GRAPHQL_PORT=8080
Expand All @@ -36,14 +38,18 @@ HASURA_GRAPHQL_CORS_DOMAIN="*"
DICTIONARY_DIRECTORY=autonomys
# Testnet - Taurus
# DICTIONARY_DIRECTORY=autonomys-taurus
DICTIONARY_SUBQUERY_NODE_PORT=3010
DICTIONARY_URL="http://dictionary_subquery_node:3000"
DICTIONARY_SUBQUERY_NODE_PORT=3000
DICTIONARY_URL="http://localhost:3000"

REDIS_PORT=6379

BULL_USERNAME=bull
BULL_PASSWORD=board
BULL_PORT=3020
BULL_SESSION_SECRET=keyboardcat

NR_API_KEY=""
NR_AGENT_IDENTIFIER=""
NR_AGENT_IDENTIFIER=""

SLACK_TOKEN=""
SLACK_CONVERSATION_ID=""
5 changes: 3 additions & 2 deletions .vscode/astral.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"path": "../indexers/gemini-3h"
},
{
"name": "indexer - Gemini 3G",
"path": "../indexers/gemini-3g"
"name": "Taskboard",
"path": "../indexers/taskboard"
}
],
"settings": {
Expand All @@ -56,6 +56,7 @@
"gemini",
"graphiql",
"leaderboard",
"polkadot",
"siwe",
"subscan",
"subspace",
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"gemini",
"graphiql",
"leaderboard",
"polkadot",
"siwe",
"subscan",
"subspace",
Expand Down
8 changes: 6 additions & 2 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.9"

services:
postgres:
volumes:
Expand Down Expand Up @@ -28,6 +26,12 @@ services:
NRIA_DISPLAY_NAME: "${NR_AGENT_IDENTIFIER}"
restart: unless-stopped

node:
logging:
driver: loki
options:
loki-url: "https://logging.subspace.network/loki/api/v1/push"

hasura:
image: hasura/graphql-engine:v2.40.0
logging:
Expand Down
85 changes: 47 additions & 38 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.9"

volumes:
node-data: {}
postgres_db: {}
Expand All @@ -16,32 +14,24 @@ services:
hard: 65536 # Hard limit for open files
image: caddy:latest
ports:
- "80:9944" # Map external 80 to Caddy's 9944 for Node/RPC
- "443:9944" # Map external 443 to Caddy's 9945 for HTTPS
- "8081:8080" # Map external 8081 to Caddy's 8080 for Hasura
- "3011:3001" # Map external 3011 to Caddy's 3001 for Consensus
- "3012:3002" # Map external 3012 to Caddy's 3002 for Leaderboard
- "3013:3003" # Map external 3013 to Caddy's 3003 for Staking
- "127.0.0.1:8000:8000"
volumes:
- ./indexers/Caddyfile:/etc/caddy/Caddyfile # Mount the Caddyfile
- caddy_data:/data # Volume for Let's Encrypt certificates
- caddy_config:/config

environment:
- DOMAIN=subql.${NETWORK_ID}.subspace.network
depends_on:
- node
restart: unless-stopped

# Subspace Node
node:
image: ghcr.io/autonomys/node:${NODE_DOCKER_TAG}
platform: linux/amd64
volumes:
- node-data:/var/subspace:rw
ports:
- "30333:30333/tcp"
- "30433:30433/tcp"
- "127.0.0.1:9944:9944/tcp"
restart: unless-stopped
command:
[
Expand All @@ -50,8 +40,10 @@ services:
"${NETWORK_ID}",
"--base-path",
"/var/subspace",
"--pot-external-entropy",
"00000000000000000000661e88ab45dc3b61daec5ccf3cc83532153589b133b9",
"--state-pruning",
"archive",
"--blocks-pruning",
"archive",
"--listen-on",
"/ip4/0.0.0.0/tcp/30333",
"--dsn-listen-on",
Expand All @@ -66,7 +58,6 @@ services:
"1000",
"--rpc-max-connections",
"20000",
"--farmer",
"--name",
"astral",
"--sync",
Expand All @@ -83,6 +74,7 @@ services:
volumes:
- postgres_db:/var/lib/postgresql/data
- ./indexers/db/docker-entrypoint-initdb.d/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
- ./indexers/db/postgresql.conf:/etc/postgresql/postgresql.conf
restart: unless-stopped
hostname: postgres
environment:
Expand All @@ -97,12 +89,14 @@ services:
interval: 5s
timeout: 5s
retries: 5
command: ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"]

# Hasura GraphQL Engine
hasura:
image: hasura/graphql-engine:v2.40.0
depends_on:
- "postgres"
postgres:
condition: service_healthy
volumes:
- ./indexers/db/migrations:/hasura-migrations
- ./indexers/db/metadata:/hasura-metadata
Expand Down Expand Up @@ -140,6 +134,10 @@ services:
# Hasura Migrations and Metadata
HASURA_GRAPHQL_MIGRATIONS_DIR: /hasura-migrations
HASURA_GRAPHQL_METADATA_DIR: /hasura-metadata

# Task Board Action Endpoint
HASURA_GRAPHQL_ACTION_TASK_BOARD: http://taskboard:${BULL_PORT}
HASURA_GRAPHQL_ACTION_TASK_BOARD_SESSION_SECRET: ${BULL_SESSION_SECRET}
ports:
- "${HASURA_GRAPHQL_PORT}:8080"
command:
Expand All @@ -159,7 +157,7 @@ services:
DB_PASS: ${DB_PASSWORD}
DB_DATABASE: ${DB_DATABASE}
DB_HOST: ${DB_HOST}
DB_PORT: 5432
DB_PORT: ${DB_PORT}
volumes:
- ./indexers/dictionary/${DICTIONARY_DIRECTORY}:/dictionary
healthcheck:
Expand All @@ -175,17 +173,19 @@ services:
profiles: [dictionary, indexers]
image: onfinality/subql-query:latest
ports:
- "${DICTIONARY_SUBQUERY_NODE_PORT}:3000"
- "127.0.0.1:${DICTIONARY_SUBQUERY_NODE_PORT}:3000"
depends_on:
- "postgres"
- "dictionary_subquery_node"
"postgres":
condition: service_healthy
"dictionary_subquery_node":
condition: service_healthy
restart: unless-stopped
environment:
DB_USER: ${DB_USER}
DB_PASS: ${DB_PASSWORD}
DB_DATABASE: ${DB_DATABASE}
DB_HOST: ${DB_HOST}
DB_PORT: 5432
DB_PORT: ${DB_PORT}
command:
- --name=dictionary
- --playground
Expand All @@ -195,22 +195,19 @@ services:
profiles: [indexers]
image: subquerynetwork/subql-node-substrate:latest
ports:
- "3001:3000"
- "3001:3001"
depends_on:
"postgres":
condition: service_healthy
"dictionary_subquery_node":
condition: service_healthy
restart: unless-stopped
environment:
ENDPOINT: ${RPC_URLS}
CHAIN_ID: ${CHAIN_ID}
DICTIONARY: http://dictionary_subquery_node:3000
DB_USER: ${DB_USER}
DB_PASS: ${DB_PASSWORD}
DB_DATABASE: ${DB_DATABASE}
DB_HOST: ${DB_HOST}
DB_PORT: 5432
DB_PORT: ${DB_PORT}
volumes:
- ./indexers/${NETWORK_ID}/consensus:/${NETWORK_ID}/consensus
command:
Expand All @@ -222,8 +219,9 @@ services:
- --batch-size=250
- --unfinalized-blocks=true
- --disable-historical=false
- --port 3001
healthcheck:
test: ["CMD", "curl", "-f", "http://consensus_subquery_node:3000/ready"]
test: ["CMD", "curl", "-f", "http://consensus_subquery_node:3001/ready"]
interval: 3s
timeout: 5s
retries: 10
Expand All @@ -232,7 +230,7 @@ services:
profiles: [indexers]
image: subquerynetwork/subql-node-substrate:latest
ports:
- "3002:3000"
- "3002:3002"
depends_on:
"postgres":
condition: service_healthy
Expand All @@ -242,24 +240,25 @@ services:
environment:
ENDPOINT: ${RPC_URLS}
CHAIN_ID: ${CHAIN_ID}
DICTIONARY: http://dictionary_subquery_node:3000
DICTIONARY: http://localhost:3000
DB_USER: ${DB_USER}
DB_PASS: ${DB_PASSWORD}
DB_DATABASE: ${DB_DATABASE}
DB_HOST: ${DB_HOST}
DB_PORT: 5432
DB_PORT: ${DB_PORT}
volumes:
- ./indexers/${NETWORK_ID}/leaderboard:/${NETWORK_ID}/leaderboard
command:
- ${SUB_COMMAND:-} # set SUB_COMMAND env variable to "test" to run tests
- -f=/${NETWORK_ID}/leaderboard
- --db-schema=leaderboard
- --workers=1
- --unsafe
- --batch-size=15
- --disable-historical=true
- --unfinalized-blocks=true
- --disable-historical=false
- --port 3002
healthcheck:
test: ["CMD", "curl", "-f", "http://leaderboard_subquery_node:3000/ready"]
test: ["CMD", "curl", "-f", "http://leaderboard_subquery_node:3002/ready"]
interval: 3s
timeout: 5s
retries: 10
Expand All @@ -268,7 +267,7 @@ services:
profiles: [indexers]
image: subquerynetwork/subql-node-substrate:latest
ports:
- "3003:3000"
- "3003:3003"
depends_on:
"postgres":
condition: service_healthy
Expand All @@ -278,12 +277,12 @@ services:
environment:
ENDPOINT: ${RPC_URLS}
CHAIN_ID: ${CHAIN_ID}
DICTIONARY: http://dictionary_subquery_node:3000
DICTIONARY: http://localhost:3000
DB_USER: ${DB_USER}
DB_PASS: ${DB_PASSWORD}
DB_DATABASE: ${DB_DATABASE}
DB_HOST: ${DB_HOST}
DB_PORT: 5432
DB_PORT: ${DB_PORT}
volumes:
- ./indexers/${NETWORK_ID}/staking:/${NETWORK_ID}/staking
command:
Expand All @@ -294,8 +293,9 @@ services:
- --unsafe
- --batch-size=15
- --disable-historical=true
- --port 3003
healthcheck:
test: ["CMD", "curl", "-f", "http://staking_subquery_node:3000/ready"]
test: ["CMD", "curl", "-f", "http://staking_subquery_node:3003/ready"]
interval: 3s
timeout: 5s
retries: 10
Expand Down Expand Up @@ -327,18 +327,21 @@ services:
build:
context: ./indexers/taskboard
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./indexers/taskboard:/app
hostname: taskboard
restart: unless-stopped
ports:
- "${BULL_PORT}:3000"
- "${BULL_PORT}:${BULL_PORT}"
environment:
BULL_USERNAME: ${BULL_USERNAME}
BULL_PASSWORD: ${BULL_PASSWORD}
BULL_PORT: ${BULL_PORT}
BULL_SESSION_SECRET: ${BULL_SESSION_SECRET}

REDIS_HOST: redis
REDIS_PORT: ${REDIS_PORT}
Expand All @@ -348,3 +351,9 @@ services:
DB_DATABASE: ${DB_DATABASE}
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}

NETWORK_ID: ${NETWORK_ID}
LOG_LEVEL: ${LOG_LEVEL}

SLACK_TOKEN: ${SLACK_TOKEN}
SLACK_CONVERSATION_ID: ${SLACK_CONVERSATION_ID}
Loading
Loading