-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up gconf implementation #456
Comments
There is an initial implementation but finishing it with current assumptions is not possible #491 (comment) This approach requires adjusting as JSON data does not provide a schema. |
Currently we are using weave/cmd/bnsd/app/testdata/fixtures/app.go Lines 121 to 122 in 458dfa4
All
We want to use typed configuration, which is very much like a model. Model already supports loading from genesis and it is stored with a type information. After my latest attempt and considering that only one extension is using
|
Cleanup `gconf` package configuration. Instead of allowing for any key-value pairs inserted into gconf store, require each module to use a custom protobuf configuration object that will be stored and retrieved with the help of `gconf` package. resolve #456
That approach seems fine with me
Not really a problem. If we query eg. Just some path without raw / query |
Cleanup `gconf` package configuration. Instead of allowing for any key-value pairs inserted into gconf store, require each module to use a custom protobuf configuration object that will be stored and retrieved with the help of `gconf` package. resolve #456
Is your feature request related to a problem? Please describe.
#294 brought in an initial (minimum) global configuration. This was good to unblock us an give us experience of what is needed, but several shortcomings have been determined.
The main issue is that there is no validation or normalization of the data when importing from the genesis file. We end up with text like:
{"//amount":"0.1IOV","fractional":100000000,"ticker":"IOV"}
or"0.01 IOV"
stored undergconf:cash:minimal_fee
. This has the problem of dumping all json parse logic on the client side, as well as delaying all validation until a first transaction that accesses the config, rather than on initialization time.A second issue is no clean way to query for gconf client side (eg. register a bucket, path)
A third issue is that there is no way to update these values with transactions, or add new entries besides genesis. The third issue will be a separate point, cleaning up querying is the main point of this issue.
Describe the solution you'd like
The end result is the client can do something like (pseudocode)
And not have to reinvent the json parsing logic (which is getting complex, especially for addresses) on the client side. We should do that server side when importing.
Describe alternatives you've considered
Throwing in raw json into the store... not so pretty.
Update
Going with approach from #503 and #534
Gconf is a library with
InitConfig
LoadConfig
GConfHandler()
etc that can be used by various packages. Each module maintains it's own custom Configuration struct and we use strong typing.The text was updated successfully, but these errors were encountered: