diff --git a/pop-cli-for-appchains/.gitbook/assets/001 (1).gif b/pop-cli-for-appchains/.gitbook/assets/001 (1).gif deleted file mode 100644 index 5cfc484..0000000 Binary files a/pop-cli-for-appchains/.gitbook/assets/001 (1).gif and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-05-09 at 7.31.17\342\200\257PM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-05-09 at 7.31.17\342\200\257PM.png" deleted file mode 100644 index 5137a22..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-05-09 at 7.31.17\342\200\257PM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-05 at 5.03.46\342\200\257PM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-05 at 5.03.46\342\200\257PM.png" deleted file mode 100644 index 6f41b9e..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-05 at 5.03.46\342\200\257PM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-06 at 4.04.37\342\200\257PM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-06 at 4.04.37\342\200\257PM.png" deleted file mode 100644 index 93e3042..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-06 at 4.04.37\342\200\257PM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-18 at 3.56.34\342\200\257PM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-18 at 3.56.34\342\200\257PM.png" deleted file mode 100644 index 6d017dc..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-18 at 3.56.34\342\200\257PM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.14.37\342\200\257AM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.14.37\342\200\257AM.png" deleted file mode 100644 index a0e2204..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.14.37\342\200\257AM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.17.59\342\200\257AM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.17.59\342\200\257AM.png" deleted file mode 100644 index d460af4..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.17.59\342\200\257AM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.23.53\342\200\257AM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.23.53\342\200\257AM.png" deleted file mode 100644 index 8736b18..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.23.53\342\200\257AM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.37.32\342\200\257AM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.37.32\342\200\257AM.png" deleted file mode 100644 index 3d836d5..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.37.32\342\200\257AM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.38.09\342\200\257AM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.38.09\342\200\257AM.png" deleted file mode 100644 index e3fc08d..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.38.09\342\200\257AM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.38.50\342\200\257AM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.38.50\342\200\257AM.png" deleted file mode 100644 index 6f2f946..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.38.50\342\200\257AM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.39.09\342\200\257AM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.39.09\342\200\257AM.png" deleted file mode 100644 index 08f174f..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.39.09\342\200\257AM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.45.44\342\200\257AM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.45.44\342\200\257AM.png" deleted file mode 100644 index be10837..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.45.44\342\200\257AM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.46.09\342\200\257AM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.46.09\342\200\257AM.png" deleted file mode 100644 index e698d6f..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.46.09\342\200\257AM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.46.30\342\200\257AM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.46.30\342\200\257AM.png" deleted file mode 100644 index 9159b35..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.46.30\342\200\257AM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.50.18\342\200\257AM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.50.18\342\200\257AM.png" deleted file mode 100644 index c20c2c5..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 11.50.18\342\200\257AM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 12.20.38\342\200\257PM (1) (1).png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 12.20.38\342\200\257PM (1) (1).png" deleted file mode 100644 index 908c7c2..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 12.20.38\342\200\257PM (1) (1).png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 12.20.38\342\200\257PM (1).png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 12.20.38\342\200\257PM (1).png" deleted file mode 100644 index 908c7c2..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 12.20.38\342\200\257PM (1).png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 2.21.37\342\200\257PM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 2.21.37\342\200\257PM.png" deleted file mode 100644 index 890e017..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-24 at 2.21.37\342\200\257PM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-25 at 11.59.52\342\200\257AM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-25 at 11.59.52\342\200\257AM.png" deleted file mode 100644 index 4486a96..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-25 at 11.59.52\342\200\257AM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-25 at 12.06.57\342\200\257PM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-25 at 12.06.57\342\200\257PM.png" deleted file mode 100644 index ffa6d43..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-25 at 12.06.57\342\200\257PM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-25 at 3.15.11\342\200\257PM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-25 at 3.15.11\342\200\257PM.png" deleted file mode 100644 index 6d12653..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-25 at 3.15.11\342\200\257PM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-25 at 3.18.17\342\200\257PM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-25 at 3.18.17\342\200\257PM.png" deleted file mode 100644 index 5c4e205..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-25 at 3.18.17\342\200\257PM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-25 at 3.23.15\342\200\257PM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-25 at 3.23.15\342\200\257PM.png" deleted file mode 100644 index a85a077..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-25 at 3.23.15\342\200\257PM.png" and /dev/null differ diff --git "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-25 at 3.25.53\342\200\257PM.png" "b/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-25 at 3.25.53\342\200\257PM.png" deleted file mode 100644 index a9f13a4..0000000 Binary files "a/pop-cli-for-appchains/.gitbook/assets/Screenshot 2024-09-25 at 3.25.53\342\200\257PM.png" and /dev/null differ diff --git a/pop-cli-for-appchains/.gitbook/assets/build_spec.gif b/pop-cli-for-appchains/.gitbook/assets/build_spec.gif new file mode 100644 index 0000000..88fe661 Binary files /dev/null and b/pop-cli-for-appchains/.gitbook/assets/build_spec.gif differ diff --git a/pop-cli-for-appchains/.gitbook/assets/callchain.gif b/pop-cli-for-appchains/.gitbook/assets/callchain.gif deleted file mode 100644 index c70f917..0000000 Binary files a/pop-cli-for-appchains/.gitbook/assets/callchain.gif and /dev/null differ diff --git a/pop-cli-for-appchains/.gitbook/assets/callchain_extrinsic.gif b/pop-cli-for-appchains/.gitbook/assets/callchain_extrinsic.gif new file mode 100644 index 0000000..e8fe82e Binary files /dev/null and b/pop-cli-for-appchains/.gitbook/assets/callchain_extrinsic.gif differ diff --git a/pop-cli-for-appchains/.gitbook/assets/callchain_state.gif b/pop-cli-for-appchains/.gitbook/assets/callchain_state.gif new file mode 100644 index 0000000..da7e032 Binary files /dev/null and b/pop-cli-for-appchains/.gitbook/assets/callchain_state.gif differ diff --git a/pop-cli-for-appchains/SUMMARY.md b/pop-cli-for-appchains/SUMMARY.md index f0c3340..fd10ca2 100644 --- a/pop-cli-for-appchains/SUMMARY.md +++ b/pop-cli-for-appchains/SUMMARY.md @@ -16,6 +16,7 @@ * [Create an EVM parachain](guides/create-a-new-parachain/create-an-evm-parachain.md) * [Benchmarking](guides/benchmarking/benchmarking-pallets-and-extrinsics.md) * [Build](guides/build-your-parachain.md) + * [Build your chain specification](guides/build-spec.md) * [Build your runtime deterministically](guides/build-deterministic-runtime.md) * [Call](guides/call-a-chain.md) * [Deploy](guides/launch-a-chain/README.md) diff --git a/pop-cli-for-appchains/guides/build-deterministic-runtime.md b/pop-cli-for-appchains/guides/build-deterministic-runtime.md index a5b51b5..e0ec261 100644 --- a/pop-cli-for-appchains/guides/build-deterministic-runtime.md +++ b/pop-cli-for-appchains/guides/build-deterministic-runtime.md @@ -4,17 +4,29 @@ description: The following guide shows how to build deterministic runtimes. # Build your runtime deterministically -By default, the Rust compiler generates optimized Wasm binaries, but they aren't always deterministically reproducible. If the Wasm runtime isn't deterministic, each build might produce slightly different bytecode, This can be a problem for blockchain networks where every node must run the exact same runtime. +> Note: Omni-node-based chains typically ship only a runtime and rely on the community `polkadot-omni-node` host. In +> that setup, building your runtime deterministically is especially important since there is no bespoke node binary — the +> runtime is the source of truth. Pop can automatically source `polkadot-omni-node` when needed. -To ensure deterministic Substrate runtime builds, Pop CLI integrates [SRTool (Substrate Runtime Toolbox)](https://github.com/paritytech/srtool). `SRTool` guarantees that every runtime build produces identical Wasm bytecode, making it reliable for production use. This build requires [Docker](https://www.docker.com/) or [Podman](https://podman.io/) to be installed and running. Pop CLI automatically invokes the `SRTool` image to generate a reproducible and verifiable runtime. +By default, the Rust compiler generates optimized Wasm binaries, but they aren't always deterministically reproducible. +If the Wasm runtime isn't deterministic, each build might produce slightly different bytecode, This can be a problem for +blockchain networks where every node must run the exact same runtime. + +To ensure deterministic Substrate runtime builds, Pop CLI +integrates [SRTool (Substrate Runtime Toolbox)](https://github.com/paritytech/srtool). `SRTool` guarantees that every +runtime build produces identical Wasm bytecode, making it reliable for production use. This build +requires [Docker](https://www.docker.com/) or [Podman](https://podman.io/) to be installed and running. Pop CLI +automatically invokes the `SRTool` image to generate a reproducible and verifiable runtime. This guide provides a quick overview of the importance of deterministic builds and how to achieve them using Pop CLI: ## Build a deterministic runtime with Pop CLI -While generating your chain spec with `pop build spec`, Pop CLI also gives you the option to build your runtime deterministically and inject it automatically. +While generating your chain spec with `pop build spec`, Pop CLI also gives you the option to build your runtime +deterministically and inject it automatically. -Once you select the option to build deterministically, Pop CLI will prompt you to provide the runtime path (by default it's typically located in the runtime/ folder). After confirming, the deterministic build process will begin. +Once you select the option to build deterministically, Pop CLI will prompt you to provide the runtime path (by default +it's typically located in the runtime/ folder). After confirming, the deterministic build process will begin. > ⏳ The build may take 10–15 minutes or more, depending on your setup, so be patient! @@ -37,9 +49,21 @@ Once the build is complete, Pop CLI will automatically inject the resulting runt If you'd prefer not to be prompted interactively, you can specify everything up front via command line: ``` +# minimal deterministic build example pop build spec --deterministic --runtime ./runtime/mainnet + +# optionally, specify the runtime package name used by srtool (if your workspace layout differs) +# note: --package is only applicable when --deterministic is set +pop build spec --deterministic --runtime ./runtime/mainnet --package parachain-template-runtime ``` +Notes about flags: + +- You can pass `--runtime` without `--deterministic` to pre-select the runtime directory for the command. This alone + will not trigger a deterministic build; you must add `--deterministic` to enable srtool. +- The `--package` flag is available to explicitly set the runtime package name when doing a deterministic build; if + omitted, Pop CLI will infer it from the runtime directory. + ## Resources #### Learning Resources diff --git a/pop-cli-for-appchains/guides/build-spec.md b/pop-cli-for-appchains/guides/build-spec.md new file mode 100644 index 0000000..216f4d7 --- /dev/null +++ b/pop-cli-for-appchains/guides/build-spec.md @@ -0,0 +1,108 @@ +--- +description: Generate a plain chain specification and optional artifacts for your chain. +--- + +# Build you Chain Spec + +The chain specification ("chain spec") captures the initial state and configuration of your chain. Nodes use it to start +a network or to join and sync with an existing one. With Pop CLI you can generate a plain chain spec interactively or +non‑interactively, and optionally produce extra artifacts such as genesis state and wasm code, and even inject a +deterministically built runtime. + +## Interactive walkthrough + +Run the command without arguments to be guided through all choices: + +```bash +pop build spec +``` + +This will prompt you for key values like output file name, parachain id, relay chain, chain type, protocol id, +properties, whether to generate genesis files, and whether to build and inject a deterministic runtime. + +
pop build spec
+ +> Tip: You can press Tab to accept defaults and type to filter list selections. + +### What you’ll typically provide + +- Output file name/path for the plain spec (default: ./chain-spec.json) +- Parachain ID (default: 2000) +- Chain type (Development / Local / Live) +- Relay chain (paseo, westend, kusama, polkadot and their local variants) +- Protocol ID and optional properties (token symbol/decimals/SS58) +- Whether to also generate genesis state and genesis code files +- Optional: Build the runtime deterministically and inject it into the spec + +## Non‑interactive usage + +Prefer to skip prompts? Provide flags up front. + +```bash +# Minimal example: write a plain chain spec +pop build spec -o ./chain-spec.json + +# Provide basics explicitly +pop build spec -o ./chain-spec.json \ + --id 2000 \ + --type Local \ + --relay paseo \ + --protocol-id my-protocol \ + --properties "tokenSymbol=UNIT,decimals=12" + +# Include build profile, features, and skip building binaries (if already built) +pop build spec -o ./chain-spec.json \ + --profile release \ + --features foo,bar \ + --skip-build + +# Also generate genesis state and wasm code files alongside the spec +pop build spec -o ./chain-spec.json \ + --genesis-state \ + --genesis-code +``` + +### Deterministic runtime build and injection (optional) + +Pop CLI can build your runtime deterministically using srtool and inject the resulting wasm code into the chain spec +generation flow. + +```bash +# Minimal deterministic build example +pop build spec --deterministic --runtime ./runtime/mainnet + +# Optionally specify the runtime package name used by srtool +# note: --package is only applicable when --deterministic is set +pop build spec --deterministic --runtime ./runtime/mainnet --package parachain-template-runtime +``` + +Notes about flags: + +- You can now pass --runtime without --deterministic to pre-select the runtime directory for the command. This alone + will not trigger a deterministic build you must add --deterministic to enable srtool. +- The --package flag is available to explicitly set the runtime package name when doing a deterministic build; if + omitted, Pop CLI will infer it from the runtime directory. + +> [!TIP] +> Omni-node-based chains: If your chain uses the community `polkadot-omni-node` host (ships only a runtime), you can still +use `pop build spec` the same way. Deterministic builds are recommended; Pop can also auto-source the +`polkadot-omni-node` binary when needed in related workflows. + +## Outputs + +Depending on the flags used you’ll get: + +- A plain chain spec JSON. +- Optionally, a raw chain spec JSON. +- Optionally, a genesis state file. +- Optionally, a genesis wasm code file. + + +#### Learning Resources + +- 🧑‍🏫 Background on Polkadot/Parachains: wiki.polkadot.network +- 🧑‍🔧 srtool: https://github.com/paritytech/srtool + +**Need help?** + +Ask on Polkadot Stack Exchange (tag it `pop`) or drop by our Telegram: https://t.me/onpopio. We're here to help! diff --git a/pop-cli-for-appchains/guides/build-your-parachain.md b/pop-cli-for-appchains/guides/build-your-parachain.md index 77ff262..7982f2b 100644 --- a/pop-cli-for-appchains/guides/build-your-parachain.md +++ b/pop-cli-for-appchains/guides/build-your-parachain.md @@ -7,10 +7,6 @@ cd my-appchain pop build ``` -{% hint style="info" %} -For Pop CLI versions <`0.3.0` the `pop build` command is `pop build parachain` -{% endhint %} - ``` ┌ Pop CLI : Building a parachain │ @@ -27,10 +23,6 @@ If you are outside the project's directory, you can specify the path pop build -p ./my-appchain ``` -{% hint style="info" %} -For Pop CLI versions <`0.3.0` the `pop build` command is `pop build parachain` -{% endhint %} - If you are building the parachain with the intent to onboard the parachain to a Polkadot Relay chain then you can run the following build command: ``` diff --git a/pop-cli-for-appchains/guides/call-a-chain.md b/pop-cli-for-appchains/guides/call-a-chain.md index 41301fe..6d999fa 100644 --- a/pop-cli-for-appchains/guides/call-a-chain.md +++ b/pop-cli-for-appchains/guides/call-a-chain.md @@ -8,45 +8,112 @@ Interact with a chain **using** Pop CLI's interactive guidance by simply enterin pop call chain ``` -You will be prompted to select a pallet, the dispatchable function and its required arguments, connection details for the chain, and the account to sign the transaction. +First, you will be prompted to select which chain you want to interact with from a list of available chains. You can * +*type to filter** the list and quickly find your desired chain. If you want to connect to a custom RPC endpoint, select +the **"Custom"** option, which allows you to manually type the chain URL. -
pop call chain

