dojoengine / dojo

Dojo is a toolchain for building provable games and applications
https://dojoengine.org
Apache License 2.0
423 stars 176 forks source link

feat(katana): node config builder #2648

Open kariy opened 3 weeks ago

kariy commented 3 weeks ago

Problem

we have a main config struct that encapsulates bunch of other smaller configs. this config struct is then passed to the katana_node::build() method.

https://github.com/dojoengine/dojo/blob/884a7267ff60752962193595eec87b01c9aa563d/crates/katana/node/src/config/mod.rs#L16-L28

https://github.com/dojoengine/dojo/blob/884a7267ff60752962193595eec87b01c9aa563d/crates/katana/node/src/lib.rs#L157-L163

because there are many configurations, it can be quite a hassle to specify each one of them. especially when you only want to specify some of them and want to use the default values for the rest. for example, in the dojo-test-utils:

https://github.com/dojoengine/dojo/blob/884a7267ff60752962193595eec87b01c9aa563d/crates/dojo/test-utils/src/sequencer.rs#L114-L122


it'd be nice to have a ConfigBuilder where you can set individual values using the builder pattern. the logic for the katana_node::build() can then be moved to ConfigBuilder::build() method.

edisontim commented 3 weeks ago

Hey! Would be down to work on this!