Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ npx @acala-network/chopsticks@latest dry-run --config=configs/mandala.yml --prei
npx @acala-network/chopsticks@latest xcm -r kusama -p karura -p statemine
```

- Setup bridged-XCM between two ecosystems
**_NOTE:_** One parachain on each side must host `pallet_bridge_messages`; both directions are wired automatically.

```bash
npx @acala-network/chopsticks@latest bridge \
-r polkadot -p polkadot-bridge-hub -p polkadot-asset-hub \
-R kusama -P kusama-bridge-hub -P kusama-asset-hub
```

## Proxy

Chopsticks respect `http_proxy` and `https_proxy` environment variables.
Expand Down Expand Up @@ -276,6 +285,33 @@ await checkHrmp(api)
.toMatchSnapshot('horizontal messages');
```

### Bridged-XCM Testing

Wire two bridge hubs and let outbound bridge messages flow automatically. The connector
subscribes to source's `OutboundLanes`, fetches storage proofs, writes the destination's
`pallet_bridge_parachains` state, and submits `receive_messages_proof` — same role
`substrate-relay` plays in production. The signer must hold a balance on `destination`
to pay the delivery fee.

```typescript
import { connectBridgeHubs, setupContext } from '@acala-network/chopsticks-testing';
import { Keyring } from '@polkadot/keyring';

const bhp = await setupContext({ endpoint: 'wss://polkadot-bridge-hub-rpc.polkadot.io' });
const bhk = await setupContext({ endpoint: 'wss://kusama-bridge-hub-rpc.polkadot.io' });

const signer = new Keyring({ type: 'sr25519' }).addFromUri('//Alice');
const handle = await connectBridgeHubs(bhp.api, bhk.api, { signer });

// ... drive source-side blocks; deliveries fire automatically ...

await handle.disconnect();
```

For the reverse direction, call `connectBridgeHubs(bhk.api, bhp.api, { signer })`. Pallet
names + para id are auto-detected from runtime metadata; override via config only for
runtimes with multiple `pallet_bridge_messages` instances.

### Data Format Conversion

Convert data to different formats for testing:
Expand Down
4 changes: 2 additions & 2 deletions executor/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading