Skip to content

Commit ffede2e

Browse files
committed
formatting updates, correct nav filepath to fix 404
1 parent 9ed7bbc commit ffede2e

File tree

2 files changed

+64
-58
lines changed

2 files changed

+64
-58
lines changed

tutorials/interoperability/.nav.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ nav:
55
- xcm-transfers
66
- 'Replay and Dry Run XCMs': replay-and-dry-run-xcms.md
77
- 'XCM Fee Estimation': xcm-fee-estimation.md
8-
- 'XCM Observability in Action': xcm-observability-in-action-in-action.md
8+
- 'XCM Observability in Action': xcm-observability-in-action.md

tutorials/interoperability/xcm-observability-in-action.md

Lines changed: 63 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,53 @@
11
---
22
title: XCM Observability in Action
3-
description: A hands-on guide to tracing, correlating, and debugging cross-chain XCMs using observability tools in the Polkadot SDK.
3+
description: Follow this step-by-step guide to trace, correlate, and debug cross-chain XCMs using observability tools in the Polkadot SDK.
44
---
55

66
# XCM Observability in Action
77

88
## Introduction
99

10-
Cross-Consensus Messaging (XCM) powers interoperability in the Polkadot ecosystem, but tracing flows across multiple chains is challenging in practice.
10+
Cross-Consensus Messaging (XCM) enables interoperability within the Polkadot ecosystem; however, tracing flows across multiple chains is challenging in practice.
1111

12-
This tutorial walks through a **hands-on scenario**: sending assets between parachains and tracing the resulting XCM across origin and destination chains. Along the way, you will:
12+
Follow this tutorial to send assets between parachains and trace the resulting XCM across the origin and destination chains. By completing this tutorial, you will:
1313

