{"id":18437829,"url":"https://github.com/zilliqa/zq2","last_synced_at":"2026-05-11T11:07:38.910Z","repository":{"id":193537522,"uuid":"593589648","full_name":"Zilliqa/zq2","owner":"Zilliqa","description":"Zilliqa 2.0 code base","archived":false,"fork":false,"pushed_at":"2026-05-05T03:38:45.000Z","size":30924,"stargazers_count":21,"open_issues_count":156,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-05-05T05:32:59.375Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zilliqa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-01-26T11:44:44.000Z","updated_at":"2026-04-30T10:24:19.000Z","dependencies_parsed_at":"2026-01-26T05:05:51.564Z","dependency_job_id":null,"html_url":"https://github.com/Zilliqa/zq2","commit_stats":null,"previous_names":["zilliqa/zq2"],"tags_count":69,"template":false,"template_full_name":null,"purl":"pkg:github/Zilliqa/zq2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zilliqa%2Fzq2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zilliqa%2Fzq2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zilliqa%2Fzq2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zilliqa%2Fzq2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zilliqa","download_url":"https://codeload.github.com/Zilliqa/zq2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zilliqa%2Fzq2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32892002,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-06T06:16:22.293Z","updated_at":"2026-05-11T11:07:38.886Z","avatar_url":"https://github.com/Zilliqa.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/Zilliqa/zq2)\n\n# Zilliqa 2.0 - The next evolution of Zilliqa\n\nFurther documentation can be found in the `docs/` directory, for Zilliqa 2 itself, and in `z2/docs` for the `z2` tool used in conjunction with it.\n\n## Running a Node\n\nTo start a node you need to pass a private key as a command line parameter.\nThis will be interpreted as both a BLS private key and a libp2p secp256k1 private key (of course the corresponding public keys will be different).\n\nYou will need to start at least 4 nodes before the network will begin to make progress.\n\n### Example invocations for a network with 4 nodes\n\nNote: You must include the public key and peer ID of one of the nodes in the config with the argument `-c`\n\n```\ncargo run --bin zilliqa -- 65d7f4da9bedc8fb79cbf6722342960bbdfb9759bc0d9e3fb4989e831ccbc227 -c ./infra/config_docker.toml\ncargo run --bin zilliqa -- 62070b1a3b5b30236e43b4f1bfd617e1af7474635558314d46127a708b9d302e  -c ./infra/config_rpc_disabled.toml\ncargo run --bin zilliqa -- 56d7a450d75c6ba2706ef71da6ca80143ec4971add9c44d7d129a12fa7d3a364 -c ./infra/config_rpc_disabled.toml\ncargo run --bin zilliqa -- db670cbff28f4b15297d03fafdab8f5303d68b7591bd59e31eaef215dd0f246a -c ./infra/config_rpc_disabled.toml\n```\n\nYou may also want to set `RUST_LOG=zilliqa=trace` to see the most detailed level of logs.\n\n### Running with z2\n\nThe `z2` program in this repository will run a small local Zilliqa network for you, for debugging. This will include `otterscan`, `spout`, a mitmweb API proxy and the documentation.\n\n`z2` utility tool usage instructions can be found [here](./z2/docs/README.md). Instructions for running a local network using z2 are [here](./z2/docs/local-network.md).\n\n\n### Bootstrap with docker-compose\n\nAutomated bootstrap of a 4 nodes Zilliqa 2.0 aka zq2 network.\n\nRun:\n\n```bash\ndocker-compose up\n```\n\n## Node configuration\n\nNodes are configured by TOML files.\nPass the path to configuration files on the command line with `-c` or `--config-file`.\nIf multiple configuration files are provided, they will be merged together.\nIf a configuration key occurs in more than one configuration file, the process will exit with an error.\n\nBy default, a node will not expose the JSON-RPC API.\nTo enable APIs, you must set `api_servers` under the [[nodes]] object in the configuration file.\nEach item must be an object with keys `port` and `enabled_apis`.\nEach item in `enabled_apis` must either be:\n\n* A string such as `\"eth\"`, which enables all API methods under the `eth_` namespace.\n* An object of the form `{ namespace = \"eth\", apis = [\"blockNumber\"] }`, which enables specific API methods.\n\nZilliqa APIs which don't have a namespace are implicitly grouped under the `zilliqa` namespace.\n\nSee `config-example.toml` for a configuration example.\n\n## Testing\n\nThe tests can be run with `cargo test`.\nMost tests create an in-memory network of nodes, with the libp2p networking layer stubbed out and send API requests to the network.\n\nSome tests involve compiling Solidity code.\n`svm-rs` will automatically download and use a suitable version for your platform when you run these tests.\n\nTo install `svm-rs` run:\n\n```\ncargo install svm-rs\n```\n\nThen you can install a suitable Solc version by executing:\n\n```\nsvm install \u003csolc version\u003e\n```\n\n### Tests with JMeter\n\nJMeter for performance and load tests is integrated in the Github Action pipelines in `.github/workflows/test_performance.yaml` and can be manually executed from the Github console with custom and default parameters. The test executions are restricted to users of the Zilliqa organization.\n\n## Running benchmarks\n\nBenchmarks can be run with `cargo bench --package zilliqa --bench it`.\nTo run a specific benchmark, append ` -- \u003cbenchmark-name\u003e` to the command.\n\nIt can also be helpful to generate flamegraphs from benchmarks to see where time is being spent.\nAppend `--profile-time \u003ctime in seconds\u003e` to the command to continue running the benchmark for the specified period of time, rather than stopping when enough samples have been gathered.\nYou should select `profile-time` to be long enough to gather a representative set of samples.\n150 seconds has been a reasonable value in testing.\nAfter running this, a flamegraph should exist in `target/criterion/\u003cbenchmark-name\u003e/\u003cbenchmark-name\u003e/profile/flamegraph.svg`.\nMake sure to open the `.svg` in a web browser - the embedded JS provides some useful features for exploring the graph (such as being able to click on functions and CTRL+F).\n\n## Logging\n\nYou can get log output globally via\n\n```unset\nRUST_LOG=zilliqa=[warn|info|debug|trace]\n```\n\nOr via individual modules using eg.\n\n```unset\nRUST_LOG=debug,sled=info,zilliqa::scilla=trace\n```\n\n## Observability\n\n### OpenTelemetry\n\nOpenTelemetry metrics from the Zilliqa nodes container are available when the OTLP collector endpoint is defined in the configuration.\n\n```yaml\notlp_collector_endpoint = \"http://otel-collector:4317\"\n```\n\nThere is a docker-compose project that includes the OpenTelemetry configuration and tech stack that can be run in local environment for testing purposes:\n\n```bash\ndocker-compose -f infra/opentelemetry/compose.yaml up -d\n```\n\nAfter the services are running, a sample dashboard could be obtained from the (Grafana)[http://localhost:9010] local service.\n\n## `rustfmt`\n\nWe use a couple of nightly-only rustfmt features. The easiest way to get these is:\n\n```sh\nrustup toolchain install nightly\ncargo +nightly fmt\n```\n\n## Supported APIs\n\nThe supported API table is now auto-generated. You can get one by running:\n\n```sh\n./scripts/zq2 doc-gen /tmp/mydir\n```\n\nand then looking in `/tmp/mydir/supported_apis.md`\n\nOf the currently undocumented APIs, the following are partially implemented:\n\n  * `eth_getBlockByHash` (issue #79)\n  * `eth_getBlockByNumber` (issue #79)\n  * `net_peerCount`\n\n## zurl - IAP Tunnel Curl Wrapper\n\n`zurl` is a curl wrapper that automatically manages Google Cloud IAP tunnels for accessing private instances.\n\n### Usage\n\nLogin to GCP and set the environment variables and paths.\n\n```sh\nsource scripts/setenv\n```\n\nUse exactly like curl, but with your private instance hostname:\n\n```bash\nzurl [curl-options] \"instance-name:port[/path]\"\n```\n\nTo see more information, you can use the --debug parameter:\n\n```bash\nzurl --debug [curl-options] \"instance-name:port[/path]\"\n```\n\n### Project Auto-Detection\n\nAutomatically selects the correct GCP project based on instance name:\n- `zq2-devnet-*` → `prj-d-zq2-devnet-c83bkpsd`\n- `zq2-testnet-*` → `prj-d-zq2-testnet-g13pnaa8`\n- `zq2-mainnet-*` → `prj-p-zq2-mainnet-sn5n8wfl`\n- Default: `prj-p-zq2-mainnet-sn5n8wfl`\n\n### Example\n\n```bash\nzurl -d '{\n    \"id\": \"1\",\n    \"jsonrpc\": \"2.0\", \n    \"method\": \"eth_blockNumber\"\n}' -H \"Content-Type: application/json\" -X POST \"zq2-devnet-api-ase1-2:4201\"\n```\n\nOutput:\n```\n{\"jsonrpc\":\"2.0\",\"id\":\"1\",\"result\":\"0x17a2b\"}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzilliqa%2Fzq2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzilliqa%2Fzq2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzilliqa%2Fzq2/lists"}