MCPcopy Create free account
hub / github.com/Sifchain/sifnode / DefaultConfig

Function DefaultConfig

testutil/network/network.go:50–90  ·  view source on GitHub ↗

DefaultConfig will initialize config for the network with custom application, genesis and single validator. All other parameters are inherited from cosmos-sdk/testutil/network.DefaultConfig

()

Source from the content-addressed store, hash-verified

48// DefaultConfig will initialize config for the network with custom application,
49// genesis and single validator. All other parameters are inherited from cosmos-sdk/testutil/network.DefaultConfig
50func DefaultConfig() network.Config {
51 var (
52 encoding = app.MakeTestEncodingConfig()
53 chainID = "chain-" + tmrand.NewRand().Str(6)
54 )
55 return network.Config{
56 Codec: encoding.Marshaler,
57 TxConfig: encoding.TxConfig,
58 LegacyAmino: encoding.Amino,
59 InterfaceRegistry: encoding.InterfaceRegistry,
60 AccountRetriever: authtypes.AccountRetriever{},
61 AppConstructor: func(val network.Validator) servertypes.Application {
62 return app.NewSifApp(
63 val.Ctx.Logger,
64 tmdb.NewMemDB(),
65 nil,
66 true,
67 map[int64]bool{},
68 val.Ctx.Config.RootDir,
69 0,
70 encoding,
71 app.EmptyAppOptions{},
72 baseapp.SetPruning(storetypes.NewPruningOptionsFromString(val.AppConfig.Pruning)),
73 baseapp.SetMinGasPrices(val.AppConfig.MinGasPrices),
74 )
75 },
76 GenesisState: app.ModuleBasics.DefaultGenesis(encoding.Marshaler),
77 TimeoutCommit: 2 * time.Second,
78 ChainID: chainID,
79 NumValidators: 1,
80 BondDenom: sdk.DefaultBondDenom,
81 MinGasPrices: fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom),
82 AccountTokens: sdk.TokensFromConsensusPower(1000, sdk.DefaultPowerReduction),
83 StakingTokens: sdk.TokensFromConsensusPower(500, sdk.DefaultPowerReduction),
84 BondedTokens: sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction),
85 PruningStrategy: storetypes.PruningOptionNothing,
86 CleanupDir: true,
87 SigningAlgo: string(hd.Secp256k1Type),
88 KeyringOptions: []keyring.Option{},
89 }
90}

Callers 2

NewFunction · 0.85

Calls 3

MakeTestEncodingConfigFunction · 0.92
NewSifAppFunction · 0.92
DefaultGenesisMethod · 0.45

Tested by 1