Follow the Substrate docs.
curl "https://github.com/paritytech/polkadot/releases/download/v0.9.18/polkadot" --output /usr/local/bin/polkadot --location
Run the Polkadot node in a separate terminal:
polkadot --dev --tmp
> 2022-06-23 21:43:57 Parity Polkadot
> 2022-06-23 21:43:57 ✌️ version 0.9.18-99cd17ddb2-x86_64-linux-gnu
> 2022-06-23 21:43:57 ❤️ by Parity Technologies <admin@parity.io>, 2017-2022
> 2022-06-23 21:43:57 📋 Chain specification: Development
> ...
Run the test suite:
cargo test
Notice the test failures, your task is to implement the helper functions.
The files in the tests/
directory are ranked in order of difficulty.
- Exercise 01 - Get the block number for a given
block_hash
. - Exercise 02 - Get the
free
balance of anaccount
. - Exercise 03 - Sum the total
frozen
balance. - Exercise 04 - Fetch the first
n
accounts from storage. - Exercise 05 - Return the embedded
RuntimeVersion
. - Exercise 06 - Transfer an
amount
from thesigner
todest
. - Exercise 07 - Estimate the fees for an extrinsic using a custom RPC.
- Exercise 08 - Make multiple transfers in the same call.
- Exercise 09 - Create a spending proposal and check the deposit.
- Exercise 10 - Listen and approve multisig operations.
This is only required if you change the node / runtime.
cargo install subxt-cli
subxt metadata -f bytes > polkadot_metadata.scale
Verbose but helpful expansion of the generated Rust code.
cargo install cargo-expand
cargo expand
Thanks to all subxt / substrate maintainers and contributors.