Skip to content

Commit

Permalink
Add Template to Core Guide to Kusama (#5879)
Browse files Browse the repository at this point in the history
* Add initial docs + Rust formatting

* add openzepplin option

* add most instructions

* add images

* faq link + spelling

* grammar + spelling

* Update docs/build/build-guides-coretime-start.md

Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com>

* Update docs/build/build-guides-coretime-start.md

Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com>

---------

Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com>
  • Loading branch information
CrackTheCode016 and DrW3RK authored May 13, 2024
1 parent 6c3ac10 commit 216abbc
Show file tree
Hide file tree
Showing 15 changed files with 481 additions and 10 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/coretime/regionx-add-task.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/coretime/regionx-assign-region.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/coretime/regionx-assigned-region.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/coretime/regionx-balance-change.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/coretime/regionx-cross-chain-roc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/coretime/regionx-purchase-bulk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/coretime/regionx-select-region.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/build/build-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ followed by FRAME, with Cumulus as the final step to understanding the entire pa
process. This way, one can view how various paradigms are applied and decide on integrating or
utilizing Substrate for their particular use case.

Please see the [parachain development guide](build-parachains.md) for how to get started on building
a parachain.
Please see [our guides on getting started with coretime](build-guides-coretime-start.md) for how to
get started on building and deploying a parachain.

#### Parachains Benefits

Expand Down
76 changes: 69 additions & 7 deletions docs/build/build-guides-coretime-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ The full definition can be found [here](../learn/learn-agile-coretime.md#task).

:::

## Deploying on a Core

Once you have your runtime and pallets developed, you will be able to deploy it on a
[core](../learn/learn-agile-coretime.md#core), which is how one utilizes the shared security of the
{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} network. One does so by:

1. **Reserving** a [`ParaId`](../general/glossary.md#paraid), where you will upload your runtime and
genesis state.
2. **Compiling** the runtime (written in Rust) to a [WebAssembly](../learn/learn-wasm.md) blob,
Expand All @@ -64,7 +58,75 @@ Once you have your runtime and pallets developed, you will be able to deploy it
6. **Assigning** that core to your[ `ParaId`](../general/glossary.md#paraid).
7. **Ensuring** you have at least one honest, synced collator for your task

### Deploy adder collator
## Deploying on a Core

Once you have your runtime and pallets developed, you will be able to deploy it on a
[core](../learn/learn-agile-coretime.md#core), which is how one utilizes the shared security of the
{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} network. One does so by:

```mermaid
%%{
init: {
'theme': 'base',
'themeVariables': {
'fontFamily': 'Unbounded',
'primaryColor': '#E6007A',
'fontSize': '16px',
'primaryTextColor': '#fff',
'primaryBorderColor': '#7C0000',
'lineColor': '#140523',
'secondaryColor': '#552BBF',
'tertiaryColor': '#fff'
}
}
}%%
flowchart TD
subgraph GA["Generate Artifacts"]
direction LR
A["Creating a runtime"]-->B["Compiling to Wasm"]-->C["Generate Genesis State"]
end
subgraph PC["Procure ParaId & Core"]
direction LR
PARAID["Reserve ParaId"]
PARAID-->D["Buy Bulk Coretime"]
PARAID-->E["Issue On-Demand Coretime Extrinsic"]
end
subgraph DEP["Deploying"]
direction LR
F["Register artifacts to ParaId"]-->assign["Assign Core"]-->G["Sync collator"]-->H["Begin generating blocks!"]
end
GA-->PC
PC-->DEP
```

### Install dependencies

Make sure you have everything you need for your target system
[here.](./build-guides-install-deps.md)

### Deployment Example - Adder Collator

Try out the above by deploying the
[adder collator, a very simple "counter" parachain implementation.](../learn/learn-guides-coretime-parachains.md).

## OpenZeppelin Templates & Guides

OpenZeppelin offers a [generic parachain template](https://github.com/OpenZeppelin/polkadot-generic-runtime-template), which has support for:

- Proxy Pallet
- Multisig Pallet
- Governance support - a treasury, referenda (OpenGov!), and assets configuration
- Collation/Parachain Support
- XCM (Cross Consensus Messaging) Configuration and Support

For more information, check their
[Substrate parachain runtime guide.](https://docs.openzeppelin.com/substrate-runtimes/1.0.0/)

## Polkadot SDK Parachain Template

If you wish to the [Polkadot SDK's Parachain template](https://github.com/paritytech/polkadot-sdk/tree/master/templates/parachain), please follow the
[Template to Core guide.](./build-guides-template-basic.md)
63 changes: 63 additions & 0 deletions docs/build/build-guides-coretime-troubleshoot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
id: build-guides-coretime-troubleshoot
title: Coretime Troubleshooting FAQ
sidebar_label: Troubleshooting FAQ
description: FAQ on issues related to using coretime and testing/deploying parachains using Polkadot SDK
keywords: [coretime, blockspace, parathread, parachain, cores, coretime, agile]
slug: ../build-guides-coretime-troubleshoot
---

This page aims to cover and aggregate various resources that relate to troubleshooting common
problems when using the Polkadot SDK or deploying on a core.

## FAQ / Troubleshooting

### Why do I have to sync Rococo locally? Can't I just use a remote, trusted node and connect to that?

**A:** You can remotely connect to Rococo network via the --relay-chain-rpc-urls flag, which can be passed to your node. Unfortunately, the caveat is you can't use this node for collation at this time - meaning if
you intend on being a collator/validator for your blockchain and intend to create blocks, you need
to sync the chain locally.

---

### Is there a faster way to sync Rococo? Why not warp sync?

**A:** Warp sync is currently not possible on Rococo or Westend.
[See this answer for more context.](https://substrate.stackexchange.com/questions/9730/rococo-cant-warp-sync-stuck-at-16mb-finality-proof-download). However, `--chain=rococo—-sync fast-unsafe` should provide a faster way to sync with the relay chain by skipping downloading state proofs and just verifying the block headers.


---

### My collator is not producing blocks

**A:** Check these sanity checklists:

- https://substrate.stackexchange.com/questions/178/how-can-i-get-my-parachain-to-produce-blocks-sanity-checklist
- https://substrate.stackexchange.com/questions/1394/our-parachain-doesnt-produce-blocks-checklist

---

### I want to run more than one collator, how do I do that?

**A:** Ideally, you would want to run these on separate machines/servers, but you could as long as
you ensure you can provide different RPC/WebSocket and P2P ports for each collator. You also may
need to sync a separate instance of Rococo for each collator on the same machine. You also will need to choose the block production mechanism like [Aura](https://substrate.stackexchange.com/questions/5572/production-like-parachain-setup-and-launch).

---

### Why do we only have one collator in the parachain guides on the Wiki? Isn't it better to have more?

**A:** Mostly for simplicity. If we have more than one collator, we would have to also spin it up,
which would be a hassle on a single machine (it is possible though). Of course, if you had an actual
network with multiple collators, it is assumed you'd have separate VPS/servers for each.

---

### Why are we registering parathreads and not parachains?

**A:** When registering a parachain on a relay chain, they are assigned a `ParaID`, and they are referred to as Parathreads till they start producing blocks. _Parathreads_ are a bit of an outdated term now. They refer to what are now known as
on-demand parachains. Although they be references in various places through PolkadotJS, docs, or
other UIs, really we only have two types of parachain: on-demand parachains, and parachains which
use bulk coretime.

---
Loading

0 comments on commit 216abbc

Please sign in to comment.