diff --git a/pop-cli-for-appchains/guides/running-on-paseo-locally.md b/pop-cli-for-appchains/guides/running-on-paseo-locally.md
index 06d2bea..864f71b 100644
--- a/pop-cli-for-appchains/guides/running-on-paseo-locally.md
+++ b/pop-cli-for-appchains/guides/running-on-paseo-locally.md
@@ -4,42 +4,28 @@ description: >-
Testnet Locally
---
-# Launching your parachain manually
+# Launch your parachain on a Local Test Network.
-## Introduction
-
-[Paseo](https://x.com/PaseoNetwork) is the community-run Polkadot Relay chain Testnet.
-
-A typical development workflow for launching your parachain on Polkadot:
-
-* Run your parachain **locally** using Pop CLI.
- * Under the hood, Pop CLI launches your parachain to Paseo Local Testnet automatically for development purposes:
- * [Run your parachain on Paseo](running-your-parachain.md)
-* When ready to test your parachain in a live environment with other parachains:
- * Use this guide to mimic the manual onboarding process for Paseo Testnet locally.
- * When comfortable with manually onboarding locally, then use the next guide to onboard to Paseo Live Testnet.
- * [Launching your parachain on Paseo Testnet](launching-your-parachain-on-polkadot/launching-on-paseo.md)
-* Finally, when thoroughly tested on Paseo, launch on Polkadot
- * The process here is similar to launching on Paseo.
-
-***
-
-Let's get started.
+This guide will show you how you can onboard your parachain to a live network. We will spin up our own local network using
+Paseo local.
## Spin up Paseo locally
+Lets create a configuration file for Paseo first.
```bash
touch network.toml
```
-network.toml
-
```toml
[relaychain]
chain = "paseo-local"
+[relaychain.genesis_overrides.sudo]
+key = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" # Alice
+
[[relaychain.nodes]]
name = "alice"
+rpc_port = 57731
validator = true
[[relaychain.nodes]]
@@ -51,7 +37,8 @@ name = "charlie"
validator = true
```
-> Interesting Fact: We have three validator nodes so that we can use Polkadot's Warp Sync to quickly sync with the network. The minimum requirement for Warp Sync are three validator nodes.
+As you can see, the sudo account (admin of the chain) is overridden with `Alice` account. This allows us to make changes
+to Paseo local if needed.
Run the network:
@@ -59,60 +46,34 @@ Run the network:
pop up parachain -f network.toml --verbose
```
-> The `--verbose` flag will allow us to see extra information such as the location of the chain spec for the local Paseo network that we are running.
+> The `--verbose` flag provides us with extra information such as the location of the Paseo chain spec file. This will become important later so keep this terminal tab as is.
Paseo should now be running on your machine and producing blocks. We can now move towards setting up our parachain.
-## Setting up our parachain
+### Configure Paseo
-For the sake of this exercise, let's create a new parachain:
+As of now, Paseo local doesn't provide cores to validate parachain blocks on demand. We will have to make 2 calls to Paseo
+using `Alice` as admin account.
-```
-pop new parachain
+First, configure Paseo to set coretime cores to `1`:
+```bash
+pop call parachain --pallet Configuration --function set_coretime_cores --args "1" --url ws://localhost:57731/ --suri //Alice --sudo --skip-confirm
```
-```
-┌ Pop CLI : Generate a parachain
-│
-◇ Select a template provider:
-│ Pop
-│
-◇ Select the type of parachain:
-│ Standard
-│
-⚙ Template License: Unlicense
-│
-◇ Select a specific release:
-│ Polkadot v1.14
-│
-◇ Where should your project be created?
-│ ./my-parachain
-│
-◇ What is the symbol of your parachain token?
-│ UNIT
-│
-◇ How many token decimals?
-│ 12
-│
-◆ And the initial endowment for dev accounts?
-│ 1u64 << 60
-└
-```
+> Note: we are calling the specified rpc port `577313` which is specified in the created `network.toml` file to interact with the chain.
-```
-cd my-parachain
-pop build
+Second, assign the core to the on demand pool:
+```bash
+pop call parachain --url ws://localhost:57731 --call 0xff004a0400000a000000040100e100 --suri //Alice --skip-confirm
```
-It will take some time for the parachain to build. In the meantime, we can start setting up our accounts.
-
## Setting Up Accounts
-First, we will need to set up a stash account to do transactions on Paseo on behalf of our collator.
+First, we will need to set up a stash account to do transactions on Paseo on behalf of our collator that we will launch in a second.
-> A collator is the parachain node that will be running your parachain.
+> A collator is the parachain node that will be running for your parachain.
There are multiple ways to generate keys (accounts) on Polkadot, such as:
@@ -126,6 +87,8 @@ There are multiple ways to generate keys (accounts) on Polkadot, such as:
For the sake of this guide, we will use subkey:
+#### Using Docker
+
```bash
docker pull parity/subkey:latest
```
@@ -138,7 +101,9 @@ Let's create the stash account key:
docker run -it parity/subkey:latest generate --scheme sr25519
```
-> If you do not have docker installed, you can download the [polkadot-sdk](https://github.com/paritytech/polkadot-sdk) and run the following command instead:
+#### On your Machine
+
+You can download the [polkadot-sdk](https://github.com/paritytech/polkadot-sdk) and run the following command instead:
```bash
git clone --depth 1 https://github.com/paritytech/polkadot-sdk
@@ -161,31 +126,44 @@ Secret phrase: innocent throw harsh wild example reflect sausage leopard l
> This your key (Polkadot account). Save the secret phrase in a vault securely and never share it.
-Now that we have a stash account, we need to fund this account with some tokens so that it has funds to perform transactions on behalf of the collator such as transactions related to onboarding your parachain.
+### Fund Stash Account
-Add the stash account to the [Polkadot Signer extension](https://polkadot.js.org/) so that you can see your account appear in the [PolkadotJs Apps](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fpaseo-rpc.dwellir.com#/accounts) UI.
+Now that we have a stash account, using docker or on your local machine, we need to fund this account with some tokens so that it has funds to perform transactions on behalf of the collator.
-
-
-Make sure it appears in the PolkadotJs Apps UI:
-
-
-
-Notice that the balance is zero. Let's transfer some tokens from Alice's account to the stash account so that the stash account has funds to do transactions:
-
-
+```bash
+pop call parachain --pallet Balances --function transfer_allow_death --args "Id(15muJJBDbC5WX8hPMXS5Ea6ZmTF7r9L2QiJd7n1Wiin8Dtyz)" "1000000000000000" --url ws://localhost:57731/ --suri //Alice
+```
+```bash
+┌ Pop CLI : Call a parachain
+│
+◇ Select the value for the parameter: dest
+│ Id
+│
+◇ Enter the value for the parameter: Id
+│
+│
+◇ Enter the value for the parameter: value
+│ 1000000000000000
+│
+◇ Would you like to dispatch this function call with `Root` origin?
+│ No
+│
+◇ Signer of the extrinsic:
+│ //Alice
+│
+◇ Do you want to submit the extrinsic?
+│ Yes
+```
> Optionally, if you knew your account beforehand, you could have pre-funded it when you spun up the Paseo network. More info [here](https://substrate.stackexchange.com/a/11930/29).
Cool. Our stash account is now funded on the Paseo Relay chain.
-### Create a Session Account Key
+### Create a Session Account
-We now need to create one more account. In order for collators to produce blocks, they need to sign the block with a (session) key. We call this key the session key. This account is specifically created for block production.
+We now need to create one more account (optionally if you are just testing and you can use the stash account). In order for collators to produce blocks, they need to sign the block with a (session) key. This account is specifically created for block production.
-Let's go ahead and create the session account key.
-
-We can use `subkey` to generate the keys for us.
+We can use `subkey` again to generate the keys for us.
```
docker pull parity/subkey:latest
@@ -209,32 +187,46 @@ Secret phrase: innocent throw harsh wild example reflect sausage leopard l
> Save the secret phrase in a secure manner.
-## Creating the chain spec for the parachain
+We now have all the accounts we need and we can start prepare our chain!
-Let's create a chain spec for our parachain:
+## Setting up the Parachain
+For the sake of this exercise, let's create a new parachain:
```
-cd my-parachain
+pop new parachain my-parachain
```
+> The folder includes a `network.toml` file which can be ignored. This is to launch a network with the parachain included.
-Build your parachain for release:
-```
-pop build --release
-```
+### Creating the chain spec for the parachain
-Create the chain spec:
+Let's create a chain spec for our parachain:
```
-pop build spec --release --id 2000 --type local --relay paseo-local --protocol-id my_parachain
+cd my-parachain
+pop build spec --profile release --id 2000 --type local --relay paseo-local --protocol-id my_parachain --chain local --genesis-state --genesis-code
+```
+```bash
+┌ Pop CLI : Generate your chain spec
+│
+◇ Name or path for the plain chain spec file:
+│ ./chain-spec.json
+│
+◇ Would you like to use local host as a bootnode ?
+│ No
+│
+┌ Pop CLI : Building your chain spec
+│
+◇ Chain specification built successfully.
+│
+◆ Generated files:
+│ ● Plain text chain specification file generated at: ./chain-spec.json
+│ ● Raw chain specification file generated at: ./chain-spec-raw.json
+│ ● WebAssembly runtime file exported at: ./para-2000.wasm
+│ ● Genesis State file exported at: ./para-2000-genesis-state
+│
+└ Need help? Learn more at https://learn.onpop.io
```
-
-This will output the following:
-
-* Your parachain's chain specification file
- * The plain text and the raw version e.g. `chain-spec.json` and `chain-spec-raw.json`
-* Your parachain's initial genesis state e.g. `para-2000-genesis-state`
-* Your parachain's Wasm runtime e.g. `para-2000.wasm`
> For more advanced customization `pop build spec --help`
@@ -320,29 +312,27 @@ It should look similar to the below:
}
```
-Since we have modified our chain spec, we will need to re-generate the raw chain spec:
+Since we have modified our chain spec, we will need to re-generate the raw chain spec, genesis state and wasm:
```bash
-./target/release/parachain-template-node build-spec --chain chain-spec.json --disable-default-bootnode --raw > chain-spec-raw.json
-```
-
-And re-generate the genesis state and wasm:
-
+pop build spec --chain chain-spec.json --disable-default-bootnode --genesis-state --genesis-code
```
-./target/release/parachain-template-node export-genesis-head --chain chain-spec-raw.json > para-2000-genesis-state
+```bash
+┌ Pop CLI : Generate your chain spec
+│
+◇ An existing chain spec file is provided. Do you want to make additional changes to it?
+│ No
```
-```
-./target/release/parachain-template-node export-genesis-wasm --chain chain-spec-raw.json > para-2000.wasm
-```
+> Pop CLI allows you to provide the path to an existing chain spec file to edit or regenerate the artifacts.
-We are now ready to run our parachain's collator node to sync with Paseo and start producing blocks.
+We are now ready to run our parachain's collator to sync with Paseo and start producing blocks.
-## Running the Collator
+## Launch the Parachain
-In order to run your parachain's collator node you will need the raw chain spec that our local Paseo network is using.
+In order to run your parachain's collator you will need the raw chain spec that our local Paseo network is using.
-This can be found in the output of when you ran the `pop up parachain -f network --verbose` command.:
+This can be found in the output when you ran the `pop up parachain -f network --verbose` command:
@@ -355,30 +345,25 @@ cp /var/folders/vl/txnq6gdj22s9rn296z0md27w0000gn/T/zombie-ddb5d2aa-704b-4658-af
> Note: Your Paseo chain spec path will be different from the above.
+### Generate Node Key
+
We will also need to create a node-key for your collator:
```bash
cd my-parachain
-```
-
-```
mkdir -p data/chains/my_parachain/network
-```
-
-```
docker run -it parity/subkey:latest generate-node-key > ./data/chains/my_parachain/network/secret_ed25519
```
> Alternatively you can use Polkadot SDK binary instead of a Docker image:
->
> ```
> path/to/polkadot-sdk/target/debug/substrate-node key generate-node-key --file=secret_ed25519 --chain=./chain-spec-raw.json
> ```
>
>
->
->
+
+### Run Collator
Run the collator with the following command:
@@ -394,11 +379,10 @@ Run the collator with the following command:
--sync warp \
--chain paseo-local-raw.json \
--port 57733 \
---rpc-port 57731 \
---bootnodes /ip4/127.0.0.1/tcp/57733/p2p/12D3KooWQCkBm1BYtkHpocxCwMgR8yjitEeHGx8spzcDLGt2gkBm
+--rpc-port 57731
```
-> The second half of this command specifies the Relay chain node to connect to. In this case, Alice is the validator node that we want to connect to. Alice is the bootnode for the Paseo network that we are running locally. Alice's ports can be found in the output from the `pop up parachain -f network.toml --verbose` command that we previously ran.
+> The second half of this command specifies the Relay chain node to connect to.
We now need to insert the session key into our running collator:
@@ -417,51 +401,112 @@ curl -H "Content-Type: application/json" \
http://localhost:8845
```
-It will take time for your collator to sync with the local Paseo Relay chain.
-
-We now need to onboard the parachain to Paseo.
-
-Go to the Parachains tab.
-
-
+Ensure the chain is synced with Paseo:
+```bash
+2024-12-10 09:06:05 [Relaychain] Warp sync is complete, continuing with state sync.
+2024-12-10 09:06:06 [Relaychain] State sync is complete, continuing with block sync.
+2024-12-10 09:06:06 [Relaychain] 🏆 Imported #47 (0xb04f…12a4 → 0x6adf…6582)
+2024-12-10 09:06:06 [Relaychain] 🏆 Imported #48 (0x6adf…6582 → 0xd036…e502)
+```
-Select "+ ParaId" and make sure to use the stash account:
+We now need to onboard the chain to Paseo.
-
+### Reserve Para ID
-Next, select "+ ParaThread". Make sure to use the stash account, upload your wasm and genesis state:
+We can reserve a para ID for the chain using pop cli:
-
+```bash
+pop call parachain --url ws://localhost:57731
+```
-It will take a moment for the ParaThread to onboard:
+
+```bash
+┌ Pop CLI : Call a parachain
+│
+◇ What would you like to do?
+│ Reserve a parachain ID
+│
+◇ Signer of the extrinsic:
+│
+│
+◇ Do you want to submit the extrinsic?
+│ Yes
+│
-
+Event(s):
-Once onboarded, we now need to use sudo privileges (Alice account) on the Paseo Relay chain to "force" a lease for our parachain so that it can begin to use produce blocks.
+Registrar::Reserved: { para_id: (2000), who: ((212, 53, 147, 199, 21, 253, 211, 28, 97, 20, 26, 189, 4, 169, 159, 214, 130, 44, 133, 88, 133, 76, 205, 227, 154, 86, 132, 231, 165, 109, 162, 125)) }
+```
-Go to the "sudo" tab:
+In the events we can see the `para_id` that is assigned to the chain. Make sure this is the para ID specified in the chain spec file (and thus the chain artifacts).
-
+### Register Para ID with Genesis State & Code
-Use sudo privileges on the Relay chain to force a lease for our parachain:
+Now we register the para ID with the generated genesis state (`para-2000-genesis-state`) and genesis code (`para-2000.wasm`).
-
+```bash
+│
+◇ Do you want to perform another call?
+│ Yes
+│
+◇ What would you like to do?
+│ Register a parachain ID with genesis state and code
+│
+◇ Enter the value for the parameter: id
+│ 2000
+│
+◇ The value for `genesis_head` might be too large to enter. You may enter the path to a file instead.
+│ para-2000-genesis-state
+│
+◇ The value for `validation_code` might be too large to enter. You may enter the path to a file instead.
+│ para-2000.wasm
+│
+◇ Signer of the extrinsic:
+│
+...
+│
+◇ Do you want to submit the extrinsic?
+│ Yes
+...
+Event(s):
-> In production, leases are assigned via the result of an on-chain auction.
+Registrar::Registered: { para_id: (2000), manager: ((212, 53, 147, 199, 21, 253, 211, 28, 97, 20, 26, 189, 4, 169, 159, 214, 130, 44, 133, 88, 133, 76, 205, 227, 154, 86, 132, 231, 165, 109, 162, 125)) }
+```
-Wait for the lease to take effect:
+Your chain is now registered on Paseo!
-
+### Buy an On Demand Core
-You will then see the parathread upgraded to a parachain:
+Now we need to buy a core to have Paseo validate a block.
-
+```bash
+│
+◇ Do you want to perform another call?
+│ Yes
+│
+◇ What would you like to do?
+│ Purchase on-demand coretime
+│
+◇ Enter the value for the parameter: max_amount
+│ 10000000
+│
+◇ Enter the value for the parameter: para_id
+│ 2000
+│
+◇ Signer of the extrinsic:
+│
+...
+│
+◇ Do you want to submit the extrinsic?
+│ Yes
+...
-After a few moments, you should see the parachain producing blocks. The included / backed will update with the Relay chain's block number in which your parachain's block was included and backed. You can also check your collator logs to confirm.
+Event(s):
-
+OnDemand::OnDemandOrderPlaced: { para_id: (2000), spot_price: 10000000, ordered_by: ((212, 53, 147, 199, 21, 253, 211, 28, 97, 20, 26, 189, 4, 169, 159, 214, 130, 44, 133, 88, 133, 76, 205, 227, 154, 86, 132, 231, 165, 109, 162, 125)) }
+```
-Congrats! Your chain is now producing blocks!
+Congrats! If your parachain produced another block it means that your first block is now validated by Paseo!
## Next Steps