Exercise 03
Objectives: implementing new pallet, changing runtime configuration
Content: In this exercise we are going to add new logic to the chain. The goal is to introduce a possibility of banishing. The new mechanics should enable sudo user to banish some account. For current purposes, banishing doesn't have to mean anything apart from some kind of marking an account as banished.
For this, you need to create a new pallet: banishment. It should expose a single call banish with a single argument outcast: AccountId, which can be called only from the root account (sudo). Banished accounts should be kept in the pallet's storage. Don't forget about emitting events for both failed and successful scenarios.
When your pallet is ready, register it in bin/runtime/src/lib.rs.
Launch updated chain (./scripts/run_nodes.sh will automatically recompile project). Then:
try to banish some account as a non-root and observe a failure event
banish some account as the root and confirm it by observing a success event
inspect pallet's storage with UI (by checking some block before banishing and after)
References:
pallets/aleph,pallets/elections
Last updated
Was this helpful?