diff --git a/.github/subway-configs/asset-hub-kusama.yml b/.github/subway-configs/asset-hub-kusama.yml deleted file mode 100644 index bca7890bd0..0000000000 --- a/.github/subway-configs/asset-hub-kusama.yml +++ /dev/null @@ -1,52 +0,0 @@ -extensions: - client: - endpoints: - - wss://sys.ibp.network/asset-hub-kusama - - wss://asset-hub-kusama.dotters.network - - wss://asset-hub-kusama-rpc.n.dwellir.com - - wss://kusama-asset-hub-rpc.polkadot.io - shuffle_endpoints: true - event_bus: - substrate_api: - stale_timeout_seconds: 180 - telemetry: - provider: none - cache: - default_ttl_seconds: 3600 - default_size: 1000 - merge_subscription: - keep_alive_seconds: 120 - server: - port: {{PORT}} - listen_address: '127.0.0.1' - max_connections: 2000 - max_batch_size: 10 - request_timeout_seconds: 120 - http_methods: - - path: /health - method: system_health - - path: /liveness - method: chain_getBlockHash - cors: null - rate_limit: - connection: - burst: 100 - period_secs: 1 - jitter_up_to_millis: 100 - ip: - burst: 1000 - period_secs: 10 - jitter_up_to_millis: 100 - use_xff: false - -middlewares: - methods: - - response - - inject_params - - cache - - upstream - subscriptions: - - merge_subscription - - upstream - -rpcs: substrate diff --git a/.github/subway-configs/asset-hub-polkadot.yml b/.github/subway-configs/asset-hub-polkadot.yml deleted file mode 100644 index 387f07b1a0..0000000000 --- a/.github/subway-configs/asset-hub-polkadot.yml +++ /dev/null @@ -1,52 +0,0 @@ -extensions: - client: - endpoints: - - wss://sys.ibp.network/asset-hub-polkadot - - wss://asset-hub-polkadot.dotters.network - - wss://polkadot-asset-hub-rpc.polkadot.io - - wss://asset-hub-polkadot-rpc.n.dwellir.com - shuffle_endpoints: true - event_bus: - substrate_api: - stale_timeout_seconds: 180 - telemetry: - provider: none - cache: - default_ttl_seconds: 3600 - default_size: 1000 - merge_subscription: - keep_alive_seconds: 120 - server: - port: {{PORT}} - listen_address: '127.0.0.1' - max_connections: 2000 - max_batch_size: 10 - request_timeout_seconds: 120 - http_methods: - - path: /health - method: system_health - - path: /liveness - method: chain_getBlockHash - cors: null - rate_limit: - connection: - burst: 100 - period_secs: 1 - jitter_up_to_millis: 100 - ip: - burst: 1000 - period_secs: 10 - jitter_up_to_millis: 100 - use_xff: false - -middlewares: - methods: - - response - - inject_params - - cache - - upstream - subscriptions: - - merge_subscription - - upstream - -rpcs: substrate diff --git a/.github/subway-configs/bridge-hub-kusama.yml b/.github/subway-configs/bridge-hub-kusama.yml deleted file mode 100644 index 38bc6c498a..0000000000 --- a/.github/subway-configs/bridge-hub-kusama.yml +++ /dev/null @@ -1,51 +0,0 @@ -extensions: - client: - endpoints: - - wss://sys.ibp.network/bridgehub-kusama - - wss://bridge-hub-kusama.dotters.network - - wss://kusama-bridge-hub-rpc.polkadot.io - shuffle_endpoints: true - event_bus: - substrate_api: - stale_timeout_seconds: 180 - telemetry: - provider: none - cache: - default_ttl_seconds: 3600 - default_size: 1000 - merge_subscription: - keep_alive_seconds: 120 - server: - port: {{PORT}} - listen_address: '127.0.0.1' - max_connections: 2000 - max_batch_size: 10 - request_timeout_seconds: 120 - http_methods: - - path: /health - method: system_health - - path: /liveness - method: chain_getBlockHash - cors: null - rate_limit: - connection: - burst: 100 - period_secs: 1 - jitter_up_to_millis: 100 - ip: - burst: 1000 - period_secs: 10 - jitter_up_to_millis: 100 - use_xff: false - -middlewares: - methods: - - response - - inject_params - - cache - - upstream - subscriptions: - - merge_subscription - - upstream - -rpcs: substrate diff --git a/.github/subway-configs/bridge-hub-polkadot.yml b/.github/subway-configs/bridge-hub-polkadot.yml deleted file mode 100644 index 3bc02a56d7..0000000000 --- a/.github/subway-configs/bridge-hub-polkadot.yml +++ /dev/null @@ -1,51 +0,0 @@ -extensions: - client: - endpoints: - - wss://sys.ibp.network/bridgehub-polkadot - - wss://bridge-hub-polkadot.dotters.network - - wss://bridge-hub-polkadot-rpc.n.dwellir.com - shuffle_endpoints: true - event_bus: - substrate_api: - stale_timeout_seconds: 180 - telemetry: - provider: none - cache: - default_ttl_seconds: 3600 - default_size: 1000 - merge_subscription: - keep_alive_seconds: 120 - server: - port: {{PORT}} - listen_address: '127.0.0.1' - max_connections: 2000 - max_batch_size: 10 - request_timeout_seconds: 120 - http_methods: - - path: /health - method: system_health - - path: /liveness - method: chain_getBlockHash - cors: null - rate_limit: - connection: - burst: 100 - period_secs: 1 - jitter_up_to_millis: 100 - ip: - burst: 1000 - period_secs: 10 - jitter_up_to_millis: 100 - use_xff: false - -middlewares: - methods: - - response - - inject_params - - cache - - upstream - subscriptions: - - merge_subscription - - upstream - -rpcs: substrate diff --git a/.github/subway-configs/collectives-polkadot.yml b/.github/subway-configs/collectives-polkadot.yml deleted file mode 100644 index 75614f4d67..0000000000 --- a/.github/subway-configs/collectives-polkadot.yml +++ /dev/null @@ -1,51 +0,0 @@ -extensions: - client: - endpoints: - - wss://sys.ibp.network/collectives-polkadot - - wss://collectives-polkadot.dotters.network - - wss://collectives-polkadot-rpc.n.dwellir.com - shuffle_endpoints: true - event_bus: - substrate_api: - stale_timeout_seconds: 180 - telemetry: - provider: none - cache: - default_ttl_seconds: 3600 - default_size: 1000 - merge_subscription: - keep_alive_seconds: 120 - server: - port: {{PORT}} - listen_address: '127.0.0.1' - max_connections: 2000 - max_batch_size: 10 - request_timeout_seconds: 120 - http_methods: - - path: /health - method: system_health - - path: /liveness - method: chain_getBlockHash - cors: null - rate_limit: - connection: - burst: 100 - period_secs: 1 - jitter_up_to_millis: 100 - ip: - burst: 1000 - period_secs: 10 - jitter_up_to_millis: 100 - use_xff: false - -middlewares: - methods: - - response - - inject_params - - cache - - upstream - subscriptions: - - merge_subscription - - upstream - -rpcs: substrate diff --git a/.github/subway-configs/coretime-kusama.yml b/.github/subway-configs/coretime-kusama.yml deleted file mode 100644 index 88a7ff9491..0000000000 --- a/.github/subway-configs/coretime-kusama.yml +++ /dev/null @@ -1,50 +0,0 @@ -extensions: - client: - endpoints: - - wss://sys.ibp.network/coretime-kusama - - wss://coretime-kusama.dotters.network - shuffle_endpoints: true - event_bus: - substrate_api: - stale_timeout_seconds: 180 - telemetry: - provider: none - cache: - default_ttl_seconds: 3600 - default_size: 1000 - merge_subscription: - keep_alive_seconds: 120 - server: - port: {{PORT}} - listen_address: '127.0.0.1' - max_connections: 2000 - max_batch_size: 10 - request_timeout_seconds: 120 - http_methods: - - path: /health - method: system_health - - path: /liveness - method: chain_getBlockHash - cors: null - rate_limit: - connection: - burst: 100 - period_secs: 1 - jitter_up_to_millis: 100 - ip: - burst: 1000 - period_secs: 10 - jitter_up_to_millis: 100 - use_xff: false - -middlewares: - methods: - - response - - inject_params - - cache - - upstream - subscriptions: - - merge_subscription - - upstream - -rpcs: substrate diff --git a/.github/subway-configs/coretime-polkadot.yml b/.github/subway-configs/coretime-polkadot.yml deleted file mode 100644 index 6f66763af7..0000000000 --- a/.github/subway-configs/coretime-polkadot.yml +++ /dev/null @@ -1,51 +0,0 @@ -extensions: - client: - endpoints: - - wss://sys.ibp.network/coretime-polkadot - - wss://coretime-polkadot.dotters.network - - wss://polkadot-coretime-rpc.polkadot.io - shuffle_endpoints: true - event_bus: - substrate_api: - stale_timeout_seconds: 180 - telemetry: - provider: none - cache: - default_ttl_seconds: 3600 - default_size: 1000 - merge_subscription: - keep_alive_seconds: 120 - server: - port: {{PORT}} - listen_address: '127.0.0.1' - max_connections: 2000 - max_batch_size: 10 - request_timeout_seconds: 120 - http_methods: - - path: /health - method: system_health - - path: /liveness - method: chain_getBlockHash - cors: null - rate_limit: - connection: - burst: 100 - period_secs: 1 - jitter_up_to_millis: 100 - ip: - burst: 1000 - period_secs: 10 - jitter_up_to_millis: 100 - use_xff: false - -middlewares: - methods: - - response - - inject_params - - cache - - upstream - subscriptions: - - merge_subscription - - upstream - -rpcs: substrate diff --git a/.github/subway-configs/kusama.yml b/.github/subway-configs/kusama.yml deleted file mode 100644 index f898534037..0000000000 --- a/.github/subway-configs/kusama.yml +++ /dev/null @@ -1,51 +0,0 @@ -extensions: - client: - endpoints: - - wss://kusama-rpc.n.dwellir.com - - wss://rpc.ibp.network/kusama - - wss://kusama.dotters.network - shuffle_endpoints: true - event_bus: - substrate_api: - stale_timeout_seconds: 180 - telemetry: - provider: none - cache: - default_ttl_seconds: 3600 - default_size: 1000 - merge_subscription: - keep_alive_seconds: 120 - server: - port: {{PORT}} - listen_address: '127.0.0.1' - max_connections: 2000 - max_batch_size: 10 - request_timeout_seconds: 120 - http_methods: - - path: /health - method: system_health - - path: /liveness - method: chain_getBlockHash - cors: null - rate_limit: - connection: - burst: 100 - period_secs: 1 - jitter_up_to_millis: 100 - ip: - burst: 1000 - period_secs: 10 - jitter_up_to_millis: 100 - use_xff: false - -middlewares: - methods: - - response - - inject_params - - cache - - upstream - subscriptions: - - merge_subscription - - upstream - -rpcs: substrate diff --git a/.github/subway-configs/people-polkadot.yml b/.github/subway-configs/people-polkadot.yml deleted file mode 100644 index 5edb819214..0000000000 --- a/.github/subway-configs/people-polkadot.yml +++ /dev/null @@ -1,51 +0,0 @@ -extensions: - client: - endpoints: - - wss://sys.ibp.network/people-polkadot - - wss://people-polkadot.dotters.network - - wss://polkadot-people-rpc.polkadot.io - shuffle_endpoints: true - event_bus: - substrate_api: - stale_timeout_seconds: 180 - telemetry: - provider: none - cache: - default_ttl_seconds: 3600 - default_size: 1000 - merge_subscription: - keep_alive_seconds: 120 - server: - port: {{PORT}} - listen_address: '127.0.0.1' - max_connections: 2000 - max_batch_size: 10 - request_timeout_seconds: 120 - http_methods: - - path: /health - method: system_health - - path: /liveness - method: chain_getBlockHash - cors: null - rate_limit: - connection: - burst: 100 - period_secs: 1 - jitter_up_to_millis: 100 - ip: - burst: 1000 - period_secs: 10 - jitter_up_to_millis: 100 - use_xff: false - -middlewares: - methods: - - response - - inject_params - - cache - - upstream - subscriptions: - - merge_subscription - - upstream - -rpcs: substrate diff --git a/.github/subway-configs/polkadot.yml b/.github/subway-configs/polkadot.yml deleted file mode 100644 index f54627bac8..0000000000 --- a/.github/subway-configs/polkadot.yml +++ /dev/null @@ -1,51 +0,0 @@ -extensions: - client: - endpoints: - - wss://rpc.ibp.network/polkadot - - wss://polkadot.dotters.network - - wss://polkadot-rpc.n.dwellir.com - shuffle_endpoints: true - event_bus: - substrate_api: - stale_timeout_seconds: 180 - telemetry: - provider: none - cache: - default_ttl_seconds: 3600 - default_size: 1000 - merge_subscription: - keep_alive_seconds: 120 - server: - port: {{PORT}} - listen_address: '127.0.0.1' - max_connections: 2000 - max_batch_size: 10 - request_timeout_seconds: 120 - http_methods: - - path: /health - method: system_health - - path: /liveness - method: chain_getBlockHash - cors: null - rate_limit: - connection: - burst: 100 - period_secs: 1 - jitter_up_to_millis: 100 - ip: - burst: 1000 - period_secs: 10 - jitter_up_to_millis: 100 - use_xff: false - -middlewares: - methods: - - response - - inject_params - - cache - - upstream - subscriptions: - - merge_subscription - - upstream - -rpcs: substrate diff --git a/.github/subway-configs/people-kusama.yml b/.github/subway-configs/template.yml similarity index 89% rename from .github/subway-configs/people-kusama.yml rename to .github/subway-configs/template.yml index b9449c5c71..59c1838a8a 100644 --- a/.github/subway-configs/people-kusama.yml +++ b/.github/subway-configs/template.yml @@ -1,8 +1,6 @@ extensions: client: - endpoints: - - wss://kusama-people-rpc.polkadot.io - - wss://people-kusama.dotters.network + endpoints: {{ENDPOINTS}} shuffle_endpoints: true event_bus: substrate_api: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c05de41e0a..959809cd8b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -361,20 +361,20 @@ jobs: - name: "polkadot" test_dir: "packages/polkadot" chains: - - { config: "polkadot.yml", port: 9000, endpoint_var: "POLKADOT_ENDPOINT" } - - { config: "asset-hub-polkadot.yml", port: 9001, endpoint_var: "ASSETHUBPOLKADOT_ENDPOINT" } - - { config: "bridge-hub-polkadot.yml", port: 9002, endpoint_var: "BRIDGEHUBPOLKADOT_ENDPOINT" } - - { config: "collectives-polkadot.yml", port: 9003, endpoint_var: "COLLECTIVESPOLKADOT_ENDPOINT" } - - { config: "coretime-polkadot.yml", port: 9004, endpoint_var: "CORETIMEPOLKADOT_ENDPOINT" } - - { config: "people-polkadot.yml", port: 9005, endpoint_var: "PEOPLEPOLKADOT_ENDPOINT" } + - { chain: "polkadot", port: 9000, endpoint_var: "POLKADOT_ENDPOINT" } + - { chain: "asset-hub-polkadot", port: 9001, endpoint_var: "ASSETHUBPOLKADOT_ENDPOINT" } + - { chain: "bridge-hub-polkadot", port: 9002, endpoint_var: "BRIDGEHUBPOLKADOT_ENDPOINT" } + - { chain: "collectives-polkadot", port: 9003, endpoint_var: "COLLECTIVESPOLKADOT_ENDPOINT" } + - { chain: "coretime-polkadot", port: 9004, endpoint_var: "CORETIMEPOLKADOT_ENDPOINT" } + - { chain: "people-polkadot", port: 9005, endpoint_var: "PEOPLEPOLKADOT_ENDPOINT" } - name: "kusama" test_dir: "packages/kusama" chains: - - { config: "kusama.yml", port: 9010, endpoint_var: "KUSAMA_ENDPOINT" } - - { config: "asset-hub-kusama.yml", port: 9011, endpoint_var: "ASSETHUBKUSAMA_ENDPOINT" } - - { config: "bridge-hub-kusama.yml", port: 9012, endpoint_var: "BRIDGEHUBKUSAMA_ENDPOINT" } - - { config: "coretime-kusama.yml", port: 9013, endpoint_var: "CORETIMEKUSAMA_ENDPOINT" } - - { config: "people-kusama.yml", port: 9014, endpoint_var: "PEOPLEKUSAMA_ENDPOINT" } + - { chain: "kusama", port: 9010, endpoint_var: "KUSAMA_ENDPOINT" } + - { chain: "asset-hub-kusama", port: 9011, endpoint_var: "ASSETHUBKUSAMA_ENDPOINT" } + - { chain: "bridge-hub-kusama", port: 9012, endpoint_var: "BRIDGEHUBKUSAMA_ENDPOINT" } + - { chain: "coretime-kusama", port: 9013, endpoint_var: "CORETIMEKUSAMA_ENDPOINT" } + - { chain: "people-kusama", port: 9014, endpoint_var: "PEOPLEKUSAMA_ENDPOINT" } steps: - name: Free Disk Space (Ubuntu) if: ${{ runner.environment == 'github-hosted' }} @@ -406,20 +406,26 @@ jobs: echo "Starting all Subway instances for ${{ matrix.network.name }}..." # Start each subway instance - echo '${{ toJSON(matrix.network.chains) }}' | jq -c '.[]' | while read chain; do - CONFIG=$(echo $chain | jq -r '.config') - PORT=$(echo $chain | jq -r '.port') + echo '${{ toJSON(matrix.network.chains) }}' | jq -c '.[]' | while IFS= read -r chain; do + CHAIN_NAME=$(echo "$chain" | jq -r '.chain') + PORT=$(echo "$chain" | jq -r '.port') - echo "Starting Subway for $CONFIG on port $PORT..." - sed "s/{{PORT}}/$PORT/g" .github/subway-configs/$CONFIG > /tmp/subway-$PORT.yml + ENDPOINTS=$(jq -c --arg chain "$CHAIN_NAME" '.[] | select(.name == $chain) | .uris' .github/workflows/runtimes-matrix.json) + if [ -z "$ENDPOINTS" ] || [ "$ENDPOINTS" = "null" ]; then + echo "ERROR: No endpoints found for $CHAIN_NAME in runtimes-matrix.json" + exit 1 + fi + + echo "Starting Subway for $CHAIN_NAME on port $PORT..." + sed -e "s/{{PORT}}/$PORT/g" -e "s|{{ENDPOINTS}}|$ENDPOINTS|g" .github/subway-configs/template.yml > /tmp/subway-$PORT.yml subway --config /tmp/subway-$PORT.yml > /tmp/subway-$PORT.log 2>&1 & echo $! >> /tmp/subway.pids done # Wait for all subways to start echo "Waiting for all Subway instances to start..." - echo '${{ toJSON(matrix.network.chains) }}' | jq -c '.[]' | while read chain; do - PORT=$(echo $chain | jq -r '.port') + echo '${{ toJSON(matrix.network.chains) }}' | jq -c '.[]' | while IFS= read -r chain; do + PORT=$(echo "$chain" | jq -r '.port') timeout=60 elapsed=0 while [ $elapsed -lt $timeout ]; do @@ -448,9 +454,9 @@ jobs: - name: Setup endpoint and runtime overrides run: | # Set all subway endpoint environment variables - echo '${{ toJSON(matrix.network.chains) }}' | jq -c '.[]' | while read chain; do - ENDPOINT_VAR=$(echo $chain | jq -r '.endpoint_var') - PORT=$(echo $chain | jq -r '.port') + echo '${{ toJSON(matrix.network.chains) }}' | jq -c '.[]' | while IFS= read -r chain; do + ENDPOINT_VAR=$(echo "$chain" | jq -r '.endpoint_var') + PORT=$(echo "$chain" | jq -r '.port') echo "${ENDPOINT_VAR}=ws://localhost:${PORT}" >> $GITHUB_ENV done