@@ -586,6 +586,37 @@ impl NodeBuilder {
586586 self . build_with_store ( node_entropy, kv_store)
587587 }
588588
589+ /// Builds a [`Node`] instance with a [VSS] backend and according to the options
590+ /// previously configured.
591+ ///
592+ /// Uses a simple authentication scheme proving knowledge of a secret key.
593+ ///
594+ /// `fixed_headers` are included as it is in all the requests made to VSS.
595+ ///
596+ /// `store_id` allows you to segment LDK Node storage from other storage accessed with
597+ /// [`VssStoreBuilder`] using the same [`NodeEntropy`] (as storage with different keys is
598+ /// obviously segmented to prevent wallets from reading data for unrelated wallets). It can be
599+ /// any value.
600+ ///
601+ /// **Caution**: VSS support is in **alpha** and is considered experimental.
602+ /// Using VSS (or any remote persistence) may cause LDK to panic if persistence failures are
603+ /// unrecoverable, i.e., if they remain unresolved after internal retries are exhausted.
604+ ///
605+ /// [VSS]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
606+ pub fn build_with_vss_store (
607+ & self , node_entropy : NodeEntropy , vss_url : String , store_id : String ,
608+ fixed_headers : HashMap < String , String > ,
609+ ) -> Result < Node , BuildError > {
610+ let logger = setup_logger ( & self . log_writer_config , & self . config ) ?;
611+ let builder = VssStoreBuilder :: new ( node_entropy, vss_url, store_id, self . config . network ) ;
612+ let vss_store = builder. build_with_sigs_auth ( fixed_headers) . map_err ( |e| {
613+ log_error ! ( logger, "Failed to setup VSS store: {}" , e) ;
614+ BuildError :: KVStoreSetupFailed
615+ } ) ?;
616+
617+ self . build_with_store ( node_entropy, vss_store)
618+ }
619+
589620 /// Builds a [`Node`] instance with a [VSS] backend and according to the options
590621 /// previously configured.
591622 ///
@@ -595,6 +626,11 @@ impl NodeBuilder {
595626 /// The returned JWT token in response to the signed LNURL request, will be used for
596627 /// authentication/authorization of all the requests made to VSS.
597628 ///
629+ /// `store_id` allows you to segment LDK Node storage from other storage accessed with
630+ /// [`VssStoreBuilder`] using the same authentication (as storage with different keys is
631+ /// obviously segmented to prevent wallets from reading data for unrelated wallets). It can be
632+ /// any value.
633+ ///
598634 /// `fixed_headers` are included as it is in all the requests made to VSS and LNURL auth server.
599635 ///
600636 /// **Caution**: VSS support is in **alpha** and is considered experimental.
@@ -603,16 +639,17 @@ impl NodeBuilder {
603639 ///
604640 /// [VSS]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
605641 /// [LNURL-auth]: https://github.com/lnurl/luds/blob/luds/04.md
606- pub fn build_with_vss_store (
642+ pub fn build_with_vss_store_and_lnurl_auth (
607643 & self , node_entropy : NodeEntropy , vss_url : String , store_id : String ,
608644 lnurl_auth_server_url : String , fixed_headers : HashMap < String , String > ,
609645 ) -> Result < Node , BuildError > {
610646 let logger = setup_logger ( & self . log_writer_config , & self . config ) ?;
611647 let builder = VssStoreBuilder :: new ( node_entropy, vss_url, store_id, self . config . network ) ;
612- let vss_store = builder. build ( lnurl_auth_server_url, fixed_headers) . map_err ( |e| {
613- log_error ! ( logger, "Failed to setup VSS store: {}" , e) ;
614- BuildError :: KVStoreSetupFailed
615- } ) ?;
648+ let vss_store =
649+ builder. build_with_lnurl ( lnurl_auth_server_url, fixed_headers) . map_err ( |e| {
650+ log_error ! ( logger, "Failed to setup VSS store: {}" , e) ;
651+ BuildError :: KVStoreSetupFailed
652+ } ) ?;
616653
617654 self . build_with_store ( node_entropy, vss_store)
618655 }
@@ -958,6 +995,34 @@ impl ArcedNodeBuilder {
958995 self . inner . read ( ) . unwrap ( ) . build_with_fs_store ( * node_entropy) . map ( Arc :: new)
959996 }
960997
998+ /// Builds a [`Node`] instance with a [VSS] backend and according to the options
999+ /// previously configured.
1000+ ///
1001+ /// Uses a simple authentication scheme proving knowledge of a secret key.
1002+ ///
1003+ /// `fixed_headers` are included as it is in all the requests made to VSS and LNURL auth server.
1004+ ///
1005+ /// `store_id` allows you to segment LDK Node storage from other storage accessed with
1006+ /// [`VssStoreBuilder`] using the same [`NodeEntropy`] (as storage with different keys is
1007+ /// obviously segmented to prevent wallets from reading data for unrelated wallets). It can be
1008+ /// any value.
1009+ ///
1010+ /// **Caution**: VSS support is in **alpha** and is considered experimental.
1011+ /// Using VSS (or any remote persistence) may cause LDK to panic if persistence failures are
1012+ /// unrecoverable, i.e., if they remain unresolved after internal retries are exhausted.
1013+ ///
1014+ /// [VSS]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
1015+ pub fn build_with_vss_store (
1016+ & self , node_entropy : Arc < NodeEntropy > , vss_url : String , store_id : String ,
1017+ fixed_headers : HashMap < String , String > ,
1018+ ) -> Result < Arc < Node > , BuildError > {
1019+ self . inner
1020+ . read ( )
1021+ . unwrap ( )
1022+ . build_with_vss_store ( * node_entropy, vss_url, store_id, fixed_headers)
1023+ . map ( Arc :: new)
1024+ }
1025+
9611026 /// Builds a [`Node`] instance with a [VSS] backend and according to the options
9621027 /// previously configured.
9631028 ///
@@ -969,20 +1034,25 @@ impl ArcedNodeBuilder {
9691034 ///
9701035 /// `fixed_headers` are included as it is in all the requests made to VSS and LNURL auth server.
9711036 ///
1037+ /// `store_id` allows you to segment LDK Node storage from other storage accessed with
1038+ /// [`VssStoreBuilder`] using the same authentication (as storage with different keys is
1039+ /// obviously segmented to prevent wallets from reading data for unrelated wallets). It can be
1040+ /// any value.
1041+ ///
9721042 /// **Caution**: VSS support is in **alpha** and is considered experimental.
9731043 /// Using VSS (or any remote persistence) may cause LDK to panic if persistence failures are
9741044 /// unrecoverable, i.e., if they remain unresolved after internal retries are exhausted.
9751045 ///
9761046 /// [VSS]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
9771047 /// [LNURL-auth]: https://github.com/lnurl/luds/blob/luds/04.md
978- pub fn build_with_vss_store (
1048+ pub fn build_with_vss_store_and_lnurl_auth (
9791049 & self , node_entropy : Arc < NodeEntropy > , vss_url : String , store_id : String ,
9801050 lnurl_auth_server_url : String , fixed_headers : HashMap < String , String > ,
9811051 ) -> Result < Arc < Node > , BuildError > {
9821052 self . inner
9831053 . read ( )
9841054 . unwrap ( )
985- . build_with_vss_store (
1055+ . build_with_vss_store_and_lnurl_auth (
9861056 * node_entropy,
9871057 vss_url,
9881058 store_id,
0 commit comments