pop call chain

+After selecting your chain, you will be prompted to select a pallet, then choose what you want to do with that pallet: + +- **Execute an extrinsic** (dispatchable function) +- **Query storage** items +- **Read constant** values + +After making your selection, you'll be guided through providing any required arguments and (for extrinsics) the account +to sign the transaction. + +### What Can You Do? + +The `pop call chain` command supports three types of operations: + +#### 1. Execute Extrinsics + +Submit transactions to the chain by calling dispatchable functions. These require signing and will modify chain state. + +#### 2. Query Storage + +Read storage items from the chain's state. Storage queries don't require signing and can read: + +- **Plain storage values** (e.g., System::Number - the current block number) +- **Storage maps** (e.g., System::Account - account information by address) + +#### 3. Read Constants + +Access constant values defined in the runtime metadata (e.g., System::Version, System::BlockHashCount). ### Manual (non-interactive) If you prefer not to use interactive prompts, you can call the chain by specifying all the required arguments directly: +#### Executing an Extrinsic + +You can execute an extrinsic by specifying the pallet and function (dispatchable function name) and any arguments. + +> [!TIP] +> If you receive "Pallet not found" or "Function not found" errors, double-check the case of your pallet and function +> names. Common examples: use "Balances" (not "balances"), "transfer_keep_alive" (not "transferKeepAlive"). + ```shell -pop call chain --pallet System --function remark --args "0x11" --url ws://localhost:9944/ --suri //Alice --skip-confirm +pop call chain --pallet System --function remark --args "0x11" --url ws://localhost:9944 --suri //Alice --sudo ``` +pop call chain + +#### Querying Storage + +You can query storage items by specifying the pallet and function (storage item name). +Storage queries return the current value immediately without requiring transaction signing. + +```shell +pop call chain --pallet Sudo --function Key --url wss://pas-rpc.stakeworld.io -y ``` -┌ Pop CLI : Call a chain -│ -◇ Would you like to dispatch this function call with `Root` origin? -│ No -│ -⚙ pop call chain --pallet System --function remark --args "0x11" --url ws://localhost:9944/ --suri //Alice -│ -⚙ Encoded call data: 0x00000411 -│ -◇ Do you want to submit the extrinsic? -│ Yes -│ -◇ Extrinsic submitted with hash: "0xadbfbb2f92b22a2c5d6542ba80e4111b5c60057f594a6d155341879c5a46f96e" -│ -└ Call complete. + +```shell +pop call chain --pallet System --function Account --args 0xb815821c5b300d1667d5fc081c06cc4b6addffb90464d68d871ee363b01a127c --url wss://pas-rpc.stakeworld.io -y ``` -#### Additional Options +pop call chain + +#### Reading Constants -* To dispatch a call with Root origin when the chain's runtime includes `pallet-sudo`, you can wrap the call in a `sudo.sudo()` call by using the `--sudo` flag: +Query constant values from the runtime. +Constants are read directly from metadata and don't require signing or keys. ```shell -pop call chain --pallet System --function remark --args "0x11" --url ws://localhost:9944/ --suri //Alice --sudo +pop call chain --pallet System --function Version --url wss://pas-rpc.stakeworld.io -y ``` -* If you already have the SCALE-encoded call data, and want to directly submit the extrinsic: +```shell +pop call chain --pallet System --function BlockHashCount --url wss://pas-rpc.stakeworld.io -y +``` + +### Additional Options + +#### Sudo Calls + +To dispatch a call with Root origin when the chain's runtime includes `pallet-sudo`, you can wrap the call in a +`sudo.sudo()` call by using the `--sudo` flag: + +```shell +pop call chain --pallet System --function remark --args "0x11" --url ws://localhost:9944 --suri //Alice --sudo +``` + +#### Using Wallet for Signing + +You can use a browser extension wallet to sign extrinsics instead of providing a secret URI: + +```shell +pop call chain --pallet System --function remark --args "0x11" --url ws://localhost:9944/ --use-wallet +``` + +Or use the shorthand `-w`: + +```shell +pop call chain --pallet System --function remark --args "0x11" --url ws://localhost:9944/ -w +``` + +#### Direct Call Data Submission + +If you already have the SCALE-encoded call data and want to directly submit the extrinsic: ```shell pop call chain --call 0x00000411 --url ws://localhost:9944/ --suri //Alice @@ -65,6 +132,65 @@ pop call chain --call 0x00000411 --url ws://localhost:9944/ --suri //Alice └ Call complete. ``` +#### Skip Confirmation + +Use the `--skip-confirm` or `-y` flag to automatically submit extrinsics without prompting for confirmation. This also +prevents the prompt to perform another call: + +```shell +pop call chain --pallet System --function remark --args "0x11" --url ws://localhost:9944/ --suri //Alice -y +``` + +This is particularly useful for scripting and automation. + +#### Quick URL Entry + +When prompted for a chain, you can select "Custom" to quickly type the chain URL manually, accelerating the process when +you already know the endpoint. + +### Interactive Features + +When using the interactive mode, you'll experience: + +- **Predefined Actions**: Quick access to common operations like creating assets, transferring balances, etc. +- **Filtered Selection**: Type to filter through pallets and functions for faster navigation +- **Visual Indicators**: Clear labels showing whether an item is an `[EXTRINSIC]`, `[STORAGE]`, or `[CONSTANT]` +- **Documentation**: Inline documentation for each pallet and function +- **Repeat Calls**: After completing an operation, you'll be asked if you want to perform another call (unless + `--skip-confirm` is used) + +### Examples + +#### Example 1: Query Current Block Number + +```shell +pop call chain --pallet System --function Number --url ws://localhost:9944/ +``` + +#### Example 2: Check an Account Balance + +```shell +pop call chain --pallet System --function Account --args "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" --url ws://localhost:9944/ +``` + +#### Example 3: Read Runtime Version + +```shell +pop call chain --pallet System --function Version --url ws://localhost:9944/ +``` + +#### Example 4: Transfer with Wallet + +```shell +pop call chain --pallet Balances --function transfer_keep_alive --args "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty" "1000000000000" --url wss://rpc.polkadot.io --use-wallet +``` + +#### Example 5: Sudo Call with Auto-confirm + +```shell +pop call chain --pallet System --function set_code --args "./runtime.wasm" --url ws://localhost:9944/ --suri //Alice --sudo -y +``` + **Need help?** Ask on [Polkadot Stack Exchange](https://polkadot.stackexchange.com/) (tag it [`pop`](https://substrate.stackexchange.com/tags/pop/info)) or drop by [our Telegram](https://t.me/onpopio). We're here to help! diff --git a/pop-cli-for-appchains/guides/launch-a-chain/launch-paseo.md b/pop-cli-for-appchains/guides/launch-a-chain/launch-paseo.md index 1adb902..c3bf586 100644 --- a/pop-cli-for-appchains/guides/launch-a-chain/launch-paseo.md +++ b/pop-cli-for-appchains/guides/launch-a-chain/launch-paseo.md @@ -39,9 +39,8 @@ Run the network: pop up network ./paseo-local.toml --verbose ``` -{% hint style="info" %} -For Pop CLI versions <`0.7.0` the `pop up network` command is `pop up parachain` -{% endhint %} +> [!TIP] +> For Pop CLI versions <`0.7.0` the `pop up network` command is `pop up parachain` > The `--verbose` flag provides us with extra information such as the location of the Paseo Local chain spec file. diff --git a/pop-cli-for-appchains/guides/launch-a-chain/running-your-parachain.md b/pop-cli-for-appchains/guides/launch-a-chain/running-your-parachain.md index b81d400..7c6cc6d 100644 --- a/pop-cli-for-appchains/guides/launch-a-chain/running-your-parachain.md +++ b/pop-cli-for-appchains/guides/launch-a-chain/running-your-parachain.md @@ -8,9 +8,8 @@ The `pop up` command can help with this. pop up network --help ``` -{% hint style="info" %} -For Pop CLI versions <`0.7.0` the `pop up network` command is `pop up parachain` -{% endhint %} +> [!TIP] +> For Pop CLI versions <`0.7.0` the `pop up network` command is `pop up parachain` Say we want to spin up a local network for your parachain. First we need to define a [zombienet](https://github.com/paritytech/zombienet) network configuration file. You can do this in the root of your project. diff --git a/pop-cli-for-appchains/install-pop-cli.md b/pop-cli-for-appchains/install-pop-cli.md index db72002..bff1321 100644 --- a/pop-cli-for-appchains/install-pop-cli.md +++ b/pop-cli-for-appchains/install-pop-cli.md @@ -2,13 +2,46 @@ ## 1. Install Pop CLI -### 1.1 For MacOS +### 1.1 For macOS and Linux (Homebrew) + +#### Install Homebrew (if not installed) + +- Run the official installer: + +```bash +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +``` + +More info: https://brew.sh + +- Add Homebrew to your PATH (if the installer didn’t do it for you): + +macOS (Apple Silicon): +```bash +echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile +eval "$([ -x /opt/homebrew/bin/brew ] && /opt/homebrew/bin/brew shellenv)" +``` + +Linux: +```bash +echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.profile +eval "$([ -x /home/linuxbrew/.linuxbrew/bin/brew ] && /home/linuxbrew/.linuxbrew/bin/brew shellenv)" +``` + +Verify: +```bash +brew --version +``` + +Now install Pop CLI with Homebrew: ```bash brew install r0gue-io/pop-cli/pop ``` -### 1.2 For any other OS +> Homebrew is available on both macOS and Linux. If you prefer or are on another OS, you can build from source instead. + +### 1.2 Build from source (any OS) Firstly, install Rust: ```bash diff --git "a/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2024-05-09 at 7.31.17\342\200\257PM.png" "b/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2024-05-09 at 7.31.17\342\200\257PM.png" deleted file mode 100644 index 5137a22..0000000 Binary files "a/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2024-05-09 at 7.31.17\342\200\257PM.png" and /dev/null differ diff --git "a/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2024-11-12 at 1.11.26\342\200\257PM.png" "b/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2024-11-12 at 1.11.26\342\200\257PM.png" deleted file mode 100644 index b21cf73..0000000 Binary files "a/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2024-11-12 at 1.11.26\342\200\257PM.png" and /dev/null differ diff --git "a/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2024-11-12 at 11.21.58\342\200\257AM.png" "b/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2024-11-12 at 11.21.58\342\200\257AM.png" deleted file mode 100644 index 3150782..0000000 Binary files "a/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2024-11-12 at 11.21.58\342\200\257AM.png" and /dev/null differ diff --git "a/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2024-11-12 at 11.47.56\342\200\257AM.png" "b/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2024-11-12 at 11.47.56\342\200\257AM.png" deleted file mode 100644 index ff39577..0000000 Binary files "a/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2024-11-12 at 11.47.56\342\200\257AM.png" and /dev/null differ diff --git "a/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2024-11-13 at 6.19.06\342\200\257PM.png" "b/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2024-11-13 at 6.19.06\342\200\257PM.png" deleted file mode 100644 index 09472d6..0000000 Binary files "a/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2024-11-13 at 6.19.06\342\200\257PM.png" and /dev/null differ diff --git "a/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2024-11-13 at 6.21.14\342\200\257PM.png" "b/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2024-11-13 at 6.21.14\342\200\257PM.png" deleted file mode 100644 index 658f105..0000000 Binary files "a/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2024-11-13 at 6.21.14\342\200\257PM.png" and /dev/null differ diff --git "a/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2025-03-14 at 9.09.40\342\200\257AM.png" "b/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2025-03-14 at 9.09.40\342\200\257AM.png" deleted file mode 100644 index bd66188..0000000 Binary files "a/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2025-03-14 at 9.09.40\342\200\257AM.png" and /dev/null differ diff --git "a/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2025-03-14 at 9.11.06\342\200\257AM.png" "b/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2025-03-14 at 9.11.06\342\200\257AM.png" deleted file mode 100644 index 26d771b..0000000 Binary files "a/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2025-03-14 at 9.11.06\342\200\257AM.png" and /dev/null differ diff --git "a/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2025-03-18 at 3.03.33\342\200\257PM.png" "b/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2025-03-18 at 3.03.33\342\200\257PM.png" deleted file mode 100644 index f97ef07..0000000 Binary files "a/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2025-03-18 at 3.03.33\342\200\257PM.png" and /dev/null differ diff --git "a/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2025-03-18 at 3.06.56\342\200\257PM.png" "b/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2025-03-18 at 3.06.56\342\200\257PM.png" deleted file mode 100644 index 1e076ae..0000000 Binary files "a/pop-cli-for-smart-contracts/.gitbook/assets/Screenshot 2025-03-18 at 3.06.56\342\200\257PM.png" and /dev/null differ diff --git a/pop-cli-for-smart-contracts/.gitbook/assets/image (1).png b/pop-cli-for-smart-contracts/.gitbook/assets/image (1).png deleted file mode 100644 index 4a14256..0000000 Binary files a/pop-cli-for-smart-contracts/.gitbook/assets/image (1).png and /dev/null differ diff --git a/pop-cli-for-smart-contracts/.gitbook/assets/image (2).png b/pop-cli-for-smart-contracts/.gitbook/assets/image (2).png deleted file mode 100644 index 08f6f6e..0000000 Binary files a/pop-cli-for-smart-contracts/.gitbook/assets/image (2).png and /dev/null differ diff --git a/pop-cli-for-smart-contracts/.gitbook/assets/image (3).png b/pop-cli-for-smart-contracts/.gitbook/assets/image (3).png deleted file mode 100644 index dedc07a..0000000 Binary files a/pop-cli-for-smart-contracts/.gitbook/assets/image (3).png and /dev/null differ diff --git a/pop-cli-for-smart-contracts/.gitbook/assets/image (4).png b/pop-cli-for-smart-contracts/.gitbook/assets/image (4).png deleted file mode 100644 index 07c78d8..0000000 Binary files a/pop-cli-for-smart-contracts/.gitbook/assets/image (4).png and /dev/null differ diff --git a/pop-cli-for-smart-contracts/.gitbook/assets/image (5).png b/pop-cli-for-smart-contracts/.gitbook/assets/image (5).png deleted file mode 100644 index 0105b00..0000000 Binary files a/pop-cli-for-smart-contracts/.gitbook/assets/image (5).png and /dev/null differ diff --git a/pop-cli-for-smart-contracts/welcome/install-pop-cli.md b/pop-cli-for-smart-contracts/welcome/install-pop-cli.md index b7cfd92..ad8b2ec 100644 --- a/pop-cli-for-smart-contracts/welcome/install-pop-cli.md +++ b/pop-cli-for-smart-contracts/welcome/install-pop-cli.md @@ -2,13 +2,46 @@ ## 1. Install Pop CLI -### 1.1 For MacOS +### 1.1 For macOS and Linux (Homebrew) + +#### Install Homebrew (if not installed) + +- Run the official installer: + +```bash +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +``` + +More info: https://brew.sh + +- Add Homebrew to your PATH (if the installer didn’t do it for you): + +macOS (Apple Silicon): +```bash +echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile +eval "$([ -x /opt/homebrew/bin/brew ] && /opt/homebrew/bin/brew shellenv)" +``` + +Linux: +```bash +echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.profile +eval "$([ -x /home/linuxbrew/.linuxbrew/bin/brew ] && /home/linuxbrew/.linuxbrew/bin/brew shellenv)" +``` + +Verify: +```bash +brew --version +``` + +Now install Pop CLI with Homebrew: ```bash brew install r0gue-io/pop-cli/pop ``` -### 1.2 For any other OS +> Homebrew is available on both macOS and Linux. If you prefer or are on another OS, you can build from source instead. + +### 1.2 Build from source (any OS) Firstly, install Rust: ```bash diff --git "a/pop-network/.gitbook/assets/Screenshot 2024-05-02 at 6.26.01\342\200\257PM.png" "b/pop-network/.gitbook/assets/Screenshot 2024-05-02 at 6.26.01\342\200\257PM.png" deleted file mode 100644 index 4588dd1..0000000 Binary files "a/pop-network/.gitbook/assets/Screenshot 2024-05-02 at 6.26.01\342\200\257PM.png" and /dev/null differ diff --git "a/pop-network/.gitbook/assets/Screenshot 2024-05-02 at 6.40.00\342\200\257PM (1).png" "b/pop-network/.gitbook/assets/Screenshot 2024-05-02 at 6.40.00\342\200\257PM (1).png" deleted file mode 100644 index 7c42846..0000000 Binary files "a/pop-network/.gitbook/assets/Screenshot 2024-05-02 at 6.40.00\342\200\257PM (1).png" and /dev/null differ diff --git a/welcome/install-pop-cli.md b/welcome/install-pop-cli.md index 4291ae3..1b0a2ad 100644 --- a/welcome/install-pop-cli.md +++ b/welcome/install-pop-cli.md @@ -15,13 +15,52 @@ layout: # Install Pop CLI -### 1. Install Rust and Cargo +### 1. Install Pop CLI (macOS and Linux via Homebrew) + +#### Install Homebrew (if not installed) + +- Run the official installer: + +```bash +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +``` + +More info: https://brew.sh + +- Add Homebrew to your PATH (if the installer didn’t do it for you): + +macOS (Apple Silicon): +```bash +echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile +eval "$([ -x /opt/homebrew/bin/brew ] && /opt/homebrew/bin/brew shellenv)" +``` + +Linux: +```bash +echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.profile +eval "$([ -x /home/linuxbrew/.linuxbrew/bin/brew ] && /home/linuxbrew/.linuxbrew/bin/brew shellenv)" +``` + +Verify: +```bash +brew --version +``` + +Now install Pop CLI with Homebrew: + +```bash +brew install r0gue-io/pop-cli/pop +``` + +> Homebrew is available on both macOS and Linux. If you prefer or are on another OS, or want to build from source, use the steps below. + +### 2. Install Rust and Cargo (for building from source) ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -### 2. Install Pop CLI +### 3. Install Pop CLI from source > **Note:** If you want to install Pop CLI for ink! v6 support, see [Getting Started with ink! v6](https://app.gitbook.com/s/CzgRNwlfNkPLJDU555lw/guides/migrating-to-inkv6). @@ -29,7 +68,7 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh cargo install --force --locked pop-cli ``` -### 3. Set up your environment +### 4. Set up your environment ```bash pop install