Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update dry-run docs #261

Merged
merged 1 commit into from
Apr 2, 2023
Merged
Changes from all commits
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
37 changes: 34 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,45 @@ Make sure you have setup Rust environment (>= 1.64).
- Use option `--output-path=<file_path>` to print out JSON file
- Use option `--html` to generate storage diff preview (add `--open` to automatically open file)

## Dry-run

- Dry run hep:
```
yarn start dry-run --help
```

- Dry run extrinsic, same as `run-block`, example:
- `yarn start dry-run --config=configs/mandala.yml --html --open --extrinsic=0x39028400d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d01183abac17ff331f8b65dbeddd27f014dedd892020cfdc6c40b574f6930f8cf391bde95997ae2edc5b1192a4036ea97804956c4b5497175c8d68b630301685889450200000a00008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a480284d717`
- Dry run call `yarn start dry-run --config=configs/mandala.yml --html --open --extrinsic=0xff00000080969800 --address=5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY --at=0x5f660b32489966cc707ecde831864aeecf9092c4983e75f9880313e9158d62b9`
```
yarn start dry-run --config=configs/mandala.yml --html --open --extrinsic=0x39028400d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d01183abac17ff331f8b65dbeddd27f014dedd892020cfdc6c40b574f6930f8cf391bde95997ae2edc5b1192a4036ea97804956c4b5497175c8d68b630301685889450200000a00008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a480284d717
```

- Dry run call, make sure `mock-signature-host: true` to fake caller's signature:
```
yarn start dry-run --config=configs/mandala.yml --html --open --extrinsic=0xff00000080969800 --address=5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY --at=<block_hash_optional>
```

- Dry run a preimage:
```
yarn start dry-run --endpoint=wss://rpc.polkadot.io --preimage=<preimage> --open
```

- Dry run a preimage and execute an extrinsic after that:
```
yarn start dry-run --endpoint=wss://rpc.polkadot.io --preimage=<preimage> --extrinsic=<extrinsic> --open
```

- Dry run a preimage and execute a call after that, make sure `mock-signature-host: true` to fake caller's signature:
```
yarn start dry-run --config=configs/mandala.yml --preimage=<preimage> --extrinsic=<call> --address=<who> --open
```

- Run a test node
- `yarn start dev --endpoint=wss://acala-rpc-2.aca-api.network/ws`
- You have a test node running at `ws://localhost:8000`
- You can use [Polkadot.js Apps](https://polkadot.js.org/apps/) to connect to this node
- Submit any transaction to produce a new block in the in parallel reality
- (Optional) Pre-define/override storage using option `--import-storage=storage.[json/yaml]`. See example storage below.

```json5
{
"Sudo": {
Expand All @@ -60,18 +89,20 @@ Make sure you have setup Rust environment (>= 1.64).
}
}
```

- Run Kusama fork
- Edit configs/kusama.yml if needed. (e.g. update the block number)
- `yarn start dev --config=configs/kusama.yml`

- Setup XCM multichain
**_NOTE:_** You can also connect multiple parachains without a relaychain

```bash
yarn start xcm --relaychain=configs/kusama.yml --parachain=configs/karura.yml --parachain=configs/statemine.yml
```

## Documentation

External documentation on Chopsticks can be found at the following links:
External documentation on Chopsticks can be found at the following links:

- [Moonbeam documentation site](https://docs.moonbeam.network/builders/build/substrate-api/chopsticks/)