{"id":13632892,"url":"https://github.com/paritytech/polkadot-launch","last_synced_at":"2025-12-14T20:56:20.090Z","repository":{"id":37355997,"uuid":"292541678","full_name":"paritytech/polkadot-launch","owner":"paritytech","description":"Simple CLI tool to launch a local Polkadot test network","archived":false,"fork":false,"pushed_at":"2023-02-04T03:16:40.000Z","size":255760,"stargazers_count":463,"open_issues_count":43,"forks_count":95,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-04T11:49:06.055Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paritytech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-09-03T10:47:14.000Z","updated_at":"2025-03-26T00:23:28.000Z","dependencies_parsed_at":"2024-01-03T05:14:29.336Z","dependency_job_id":"f64bd2e2-f84a-4803-a24d-835e9b2ac7ac","html_url":"https://github.com/paritytech/polkadot-launch","commit_stats":null,"previous_names":["shawntabrizi/polkadot-launch"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritytech%2Fpolkadot-launch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritytech%2Fpolkadot-launch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritytech%2Fpolkadot-launch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritytech%2Fpolkadot-launch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paritytech","download_url":"https://codeload.github.com/paritytech/polkadot-launch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249525,"owners_count":20908212,"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-08-01T22:03:22.133Z","updated_at":"2025-12-14T20:56:20.037Z","avatar_url":"https://github.com/paritytech.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# ⚠️ Deprecated ⚠️\n\nThis project has been deprecated. Please use one of the following alternatives:\n- [zombienet](https://github.com/paritytech/zombienet)\n- [parachain-launch](https://github.com/open-web3-stack/parachain-launch)\n\n# polkadot-launch\n\nSimple CLI tool to launch a local [Polkadot](https://github.com/paritytech/polkadot/) test network.\n\n## Install\n\n```\nyarn global add polkadot-launch\n```\n\nOr, if you use `npm`:\n\n```bash\nnpm i polkadot-launch -g\n```\n\n## Binary Files\n\nTo use polkadot-launch, you need to have binary files for a `polkadot` relay chain and a\n`polkadot-parachain` in the bin folder.\n\n\u003e If you are on an Apple M1 ARM chip, make sure you are using the `stable-aarch64-apple-darwin` toolchain to compile the binaries.\n\nYou can generate these files by cloning the `rococo-v1` branch of these projects in the same root as the polkadot-launch repo\nand building them with the specific flags below:\n\n```bash\ngit clone https://github.com/paritytech/polkadot\ncd polkadot\ncargo build --release\ncp ./target/release/polkadot ../polkadot-launch/bin/polkadot-relaychain\n```\n\nand\n\n```\ngit clone https://github.com/paritytech/cumulus\ncd cumulus\ncargo build --release -p polkadot-parachain\ncp ./target/release/polkadot-parachain ../polkadot-launch/bin/polkadot-parachain\n```\n\n## Use\n\n```bash\npolkadot-launch config.json\n```\n\n### Configuration File\n\nThe required configuration file defines the properties of the network you want to set up.\nYou may use a json or a js file.\n\nYou can see the examples:\n- [config.json](config.json)\n- [config.js](config.js)\n\nYou may find the .js alternative more convenient if you need comments, trailing commas or if you prefer do dedup some portions of the config.\n\n#### `relaychain`\n\n- `bin`: The path of the [Polkadot relay chain binary](https://github.com/paritytech/polkadot/) used\n  to setup your test network. For example `\u003cpath/to/polkadot\u003e/target/release/polkadot`.\n- `chain`: The chain you want to use to generate your spec (probably `rococo-local`).\n- `nodes`: An array of nodes that will be validators on the relay chain.\n  - `name`: Must be one of `alice`, `bob`, `charlie`, or `dave`.\n  - `wsPort`: The websocket port for this node.\n  - `port`: The TCP port for this node.\n  - `nodeKey`: a secret key used for generating libp2p peer identifier. Optional.\n  - `basePath`: The directory used for the blockchain db and other outputs. When unspecified, we use\n    `--tmp`.\n  - `flags`: Any additional command line flags you want to add when starting your node.\n- `genesis`: A JSON object of the properties you want to modify from the genesis configuration.\n  Non-specified properties will be unchanged from the original genesis configuration.\n\nThese variable are fed directly into the Polkadot binary and used to spawn a node:\n\n```bash\n\u003cbin\u003e \\\n    --chain=\u003cchain\u003e-raw.json \\\n    --tmp \\\n    --ws-port=\u003cwsPort\u003e \\\n    --port=\u003cport\u003e \\\n    --\u003cname\u003e \\\n```\n\nAn example of `genesis` is:\n\n```json\n\"genesis\": {\n  \"runtime\": {\n    \"runtime_genesis_config\": {\n      \"configuration\": {\n        \"config\": {\n          \"validation_upgrade_frequency\": 10,\n          \"validation_upgrade_delay\": 10\n        }\n      },\n      \"palletCollective\": {\n        \"members\": [\"5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY\", \"5DbKjhNLpqX3zqZdNBc9BGb4fHU1cRBaDhJUskrvkwfraDi6\"]\n      }\n    },\n    \"session_length_in_blocks\": 10\n  }\n}\n```\n\nAll `genesis` properties can be found in the chainspec output:\n\n```bash\n./polkadot build-spec --chain=rococo-local --disable-default-bootnode\n```\n\n#### `parachains`\n\n`parachains` is an array of objects that consists of:\n\n- `bin`: The path of the [collator node\n  binary](https://github.com/substrate-developer-hub/substrate-parachain-template) used to create\n  blocks for your parachain. For example\n  `\u003cpath/to/substrate-parachain-template\u003e/target/release/polkadot-parachain`.\n- `id`: The id to assign to this parachain. Must be unique.\n- `wsPort`: The websocket port for this node.\n- `port`: The TCP port for this node.\n- `balance`: (Optional) Configure a starting amount of balance on the relay chain for this chain's\n  account ID.\n- `chain`: (Optional) Configure an alternative chain specification to be used for launching the\n  parachain.\n- `basePath`: The directory used for the blockchain db and other outputs. When unspecified, we use\n  `--tmp`.\n- `flags`: Any additional command line flags you want to add when starting your node.\n\nThese variables are fed directly into the collator binary and used to spawn a node:\n\n```bash\n\u003cbin\u003e \\\n    --tmp \\\n    --ws-port=\u003cwsPort\u003e \\\n    --port=\u003cport\u003e \\\n    --parachain-id=\u003cid\u003e \\\n    --validator \\\n    --chain=\u003cchain\u003e\n    -- \\\n    --chain=\u003crelaychain.chain\u003e-raw.json \\\n```\n\n#### `simpleParachains`\n\nThis is similar to `parachains` but for \"simple\" collators like the adder-collator, a very simple\ncollator that lives in the polkadot repo and is meant just for simple testing. It supports a subset\nof configuration values:\n\n- `bin`: The path to the collator binary.\n- `id`: The id to assign to this parachain. Must be unique.\n- `port`: The TCP port for this node.\n- `balance`: (Optional) Configure a starting amount of balance on the relay chain for this chain's\n  account ID.\n\n#### `hrmpChannels`\n\nOpen HRMP channels between the specified parachains so that it's possible to send messages between\nthose. Keep in mind that an HRMP channel is unidirectional and in case you need to communicate both\nways you need to open channels in both directions.\n\n```json\n\"hrmpChannels\": [\n    {\n        \"sender\": \"200\",\n        \"recipient\": \"300\",\n        \"maxCapacity\": 8,\n        \"maxMessageSize\": 512\n    }\n]\n```\n\n#### `types`\n\nThese are the Polkadot JS types you might need to include so that Polkadot JS will be able to\ninterface properly with your runtime.\n\n```json\n\"types\": {\n    \"HrmpChannelId\": {\n        \"sender\": \"u32\",\n        \"receiver\": \"u32\"\n    }\n}\n```\n\nOr you can specify a path to the type definition json file instead:\n\n```json\n\"types\": \"./typedefs.json\"\n```\n\n#### `finalization`\n\nA simple boolean flag for whether you want to make sure all of the transactions submitted in\npolkadot-launch wait for finalization.\n\n## How Does It Work?\n\nThis tool just automates the steps needed to spin up multiple relay chain nodes and parachain nodes\nin order to create a local test network.\n\nYou can add the `-v` or `--verbose` flag to see what processes it is invoking and with which arguments.\n\n- [`child_process`](https://nodejs.org/api/child_process.html) is used to execute commands on your\n  node:\n  - We build a fresh chain spec using the `chain` parameter specified in your config.\n    - Includes the authorities you specified.\n    - Includes changes to the `paras`.\n    - Includes parachains you have added.\n      - `wasm` is generated using the `\u003cnode\u003e export-genesis-wasm` subcommand.\n      - `header` is retrieved by calling `api.rpc.chain.getHeader(genesis_hash)`.\n    - The final file is named `\u003cchain\u003e-raw.json`.\n  - We spawn new node instances using the information provided in your config. Each node produces a\n    `\u003cname\u003e.log` file in your working directory that you can use to track the output. For example:\n    ```bash\n    tail -f alice.log # Alice validator on the relay chain\n    # or\n    tail -f 9988.log # Collator for Parachain ID 200 on wsPort 9988\n    ```\n- [`polkadot-js api`](https://polkadot.js.org/api/) is used to connect to these spawned nodes over\n  their WebSocket endpoint.\n\n## Development\n\nTo work on this project, you will need [`yarn`](https://yarnpkg.com/).\n\nInstall all NodeJS dependencies with:\n\n```bash\nyarn\n```\n\nStart the application with:\n\n```bash\nyarn start config.json\n```\n\nWhen you have finished your changes, make a [pull\nrequest](https://github.com/paritytech/polkadot-launch/pulls) to this repo.\n\n## Get Help\n\nOpen an [issue](https://github.com/paritytech/polkadot-launch/issues) if you have problems or\nfeature requests!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparitytech%2Fpolkadot-launch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparitytech%2Fpolkadot-launch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparitytech%2Fpolkadot-launch/lists"}