mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-19 06:44:19 +01:00
python examples for connecting to lsp
This commit is contained in:
@@ -1 +1,28 @@
|
||||
# Connecting to an LSP
|
||||
|
||||
In order to list all available lsp you may connect to you may do the following.
|
||||
|
||||
<custom-tabs category="lang">
|
||||
<div slot="title">python</div>
|
||||
<section>
|
||||
|
||||
```python
|
||||
try:
|
||||
lsps = sdk_services.list_lsps()
|
||||
# Select your desired LSP
|
||||
|
||||
except Exception as error:
|
||||
# Handle error
|
||||
```
|
||||
|
||||
When you have selected an LSP you may then connect to it.
|
||||
|
||||
```python
|
||||
try:
|
||||
lsp_id = sdk_services.lsp_id()
|
||||
sdk_services.connect_lsp(lsp_id)
|
||||
except Exception as error:
|
||||
# Handle error
|
||||
```
|
||||
|
||||
</section>
|
||||
Reference in New Issue
Block a user