Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Add Parachain Template (#620)
Browse files Browse the repository at this point in the history
* Add Canvas node as Parachain template

* Remove `pallet-contracts`

* Point to local Cumulus dependency

* Use double quotes instead of single quotes

* Get rid of GPL licensing

* Remove references to Canvas

* Get rid of warnings

* Remove GLP-3 License copy-pasta file

* Copy in README from `substrate-parachain-template`

* Add mention of `polkadot-launch` tool

* Add missing screenshot asset

* Remove Canvas hidden files and scripts

* Rename `template` to `parachain-template`

* Remove a few more Canvas references

* Add `pallet-template`

* Get `pallet-template` compiling

* Remove TODOs about Weights

* Sort some dependencies

* Remove contracts specific const

* Change binary name back to `parachain-collator`

* RustFmt

* Fix mock tests

* Purge sneaky whitespace

* Add template pallet index to runtime

Co-authored-by: Ricardo Rius <9488369+riusricardo@users.noreply.github.com>

* Add force authoring to collator `polkadot-launch` config

Co-authored-by: Ricardo Rius <9488369+riusricardo@users.noreply.github.com>

* Refer README readers to `substrate-parachain-template`

* Remove license header in `build.rs`

Co-authored-by: Michael Müller <michi@parity.io>

* Fix punctuation nitpick

Co-authored-by: Michael Müller <michi@parity.io>

* Remove unused `lib.rs` file

* Add note about Rococo network

Co-authored-by: Ricardo Rius <9488369+riusricardo@users.noreply.github.com>
Co-authored-by: Michael Müller <michi@parity.io>
  • Loading branch information
3 people committed Sep 23, 2021
1 parent 1aab334 commit 391d2f5
Show file tree
Hide file tree
Showing 22 changed files with 2,863 additions and 3 deletions.
132 changes: 132 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ members = [
"pallets/session-benchmarking",
"pallets/xcm",
"pallets/xcmp-queue",
"parachain-template/node",
"parachain-template/runtime",
"primitives/core",
"primitives/parachain-inherent",
"primitives/timestamp",
Expand All @@ -28,12 +30,12 @@ members = [
"polkadot-parachains/statemint",
"polkadot-parachains/statemine",
"polkadot-parachains/westmint",
"test/runtime",
"test/runtime-upgrade",
"test/client",
"test/service",
"test/relay-sproof-builder",
"test/relay-validation-worker-provider",
"test/runtime",
"test/runtime-upgrade",
"test/service",
]

[profile.release]
Expand Down
24 changes: 24 additions & 0 deletions parachain-template/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org>
14 changes: 14 additions & 0 deletions parachain-template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Substrate Cumulus Parachain Template

A new [Cumulus](https://github.com/paritytech/cumulus/)-based Substrate node, ready for hacking ☁️..

This project is a fork of the [Substrate Node Template](https://github.com/substrate-developer-hub/substrate-node-template)
modified to include dependencies required for registering this node as a **parathread** or
**parachain** to the Rococo **relay chain**.
Rococo is [Polkadot's parachain testnet](https://polkadot.network/blog/introducing-rococo-polkadots-parachain-testnet/) 👑.

👉 Learn more about parachains [here](https://wiki.polkadot.network/docs/learn-parachains), and
parathreads [here](https://wiki.polkadot.network/docs/learn-parathreads).

To learn about how to actually use the template to hack together your own parachain check out the
`README` from the [`substrate-parachain-template` repository](https://github.com/substrate-developer-hub/substrate-parachain-template/).
95 changes: 95 additions & 0 deletions parachain-template/node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
[package]
name = "parachain-template-node"
version = "0.1.0"
authors = ["Anonymous"]
description = "A new Cumulus FRAME-based Substrate Node, ready for hacking together a parachain."
license = "Unlicense"
homepage = "https://substrate.dev"
repository = "https://github.com/paritytech/cumulus/"
edition = "2018"
build = "build.rs"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[build-dependencies]
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" }

[[bin]]
name = "parachain-collator"
path = "src/main.rs"

[features]
runtime-benchmarks = ["parachain-template-runtime/runtime-benchmarks"]

[dependencies]
derive_more = "0.99.2"
log = "0.4.14"
codec = { package = "parity-scale-codec", version = "2.0.0" }
structopt = "0.3.8"
serde = { version = "1.0.119", features = ["derive"] }
hex-literal = "0.3.1"

# RPC related Dependencies
jsonrpc-core = "18.0.0"

# Local Dependencies
parachain-template-runtime = { path = "../runtime" }

# Substrate Dependencies
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master" }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "master" }

pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }

substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "master" }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "master" }

## Substrate Client Dependencies
sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-service = { git = "https://github.com/paritytech/substrate", features = ["wasmtime"] , branch = "master" }
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" }

## Substrate Primitive Dependencies
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-session = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" }

# Cumulus dependencies
cumulus-client-cli = { path = "../../client/cli" }
cumulus-client-collator = { path = "../../client/collator" }
cumulus-client-consensus-aura = { path = "../../client/consensus/aura" }
cumulus-client-consensus-common = { path = "../../client/consensus/common" }
cumulus-client-network = { path = "../../client/network" }
cumulus-client-service = { path = "../../client/service" }
cumulus-primitives-core = { path = "../../primitives/core" }
cumulus-primitives-parachain-inherent = { path = "../../primitives/parachain-inherent" }

# Polkadot dependencies
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "master" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "master" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "master" }
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "master" }
polkadot-test-service = { git = "https://github.com/paritytech/polkadot", branch = "master" }
7 changes: 7 additions & 0 deletions parachain-template/node/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed};

fn main() {
generate_cargo_keys();

rerun_if_git_head_changed();
}

0 comments on commit 391d2f5

Please sign in to comment.