You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example above shows how to create an `AppConfig` using Go. However, it is also possible to create an `AppConfig` using YAML, or JSON.
60
-
The configuration can then be embed with `go:embed` and read with [`appconfig.LoadYAML`](https://pkg.go.dev/cosmossdk.io/core/appconfig#LoadYAML), or [`appconfig.LoadJSON`](https://pkg.go.dev/cosmossdk.io/core/appconfig#LoadJSON), in `app_v2.go`.
60
+
The configuration can then be embed with `go:embed` and read with [`appconfig.LoadYAML`](https://pkg.go.dev/cosmossdk.io/core/appconfig#LoadYAML), or [`appconfig.LoadJSON`](https://pkg.go.dev/cosmossdk.io/core/appconfig#LoadJSON), in `app_di.go`.
61
61
62
62
```go
63
63
//go:embed app_config.yaml
@@ -95,13 +95,13 @@ modules:
95
95
96
96
A more complete example of `app.yaml` can be found [here](https://github.com/cosmos/cosmos-sdk/blob/91b1d83f1339e235a1dfa929ecc00084101a19e3/simapp/app.yaml).
97
97
98
-
## `app_v2.go`
98
+
## `app_di.go`
99
99
100
-
`app_v2.go` is the place where `SimApp` is constructed. `depinject.Inject` facilitates that by automatically wiring the app modules and keepers, provided an application configuration `AppConfig` is provided. `SimApp` is constructed, when calling the injected `*runtime.AppBuilder`, with `appBuilder.Build(...)`.
101
-
In short `depinject` and the [`runtime`package](https://pkg.go.dev/github.com/cosmos/cosmos-sdk/runtime) abstract the wiring of the app, and the `AppBuilder` is the place where the app is constructed. [`runtime`](https://pkg.go.dev/github.com/cosmos/cosmos-sdk/runtime) takes care of registering the codecs, KV store, subspaces and instantiating `baseapp`.
100
+
`app_di.go` is the place where `SimApp` is constructed. `depinject.Inject` facilitates this by automatically wiring the app modules and keepers, with the provided application configuration `AppConfig`. `SimApp` is constructed upon calling the `Build` method on the injected `*runtime.AppBuilder`.
101
+
In short,`depinject` and the [`runtime`package](https://pkg.go.dev/github.com/cosmos/cosmos-sdk/runtime) abstract the wiring of the app, and the `AppBuilder` takes care of constructing the application. [`runtime`](https://pkg.go.dev/github.com/cosmos/cosmos-sdk/runtime) handles registering the codecs, KV store, subspaces, and instantiating `baseapp`.
@@ -111,16 +111,16 @@ When using `depinject.Inject`, the injected types must be pointers.
111
111
### AdvancedConfiguration
112
112
113
113
In advanced cases, it is possible to inject extra (module) configuration in a way that is not (yet) supported by `AppConfig`.
114
-
In this case, use `depinject.Configs`for combining the extra configuration and `AppConfig`, and `depinject.Supply`to providing that extra configuration.
115
-
More information on how work `depinject.Configs` and `depinject.Supply` can be found in the [`depinject` documentation](https://pkg.go.dev/cosmossdk.io/depinject).
114
+
In this case, use `depinject.Configs`for combining the extra configuration, and `AppConfig` and `depinject.Supply`for providing the extra configuration.
115
+
More information on how `depinject.Configs` and `depinject.Supply` function can be found in the [`depinject` documentation](https://pkg.go.dev/cosmossdk.io/depinject).
It is possible to combine app wiring / depinject enabled modules with nonapp wiring modules.
123
+
It is possible to combine app wiring / depinject enabled modules with non-app wiring modules.
124
124
To do so, use the `app.RegisterModules` method to register the modules on your app, as well as `app.RegisterStores`for registering the extra stores needed.
0 commit comments