Skip to content

Commit

Permalink
gossip docs
Browse files Browse the repository at this point in the history
  • Loading branch information
leo-lox committed Jan 20, 2025
1 parent 78de245 commit ea9c679
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 6 deletions.
28 changes: 25 additions & 3 deletions doc/guides/enabling-gossip.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
---
icon: broadcast
order: 99
---

The simplest way to enable inbox/outbox (gossip) is to use the `JIT` engine as it does everything automatically.

```dart
final ndkConfig = NdkConfig(
engine: NdkEngine.JIT,
cache: cache,
eventSigner: eventSigner,
eventVerifier: eventVerifier,
);
final ndk = Ndk(ndkConfig);
```

For more granular control you can use the `RELAY_SETS` engine.

```dart
NdkEngine.RELAY_SETS,
```

To make use of gossip you need to pass a `RelaySet` to the usecase.

icon: rocket
level: 101
---
[!ref](/usecases/relay-sets.md)
10 changes: 7 additions & 3 deletions doc/guides/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
icon: rocket
level: 100
order: 100
---

# Getting started
Expand Down Expand Up @@ -66,6 +66,10 @@ import 'package:ndk_amber/ndk_amber.dart';

## Usage

!!!
We strongly recommend using `RustEventVerifier()` for client applications. It uses a separate thread for signature verification and is therefore more performant.
!!!

```dart
import 'package:ndk/ndk.dart';
import 'package:ndk_rust_verifier/ndk_rust_verifier.dart';
Expand Down Expand Up @@ -95,5 +99,5 @@ await for (final event in response.stream) {
}
```

> We strongly recommend using `RustEventVerifier()` for client applications. It uses a separate thread for signature verification and is therefore more performant.
> $~~~~~~~~~~~$


Empty file removed doc/guides/high-level.md
Empty file.
Empty file removed doc/guides/low-level.md
Empty file.
5 changes: 5 additions & 0 deletions doc/guides/tips.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
icon: info
order: 0
---

## how to keep the ndk obj global

If you have a relatively simple app you can initialize ndk in your main method and pass down ndk on the widget tree.\
Expand Down

0 comments on commit ea9c679

Please sign in to comment.