-
Notifications
You must be signed in to change notification settings - Fork 2
/
app.go
58 lines (42 loc) · 1.6 KB
/
app.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package app
import (
"encoding/json"
"os"
"github.com/tendermint/tendermint/libs/log"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/auth/genaccounts"
"github.com/cosmos/cosmos-sdk/x/bank"
distr "github.com/cosmos/cosmos-sdk/x/distribution"
"github.com/cosmos/cosmos-sdk/x/params"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/sdk-application-tutorial/x/nameservice"
bam "github.com/cosmos/cosmos-sdk/baseapp"
sdk "github.com/cosmos/cosmos-sdk/types"
abci "github.com/tendermint/tendermint/abci/types"
cmn "github.com/tendermint/tendermint/libs/common"
dbm "github.com/tendermint/tendermint/libs/db"
)
const appName = "identityCertify"
var (
// default home directories for the application CLI
DefaultCLIHome = os.ExpandEnv("$HOME/.idcli")
// DefaultNodeHome sets the folder where the application data and configuration will be stored
DefaultNodeHome = os.ExpandEnv("$HOME/.iddaemon")
// ModuleBasicManager is in charge of setting up basic module elements
ModuleBasics sdk.ModuleBasicManager
)
type identityServiceApp struct {
*bam.BaseApp
}
func NewIdentityServiceApp(logger log.Logger, db dbm.DB) *identityServiceApp {
// First define the top level codec that will be shared by the different modules. Note: Codec will be explained later
cdc := MakeCodec()
// BaseApp handles interactions with Tendermint through the ABCI protocol
bApp := bam.NewBaseApp(appName, logger, db, auth.DefaultTxDecoder(cdc))
var app = &identityServiceApp{
BaseApp: bApp,
cdc: cdc,
}
return app
}