mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-24 22:55:43 +00:00
Use the relay-headers-and-messages command (#1913)
* Bridge hubs readme: fixes and additions * Use the relay-headers-and-messages command * cargo fmt
This commit is contained in:
committed by
Branislav Kontur
parent
ac92420a0c
commit
ffa4172b09
@@ -22,22 +22,25 @@ Every _BridgeHub_ is meant to be **_common good parachain_** with main responsib
|
|||||||
mkdir -p ~/local_bridge_testing/bin
|
mkdir -p ~/local_bridge_testing/bin
|
||||||
mkdir -p ~/local_bridge_testing/logs
|
mkdir -p ~/local_bridge_testing/logs
|
||||||
|
|
||||||
|
# 1. Install zombienet
|
||||||
|
Go to: https://github.com/paritytech/zombienet/releases
|
||||||
|
Copy the apropriate binary (zombienet-linux) from the latest release to ~/local_bridge_testing/bin
|
||||||
|
|
||||||
# 1. Build polkadot binary
|
# 2. Build polkadot binary
|
||||||
git clone https://github.com/paritytech/polkadot.git
|
git clone https://github.com/paritytech/polkadot.git
|
||||||
cd polkadot
|
cd polkadot
|
||||||
cargo build --release
|
cargo build --release
|
||||||
cp target/release/polkadot ~/local_bridge_testing/bin/polkadot
|
cp target/release/polkadot ~/local_bridge_testing/bin/polkadot
|
||||||
|
|
||||||
# 2. Build cumulus polkadot-parachain binary
|
# 3. Build cumulus polkadot-parachain binary
|
||||||
cd <cumulus-git-repo-dir>
|
cd <cumulus-git-repo-dir>
|
||||||
cargo build --release --locked -p polkadot-parachain@0.9.300
|
cargo build --release --locked -p polkadot-parachain@0.9.300
|
||||||
cp target/release/polkadot-parachain ~/local_bridge_testing/bin/polkadot-parachain
|
cp target/release/polkadot-parachain ~/local_bridge_testing/bin/polkadot-parachain
|
||||||
|
|
||||||
# 3. Build substrate-relay binary
|
# 4. Build substrate-relay binary
|
||||||
git clone https://github.com/paritytech/parity-bridges-common.git
|
git clone https://github.com/paritytech/parity-bridges-common.git
|
||||||
cd parity-bridges-common
|
cd parity-bridges-common
|
||||||
cargo build -p substrate-relay
|
cargo build --release -p substrate-relay
|
||||||
cp target/release/substrate-relay ~/local_bridge_testing/bin/substrate-relay
|
cp target/release/substrate-relay ~/local_bridge_testing/bin/substrate-relay
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -45,16 +48,16 @@ cp target/release/substrate-relay ~/local_bridge_testing/bin/substrate-relay
|
|||||||
|
|
||||||
```
|
```
|
||||||
# Rococo + BridgeHubWococo
|
# Rococo + BridgeHubWococo
|
||||||
POLKADOT_BINARY_PATH=../../polkadot/target/release/polkadot \
|
POLKADOT_BINARY_PATH=~/local_bridge_testing/bin/polkadot \
|
||||||
POLKADOT_PARACHAIN_BINARY_PATH=./target/release/polkadot-parachain \
|
POLKADOT_PARACHAIN_BINARY_PATH=~/local_bridge_testing/bin/polkadot-parachain \
|
||||||
./zombienet-linux --provider native spawn ./zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml
|
~/local_bridge_testing/bin/zombienet-linux --provider native spawn ./zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml
|
||||||
```
|
```
|
||||||
|
|
||||||
```
|
```
|
||||||
# Wococo + BridgeHubWococo
|
# Wococo + BridgeHubWococo
|
||||||
POLKADOT_BINARY_PATH=../../polkadot/target/release/polkadot \
|
POLKADOT_BINARY_PATH=~/local_bridge_testing/bin/polkadot \
|
||||||
POLKADOT_PARACHAIN_BINARY_PATH=./target/release/polkadot-parachain \
|
POLKADOT_PARACHAIN_BINARY_PATH=~/local_bridge_testing/bin/polkadot-parachain \
|
||||||
./zombienet-linux --provider native spawn ./zombienet/bridge-hubs/bridge_hub_wococo_local_network.toml
|
~/local_bridge_testing/bin/zombienet-linux --provider native spawn ./zombienet/bridge-hubs/bridge_hub_wococo_local_network.toml
|
||||||
```
|
```
|
||||||
|
|
||||||
### Run chains (Rococo + BridgeHub, Wococo + BridgeHub) from `./scripts/bridges_rococo_wococo.sh`
|
### Run chains (Rococo + BridgeHub, Wococo + BridgeHub) from `./scripts/bridges_rococo_wococo.sh`
|
||||||
@@ -106,68 +109,43 @@ RUST_LOG=runtime=trace,rpc=trace,bridge=trace \
|
|||||||
--target-signer //Bob
|
--target-signer //Bob
|
||||||
```
|
```
|
||||||
|
|
||||||
**2. Relay (Grandpa relay-chain) headers**
|
**2. Relay relay-chain headers, parachain headers and messages**
|
||||||
|
|
||||||
**source-host/source-port** - WS-port of collator's inner RelayChain validator
|
|
||||||
**target-host/target-port** - WS-port of BridgeHub collator
|
|
||||||
|
|
||||||
```
|
```
|
||||||
# Rococo -> Wococo
|
|
||||||
RUST_LOG=runtime=trace,rpc=trace,bridge=trace \
|
RUST_LOG=runtime=trace,rpc=trace,bridge=trace \
|
||||||
~/local_bridge_testing/bin/substrate-relay relay-headers rococo-to-bridge-hub-wococo \
|
~/local_bridge_testing/bin/substrate-relay relay-headers-and-messages bridge-hub-rococo-bridge-hub-wococo \
|
||||||
--source-host localhost \
|
--rococo-host localhost \
|
||||||
--source-port 9942 \
|
--rococo-port 9942 \
|
||||||
--target-host localhost \
|
--bridge-hub-rococo-host localhost \
|
||||||
--target-port 8945 \
|
--bridge-hub-rococo-port 8943 \
|
||||||
--target-signer //Bob \
|
--bridge-hub-rococo-signer //Charlie \
|
||||||
--target-transactions-mortality=4
|
--wococo-headers-to-bridge-hub-rococo-signer //Bob \
|
||||||
|
--wococo-parachains-to-bridge-hub-rococo-signer //Bob \
|
||||||
# Wococo -> Rococo
|
--bridge-hub-rococo-messages-pallet-owner //Bob \
|
||||||
RUST_LOG=runtime=trace,rpc=trace,bridge=trace \
|
--bridge-hub-rococo-transactions-mortality 4 \
|
||||||
~/local_bridge_testing/bin/substrate-relay relay-headers wococo-to-bridge-hub-rococo \
|
--wococo-host localhost \
|
||||||
--source-host localhost \
|
--wococo-port 9945 \
|
||||||
--source-port 9945 \
|
--bridge-hub-wococo-host localhost \
|
||||||
--target-host localhost \
|
--bridge-hub-wococo-port 8945 \
|
||||||
--target-port 8943 \
|
--bridge-hub-wococo-signer //Charlie \
|
||||||
--target-signer //Bob \
|
--rococo-headers-to-bridge-hub-wococo-signer //Bob \
|
||||||
--target-transactions-mortality=4
|
--rococo-parachains-to-bridge-hub-wococo-signer //Bob \
|
||||||
|
--bridge-hub-wococo-messages-pallet-owner //Bob \
|
||||||
|
--bridge-hub-wococo-transactions-mortality 4 \
|
||||||
|
--lane 00000001
|
||||||
```
|
```
|
||||||
|
|
||||||
**Check parachain collators:**
|
**Check relay-chain headers relaying:**
|
||||||
- Rococo parachain:
|
- Rococo parachain:
|
||||||
- https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A8943#/chainstate
|
- https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A8943#/chainstate
|
||||||
- Pallet: **bridgeWococoGrandpa**
|
- Pallet: **bridgeWococoGrandpa**
|
||||||
- Keys: **bestFinalized()**
|
- Keys: **bestFinalized()**
|
||||||
- Wococo parachain:
|
- Wococo parachain:
|
||||||
- https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A8945#/chainstate
|
- https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A8945#/chainstate
|
||||||
- Pallet: **bridgeRococoGrandpa**
|
- Pallet: **bridgeRococoGrandpa**
|
||||||
- Keys: **bestFinalized()**
|
- Keys: **bestFinalized()**
|
||||||
|
|
||||||
**3. Relay (BridgeHub parachain) headers**
|
**Check parachain headers relaying:**
|
||||||
|
|
||||||
```
|
|
||||||
# Rococo -> Wococo
|
|
||||||
RUST_LOG=runtime=trace,rpc=trace,bridge=trace \
|
|
||||||
~/local_bridge_testing/bin/substrate-relay relay-parachains bridge-hub-rococo-to-bridge-hub-wococo \
|
|
||||||
--source-host localhost \
|
|
||||||
--source-port 9942 \
|
|
||||||
--target-host localhost \
|
|
||||||
--target-port 8945 \
|
|
||||||
--target-signer //Bob \
|
|
||||||
--target-transactions-mortality=4
|
|
||||||
|
|
||||||
# Wococo -> Rococo
|
|
||||||
RUST_LOG=runtime=trace,rpc=trace,bridge=trace \
|
|
||||||
~/local_bridge_testing/bin/substrate-relay relay-parachains bridge-hub-wococo-to-bridge-hub-rococo \
|
|
||||||
--source-host localhost \
|
|
||||||
--source-port 9945 \
|
|
||||||
--target-host localhost \
|
|
||||||
--target-port 8943 \
|
|
||||||
--target-signer //Bob \
|
|
||||||
--target-transactions-mortality=4
|
|
||||||
```
|
|
||||||
|
|
||||||
**Check parachain collators:**
|
|
||||||
- Rococo parachain:
|
- Rococo parachain:
|
||||||
- https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A8943#/chainstate
|
- https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A8943#/chainstate
|
||||||
- Pallet: **bridgeWococoParachain**
|
- Pallet: **bridgeWococoParachain**
|
||||||
@@ -177,36 +155,6 @@ RUST_LOG=runtime=trace,rpc=trace,bridge=trace \
|
|||||||
- Pallet: **bridgeRococoParachain**
|
- Pallet: **bridgeRococoParachain**
|
||||||
- Keys: **bestParaHeads()**
|
- Keys: **bestParaHeads()**
|
||||||
|
|
||||||
**4. Relay (XCM) messages**
|
|
||||||
|
|
||||||
```
|
|
||||||
# Rococo -> Wococo
|
|
||||||
RUST_LOG=runtime=trace,rpc=trace,bridge=trace \
|
|
||||||
~/local_bridge_testing/bin/substrate-relay relay-messages bridge-hub-rococo-to-bridge-hub-wococo \
|
|
||||||
--source-host localhost \
|
|
||||||
--source-port 8943 \
|
|
||||||
--source-signer //Charlie \
|
|
||||||
--target-host localhost \
|
|
||||||
--target-port 8945 \
|
|
||||||
--target-signer //Charlie \
|
|
||||||
--target-transactions-mortality=4 \
|
|
||||||
--lane 00000002
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
# Wococo -> Rococo
|
|
||||||
RUST_LOG=runtime=trace,rpc=trace,bridge=trace \
|
|
||||||
~/local_bridge_testing/bin/substrate-relay relay-messages bridge-hub-wococo-to-bridge-hub-rococo \
|
|
||||||
--source-host localhost \
|
|
||||||
--source-port 8945 \
|
|
||||||
--source-signer //Charlie \
|
|
||||||
--target-host localhost \
|
|
||||||
--target-port 8943 \
|
|
||||||
--target-signer //Charlie \
|
|
||||||
--target-transactions-mortality=4 \
|
|
||||||
--lane 00000001
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Git subtree `./bridges`
|
## Git subtree `./bridges`
|
||||||
|
|||||||
@@ -31,10 +31,9 @@ use xcm::latest::prelude::*;
|
|||||||
use xcm_builder::{
|
use xcm_builder::{
|
||||||
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
|
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
|
||||||
AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin,
|
AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin,
|
||||||
FixedWeightBounds, IsConcrete, ParentAsSuperuser, ParentIsPreset,
|
FixedWeightBounds, IsConcrete, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative,
|
||||||
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
|
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
|
||||||
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
|
SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,
|
||||||
UsingComponents,
|
|
||||||
};
|
};
|
||||||
use xcm_executor::XcmExecutor;
|
use xcm_executor::XcmExecutor;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user