Skip to content

Commit 4af4aa7

Browse files
committed
Add xcm
1 parent cefef9e commit 4af4aa7

File tree

5 files changed

+87
-34
lines changed

5 files changed

+87
-34
lines changed

develop/parachains/deployment/coretime-renewal.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,4 +170,47 @@ Once you have these values, construct the extrinsic:
170170
171171
3. Check the transaction weight for executing the call. You can estimate this by executing the `transactionPaymentCallApi.queryCallInfo` runtime call with the encoded call data previously obtained:
172172
173-
![](/images/develop/parachains/deployment/coretime-renewal/coretime-renewal-4.webp)
173+
![](/images/develop/parachains/deployment/coretime-renewal/coretime-renewal-4.webp)
174+
175+
176+
### Submit the XCM from your Parachain
177+
178+
To activate auto-renewal, you must submit an XCM from your parachain to the Coretime chain using Root origin. This can be done either through the sudo pallet (if available) or through your parachain's governance system.
179+
180+
The XCM message needs to execute these operations:
181+
182+
1. Withdraw DOT from your parachain's sovereign account on the Coretime chain
183+
2. Buy execution to pay for transaction fees
184+
3. Execute the auto-renewal extrinsic
185+
4. Refund surplus DOT back to the sovereign account
186+
187+
Here's how to submit this XCM using Acala (Parachain 2000) as an example:
188+
189+
1. In [Polkadot.js Apps](https://polkadot.js.org/apps/#/explorer){target=\_blank}, connect to your parachain, navigate to the **Developer** dropdown and select the **Extrinsics** option
190+
191+
2. Create a `sudo.sudo` extrinsic that executes `polkadotXcm.send`:
192+
1. Use the `sudo.sudo` extrinsic to execute the following call as Root
193+
2. Select the **polkadotXcm** pallet
194+
3. Choose the **send** extrinsic
195+
4. Set the **dest** parameter as the Coretime chain (Parachain 1005)
196+
197+
![](/images/develop/parachains/deployment/coretime-renewal/coretime-renewal-5.webp)
198+
199+
200+
3. Construct the XCM and submit it:
201+
202+
1. Add a **WithdrawAsset** instruction
203+
2. Add a **BuyExecution** instruction
204+
3. Add a **Transact** instruction with the following parameters:
205+
- **originKind** - use `SovereignAccount`
206+
- **requireWeightAtMost** - use the weight calculated previously
207+
- **call** - use the encoded call data generated before
208+
4. Add a **RefundSurplus** instruction
209+
5. Add a **DepositAsset** instruction to send remaining funds to the parachain sovereign account
210+
6. Click the **Submit Transaction** button
211+
212+
![](/images/develop/parachains/deployment/coretime-renewal/coretime-renewal-6.webp)
213+
214+
After successful execution, your parachain should have auto-renewal enabled. To verify this, check the events emitted in the Coretime chain.You should see confirmation events similar to:
215+
216+
![](/images/develop/parachains/deployment/coretime-renewal/coretime-renewal-7.webp)
196 KB
Loading
441 KB
Loading
289 KB
Loading

llms.txt

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4034,6 +4034,49 @@ Once you have these values, construct the extrinsic:
40344034
3. Check the transaction weight for executing the call. You can estimate this by executing the `transactionPaymentCallApi.queryCallInfo` runtime call with the encoded call data previously obtained:
40354035

40364036
![](/images/develop/parachains/deployment/coretime-renewal/coretime-renewal-4.webp)
4037+
4038+
4039+
### Submit the XCM from your Parachain
4040+
4041+
To activate auto-renewal, you must submit an XCM from your parachain to the Coretime chain using Root origin. This can be done either through the sudo pallet (if available) or through your parachain's governance system.
4042+
4043+
The XCM message needs to execute these operations:
4044+
4045+
1. Withdraw DOT from your parachain's sovereign account on the Coretime chain
4046+
2. Buy execution to pay for transaction fees
4047+
3. Execute the auto-renewal extrinsic
4048+
4. Refund surplus DOT back to the sovereign account
4049+
4050+
Here's how to submit this XCM using Acala (Parachain 2000) as an example:
4051+
4052+
1. In [Polkadot.js Apps](https://polkadot.js.org/apps/#/explorer){target=\_blank}, connect to your parachain, navigate to the **Developer** dropdown and select the **Extrinsics** option
4053+
4054+
2. Create a `sudo.sudo` extrinsic that executes `polkadotXcm.send`:
4055+
1. Use the `sudo.sudo` extrinsic to execute the following call as Root
4056+
2. Select the **polkadotXcm** pallet
4057+
3. Choose the **send** extrinsic
4058+
4. Set the **dest** parameter as the Coretime chain (Parachain 1005)
4059+
4060+
![](/images/develop/parachains/deployment/coretime-renewal/coretime-renewal-5.webp)
4061+
4062+
4063+
3. Construct the XCM and submit it:
4064+
4065+
1. Add a **WithdrawAsset** instruction
4066+
2. Add a **BuyExecution** instruction
4067+
3. Add a **Transact** instruction with the following parameters:
4068+
- **originKind** - use `SovereignAccount`
4069+
- **requireWeightAtMost** - use the weight calculated previously
4070+
- **call** - use the encoded call data generated before
4071+
4. Add a **RefundSurplus** instruction
4072+
5. Add a **DepositAsset** instruction to send remaining funds to the parachain sovereign account
4073+
6. Click the **Submit Transaction** button
4074+
4075+
![](/images/develop/parachains/deployment/coretime-renewal/coretime-renewal-6.webp)
4076+
4077+
After successful execution, your parachain should have auto-renewal enabled. To verify this, check the events emitted in the Coretime chain.You should see confirmation events similar to:
4078+
4079+
![](/images/develop/parachains/deployment/coretime-renewal/coretime-renewal-7.webp)
40374080
--- END CONTENT ---
40384081

40394082
Doc-Content: https://docs.polkadot.com/develop/parachains/deployment/generate-chain-specs/
@@ -24229,12 +24272,6 @@ Configure the pallets by implementing their `Config` trait and update the runtim
2422924272

2423024273
```
2423124274

24232-
```rust title="mod.rs" hl_lines="3"
24233-
...
24234-
use super::OriginCaller;
24235-
...
24236-
```
24237-
2423824275
2. Implement the [`Config`](https://paritytech.github.io/polkadot-sdk/master/pallet_utility/pallet/trait.Config.html){target=\_blank} trait for both pallets at the end of the `runtime/src/config/mod.rs` file:
2423924276

2424024277
```rust title="mod.rs"
@@ -24250,33 +24287,6 @@ parameter_types! {
2425024287
pub const CounterMaxValue: u32 = 500;
2425124288
}
2425224289

24253-
// Configure custom pallet.
24254-
impl custom_pallet::Config for Runtime {
24255-
type RuntimeEvent = RuntimeEvent;
24256-
type CounterMaxValue = CounterMaxValue;
24257-
24258-
```
24259-
24260-
```rust title="mod.rs" hl_lines="8-25"
24261-
...
24262-
impl pallet_parachain_template::Config for Runtime {
24263-
type RuntimeEvent = RuntimeEvent;
24264-
type WeightInfo = pallet_parachain_template::weights::SubstrateWeight<Runtime>;
24265-
}
24266-
24267-
// Configure utility pallet.
24268-
impl pallet_utility::Config for Runtime {
24269-
type RuntimeEvent = RuntimeEvent;
24270-
type RuntimeCall = RuntimeCall;
24271-
type PalletsOrigin = OriginCaller;
24272-
type WeightInfo = pallet_utility::weights::SubstrateWeight<Runtime>;
24273-
}
24274-
24275-
// Define counter max value runtime constant.
24276-
parameter_types! {
24277-
pub const CounterMaxValue: u32 = 500;
24278-
}
24279-
2428024290
// Configure custom pallet.
2428124291
impl custom_pallet::Config for Runtime {
2428224292
type RuntimeEvent = RuntimeEvent;

0 commit comments

Comments
 (0)