@@ -586,6 +586,32 @@ 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 and LNURL auth server.
595+ ///
596+ /// **Caution**: VSS support is in **alpha** and is considered experimental.
597+ /// Using VSS (or any remote persistence) may cause LDK to panic if persistence failures are
598+ /// unrecoverable, i.e., if they remain unresolved after internal retries are exhausted.
599+ ///
600+ /// [VSS]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
601+ pub fn build_with_vss_store (
602+ & self , node_entropy : NodeEntropy , vss_url : String , store_id : String ,
603+ fixed_headers : HashMap < String , String > ,
604+ ) -> Result < Node , BuildError > {
605+ let logger = setup_logger ( & self . log_writer_config , & self . config ) ?;
606+ let builder = VssStoreBuilder :: new ( node_entropy, vss_url, store_id, self . config . network ) ;
607+ let vss_store = builder. build_with_sigs_auth ( fixed_headers) . map_err ( |e| {
608+ log_error ! ( logger, "Failed to setup VSS store: {}" , e) ;
609+ BuildError :: KVStoreSetupFailed
610+ } ) ?;
611+
612+ self . build_with_store ( node_entropy, vss_store)
613+ }
614+
589615 /// Builds a [`Node`] instance with a [VSS] backend and according to the options
590616 /// previously configured.
591617 ///
@@ -603,16 +629,17 @@ impl NodeBuilder {
603629 ///
604630 /// [VSS]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
605631 /// [LNURL-auth]: https://github.com/lnurl/luds/blob/luds/04.md
606- pub fn build_with_vss_store (
632+ pub fn build_with_vss_store_and_lnurl_auth (
607633 & self , node_entropy : NodeEntropy , vss_url : String , store_id : String ,
608634 lnurl_auth_server_url : String , fixed_headers : HashMap < String , String > ,
609635 ) -> Result < Node , BuildError > {
610636 let logger = setup_logger ( & self . log_writer_config , & self . config ) ?;
611637 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- } ) ?;
638+ let vss_store =
639+ builder. build_with_lnurl ( lnurl_auth_server_url, fixed_headers) . map_err ( |e| {
640+ log_error ! ( logger, "Failed to setup VSS store: {}" , e) ;
641+ BuildError :: KVStoreSetupFailed
642+ } ) ?;
616643
617644 self . build_with_store ( node_entropy, vss_store)
618645 }
@@ -958,6 +985,29 @@ impl ArcedNodeBuilder {
958985 self . inner . read ( ) . unwrap ( ) . build_with_fs_store ( * node_entropy) . map ( Arc :: new)
959986 }
960987
988+ /// Builds a [`Node`] instance with a [VSS] backend and according to the options
989+ /// previously configured.
990+ ///
991+ /// Uses a simple authentication scheme proving knowledge of a secret key.
992+ ///
993+ /// `fixed_headers` are included as it is in all the requests made to VSS and LNURL auth server.
994+ ///
995+ /// **Caution**: VSS support is in **alpha** and is considered experimental.
996+ /// Using VSS (or any remote persistence) may cause LDK to panic if persistence failures are
997+ /// unrecoverable, i.e., if they remain unresolved after internal retries are exhausted.
998+ ///
999+ /// [VSS]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
1000+ pub fn build_with_vss_store (
1001+ & self , node_entropy : Arc < NodeEntropy > , vss_url : String , store_id : String ,
1002+ fixed_headers : HashMap < String , String > ,
1003+ ) -> Result < Arc < Node > , BuildError > {
1004+ self . inner
1005+ . read ( )
1006+ . unwrap ( )
1007+ . build_with_vss_store ( * node_entropy, vss_url, store_id, fixed_headers)
1008+ . map ( Arc :: new)
1009+ }
1010+
9611011 /// Builds a [`Node`] instance with a [VSS] backend and according to the options
9621012 /// previously configured.
9631013 ///
@@ -975,14 +1025,14 @@ impl ArcedNodeBuilder {
9751025 ///
9761026 /// [VSS]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
9771027 /// [LNURL-auth]: https://github.com/lnurl/luds/blob/luds/04.md
978- pub fn build_with_vss_store (
1028+ pub fn build_with_vss_store_and_lnurl_auth (
9791029 & self , node_entropy : Arc < NodeEntropy > , vss_url : String , store_id : String ,
9801030 lnurl_auth_server_url : String , fixed_headers : HashMap < String , String > ,
9811031 ) -> Result < Arc < Node > , BuildError > {
9821032 self . inner
9831033 . read ( )
9841034 . unwrap ( )
985- . build_with_vss_store (
1035+ . build_with_vss_store_and_lnurl_auth (
9861036 * node_entropy,
9871037 vss_url,
9881038 store_id,
0 commit comments