mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
Executable
+37
@@ -0,0 +1,37 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
||||
"github.com/sonr-io/sonr/app"
|
||||
)
|
||||
|
||||
func main() {
|
||||
setupSDKConfig()
|
||||
|
||||
// Standard snrd execution
|
||||
rootCmd := NewRootCmd()
|
||||
if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil {
|
||||
fmt.Fprintln(rootCmd.OutOrStderr(), err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func setupSDKConfig() {
|
||||
config := sdk.GetConfig()
|
||||
SetBech32Prefixes(config)
|
||||
config.SetCoinType(app.CoinType)
|
||||
config.SetPurpose(44)
|
||||
config.Seal()
|
||||
}
|
||||
|
||||
// SetBech32Prefixes sets the global prefixes to be used when serializing addresses and public keys to Bech32 strings.
|
||||
func SetBech32Prefixes(config *sdk.Config) {
|
||||
config.SetBech32PrefixForAccount(app.Bech32PrefixAccAddr, app.Bech32PrefixAccPub)
|
||||
config.SetBech32PrefixForValidator(app.Bech32PrefixValAddr, app.Bech32PrefixValPub)
|
||||
config.SetBech32PrefixForConsensusNode(app.Bech32PrefixConsAddr, app.Bech32PrefixConsPub)
|
||||
}
|
||||
Reference in New Issue
Block a user