@@ -584,6 +584,32 @@ impl NodeBuilder {
584584 self . build_with_store ( node_entropy, kv_store)
585585 }
586586
587+ /// Builds a [`Node`] instance with a [VSS] backend and according to the options
588+ /// previously configured.
589+ ///
590+ /// Uses a simple authentication scheme proving knowledge of a secret key.
591+ ///
592+ /// `fixed_headers` are included as it is in all the requests made to VSS and LNURL auth server.
593+ ///
594+ /// **Caution**: VSS support is in **alpha** and is considered experimental.
595+ /// Using VSS (or any remote persistence) may cause LDK to panic if persistence failures are
596+ /// unrecoverable, i.e., if they remain unresolved after internal retries are exhausted.
597+ ///
598+ /// [VSS]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
599+ pub fn build_with_vss_store (
600+ & self , node_entropy : NodeEntropy , vss_url : String , store_id : String ,
601+ fixed_headers : HashMap < String , String > ,
602+ ) -> Result < Node , BuildError > {
603+ let logger = setup_logger ( & self . log_writer_config , & self . config ) ?;
604+ let builder = VssStoreBuilder :: new ( node_entropy, vss_url, store_id, self . config . network ) ;
605+ let vss_store = builder. build_with_sigs_auth ( fixed_headers) . map_err ( |e| {
606+ log_error ! ( logger, "Failed to setup VSS store: {}" , e) ;
607+ BuildError :: KVStoreSetupFailed
608+ } ) ?;
609+
610+ self . build_with_store ( node_entropy, vss_store)
611+ }
612+
587613 /// Builds a [`Node`] instance with a [VSS] backend and according to the options
588614 /// previously configured.
589615 ///
@@ -601,16 +627,17 @@ impl NodeBuilder {
601627 ///
602628 /// [VSS]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
603629 /// [LNURL-auth]: https://github.com/lnurl/luds/blob/luds/04.md
604- pub fn build_with_vss_store (
630+ pub fn build_with_vss_store_and_lnurl_auth (
605631 & self , node_entropy : NodeEntropy , vss_url : String , store_id : String ,
606632 lnurl_auth_server_url : String , fixed_headers : HashMap < String , String > ,
607633 ) -> Result < Node , BuildError > {
608634 let logger = setup_logger ( & self . log_writer_config , & self . config ) ?;
609635 let builder = VssStoreBuilder :: new ( node_entropy, vss_url, store_id, self . config . network ) ;
610- let vss_store = builder. build ( lnurl_auth_server_url, fixed_headers) . map_err ( |e| {
611- log_error ! ( logger, "Failed to setup VSS store: {}" , e) ;
612- BuildError :: KVStoreSetupFailed
613- } ) ?;
636+ let vss_store =
637+ builder. build_with_lnurl ( lnurl_auth_server_url, fixed_headers) . map_err ( |e| {
638+ log_error ! ( logger, "Failed to setup VSS store: {}" , e) ;
639+ BuildError :: KVStoreSetupFailed
640+ } ) ?;
614641
615642 self . build_with_store ( node_entropy, vss_store)
616643 }
@@ -956,6 +983,34 @@ impl ArcedNodeBuilder {
956983 self . inner . read ( ) . unwrap ( ) . build_with_fs_store ( * node_entropy) . map ( Arc :: new)
957984 }
958985
986+ /// Builds a [`Node`] instance with a [VSS] backend and according to the options
987+ /// previously configured.
988+ ///
989+ /// Uses a simple authentication scheme proving knowledge of a secret key.
990+ ///
991+ /// `fixed_headers` are included as it is in all the requests made to VSS and LNURL auth server.
992+ ///
993+ /// **Caution**: VSS support is in **alpha** and is considered experimental.
994+ /// Using VSS (or any remote persistence) may cause LDK to panic if persistence failures are
995+ /// unrecoverable, i.e., if they remain unresolved after internal retries are exhausted.
996+ ///
997+ /// [VSS]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
998+ pub fn build_with_vss_store (
999+ & self , node_entropy : Arc < NodeEntropy > , vss_url : String , store_id : String ,
1000+ fixed_headers : HashMap < String , String > ,
1001+ ) -> Result < Arc < Node > , BuildError > {
1002+ self . inner
1003+ . read ( )
1004+ . unwrap ( )
1005+ . build_with_vss_store (
1006+ * node_entropy,
1007+ vss_url,
1008+ store_id,
1009+ fixed_headers,
1010+ )
1011+ . map ( Arc :: new)
1012+ }
1013+
9591014 /// Builds a [`Node`] instance with a [VSS] backend and according to the options
9601015 /// previously configured.
9611016 ///
@@ -973,14 +1028,14 @@ impl ArcedNodeBuilder {
9731028 ///
9741029 /// [VSS]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
9751030 /// [LNURL-auth]: https://github.com/lnurl/luds/blob/luds/04.md
976- pub fn build_with_vss_store (
1031+ pub fn build_with_vss_store_and_lnurl_auth (
9771032 & self , node_entropy : Arc < NodeEntropy > , vss_url : String , store_id : String ,
9781033 lnurl_auth_server_url : String , fixed_headers : HashMap < String , String > ,
9791034 ) -> Result < Arc < Node > , BuildError > {
9801035 self . inner
9811036 . read ( )
9821037 . unwrap ( )
983- . build_with_vss_store (
1038+ . build_with_vss_store_and_lnurl_auth (
9841039 * node_entropy,
9851040 vss_url,
9861041 store_id,
0 commit comments