mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-19 23:04:19 +01:00
Handle errors and remove call to Start
This commit is contained in:
@@ -245,13 +245,19 @@ nodeConfig := breez_sdk.NodeConfigGreenlight{
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
config := breez_sdk.DefaultConfig(breez_sdk.EnvironmentTypeProduction, apiKey, nodeConfig)
|
config, err := breez_sdk.DefaultConfig(breez_sdk.EnvironmentTypeProduction, apiKey, nodeConfig)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("DefaultConfig failed: %#v", err)
|
||||||
|
}
|
||||||
|
|
||||||
// Customize the config object according to your needs
|
// Customize the config object according to your needs
|
||||||
config.workingDir = "path to an existing directory"
|
config.workingDir = "path to an existing directory"
|
||||||
|
|
||||||
if sdkServices, err := breez_sdk.Connect(config, seed, BreezListener{}); err != nil {
|
sdkServices, err := breez_sdk.Connect(config, seed, BreezListener{})
|
||||||
sdkServices.Start()
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("Connect failed: %#v", err)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
At any point we can fetch our balance from the Greenlight node:
|
At any point we can fetch our balance from the Greenlight node:
|
||||||
|
|||||||
Reference in New Issue
Block a user