-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: include call chain new feature (#12)
* docs: include call contract improvements in the existing docs * chore: update gif file * docs: small improvements * docs: update gif * docs: various improvements * docs: small adjusts * docs: fix feedback * refactor: call a chain instead of calling
- Loading branch information
Showing
4 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Call a chain | ||
|
||
### Interactive Guidance (Recommended) | ||
|
||
Interact with a chain **using** Pop CLI's interactive guidance by simply entering: | ||
|
||
```shell | ||
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. | ||
|
||
<figure><img src="../.gitbook/assets/callchain.gif" alt="pop call chain"><figcaption><p>pop call chain</p></figcaption></figure> | ||
|
||
### Manual (non-interactive) | ||
|
||
If you prefer not to use interactive prompts, you can call the chain by specifying all the required arguments directly: | ||
|
||
```shell | ||
pop call chain --pallet System --function remark --args "0x11" --url ws://localhost:9944/ --suri //Alice --skip-confirm | ||
``` | ||
|
||
``` | ||
┌ 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. | ||
``` | ||
|
||
#### Additional Options | ||
|
||
* 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 | ||
``` | ||
|
||
* 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 | ||
``` | ||
|
||
``` | ||
┌ Pop CLI : Call a chain | ||
│ | ||
⚙ Encoded call data: 0x00000411 | ||
│ | ||
◇ Do you want to submit the extrinsic? | ||
│ Yes | ||
│ | ||
◇ Extrinsic submitted successfully with hash: "0x60b10fa42fa7bb9e36460d199cef55b28b41dae3f9bb3326fc0e584009ce305b" | ||
│ | ||
└ Call complete. | ||
``` | ||
|
||
**Technical Support** | ||
|
||
* [Polkadot Stack Exchange](https://polkadot.stackexchange.com/) | ||
* Create a question and tag it with "[`pop`](https://substrate.stackexchange.com/tags/pop/info)" | ||
* Share the StackExchange question in our [Pop Support Telegram channel](https://t.me/pop\_support) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
description: Call a chain | ||
--- | ||
|
||
# call | ||
|
||
```bash | ||
pop call <COMMAND> | ||
``` | ||
|
||
**Interacting with the chain** | ||
|
||
```bash | ||
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. | ||
|
||
If interactive guidance is not desired, you can proceed manually as follows: | ||
|
||
```bash | ||
pop call chain --pallet System --function remark --args "0x11" --url ws://localhost:9944/ --suri //Alice --skip-confirm | ||
``` | ||
|
||
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: | ||
|
||
```bash | ||
pop call chain --pallet System --function remark --args "0x11" --url ws://localhost:9944/ --suri //Alice --sudo | ||
``` | ||
|
||
If you already have the `SCALE`-encoded call data and want to submit the extrinsic directly, use `--chain` as shown below: | ||
|
||
```shell | ||
pop call chain --call 0x00000411 --url ws://localhost:9944/ --suri //Alice | ||
``` | ||
|
||
**Additional options:** | ||
|
||
``` | ||
pop call chain --help | ||
Call a chain | ||
Usage: pop call chain [OPTIONS] | ||
Options: | ||
-p, --pallet <PALLET> | ||
The pallet containing the dispatchable function to execute | ||
-f, --function <FUNCTION> | ||
The dispatchable function to execute within the specified pallet | ||
-a, --args [<ARGS>...] | ||
The dispatchable function arguments, encoded as strings | ||
-u, --url <URL> | ||
Websocket endpoint of a node | ||
-s, --suri <SURI> | ||
Secret key URI for the account signing the extrinsic. | ||
e.g. - for a dev account "//Alice" - with a password "//Alice///SECRET_PASSWORD" | ||
-c, --call <call> | ||
SCALE encoded bytes representing the call data of the extrinsic | ||
-S, --sudo | ||
Authenticates the sudo key and dispatches a function call with `Root` origin | ||
-y, --skip-confirm | ||
Automatically signs and submits the extrinsic without prompting for confirmation | ||
-h, --help | ||
Print help (see a summary with '-h') | ||
``` |