From ea9c679df5afb413fb71741d62110ed7014e9c17 Mon Sep 17 00:00:00 2001 From: LeoLox <58687994+leo-lox@users.noreply.github.com> Date: Mon, 20 Jan 2025 17:02:29 +0100 Subject: [PATCH] gossip docs --- doc/guides/enabling-gossip.md | 28 +++++++++++++++++++++++++--- doc/guides/getting-started.md | 10 +++++++--- doc/guides/high-level.md | 0 doc/guides/low-level.md | 0 doc/guides/tips.md | 5 +++++ 5 files changed, 37 insertions(+), 6 deletions(-) delete mode 100644 doc/guides/high-level.md delete mode 100644 doc/guides/low-level.md diff --git a/doc/guides/enabling-gossip.md b/doc/guides/enabling-gossip.md index 55ab0d31..35353d5e 100644 --- a/doc/guides/enabling-gossip.md +++ b/doc/guides/enabling-gossip.md @@ -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 ---- \ No newline at end of file +[!ref](/usecases/relay-sets.md) diff --git a/doc/guides/getting-started.md b/doc/guides/getting-started.md index fd216099..d9b9bfc6 100644 --- a/doc/guides/getting-started.md +++ b/doc/guides/getting-started.md @@ -1,6 +1,6 @@ --- icon: rocket -level: 100 +order: 100 --- # Getting started @@ -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'; @@ -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. -> $~~~~~~~~~~~$ + + diff --git a/doc/guides/high-level.md b/doc/guides/high-level.md deleted file mode 100644 index e69de29b..00000000 diff --git a/doc/guides/low-level.md b/doc/guides/low-level.md deleted file mode 100644 index e69de29b..00000000 diff --git a/doc/guides/tips.md b/doc/guides/tips.md index b9432baa..2e639904 100644 --- a/doc/guides/tips.md +++ b/doc/guides/tips.md @@ -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.\