Exercise 02

Objectives: launching nodes, interacting with UI

Content: This task consists of two steps:

a) Starting actual blockchain in the local environment. For this, launch scripts/run_nodes.sh. After a few moments inspect node-x.log file:

  • Check the first couple of lines that describe the environment.

  • Try to find lines that show progress (regarding finalization and currently highest (best) block).

  • Track 'lifetime' of some block: choose some block hash and find information about importing, finalizing, and building a new block on top of it. Remark: not every block will be considered as a parent block - only every 4th. Try to find out why.

Just before launching the nodes, our script will bootstrap chain. This is a preparatory step, during which an important file is generated: chainspec file. By default, it will be placed at /tmp/chainspec.json. It contains all data needed to initialize the first block and start building on top of it. This includes things like initial account balances, runtime code or pallets settings.

It can be either in a raw (encoded) or human-readable form. Our binary (target/release/aleph-node) contains subcommands for generating and translating chainspec. We will be working with them in the subsequent exercises.

b) Check out the fresh chain with PolkadotUI. Go to https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944 and explore UI. In particular:

  • Look at the details of a single block.

  • Verify that there are 3 connected peers.

  • Check saved accounts. Add a new one.

  • Perform a token transfer to the new account (from e.g. //Alice or //0). Observe emitted event (in a form of React toast) that confirms the successful transaction. Inspect details of the block that contains your extrinsic.

https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944 is not official UI for Aleph. For such, check out: https://azero.dev. However, the former is sometimes more useful for local development.

The prefix // before account name has specific semantics: check out: https://polkadot.js.org/docs/keyring/start/suri/.

You can stop chain with killall aleph-node.

References:

Last updated

Was this helpful?