Skip to content
This repository was archived by the owner on Aug 27, 2024. It is now read-only.

Commit bb967c7

Browse files
Sacha Lanskyemostov
andauthored
Update try-runtime docs (#1126)
* Update try-runtime docs * Update docs/knowledgebase/integrate/try-runtime.md Co-authored-by: Zeke Mostov <[email protected]> * Update docs/knowledgebase/integrate/try-runtime.md Co-authored-by: Zeke Mostov <[email protected]> Co-authored-by: Zeke Mostov <[email protected]>
1 parent f15a6f6 commit bb967c7

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

docs/knowledgebase/integrate/try-runtime.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ In order to query state, `try-runtime` makes use of Substrate's RPCs, namely [`S
4040

4141
The most common use case for `try-runtime` is with storage migrations and runtime upgrades.
4242

43+
There are a number of flags that should be set on the node try-runtime is completing RPC queries against in order to work well with the large payloads, namely:
44+
45+
- set `--rpc-max-payload 1000` to ensure large RPC queries can work.
46+
- set `--rpc-cors all` to ensure ws connections can come through.
47+
4348
> **Tip:** Combine `try-runtime` with [`fork-off-substrate`][fork-off-gh] to test your chain before
4449
> production. Use `try-runtime` to test your chain's migration and its pre and post states. Then,
4550
> use `fork-off-substrate` if you want to check that block production continues fine after the
@@ -134,6 +139,8 @@ The possible sub-commands include:
134139
- **`on-runtime-upgrade`**: Executes "tryRuntime_on_runtime_upgrade" against the given runtime state.
135140
- **`offchain-worker`**: Executes "offchainWorkerApi_offchain_worker" against the given runtime state.
136141
- **`execute-block`**: Executes "core_execute_block" using the given block and the runtime state of the parent block.
142+
- **`follow-chain`**: Follows a given chain's finalized blocks and applies to all its extrinsics. This allows the
143+
behavior of a new runtime to be inspected over a long period of time, with real transactions coming as input.
137144

138145
For example, running `try-runtime` with the "on-runtime-upgrade" subcommand on a chain
139146
running locally:
@@ -162,6 +169,32 @@ ws//$HOST:9944
162169

163170
> **Tip:** pass in the --help flag after each subcommand to see the command's different options.
164171
172+
Run the migrations of the local runtime on the state of SomeChain, for example:
173+
174+
```bash
175+
RUST_LOG=runtime=trace,try-runtime::cli=trace,executor=trace \
176+
cargo run try-runtime \
177+
--execution Native \
178+
--chain somechain-dev \
179+
on-runtime-upgrade \
180+
live \
181+
--uri wss://rpc.polkadot.io
182+
```
183+
184+
Running it at a specific block number's state:
185+
186+
```bash
187+
RUST_LOG=runtime=trace,try-runtime::cli=trace,executor=trace \
188+
cargo run try-runtime \
189+
--execution Native \
190+
--chain dev \
191+
--no-spec-name-check \ # mind this one!
192+
on-runtime-upgrade \
193+
live \
194+
--uri wss://rpc.polkadot.io \
195+
--at <block-hash>
196+
```
197+
165198
## Next Steps
166199

167200
### Learn More

0 commit comments

Comments
 (0)