initial commit

This commit is contained in:
Roei Erez
2023-04-24 14:18:55 +03:00
parent 97ba3dee81
commit bf112507ae
12 changed files with 125 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
# Getting Started
Connecting to your node is the first step before attempting to send and receive lightning payments.
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.
## Registering a new node
```rust
let seed = <your seed>;
let credentials = BreezServices::register_node(Network::Bitcoin, seed).await?;
```
## Recovering an existing node
```rust
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:
## Initializing the SDK
```rust
// Create the default config
let config = BreezServices::default_config(EnvironmentType::Production)
// Customize the config object according to your needs
config.api_key = Some("your API key".into());
config.working_dir = "path to an existing directory".into();
let sdk = BreezServices::init_services(
config,
seed.to_vec(),
credentials.clone(),
Box::new(AppEventListener {}),
)
.await?;
BreezServices::start(rt(), &sdk).await?;
```
Now your node is ready to receive payments.