{"id":31073679,"url":"https://github.com/sgerodes/sg-parachain","last_synced_at":"2025-09-16T01:57:58.248Z","repository":{"id":307513531,"uuid":"1029788578","full_name":"sgerodes/sg-parachain","owner":"sgerodes","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-31T18:44:41.000Z","size":2169,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-31T18:59:19.609Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sgerodes.png","metadata":{"files":{"readme":"README.docify.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-31T15:16:32.000Z","updated_at":"2025-07-31T18:44:45.000Z","dependencies_parsed_at":"2025-07-31T19:09:50.662Z","dependency_job_id":null,"html_url":"https://github.com/sgerodes/sg-parachain","commit_stats":null,"previous_names":["sgerodes/sg-parachain"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/sgerodes/sg-parachain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgerodes%2Fsg-parachain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgerodes%2Fsg-parachain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgerodes%2Fsg-parachain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgerodes%2Fsg-parachain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sgerodes","download_url":"https://codeload.github.com/sgerodes/sg-parachain/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgerodes%2Fsg-parachain/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275348504,"owners_count":25448626,"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","status":"online","status_checked_at":"2025-09-15T02:00:09.272Z","response_time":75,"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":"2025-09-16T01:57:56.827Z","updated_at":"2025-09-16T01:57:58.232Z","avatar_url":"https://github.com/sgerodes.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Polkadot SDK's Parachain Template\n\n\u003cimg height=\"70px\" alt=\"Polkadot SDK Logo\" src=\"https://github.com/paritytech/polkadot-sdk/raw/master/docs/images/Polkadot_Logo_Horizontal_Pink_White.png#gh-dark-mode-only\"/\u003e\n\u003cimg height=\"70px\" alt=\"Polkadot SDK Logo\" src=\"https://github.com/paritytech/polkadot-sdk/raw/master/docs/images/Polkadot_Logo_Horizontal_Pink_Black.png#gh-light-mode-only\"/\u003e\n\n\u003e This is a template for creating a [parachain](https://wiki.polkadot.network/docs/learn-parachains) based on Polkadot SDK.\n\u003e\n\u003e This template is automatically updated after releases in the main [Polkadot SDK monorepo](https://github.com/paritytech/polkadot-sdk).\n\n\u003c/div\u003e\n\n## Table of Contents\n\n- [Intro](#intro)\n\n- [Template Structure](#template-structure)\n\n- [Getting Started](#getting-started)\n\n- [Starting a Development Chain](#starting-a-development-chain)\n\n  - [Omni Node](#omni-node-prerequisites)\n  - [Zombienet setup with Omni Node](#zombienet-setup-with-omni-node)\n  - [Parachain Template Node](#parachain-template-node)\n  - [Connect with the Polkadot-JS Apps Front-End](#connect-with-the-polkadot-js-apps-front-end)\n  - [Takeaways](#takeaways)\n\n- [Runtime development](#runtime-development)\n- [Contributing](#contributing)\n- [Getting Help](#getting-help)\n\n## Intro\n\n- ⏫ This template provides a starting point to build a [parachain](https://wiki.polkadot.network/docs/learn-parachains).\n\n- ☁️ It is based on the\n  [Cumulus](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/polkadot_sdk/cumulus/index.html) framework.\n\n- 🔧 Its runtime is configured with a single custom pallet as a starting point, and a handful of ready-made pallets\n  such as a [Balances pallet](https://paritytech.github.io/polkadot-sdk/master/pallet_balances/index.html).\n\n- 👉 Learn more about parachains [here](https://wiki.polkadot.network/docs/learn-parachains)\n\n## Template Structure\n\nA Polkadot SDK based project such as this one consists of:\n\n- 🧮 the [Runtime](./runtime/README.md) - the core logic of the parachain.\n- 🎨 the [Pallets](./pallets/README.md) - from which the runtime is constructed.\n- 💿 a [Node](./node/README.md) - the binary application, not part of the project default-members list and not compiled unless\n  building the project with `--workspace` flag, which builds all workspace members, and is an alternative to\n  [Omni Node](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/reference_docs/omni_node/index.html).\n\n## Getting Started\n\n- 🦀 The template is using the Rust language.\n\n- 👉 Check the\n  [Rust installation instructions](https://www.rust-lang.org/tools/install) for your system.\n\n- 🛠️ Depending on your operating system and Rust version, there might be additional\n  packages required to compile this template - please take note of the Rust compiler output.\n\nFetch parachain template code:\n\n```sh\ngit clone https://github.com/paritytech/polkadot-sdk-parachain-template.git parachain-template\n\ncd parachain-template\n```\n\n## Starting a Development Chain\n\nThe parachain template relies on a hardcoded parachain id which is defined in the runtime code\nand referenced throughout the contents of this file as `{{PARACHAIN_ID}}`. Please replace\nany command or file referencing this placeholder with the value of the `PARACHAIN_ID` constant:\n\n\u003c!-- docify::embed!(\"runtime/src/genesis_config_presets.rs\", PARACHAIN_ID)--\u003e\n\n### Omni Node Prerequisites\n\n[Omni Node](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/reference_docs/omni_node/index.html) can\nbe used to run the parachain template's runtime. `polkadot-omni-node` binary crate usage is described at a high-level\n[on crates.io](https://crates.io/crates/polkadot-omni-node).\n\n#### Install `polkadot-omni-node`\n\nPlease see the installation section at [`crates.io/omni-node`](https://crates.io/crates/polkadot-omni-node).\n\n#### Build `parachain-template-runtime`\n\n```sh\ncargo build --profile production\n```\n\n#### Install `staging-chain-spec-builder`\n\nPlease see the installation section at [`crates.io/staging-chain-spec-builder`](https://crates.io/crates/staging-chain-spec-builder).\n\n#### Use `chain-spec-builder` to generate the `chain_spec.json` file\n\n```sh\nchain-spec-builder create --relay-chain \"rococo-local\" --runtime \\\n    target/release/wbuild/parachain-template-runtime/parachain_template_runtime.wasm named-preset development\n```\n\n**Note**: the `relay-chain` flag is required by Omni Node. The `relay-chain` value is set in accordance\nwith the relay chain ID where this instantiation of parachain-template will connect to.\n\n#### Run Omni Node\n\nStart Omni Node with the generated chain spec. We'll start it in development mode (without a relay chain config), producing\nand finalizing blocks based on manual seal, configured below to seal a block with each second.\n\n```bash\npolkadot-omni-node --chain \u003cpath/to/chain_spec.json\u003e --dev --dev-block-time 1000\n```\n\nHowever, such a setup is not close to what would run in production, and for that we need to setup a local\nrelay chain network that will help with the block finalization. In this guide we'll setup a local relay chain\nas well. We'll not do it manually, by starting one node at a time, but we'll use [zombienet](https://paritytech.github.io/zombienet/intro.html).\n\nFollow through the next section for more details on how to do it.\n\n### Zombienet setup with Omni Node\n\nAssuming we continue from the last step of the previous section, we have a chain spec and we need to setup a relay chain.\nWe can install `zombienet` as described [here](https://paritytech.github.io/zombienet/install.html#installation), and\n`zombienet-omni-node.toml` contains the network specification we want to start.\n\n#### Relay chain prerequisites\n\nDownload the `polkadot` (and the accompanying `polkadot-prepare-worker` and `polkadot-execute-worker`) binaries from\n[Polkadot SDK releases](https://github.com/paritytech/polkadot-sdk/releases). Then expose them on `PATH` like so:\n\n```sh\nexport PATH=\"$PATH:\u003cpath/to/binaries\u003e\"\n```\n\n#### Update `zombienet-omni-node.toml` with a valid chain spec path\n\nTo simplify the process of using the parachain-template with zombienet and Omni Node, we've added a pre-configured\ndevelopment chain spec (dev_chain_spec.json) to the parachain template. The zombienet-omni-node.toml file of this\ntemplate points to it, but you can update it to an updated chain spec generated on your machine. To generate a\nchain spec refer to [staging-chain-spec-builder](https://crates.io/crates/staging-chain-spec-builder)\n\nThen make the changes in the network specification like so:\n\n```toml\n# ...\n[[parachains]]\nid = \"\u003cPARACHAIN_ID\u003e\"\nchain_spec_path = \"\u003cTO BE UPDATED WITH A VALID PATH\u003e\"\n# ...\n```\n\n#### Start the network\n\n```sh\nzombienet --provider native spawn zombienet-omni-node.toml\n```\n\n### Parachain Template Node\n\nAs mentioned in the `Template Structure` section, the `node` crate is optionally compiled and it is an alternative\nto `Omni Node`. Similarly, it requires setting up a relay chain, and we'll use `zombienet` once more.\n\n#### Install the `parachain-template-node`\n\n```sh\ncargo install --path node --locked\n```\n\n#### Setup and start the network\n\nFor setup, please consider the instructions for `zombienet` installation [here](https://paritytech.github.io/zombienet/install.html#installation)\nand [relay chain prerequisites](#relay-chain-prerequisites).\n\nWe're left just with starting the network:\n\n```sh\nzombienet --provider native spawn zombienet.toml\n```\n\n### Connect with the Polkadot-JS Apps Front-End\n\n- 🌐 You can interact with your local node using the\n  hosted version of the Polkadot/Substrate Portal:\n  [relay chain](https://polkadot.js.org/apps/#/explorer?rpc=ws://localhost:9944)\n  and [parachain](https://polkadot.js.org/apps/#/explorer?rpc=ws://localhost:9988).\n\n- 🪐 A hosted version is also\n  available on [IPFS](https://dotapps.io/).\n\n- 🧑‍🔧 You can also find the source code and instructions for hosting your own instance in the\n  [`polkadot-js/apps`](https://github.com/polkadot-js/apps) repository.\n\n### Takeaways\n\nDevelopment parachains:\n\n- 🔗 Connect to relay chains, and we showcased how to connect to a local one.\n- 🧹 Do not persist the state.\n- 💰 Are preconfigured with a genesis state that includes several prefunded development accounts.\n- 🧑‍⚖️ Development accounts are used as validators, collators, and `sudo` accounts.\n\n## Runtime development\n\nWe recommend using [`chopsticks`](https://github.com/AcalaNetwork/chopsticks) when the focus is more on the runtime\ndevelopment and `OmniNode` is enough as is.\n\n### Install chopsticks\n\nTo use `chopsticks`, please install the latest version according to the installation [guide](https://github.com/AcalaNetwork/chopsticks?tab=readme-ov-file#install).\n\n### Build a raw chain spec\n\nBuild the `parachain-template-runtime` as mentioned before in this guide and use `chain-spec-builder`\nagain but this time by passing `--raw-storage` flag:\n\n```sh\nchain-spec-builder create --raw-storage --relay-chain \"rococo-local\" --runtime \\\n    target/release/wbuild/parachain-template-runtime/parachain_template_runtime.wasm named-preset development\n```\n\n### Start `chopsticks` with the chain spec\n\n```sh\nnpx @acala-network/chopsticks@latest --chain-spec \u003cpath/to/chain_spec.json\u003e\n```\n\n### Alternatives\n\n`OmniNode` can be still used for runtime development if using the `--dev` flag, while `parachain-template-node` doesn't\nsupport it at this moment. It can still be used to test a runtime in a full setup where it is started alongside a\nrelay chain network (see [Parachain Template node](#parachain-template-node) setup).\n\n## Contributing\n\n- 🔄 This template is automatically updated after releases in the main [Polkadot SDK monorepo](https://github.com/paritytech/polkadot-sdk).\n\n- ➡️ Any pull requests should be directed to this [source](https://github.com/paritytech/polkadot-sdk/tree/master/templates/parachain).\n\n- 😇 Please refer to the monorepo's\n  [contribution guidelines](https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md) and\n  [Code of Conduct](https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CODE_OF_CONDUCT.md).\n\n## Getting Help\n\n- 🧑‍🏫 To learn about Polkadot in general, [docs.Polkadot.com](https://docs.polkadot.com/) website is a good starting point.\n\n- 🧑‍🔧 For technical introduction, [here](https://github.com/paritytech/polkadot-sdk#-documentation) are\n  the Polkadot SDK documentation resources.\n\n- 👥 Additionally, there are [GitHub issues](https://github.com/paritytech/polkadot-sdk/issues) and\n  [Substrate StackExchange](https://substrate.stackexchange.com/).\n- 👥You can also reach out on the [Official Polkdot discord server](https://polkadot-discord.w3f.tools/)\n- 🧑Reach out on [Telegram](https://t.me/substratedevs) for more questions and discussions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgerodes%2Fsg-parachain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsgerodes%2Fsg-parachain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgerodes%2Fsg-parachain/lists"}