-
Notifications
You must be signed in to change notification settings - Fork 17
/
config.go
35 lines (28 loc) · 1.12 KB
/
config.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
package main
import (
"fmt"
globalTypes "github.com/KYVENetwork/chain/x/global/types"
tmCfg "github.com/cometbft/cometbft/config"
serverCfg "github.com/cosmos/cosmos-sdk/server/config"
sdk "github.com/cosmos/cosmos-sdk/types"
)
func initAppConfig() (string, *serverCfg.Config) {
cfg := serverCfg.DefaultConfig()
cfg.MinGasPrices = fmt.Sprintf("0.001%s", globalTypes.Denom)
return serverCfg.DefaultConfigTemplate, cfg
}
func initSDKConfig(accountAddressPrefix string) {
accountPubKeyPrefix := accountAddressPrefix + "pub"
validatorAddressPrefix := accountAddressPrefix + "valoper"
validatorPubKeyPrefix := accountAddressPrefix + "valoperpub"
consNodeAddressPrefix := accountAddressPrefix + "valcons"
consNodePubKeyPrefix := accountAddressPrefix + "valconspub"
config := sdk.GetConfig()
config.SetBech32PrefixForAccount(accountAddressPrefix, accountPubKeyPrefix)
config.SetBech32PrefixForValidator(validatorAddressPrefix, validatorPubKeyPrefix)
config.SetBech32PrefixForConsensusNode(consNodeAddressPrefix, consNodePubKeyPrefix)
config.Seal()
}
func initTendermintConfig() *tmCfg.Config {
return tmCfg.DefaultConfig()
}