Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouop0 authored and 0x677261706562616261 committed Nov 21, 2023
1 parent c4db3b1 commit 1a0468c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion x/bitcoincommiter/keeper/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1a0468c

Please sign in to comment.