diff --git a/x/bitcoincommiter/keeper/config.go b/x/bitcoincommiter/keeper/config.go index d6aafdfaa4..8ac1560958 100644 --- a/x/bitcoincommiter/keeper/config.go +++ b/x/bitcoincommiter/keeper/config.go @@ -24,11 +24,23 @@ const ( ) func DefaultBITCOINConfig(homePath string) *BITCOINConfig { + _, err := os.Stat(homePath + "/" + BitcoinRPCConfigFileName) + config := BITCOINConfig{} + if os.IsNotExist(err) { + config.NetworkName = "signet" + config.RPCHost = "localhost" + config.RPCPort = "8332" + config.RPCUser = "b2node" + config.RPCPass = "b2node" + config.WalletName = "b2node" + config.Destination = "tb1qgm39cu009lyvq93afx47pp4h9wxq5x92lxxgnz" + return &config + } + data, err := os.ReadFile(homePath + "/" + BitcoinRPCConfigFileName) if err != nil { log.Fatalf("can not read rpc config file: %v", err) } - config := BITCOINConfig{} err = yaml.Unmarshal(data, &config) if err != nil { log.Fatalf("can not unmarshal rpc config file: %v", err)