Configuration Trait (Substrate)

Viewed 94

I don't understand from a high level what the purpose of the configuration trait is in Substrate or what I'm supposed to put in there?

I am also new to Rust and have never seen traits with just types inside of them. I thought they had to have function signatures like interfaces in other languages?

1 Answers

I thought they had to have function signatures like interfaces in other languages?

Yes that is right, you can also have functions in there.

The FRAME pallets are highly configurable to support all different kind of runtimes. For that, each pallet exposes a configuration trait that you need to implement for your runtime. In this configuration trait you add everything that should be configured from the runtime. If you don't have any configuration options for your pallet, the trait can also just be empty.

Related