@@ -18,6 +18,8 @@ import (
1818 "github.com/lightninglabs/taproot-assets/taprpc"
1919 unirpc "github.com/lightninglabs/taproot-assets/taprpc/universerpc"
2020 "github.com/lightningnetwork/lnd/build"
21+ "github.com/lightningnetwork/lnd/lnrpc"
22+ "github.com/lightningnetwork/lnd/lnrpc/walletrpc"
2123 "github.com/lightningnetwork/lnd/lntest"
2224 "github.com/lightningnetwork/lnd/lntest/node"
2325 "github.com/lightningnetwork/lnd/lntest/port"
@@ -40,13 +42,24 @@ var (
4042
4143 // noDelete is a command line flag for disabling deleting the tapd
4244 // data directories.
43- noDelete = flag .Bool ("nodelete" , false , "Set to true to keep all " +
44- "tapd data directories after completing the tests" )
45+ noDelete = flag .Bool (
46+ "nodelete" , false , "Set to true to keep all tapd data " +
47+ "directories after completing the tests" ,
48+ )
4549
4650 // logLevel is a command line flag for setting the log level of the
4751 // integration test output.
48- logLevel = flag .String ("loglevel" , "info" , "Set the log level of the " +
49- "integration test output" )
52+ logLevel = flag .String (
53+ "loglevel" , "info" , "Set the log level of the integration " +
54+ "test output" ,
55+ )
56+
57+ // lndRemoteSigner is a command line flag that indicates whether the
58+ // lnd instances should be set up to use a remote signer.
59+ lndRemoteSigner = flag .Bool (
60+ "lndremotesigner" , false , "if true, the lnd instances will " +
61+ "be set up to use a remote signer" ,
62+ )
5063)
5164
5265const (
@@ -303,7 +316,45 @@ func setupHarnesses(t *testing.T, ht *harnessTest,
303316 proofCourier = universeServer
304317 }
305318
306- alice := lndHarness .NewNodeWithCoins ("Alice" , nil )
319+ var alice * node.HarnessNode
320+ if * lndRemoteSigner {
321+ signer := lndHarness .NewNode ("Signer" , nil )
322+
323+ rpcAccts := signer .RPC .ListAccounts (
324+ & walletrpc.ListAccountsRequest {},
325+ )
326+
327+ watchOnlyAccounts , err := walletrpc .AccountsToWatchOnly (
328+ rpcAccts .Accounts ,
329+ )
330+ require .NoError (t , err )
331+ alice = lndHarness .NewNodeRemoteSigner (
332+ "WatchOnly" , append ([]string {
333+ "--remotesigner.enable" ,
334+ fmt .Sprintf (
335+ "--remotesigner.rpchost=localhost:%d" ,
336+ signer .Cfg .RPCPort ,
337+ ),
338+ fmt .Sprintf (
339+ "--remotesigner.tlscertpath=%s" ,
340+ signer .Cfg .TLSCertPath ,
341+ ),
342+ fmt .Sprintf (
343+ "--remotesigner.macaroonpath=%s" ,
344+ signer .Cfg .AdminMacPath ,
345+ ),
346+ }),
347+ []byte ("itestpassword" ), & lnrpc.WatchOnly {
348+ MasterKeyBirthdayTimestamp : 0 ,
349+ MasterKeyFingerprint : nil ,
350+ Accounts : watchOnlyAccounts ,
351+ },
352+ )
353+
354+ lndHarness .FundNumCoins (alice , 5 )
355+ } else {
356+ alice = lndHarness .NewNodeWithCoins ("Alice" , nil )
357+ }
307358
308359 // Create a tapd that uses Alice and connect it to the universe server.
309360 tapdHarness := setupTapdHarness (
0 commit comments