Skip to content

Node config builder #42

@glihm

Description

@glihm

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.

(ported from dojoengine/dojo#2648)
(related PR dojoengine/dojo#2653)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions