Refine wording.

This commit is contained in:
Roei Erez
2023-04-25 14:32:04 +03:00
parent bf112507ae
commit 520da0f2c3
8 changed files with 35 additions and 21 deletions

View File

@@ -1,9 +1,15 @@
# Getting Started
Connecting to your node is the first step before attempting to send and receive lightning payments.
The Breez SDK enables mobile developers to integrate Lightning and bitcoin payments into their apps with a very shallow learning curve. The use cases are endless from social apps that want to integrate tipping between users to content-creation apps interested in adding bitcoin monetization. Crucially, this SDK is an end-to-end, non-custodial, drop-in solution powered by Greenlight, a built-in LSP, on-chain interoperability, third-party fiat on-ramps, and other services users and operators need.
The SDK is implemented in rust and is made accessible to other languages using ffi binding.
Connecting to a node requires a seed (your master key) and credentials. The seed represents a bip39 mnemonics and the credentials are retrieved by registering a new node or recovering an existing one.
The Breez SDK provides the following services:
* Sending payments (via various protocols such as: bolt11, keysend, lnurl-pay, lightning address, etc.)
* Receiving payments (via various protocols such as: bolt11, lnurl-withdraw, etc.)
* Fetching node status (e.g. balance, max allow to pay, max allow to receive, on-chain balance, etc.)
* Connecting to a new or existing node.
Connecting to a node requires a seed (your master key) and credentials. The seed is a bip39 mnemonic and the credentials are retrieved by registering a new node or recovering an existing one.
## Registering a new node
```rust
@@ -16,7 +22,8 @@ let seed = <your seed>;
let credentials = BreezServices::register_node(Network::Bitcoin, seed).await?;
```
Once you got your credentials you should save them in a secure storage and then you are able to initialize the SDK and start using your node:
Once the credentials are retrieved they should be saved in a secured storage.
The next step is to initialize the SDK and start the node:
## Initializing the SDK
```rust
@@ -38,4 +45,12 @@ let sdk = BreezServices::init_services(
BreezServices::start(rt(), &sdk).await?;
```
Now your node is ready to receive payments.
At any point we can fetch our balance from the Greenlight node
```rust
if let Some(node_state) = sdk.node_info()? {
let balance_ln = node_state.channels_balance_msat;
let balance_onchain = node_state.onchain_balance_msat;
}
```
We are now ready to receive [payments](guide/payments.md)