14-
- Capture `message_id` and [`SetTopic([u8; 32])`](https://github.com/polkadot-fellows/xcm-format#settopic){target=\_blank} for tracking
15-
- Correlate [`PolkadotXcm.Sent`](https://paritytech.github.io/polkadot-sdk/master/pallet_xcm/pallet/enum.Event.html#variant.Sent){target=\_blank} and [`MessageQueue.Processed`](https://paritytech.github.io/polkadot-sdk/master/pallet_message_queue/pallet/enum.Event.html#variant.Processed){target=\_blank} events across chains
16-
- Apply manual topic tagging for custom multi-hop flows
17-
18-
For background concepts and best practices, see the companion page: [XCM Observability](/develop/interoperability/xcm-observability){target=\_blank}.
14+
- Capture `message_id` and [`SetTopic([u8; 32])`](https://github.com/polkadot-fellows/xcm-format#settopic){target=\_blank} for tracking.
15+
- Correlate [`PolkadotXcm.Sent`](https://paritytech.github.io/polkadot-sdk/master/pallet_xcm/pallet/enum.Event.html#variant.Sent){target=\_blank} and [`MessageQueue.Processed`](https://paritytech.github.io/polkadot-sdk/master/pallet_message_queue/pallet/enum.Event.html#variant.Processed){target=\_blank} events across chains.
16+
- Apply manual topic tagging for custom multi-hop flows.
1917

2018
## Prerequisites
2119

22-
Before you begin, make sure you've:
23-
24-
- [Chopsticks](/develop/toolkit/parachains/fork-chains/chopsticks/get-started/){target=\_blank} installed
25-
- Access to local or remote parachain endpoints
26-
- An origin chain running runtime **`stable2503-5`** or later
27-
- A TypeScript development environment with essential tools
28-
- Familiarity with replaying or dry-running XCMs
20+
Before you begin, ensure you have the following:
2921

30-
If you're new to replay or dry-run XCMs, see [Replay and Dry Run XCMs Using Chopsticks](/tutorials/interoperability/replay-and-dry-run-xcms/){target=\_blank}.
22+
- [Node.js and npm installed](https://nodejs.org/en/download){target=\_blank}.
23+
- [Chopsticks](/develop/toolkit/parachains/fork-chains/chopsticks/get-started/){target=\_blank} installed.
24+
- Access to local or remote parachain endpoints.
25+
- An origin chain running runtime `stable2503-5` or later.
26+
- A TypeScript development environment with essential tools.
27+
- Familiarity with [replaying or dry-running XCMs](/tutorials/interoperability/replay-and-dry-run-xcms/){target=\_blank}.
3128

32-
## Setting Up Your Workspace
29+
## Set Up Your Workspace
3330

34-
1. Create a project directory:
31+
1. Run the following command to create a new project directory:
3532

3633
```bash
3734
mkdir -p xcm-obs-demo && cd xcm-obs-demo
3835
```
3936

40-
2. Install Chopsticks globally:
37+
2. Install Chopsticks globally using the command:
4138

4239
```bash
4340
npm install -g @acala-network/chopsticks@latest
4441
```
4542

46-
3. Download 1.6.0 runtime, which is built from **`stable2503-5` or later**:
43+
3. Next, use the following command to download the 1.6.0 runtime, which is built from `stable2503-5` or later:
4744

4845
```bash
4946
mkdir -p wasms
5047
wget https://github.com/polkadot-fellows/runtimes/releases/download/v1.6.0/asset-hub-polkadot_runtime-v1006000.compact.compressed.wasm -O wasms/asset-hub-polkadot_v1.6.0.wasm
5148
```
5249

53-
4. Download config of Polkadot Hub:
50+
4. Download the config for Polkadot Hub:
5451

5552
```bash
5653
mkdir -p configs
@@ -68,15 +65,17 @@ If you're new to replay or dry-run XCMs, see [Replay and Dry Run XCMs Using Chop
6865
...
6966
```
7067

71-
6. Fork the relevant chains locally using Chopsticks:
68+
6. Use the following command to fork the relevant chains locally using Chopsticks:
7269

7370
```bash
7471
npx @acala-network/chopsticks xcm -r polkadot -p configs/polkadot-hub-override.yaml -p hydradx
7572
```
7673

77-
→ See the [Fork a Chain with Chopsticks guide](/tutorials/polkadot-sdk/testing/fork-live-chains/){target=\_blank} for detailed instructions.
74+
!!! tip
75+
76+
See the [Fork a Chain with Chopsticks](/tutorials/polkadot-sdk/testing/fork-live-chains/){target=\_blank} guide for detailed instructions.
7877

79-
7. Open a **new terminal** in the same folder and initialise a Node.js project:
78+
7. Open a new terminal in the same folder and initialize a Node.js project:
8079

8180
```bash
8281
npm init -y && npm pkg set type="module"
@@ -90,7 +89,7 @@ If you're new to replay or dry-run XCMs, see [Replay and Dry Run XCMs Using Chop
9089
npm install @noble/hashes
9190
```
9291

93-
9. Initialise TypeScript:
92+
9. Initialize TypeScript using the command:
9493

9594
```bash
9695
npx tsc --init
@@ -103,26 +102,32 @@ If you're new to replay or dry-run XCMs, see [Replay and Dry Run XCMs Using Chop
103102
npx papi add hydration -w ws://localhost:8001
104103
```
105104

106-
## Scenario 1: XCM Flow with Implicit `SetTopic`
105+
## XCM Flow with Implicit `SetTopic`
107106

108-
### Overview
107+
Assume the following values for this scenario:
109108

110-
- **Origin:** Polkadot Hub
111-
- **Destination:** Hydration
112-
- **Extrinsic:** `limited_reserve_transfer_assets` (high-level)
113-
- **Topic:** Set automatically by the runtime
109+
- **Origin**: Polkadot Hub
110+
- **Destination**: Hydration
111+
- **Extrinsic**: `limited_reserve_transfer_assets` (high-level)
112+
- **Topic**: Set automatically by the runtime
114113

115-
### Run the Script
114+
Follow these steps to complete the implicit `SetTopic` flow:
116115

117-
Create and run `limited-reserve-transfer-assets.ts`:
116+
1. Create a file named `limited-reserve-transfer-assets.ts` and add the following code:
118117

119-
```ts
120-
--8<-- 'code/tutorials/interoperability/xcm-observability-in-action/limited-reserve-transfer-assets.ts'
121-
```
118+
```ts
119+
--8<-- 'code/tutorials/interoperability/xcm-observability-in-action/limited-reserve-transfer-assets.ts'
120+
```
122121

123-
```bash
124-
npx tsx limited-reserve-transfer-assets.ts
125-
```
122+
2. Run your script with the following command:
123+
124+
```bash
125+
npx tsx limited-reserve-transfer-assets.ts
126+
```
127+
128+
3. You will see terminal output similar to the following:
129+
130+
--8<-- 'code/tutorials/interoperability/xcm-observability-in-action/limited-reserve-transfer-assets-result.html'
126131

127132
### Forwarded XCM Example
128133

@@ -137,32 +142,31 @@ The runtime adds a `SetTopic` to the forwarded XCM automatically:
137142
| Polkadot Hub | `PolkadotXcm.Sent` | `message_id` | Matches the topic in the forwarded XCM |
138143
| Hydration | `MessageQueue.Processed` | `id` | Matches origin's `message_id` |
139144
140-
> ⚠️ Dry run generated topics may differ from actual execution.
145+
!!! note
146+
Dry run-generated topics may differ from actual execution.
141147
142-
### Message Trace Output
148+
## XCM Flow with Manual `SetTopic`
143149
144-
--8<-- 'code/tutorials/interoperability/xcm-observability-in-action/limited-reserve-transfer-assets-result.html'
150+
Assume the following values for this scenario:
145151
146-
## Scenario 2: XCM Transfer with Manual `SetTopic`
152+
- **Origin**: Polkadot Hub
153+
- **Destination**: Hydration
154+
- **Topic**: Manually assigned
155+
- **Goal**: Ensure traceability in custom multi-hop flows
147156
148-
### Overview
157+
Follow these steps to complete the manual `SetTopic` flow:
149158
150-
- **Origin:** Polkadot Hub
151-
- **Destination:** Hydration
152-
- **Topic:** Manually assigned
153-
- **Goal:** Ensure traceability in custom multi-hop flows
159+
1. Create a new file named `deposit-reserve-asset-with-set-topic.ts` and add the following code:
154160
155-
### Run the Script
161+
```ts
162+
--8<-- 'code/tutorials/interoperability/xcm-observability-in-action/deposit-reserve-asset-with-set-topic.ts'
163+
```
156164
157-
Create and run `deposit-reserve-asset-with-set-topic.ts`:
165+
2. Run your script with the following command:
158166
159-
```ts
160-
--8<-- 'code/tutorials/interoperability/xcm-observability-in-action/deposit-reserve-asset-with-set-topic.ts'
161-
```
162-
163-
```bash
164-
npx tsx deposit-reserve-asset-with-set-topic.ts
165-
```
167+
```bash
168+
npx tsx deposit-reserve-asset-with-set-topic.ts
169+
```
166170
167171
### Forwarded XCM Example
168172
@@ -243,3 +247,5 @@ This guide demonstrated:
243247
- The legacy workaround for older runtimes with derived IDs
244248
245249
With these scenarios and debugging steps, you can confidently develop, trace, and troubleshoot XCM workflows across chains.
250+
251+
To learn more before you begin, see the companion page: [XCM Observability](/develop/interoperability/xcm-observability){target=\_blank}.

0 commit comments

Comments
 (0)