From bc19bee04f832d9521284996fbb9188a478ab006 Mon Sep 17 00:00:00 2001 From: BulatSaif Date: Fri, 29 Mar 2024 12:10:23 +0300 Subject: [PATCH 1/2] update README.md --- charts/node/examples/local-rococo/README.md | 98 ++++++++++--------- .../{asset-hub.yaml => parachain.yaml} | 2 + 2 files changed, 56 insertions(+), 44 deletions(-) rename charts/node/examples/local-rococo/{asset-hub.yaml => parachain.yaml} (98%) diff --git a/charts/node/examples/local-rococo/README.md b/charts/node/examples/local-rococo/README.md index 63d6555f..da7de88a 100644 --- a/charts/node/examples/local-rococo/README.md +++ b/charts/node/examples/local-rococo/README.md @@ -1,56 +1,66 @@ -# Relaychain -## Install relaychain -```shell -helm upgrade --install bootnode . -f examples/local-rococo/bootnode.yaml -kubectl wait --for=condition=Ready pod bootnode-0 --timeout=90s -helm upgrade --install validators . -f examples/local-rococo/validators-alice-bob.yaml +## Example Rococo Local Chain +This is a simple example of deploying a rococo-local and parachain test chains in Kubernetes. +One bootnode, two validators and two parachain nodes will be deployed via the helm chart. +Once both validators are running you will see block production. +A custom node key is used on the Alice validator which all other hosts use as a bootnode. -``` +### Relaychain Setup: +1. **Install the Relaychain:** + Install the Helm charts for the bootnode and validators. Ensure that you have Helm installed and configured with the appropriate Kubernetes cluster. + ```shell + helm upgrade --install bootnode . -f examples/local-rococo/bootnode.yaml + kubectl wait --for=condition=Ready pod bootnode-0 --timeout=90s + helm upgrade --install validators . -f examples/local-rococo/validators-alice-bob.yaml + ``` -## Access to relaychain RPC -```shell -kubectl port-forward bootnode-0 9944:9944 -``` -open: https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/explorer +2. **Access Relaychain RPC:** + Port-forward to access the relaychain RPC. This will allow you to interact with the relaychain using Polkadot.js apps or other tools. + ```shell + kubectl port-forward bootnode-0 9944:9944 + ``` + Open Polkadot.js apps at https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/explorer to explore the relaychain. -# Parachain -## Install parachain -```shell -helm upgrade --install parachain . -f examples/local-rococo/asset-hub.yaml -``` +### Parachain Setup: +1. **Install the Parachain:** + Install the Helm chart for the parachain. This will deploy the parachain nodes onto your Kubernetes cluster. + ```shell + helm upgrade --install parachain . -f examples/local-rococo/parachain.yaml + ``` -## Onboard parachain -1. Find the para_id and Genesis state -```shell -kubectl logs --tail 10 -f parachain-node-0 dump-state-and-wasm -# Parachain Id: -# "para_id": 1000, -# Genesis head: -# 0x00000000000000000000000000000000000000000000000000000000000000000061dc4546910e4a874f59af705dd079344ecb7759f526cf86cf21db67473d0b4f03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c11131400 -``` -2. Download genesis-wasm -```shell -kubectl cp parachain-node-0:/chain-data/genesis-wasm genesis-wasm -``` -3. On relaychain RPC submit following call: -https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/sudo -```shell -parasSudoWrapper.sudoScheduleParaInitialize(id, genesis) -id = 1000 -genesisHead = 0x00000000000000000000000000000000000000000000000000000000000000000061dc4546910e4a874f59af705dd079344ecb7759f526cf86cf21db67473d0b4f03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c11131400 -validationCode = file upload(genesis-wasm) -paraKind = Yes -``` -4. Check onboarding progress here: https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/parachains/parathreads +2. **Onboard the Parachain:** + - **Find Para_id and Genesis State:** + Obtain the Para_id and genesisHead by checking the logs of the parachain node. + ```shell + kubectl logs --tail 10 -f parachain-node-0 dump-state-and-wasm + # Parachain Id: + # "para_id": 1000, + # Genesis head: + # 0x00000000000000000000000000000000000000000000000000000000000000000061dc4546910e4a874f59af705dd079344ecb7759f526cf86cf21db67473d0b4f03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c11131400 + ``` + - **Download Genesis-Wasm:** + Copy the genesis-wasm file from the parachain node to your local machine. + ```shell + kubectl cp parachain-node-0:/chain-data/genesis-wasm genesis-wasm + ``` + - **Submit a Call to Relaychain RPC:** + Use [Polkadot.js](https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/sudo) apps to submit a call to the relaychain RPC for onboarding the parachain. + ![Screenshot from 2024-03-29 11-54-49](https://github.com/paritytech/helm-charts/assets/24387396/1c0a178e-f842-4cfa-97f7-22c08f40b2ce) + + - **Check Onboarding Progress:** + Monitor the onboarding progress on Polkadot.js apps at https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/parachains/parathreads. + ![Screenshot from 2024-03-29 11-55-08](https://github.com/paritytech/helm-charts/assets/24387396/8de4849c-e212-4e61-a348-5bcab9cc32a6) -## Access to parachain RPC +### Access Parachain RPC: +Port-forward to access the parachain RPC for interacting with the parachain node. ```shell kubectl port-forward parachain-node-0 9945:9944 ``` -open: https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9945#/explorer +Open Polkadot.js apps at https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9945#/explorer to explore the parachain. -## Cleanup +### Cleanup: +Delete the Helm releases for bootnode, validators, and parachain. Optionally, clean up PVCs if necessary. ```shell helm delete bootnode validators parachain -# clean pvc kubectl delete pvc --all +# Clean PVCs if needed +# kubectl delete pvc --all ``` \ No newline at end of file diff --git a/charts/node/examples/local-rococo/asset-hub.yaml b/charts/node/examples/local-rococo/parachain.yaml similarity index 98% rename from charts/node/examples/local-rococo/asset-hub.yaml rename to charts/node/examples/local-rococo/parachain.yaml index 58609684..2c89a276 100644 --- a/charts/node/examples/local-rococo/asset-hub.yaml +++ b/charts/node/examples/local-rococo/parachain.yaml @@ -56,6 +56,8 @@ extraInitContainers: - name: dump-state-and-wasm image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: "{{ .Values.image.pullPolicy }}" + securityContext: + runAsUser: 0 command: [ "/bin/bash" ] args: - -c From c0292d3e081b8dec2210464a2ac7892bff2b29f8 Mon Sep 17 00:00:00 2001 From: Bulat Saifullin Date: Fri, 29 Mar 2024 12:37:53 +0300 Subject: [PATCH 2/2] add screenshots --- charts/node/examples/local-rococo/README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/charts/node/examples/local-rococo/README.md b/charts/node/examples/local-rococo/README.md index da7de88a..e55fe3e8 100644 --- a/charts/node/examples/local-rococo/README.md +++ b/charts/node/examples/local-rococo/README.md @@ -1,8 +1,8 @@ ## Example Rococo Local Chain -This is a simple example of deploying a rococo-local and parachain test chains in Kubernetes. -One bootnode, two validators and two parachain nodes will be deployed via the helm chart. +This example demonstrates deploying a Rococo-local (relaychain) test chain and parachain test chains in Kubernetes. +The setup includes deploying one bootnode, two validators, and two parachain nodes via the Helm chart. Once both validators are running you will see block production. -A custom node key is used on the Alice validator which all other hosts use as a bootnode. +A custom chainspec is generated in the initcontainer on the bootnode, which is used to connect all relaychain nodes together. ### Relaychain Setup: 1. **Install the Relaychain:** @@ -19,6 +19,8 @@ A custom node key is used on the Alice validator which all other hosts use as a kubectl port-forward bootnode-0 9944:9944 ``` Open Polkadot.js apps at https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/explorer to explore the relaychain. + ![image](https://github.com/paritytech/helm-charts/assets/24387396/c6183545-b423-46f5-b376-f30bf3f2e5f6) + ### Parachain Setup: 1. **Install the Parachain:** @@ -56,6 +58,8 @@ Port-forward to access the parachain RPC for interacting with the parachain node kubectl port-forward parachain-node-0 9945:9944 ``` Open Polkadot.js apps at https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9945#/explorer to explore the parachain. +![image](https://github.com/paritytech/helm-charts/assets/24387396/cbf12f54-18b5-443c-892d-7632fe790b88) + ### Cleanup: Delete the Helm releases for bootnode, validators, and parachain. Optionally, clean up PVCs if necessary. @@ -63,4 +67,4 @@ Delete the Helm releases for bootnode, validators, and parachain. Optionally, cl helm delete bootnode validators parachain # Clean PVCs if needed # kubectl delete pvc --all -``` \ No newline at end of file +```