{"id":19336554,"url":"https://github.com/subsquid/query-gateway","last_synced_at":"2026-05-16T02:39:42.188Z","repository":{"id":241493803,"uuid":"806442678","full_name":"subsquid/query-gateway","owner":"subsquid","description":"HTTP gateway for executing data queries against SQD Network","archived":false,"fork":false,"pushed_at":"2024-10-30T11:25:15.000Z","size":278,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-06T10:11:40.904Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://network.subsquid.io","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/subsquid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-27T07:56:39.000Z","updated_at":"2024-10-30T07:58:42.000Z","dependencies_parsed_at":"2024-05-28T19:29:16.934Z","dependency_job_id":"eb0d647d-563a-4e55-81ce-b7785c29c9d8","html_url":"https://github.com/subsquid/query-gateway","commit_stats":null,"previous_names":["subsquid/query-gateway"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subsquid%2Fquery-gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subsquid%2Fquery-gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subsquid%2Fquery-gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subsquid%2Fquery-gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/subsquid","download_url":"https://codeload.github.com/subsquid/query-gateway/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240441873,"owners_count":19801791,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T03:11:38.635Z","updated_at":"2026-05-16T02:39:42.135Z","avatar_url":"https://github.com/subsquid.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Query gateway\n\nThis is an application that connects to the worker network and executes queries submitted via HTTP.\n\n## Running\n\n```\nUsage: query-gateway [OPTIONS] --network \u003cNETWORK\u003e\n\nOptions:\n  -k, --key \u003cKEY\u003e\n          Path to libp2p key file [env: KEY_PATH=]\n      --p2p-listen-addrs \u003cP2P_LISTEN_ADDRS\u003e...\n          Addresses on which the p2p node will listen [env: P2P_LISTEN_ADDRS=] [default: /ip4/0.0.0.0/udp/0/quic-v1]\n      --p2p-public-addrs \u003cP2P_PUBLIC_ADDRS\u003e...\n          Public address(es) on which the p2p node can be reached [env: P2P_PUBLIC_ADDRS=]\n      --boot-nodes \u003cBOOT_NODES\u003e...\n          Connect to boot node '\u003cpeer_id\u003e \u003caddress\u003e'. [env: BOOT_NODES=]\n      --rpc-url \u003cRPC_URL\u003e\n          Blockchain RPC URL [env: RPC_URL=] [default: http://127.0.0.1:8545/]\n      --l1-rpc-url \u003cL1_RPC_URL\u003e\n          Layer 1 blockchain RPC URL. If not provided, rpc_url is assumed to be L1 [env: L1_RPC_URL=]\n      --gateway-registry-contract-addr \u003cGATEWAY_REGISTRY_CONTRACT_ADDR\u003e\n          [env: GATEWAY_REGISTRY_CONTRACT_ADDR=]\n      --worker-registration-contract-addr \u003cWORKER_REGISTRATION_CONTRACT_ADDR\u003e\n          [env: WORKER_REGISTRATION_CONTRACT_ADDR=]\n      --network-controller-contract-addr \u003cNETWORK_CONTROLLER_CONTRACT_ADDR\u003e\n          [env: NETWORK_CONTROLLER_CONTRACT_ADDR=]\n      --allocations-viewer-contract-addr \u003cALLOCATIONS_VIEWER_CONTRACT_ADDR\u003e\n          [env: ALLOCATIONS_VIEWER_CONTRACT_ADDR=]\n      --multicall-contract-addr \u003cMULTICALL_CONTRACT_ADDR\u003e\n          [env: MULTICALL_CONTRACT_ADDR=]\n      --network \u003cNETWORK\u003e\n          Network to connect to (mainnet or testnet) [env: NETWORK=] [possible values: tethys, mainnet]\n      --http-listen \u003cHTTP_LISTEN\u003e\n          HTTP server listen addr [env: HTTP_LISTEN_ADDR=] [default: 0.0.0.0:8000]\n      --config-path \u003cCONFIG_PATH\u003e\n          Path to config file [env: CONFIG_PATH=] [default: config.yml]\n      --allocations-db-path \u003cALLOCATIONS_DB_PATH\u003e\n          Path to allocations database file [env: ALLOCATIONS_DB_PATH=] [default: allocations.db]\n  -h, --help\n          Print help\n  -V, --version\n          Print version\n\n```\n\nWhen the process is running, first one needs to get a worker for the query:\n```\n$ curl 127.0.0.1:8000/network/ethereum-mainnet/16145000/worker\n127.0.0.1:8000/query/czM6Ly9ldGhhLW1haW5uZXQtc2lh/12D3KooWH8MFWwU9CNKuGBxMQypELByRM8jBBgp3gKxqomMbCCXb\n```\n\nThe returned URL can be further used to submit the query:\n```\n$ curl -X POST 127.0.0.1:8000/query/czM6Ly9ldGhhLW1haW5uZXQtc2lh/12D3KooWH8MFWwU9CNKuGBxMQypELByRM8jBBgp3gKxqomMbCCXb -d '{\"fromBlock\": 16145000, \"toBlock\": 16146000, \"transactions\": [{\"to\": [\"0x9cb7712c6a91506e69e8751fcb08e72e1256477d\"], \"sighash\": [\"0x8ca887ca\"]}], \"logs\": [{\"address\": [\"0x0f98431c8ad98523631ae4a59f267346ea31f984\"], \"topic0\": [\"0x783cca1c0412dd0d695e784568c96da2e9c22ff989357a2e8b1d9b2b4e6b7118\"]}, {\"address\": [\"0xc36442b4a4522e871399cd717abdd847ab11fe88\"], \"topic0\": [\"0x3067048beee31b25b2f1681f88dac838c8bba36af25bfb2b7cf7473a5847e35f\", \"0x26f6a048ee9138f2c0ce266f322cb99228e8d619ae2bff30c67f8dcf9d2377b4\", \"0x40d0efd1a53d60ecbf40971b9daf7dc90178c3aadc7aab1765632738fa8b8f01\", \"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\"]}, {\"topic0\": [\"0x0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c\", \"0x7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde\", \"0x98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c95\", \"0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67\"]}], \"fields\": {\"log\": {\"address\": true, \"topics\": true, \"data\": true, \"transaction\": true}, \"transaction\": {\"from\": true, \"to\": true, \"gasPrice\": true, \"gas\": true}}}' -o result\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n100  391k  100  390k  100  1108  1248k   3540 --:--:-- --:--:-- --:--:-- 1256k\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubsquid%2Fquery-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsubsquid%2Fquery-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubsquid%2Fquery-gateway/lists"}