From 6c3847ce1ec7507ea2a8ec75c1c8d56c06e9f02b Mon Sep 17 00:00:00 2001 From: fabricwave <167740466+fabricwave@users.noreply.github.com> Date: Fri, 19 Jul 2024 11:42:06 +0800 Subject: [PATCH 01/17] Fix dangling link to 'preparing environment' heading --- docs/for_users/pchain_client_cli/getting_started.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/for_users/pchain_client_cli/getting_started.md b/docs/for_users/pchain_client_cli/getting_started.md index fa04ffd5..428d70e5 100644 --- a/docs/for_users/pchain_client_cli/getting_started.md +++ b/docs/for_users/pchain_client_cli/getting_started.md @@ -44,7 +44,7 @@ SUBCOMMANDS: 2. Unzip the file to extract the executable `pchain_client.exe`. 3. Open Powershell by pressing *WIN+R* and typing `powershell`. 4. Navigate to the directory where `pchain_client.exe` is located using the `cd` command. For example, if the executable is located at `C:\Development`, type `cd C:\Development`. -5. Follow the instructions in Section [Prepare Environment](#prepare-environment) to get ready for interacting with the blockchain. +5. Follow the instructions in Section [Preparing Environment](#preparing-environment) to get ready for interacting with the blockchain. ### Linux / macOS @@ -63,7 +63,7 @@ The installation process for Linux and macOS is similar. To install `pchain_clie tar -xvf pchain_client_mac_v0.4.3.tar.gz ``` -3. Follow the instructions in Section [Prepare Environment](#prepare-environment) to get ready for interacting with the blockchain. +3. Follow the instructions in Section [Preparing Environment](#preparing-environment) to get ready for interacting with the blockchain. !!! Tips From 2f7ca4256d7bc1db10de4efc7984dd86d7743b32 Mon Sep 17 00:00:00 2001 From: fabricwave <167740466+fabricwave@users.noreply.github.com> Date: Fri, 19 Jul 2024 11:42:19 +0800 Subject: [PATCH 02/17] Update pchain_client version references to v0.4.4 --- docs/for_users/pchain_client_cli/getting_started.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/for_users/pchain_client_cli/getting_started.md b/docs/for_users/pchain_client_cli/getting_started.md index 428d70e5..22228f33 100644 --- a/docs/for_users/pchain_client_cli/getting_started.md +++ b/docs/for_users/pchain_client_cli/getting_started.md @@ -11,7 +11,7 @@ For a detailed description of all available commands, execute `pchain_client --h **Usage** ```terminal -ParallelChain Client CLI 0.4.3 +ParallelChain Client CLI 0.4.4 ParallelChain client (`pchain_client`) is a command-line tool for you to connect and interact with the ParallelChain Mainnet/Testnet. @@ -56,11 +56,11 @@ The installation process for Linux and macOS is similar. To install `pchain_clie === "Linux" ```bash - tar -xvf pchain_client_linux_v0.4.3.tar.gz + tar -xvf pchain_client_linux_v0.4.4.tar.gz ``` === "macOS" ```bash - tar -xvf pchain_client_mac_v0.4.3.tar.gz + tar -xvf pchain_client_mac_v0.4.4.tar.gz ``` 3. Follow the instructions in Section [Preparing Environment](#preparing-environment) to get ready for interacting with the blockchain. From c5b3d2200c2e8d34f5fbd982c1cdc0d8b32a0833 Mon Sep 17 00:00:00 2001 From: fabricwave <167740466+fabricwave@users.noreply.github.com> Date: Fri, 19 Jul 2024 11:42:23 +0800 Subject: [PATCH 03/17] Fix missing '\' to 'create transaction' console command --- docs/for_developers/smart_contracts/getting_started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/for_developers/smart_contracts/getting_started.md b/docs/for_developers/smart_contracts/getting_started.md index f2131d50..d4151014 100644 --- a/docs/for_developers/smart_contracts/getting_started.md +++ b/docs/for_developers/smart_contracts/getting_started.md @@ -139,7 +139,7 @@ You can deploy the contract using the pchain_client command line tool. You shoul === "Linux / macOS" ```bash - ./pchain_client transaction create + ./pchain_client transaction create \ --nonce \ --gas-limit \ --max-base-fee-per-gas \ From 62bc18225170e99ab1fbddd37239ca8b53e52ac3 Mon Sep 17 00:00:00 2001 From: fabricwave <167740466+fabricwave@users.noreply.github.com> Date: Fri, 19 Jul 2024 11:42:25 +0800 Subject: [PATCH 04/17] Fix invalid parameter types for calling base64url::decode --- .../smart_contract_examples/4_contract_proxy.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/for_developers/smart_contracts/smart_contract_examples/4_contract_proxy.md b/docs/for_developers/smart_contracts/smart_contract_examples/4_contract_proxy.md index 8143978f..04f1498b 100644 --- a/docs/for_developers/smart_contracts/smart_contract_examples/4_contract_proxy.md +++ b/docs/for_developers/smart_contracts/smart_contract_examples/4_contract_proxy.md @@ -63,7 +63,7 @@ address does not need to be hard-coded in the contract. ```rust #[call] fn grow_up_2(address: String) { - let contract_address = base64url::decode(address).unwrap().try_into().unwrap(); + let contract_address = base64url::decode(&address).unwrap().try_into().unwrap(); pchain_sdk::call_untyped( contract_address, "grow_up", @@ -80,7 +80,7 @@ contract to a specific address by `pchain_sdk::transfer()` (see [Transferring Ba ```rust #[call] fn send_tokens(to_address: String, value :u64){ - let contract_address = base64url::decode(to_address).unwrap().try_into().unwrap(); + let contract_address = base64url::decode(&to_address).unwrap().try_into().unwrap(); pchain_sdk::transfer( contract_address, value From 48fbf078e350848dcd7d70fc8ac4b4621a01c396 Mon Sep 17 00:00:00 2001 From: fabricwave <167740466+fabricwave@users.noreply.github.com> Date: Fri, 19 Jul 2024 11:42:27 +0800 Subject: [PATCH 05/17] Fix deposit notes partially appearing outside notes block --- .../smart_contracts/smart_contract_examples/6_my_pool.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/for_developers/smart_contracts/smart_contract_examples/6_my_pool.md b/docs/for_developers/smart_contracts/smart_contract_examples/6_my_pool.md index aecbb156..eed4aa6d 100644 --- a/docs/for_developers/smart_contracts/smart_contract_examples/6_my_pool.md +++ b/docs/for_developers/smart_contracts/smart_contract_examples/6_my_pool.md @@ -59,8 +59,7 @@ After adding the `init()` function, we can try creating a deposit into the pool. The staking commands are "deferred" because the actual execution of such commands occurs after the execution of a successful call. !!! Note - The deposit is created on behalf of the contract address, not from your account address, so make sure to transfer -sufficient balance to the contract for the operation. + The deposit is created on behalf of the contract address, not from your account address, so make sure to transfer sufficient balance to the contract for the operation. To check if the deposit is successful, you can check the deposit using `pchain-client` with the following [command](../../../for_users/pchain_client_cli/querying_blockchain.md#get-deposit-and-stake): From 35c53ab2f11b3fa5e60530af5cca421410ba578a Mon Sep 17 00:00:00 2001 From: fabricwave <167740466+fabricwave@users.noreply.github.com> Date: Mon, 22 Jul 2024 10:27:57 +0800 Subject: [PATCH 06/17] Fix typo error 'submiting' Change to 'submitting' --- docs/for_developers/smart_contracts/getting_started.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/for_developers/smart_contracts/getting_started.md b/docs/for_developers/smart_contracts/getting_started.md index d4151014..4551019a 100644 --- a/docs/for_developers/smart_contracts/getting_started.md +++ b/docs/for_developers/smart_contracts/getting_started.md @@ -160,7 +160,7 @@ You can deploy the contract using the pchain_client command line tool. You shoul --cbi-version ``` -You can follow the instruction in [Create Transaction](../../for_users/pchain_client_cli/creating_transaction.md) about submiting a transaction through `pchain-client`. +You can follow the instruction in [Create Transaction](../../for_users/pchain_client_cli/creating_transaction.md) about submitting a transaction through `pchain-client`. ## Checking Contract In State @@ -237,7 +237,7 @@ The command argument `arguments` is the JSON file that contains the method argum The gas limit required for the transaction depends on the complexity of the smart contract. For safety reasons, you can always set a higher gas limit. You can also test contract calls on testnet to reassure. -You can follow the instruction in [Create Transaction](../../for_users/pchain_client_cli/creating_transaction.md) about submiting a transaction through `pchain-client`. +You can follow the instruction in [Create Transaction](../../for_users/pchain_client_cli/creating_transaction.md) about submitting a transaction through `pchain-client`. To query the resulting receipt of the transaction, From b006f9bd5e6d75ad6778a2f9766b8a10cba9e764 Mon Sep 17 00:00:00 2001 From: fabricwave <167740466+fabricwave@users.noreply.github.com> Date: Mon, 22 Jul 2024 10:45:25 +0800 Subject: [PATCH 07/17] Add note to faucet service --- docs/for_users/pchain_client_cli/creating_transaction.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/for_users/pchain_client_cli/creating_transaction.md b/docs/for_users/pchain_client_cli/creating_transaction.md index ecf3a0aa..3d75b36f 100644 --- a/docs/for_users/pchain_client_cli/creating_transaction.md +++ b/docs/for_users/pchain_client_cli/creating_transaction.md @@ -146,6 +146,9 @@ Example: ### Submit Transaction to ParallelChain After preparing the transaction json file, you can now submit the transaction with keypair. +!!! Note + Executing transactions may require paying for gas fees. If you are testing transactions on Parallelchain Testnet, you can get free testnet tokens from the [Faucet Service](../../fundamentals/networks.md#faucet-service) to pay for the gas fees. + Example: === "Linux / macOS" From f7e5d25fc117ea911a4cde1f7dffc3bf370e0a3f Mon Sep 17 00:00:00 2001 From: fabricwave <167740466+fabricwave@users.noreply.github.com> Date: Mon, 22 Jul 2024 11:13:35 +0800 Subject: [PATCH 08/17] Increase deploy example gas limit to 500 million Original gas limit of 100000 is not enough for deploying 'hello_contract' --- docs/for_users/pchain_client_cli/creating_transaction.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/for_users/pchain_client_cli/creating_transaction.md b/docs/for_users/pchain_client_cli/creating_transaction.md index 3d75b36f..cb59f2f9 100644 --- a/docs/for_users/pchain_client_cli/creating_transaction.md +++ b/docs/for_users/pchain_client_cli/creating_transaction.md @@ -99,7 +99,7 @@ Example - Deploy contract and save to designated file `deposit-tx.json`: ./pchain_client transaction create \ --destination ~/Documents/deposit-tx.json \ --nonce 0 \ - --gas-limit 100000 \ + --gas-limit 500000000 \ --max-base-fee-per-gas 8 \ --priority-fee-per-gas 0 \ deploy \ @@ -111,7 +111,7 @@ Example - Deploy contract and save to designated file `deposit-tx.json`: ./pchain_client.exe transaction create ` --destination ~/Documents/deposit-tx.json ` --nonce 0 ` - --gas-limit 100000 ` + --gas-limit 500000000 ` --max-base-fee-per-gas 8 ` --priority-fee-per-gas 0 ` deploy ` From 11fe8023763ecab957b6d9190eaa17e8714b5382 Mon Sep 17 00:00:00 2001 From: fabricwave <167740466+fabricwave@users.noreply.github.com> Date: Mon, 22 Jul 2024 11:15:03 +0800 Subject: [PATCH 09/17] Clarify instructions on submitting transactions --- docs/for_developers/smart_contracts/getting_started.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/for_developers/smart_contracts/getting_started.md b/docs/for_developers/smart_contracts/getting_started.md index 4551019a..d5e7550c 100644 --- a/docs/for_developers/smart_contracts/getting_started.md +++ b/docs/for_developers/smart_contracts/getting_started.md @@ -160,7 +160,7 @@ You can deploy the contract using the pchain_client command line tool. You shoul --cbi-version ``` -You can follow the instruction in [Create Transaction](../../for_users/pchain_client_cli/creating_transaction.md) about submitting a transaction through `pchain-client`. +You can refer to the instruction and example arguments in [Create & Submit Transaction](../../for_users/pchain_client_cli/creating_transaction.md) to create and submit a transaction through `pchain-client`. ## Checking Contract In State @@ -237,7 +237,7 @@ The command argument `arguments` is the JSON file that contains the method argum The gas limit required for the transaction depends on the complexity of the smart contract. For safety reasons, you can always set a higher gas limit. You can also test contract calls on testnet to reassure. -You can follow the instruction in [Create Transaction](../../for_users/pchain_client_cli/creating_transaction.md) about submitting a transaction through `pchain-client`. +You can refer to the instruction and example arguments in [Create & Submit Transaction](../../for_users/pchain_client_cli/creating_transaction.md) to create and submit a transaction through `pchain-client`. To query the resulting receipt of the transaction, From 8ab83f70881e693dde5448389bf2c2a35739895c Mon Sep 17 00:00:00 2001 From: fabricwave <167740466+fabricwave@users.noreply.github.com> Date: Mon, 22 Jul 2024 11:16:42 +0800 Subject: [PATCH 10/17] Move down 'running pchain_client` section Move down the 'running pchain_client' section to after 'Preparing Environment' section --- .../pchain_client_cli/getting_started.md | 55 +++++++++---------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/docs/for_users/pchain_client_cli/getting_started.md b/docs/for_users/pchain_client_cli/getting_started.md index 22228f33..c26bb582 100644 --- a/docs/for_users/pchain_client_cli/getting_started.md +++ b/docs/for_users/pchain_client_cli/getting_started.md @@ -85,34 +85,6 @@ The installation process for Linux and macOS is similar. To install `pchain_clie !!! note If this is your first time using `pchain_client`, you need to set up `$PCHAIN_CLI_HOME` in environment variables to specify the home path. See more [here](https://chlee.co/how-to-setup-environment-variables-for-windows-mac-and-linux/). -## Running pchain_client - -### Create Password - -For the first time to use `pchain_client`, you need to create your password for using it. The terminal should prompt you as follows: - -```text -First time using ParallelChain Client CLI. Please set up a password to protect your keypairs. -Your password: -``` - -This password is only used by the CLI, and **NOT** associated with the blockchain. It is used for encryption and decryption of your keypairs so that the keypairs are stored in your computer more securely. Alternatively, you can skip the password protection by simply pressing **Enter**. - -You will be required to enter your password twice. If your password is set successfully, you will see a return message with the `pchain_client` version shown on the console. - -=== "Linux / macOS" - ```bash - ./pchain_client --version - ``` -=== "Windows PowerShell" - ```PowerShell - ./pchain_client.exe --version - ``` - -!!! warning - The password is not sent and saved anywhere. You won't be able to recover the password if you lose it. Please keep your password safe. You will be required to provide this password to submit transactions and manage keypairs later. - - ## Preparing Environment ### Set Environmental Variables @@ -179,3 +151,30 @@ This would check the status of your chosen provider. If `pchain_client` cannot c A `config.toml` file will be created in the folder specified by the environment variable `PCHAIN_CLI_HOME` upon success. It only needs to be executed once. Now you can start the journey to play around with `pchain_client`! + +## Running pchain_client + +### Create Password + +For the first time to use `pchain_client`, you need to create your password for using it. The terminal should prompt you as follows: + +```text +First time using ParallelChain Client CLI. Please set up a password to protect your keypairs. +Your password: +``` + +This password is only used by the CLI, and **NOT** associated with the blockchain. It is used for encryption and decryption of your keypairs so that the keypairs are stored in your computer more securely. Alternatively, you can skip the password protection by simply pressing **Enter**. + +You will be required to enter your password twice. If your password is set successfully, you will see a return message with the `pchain_client` version shown on the console. + +=== "Linux / macOS" + ```bash + ./pchain_client --version + ``` +=== "Windows PowerShell" + ```PowerShell + ./pchain_client.exe --version + ``` + +!!! warning + The password is not sent and saved anywhere. You won't be able to recover the password if you lose it. Please keep your password safe. You will be required to provide this password to submit transactions and manage keypairs later. From f0e86382ee5a7b2dfb7a22ff87adc225a894a7bf Mon Sep 17 00:00:00 2001 From: fabricwave <167740466+fabricwave@users.noreply.github.com> Date: Mon, 22 Jul 2024 11:51:57 +0800 Subject: [PATCH 11/17] Add account creation note --- docs/for_users/pchain_client_cli/querying_blockchain.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/for_users/pchain_client_cli/querying_blockchain.md b/docs/for_users/pchain_client_cli/querying_blockchain.md index 6e3cc527..2a601ba4 100644 --- a/docs/for_users/pchain_client_cli/querying_blockchain.md +++ b/docs/for_users/pchain_client_cli/querying_blockchain.md @@ -10,6 +10,10 @@ tags: Use `pchain_client query --help` to check the full list available to query. ### Check Account Related Information + +!!! Note + If you don't have access to an account yet, check "See also" under [How Account Works](../../fundamentals/accounts.md#how-account-works) to create an account. + To check Externally Owned Accounts (EOA) information such as balance and nonce, your account address (public key) is always needed. Commands: From 3083df25d51ea6b3b335e2d7633225c49d8ebd2e Mon Sep 17 00:00:00 2001 From: fabricwave <167740466+fabricwave@users.noreply.github.com> Date: Mon, 22 Jul 2024 16:12:36 +0800 Subject: [PATCH 12/17] Clarify Cacher data structure explanation --- .../smart_contract_examples/5_my_collections.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/for_developers/smart_contracts/smart_contract_examples/5_my_collections.md b/docs/for_developers/smart_contracts/smart_contract_examples/5_my_collections.md index 381d1a8f..0d9672e1 100644 --- a/docs/for_developers/smart_contracts/smart_contract_examples/5_my_collections.md +++ b/docs/for_developers/smart_contracts/smart_contract_examples/5_my_collections.md @@ -11,7 +11,7 @@ We are going to demonstrate the use of module [collections](https://github.com/p `collections` are designed as a data structure for gas efficiency: -- Cacher: allows lazy initialization +- Cacher: allows lazy loading of a field in contract storage - Vector: lazily stores a list of items - FastMap: lazily stores items into a key-value map - IterableMap: lazily stores items into an iterable key-value map @@ -37,7 +37,7 @@ pub struct MyCollections { ``` ### Cacher -`Cacher` is a data wrapper to support Lazy Read and Lazy Write to Contract Storage. +`Cacher` is a data wrapper to support Lazy Read and Lazy Write to a field in Contract Storage. ```rust #[contract_methods] From f9d50fb9dc206a7f5edcad264101142708b25586 Mon Sep 17 00:00:00 2001 From: fabricwave <167740466+fabricwave@users.noreply.github.com> Date: Mon, 22 Jul 2024 14:47:11 +0800 Subject: [PATCH 13/17] Add base64url dependency note for contract_proxy Required for grow_up_2() and send_tokens() functions --- .../smart_contract_examples/4_contract_proxy.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/for_developers/smart_contracts/smart_contract_examples/4_contract_proxy.md b/docs/for_developers/smart_contracts/smart_contract_examples/4_contract_proxy.md index 04f1498b..27f782c5 100644 --- a/docs/for_developers/smart_contracts/smart_contract_examples/4_contract_proxy.md +++ b/docs/for_developers/smart_contracts/smart_contract_examples/4_contract_proxy.md @@ -59,6 +59,9 @@ The above example has shown how we can use the `use_contract` macro to do [cross to use `pchain_sdk::call_untyped()` to do so. We pass the contract address as an argument so that the contract address does not need to be hard-coded in the contract. +!!! note + Add `base64url = "0.1.0"` under `[Dependency]` in `Cargo.toml` for the project. + ### lib.rs: pchain_sdk::call_untyped() ```rust #[call] From 00a8d88ba6df41649cf7a4728c51c94f9cc0e0a9 Mon Sep 17 00:00:00 2001 From: fabricwave <167740466+fabricwave@users.noreply.github.com> Date: Mon, 22 Jul 2024 17:08:04 +0800 Subject: [PATCH 14/17] Add pre-requisites to deploy My Little Pony for Contract Proxy --- .../smart_contract_examples/4_contract_proxy.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/for_developers/smart_contracts/smart_contract_examples/4_contract_proxy.md b/docs/for_developers/smart_contracts/smart_contract_examples/4_contract_proxy.md index 27f782c5..f0263031 100644 --- a/docs/for_developers/smart_contracts/smart_contract_examples/4_contract_proxy.md +++ b/docs/for_developers/smart_contracts/smart_contract_examples/4_contract_proxy.md @@ -20,6 +20,9 @@ Recall that we have a deployed contract called `MyLittlePony` that consists of t `self_introduction()`, `grow_up()`, and `change_person()`. We are going to use `grow_up()` in `ContractProxy`, so we can comment out the rest of them. +!!! Pre-requisites + Deploy [My Little Pony](./2_my_little_pony.md) smart contract, and then replace the address supplied to `use_contract` macro with the smart contract address of My Little Pony. + ### lib.rs: define a trait ```rust use pchain_sdk::{ From 8039ed6e18e0220e90b98b1a2a1413bf135ebb75 Mon Sep 17 00:00:00 2001 From: fabricwave <167740466+fabricwave@users.noreply.github.com> Date: Mon, 22 Jul 2024 17:08:45 +0800 Subject: [PATCH 15/17] Fix invalid My Little Pony smart contract address --- .../smart_contracts/smart_contract_examples/4_contract_proxy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/for_developers/smart_contracts/smart_contract_examples/4_contract_proxy.md b/docs/for_developers/smart_contracts/smart_contract_examples/4_contract_proxy.md index f0263031..db7d3a47 100644 --- a/docs/for_developers/smart_contracts/smart_contract_examples/4_contract_proxy.md +++ b/docs/for_developers/smart_contracts/smart_contract_examples/4_contract_proxy.md @@ -29,7 +29,7 @@ use pchain_sdk::{ use_contract, call, contract, contract_methods }; -#[use_contract("-jUt6jrEfMRD1JM9n6_yAASl2cwsc4tg1Bqp07gvQpU")] +#[use_contract("xxT5OXMonFm8wcDw-io1jeyAEnxSddGPOG-ZezArCV4")] pub trait MyLittlePony { //fn self_introduction() -> String; fn grow_up(); From 89e736fc7ddd0ac6cae9afed1825f454815745ff Mon Sep 17 00:00:00 2001 From: fabricwave <167740466+fabricwave@users.noreply.github.com> Date: Mon, 22 Jul 2024 17:15:12 +0800 Subject: [PATCH 16/17] Match example return value to example input value Input is "Alice", which should be returned as '5' in CallResult from `name.len() as u32`, instead of 4. --- docs/for_developers/smart_contracts/getting_started.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/for_developers/smart_contracts/getting_started.md b/docs/for_developers/smart_contracts/getting_started.md index d5e7550c..eb07e803 100644 --- a/docs/for_developers/smart_contracts/getting_started.md +++ b/docs/for_developers/smart_contracts/getting_started.md @@ -256,15 +256,15 @@ The commands stored in `transaction` and command receipts in `receipt` are follo To parse the response from the contract method, represented in the field named `return value` , which is in `CallResult` format, you can use the `parse call-result` command in ParallelChain Client. -For example, if the contract method returns a u32 integer, the `return value` is "BAAAAAUAAAA" you can parse the `CallResult` data structure using the `--data-type u32` flag: +For example, if the contract method returns a u32 integer, the `return value` is "BQAAAA" you can parse the `CallResult` data structure using the `--data-type u32` flag: === "Linux / macOS" ```bash - pchain_client parse call-result --value BAAAAAUAAAA --data-type u32 + pchain_client parse call-result --value BQAAAA --data-type u32 ``` === "Windows PowerShell" ```PowerShell - ./pchain_client.exe parse call-result --value BAAAAAUAAAA --data-type u32 + ./pchain_client.exe parse call-result --value BQAAAA --data-type u32 ``` -The output will be the parsed value of the `CallResult`, which in this case is `4`. For more details, you can use the `help` command to see the usage of the tool or take a look at the example `argument,json`. \ No newline at end of file +The output will be the parsed value of the `CallResult`, which in this case is `5`. For more details, you can use the `help` command to see the usage of the tool or take a look at the example `argument,json`. From f0020f98654273ac69d422f4a0c0bef846329a53 Mon Sep 17 00:00:00 2001 From: fabricwave <167740466+fabricwave@users.noreply.github.com> Date: Tue, 23 Jul 2024 14:22:17 +0800 Subject: [PATCH 17/17] Link keypair to keypair management page Managing account page contains information to create/manage a keypair. --- docs/for_users/pchain_client_cli/creating_transaction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/for_users/pchain_client_cli/creating_transaction.md b/docs/for_users/pchain_client_cli/creating_transaction.md index cb59f2f9..495f7682 100644 --- a/docs/for_users/pchain_client_cli/creating_transaction.md +++ b/docs/for_users/pchain_client_cli/creating_transaction.md @@ -144,7 +144,7 @@ Example: ``` ### Submit Transaction to ParallelChain -After preparing the transaction json file, you can now submit the transaction with keypair. +After preparing the transaction json file, you can now submit the transaction with [keypair](../../for_users/pchain_client_cli/managing_account.md/). !!! Note Executing transactions may require paying for gas fees. If you are testing transactions on Parallelchain Testnet, you can get free testnet tokens from the [Faucet Service](../../fundamentals/networks.md#faucet-service) to pay for the gas fees.